2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00

Delete invoice.js

This commit is contained in:
Rushabh Mehta 2018-02-19 12:38:54 +05:30 committed by GitHub
parent 8c15a6829c
commit 90ae7dda4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}
]
}