mirror of
https://github.com/frappe/books.git
synced 2024-12-23 03:19:01 +00:00
Delete invoice.js
This commit is contained in:
parent
8c15a6829c
commit
90ae7dda4c
@ -1,67 +0,0 @@
|
||||
const frappe = require('frappejs');
|
||||
|
||||
module.exports = {
|
||||
"name": "Invoice",
|
||||
"doctype": "DocType",
|
||||
"documentClass": require("./InvoiceDocument.js"),
|
||||
"isSingle": 0,
|
||||
"istable": 0,
|
||||
"keywordFields": ["name", "customer"],
|
||||
"settings": "InvoiceSettings",
|
||||
"showTitle": true,
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "date",
|
||||
"label": "Date",
|
||||
"fieldtype": "Date"
|
||||
},
|
||||
{
|
||||
"fieldname": "customer",
|
||||
"label": "Customer",
|
||||
"fieldtype": "Link",
|
||||
"target": "Customer",
|
||||
"required": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "items",
|
||||
"label": "Items",
|
||||
"fieldtype": "Table",
|
||||
"childtype": "InvoiceItem",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"fieldname": "netTotal",
|
||||
"label": "Total",
|
||||
"fieldtype": "Currency",
|
||||
formula: (doc) => doc.getSum('items', 'amount'),
|
||||
"disabled": true
|
||||
},
|
||||
{
|
||||
"fieldname": "taxes",
|
||||
"label": "Taxes",
|
||||
"fieldtype": "Table",
|
||||
"childtype": "TaxSummary",
|
||||
"disabled": true,
|
||||
template: (doc, row) => {
|
||||
return `<div class='row'>
|
||||
<div class='col-6'><!-- empty left side --></div>
|
||||
<div class='col-6'>${(doc.taxes || []).map(row => {
|
||||
return `<div class='row'>
|
||||
<div class='col-6'>${row.account} (${row.rate}%)</div>
|
||||
<div class='col-6 text-right'>
|
||||
${frappe.format(row.amount, {fieldtype:'Currency'})}
|
||||
</div>
|
||||
</div>`
|
||||
}).join('')}
|
||||
</div></div>`;
|
||||
}
|
||||
},
|
||||
{
|
||||
"fieldname": "grandTotal",
|
||||
"label": "Total",
|
||||
"fieldtype": "Currency",
|
||||
formula: (doc) => doc.getGrandTotal(),
|
||||
"disabled": true
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user