2
0
mirror of https://github.com/frappe/books.git synced 2024-11-12 16:36:27 +00:00

Setting read only value to 1 for formula to work (#69)

* Setting read only value to 1 for formula to work

* Remove readOnly from tax
This commit is contained in:
sahil28297 2018-09-25 17:30:10 +05:30 committed by Faris Ansari
parent b57a301821
commit 41680c82b0
3 changed files with 9 additions and 5 deletions

View File

@ -59,14 +59,15 @@ module.exports = {
label: 'Net Total',
fieldtype: 'Currency',
formula: (doc) => doc.getSum('items', 'amount'),
disabled: true
disabled: true,
readOnly: 1
},
{
fieldname: 'taxes',
label: 'Taxes',
fieldtype: 'Table',
childtype: 'TaxSummary',
disabled: true,
readOnly: 1,
template: (doc, row) => {
return `<div class='row'>
<div class='col-6'></div>
@ -86,7 +87,8 @@ module.exports = {
label: 'Grand Total',
fieldtype: 'Currency',
formula: (doc) => doc.getGrandTotal(),
disabled: true
disabled: true,
readOnly: 1
},
{
fieldname: 'terms',

View File

@ -56,13 +56,15 @@ module.exports = {
fieldname: 'amount',
label: 'Amount',
fieldtype: 'Currency',
disabled: 1,
readOnly: 1,
disabled: true,
formula: (row, doc) => row.quantity * row.rate
},
{
fieldname: 'taxAmount',
label: 'Tax Amount',
hidden: 1,
readOnly: 1,
fieldtype: 'Text',
formula: (row, doc) => doc.getRowTax(row)
}

View File

@ -25,4 +25,4 @@ module.exports = {
"required": 1
}
]
}
}