2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 01:14:03 +00:00
books/reports/PurchaseRegister/viewConfig.js

65 lines
1.5 KiB
JavaScript
Raw Normal View History

const title = 'Purchase Register';
export default {
title: title,
method: 'purchase-register',
filterFields: [
{
fieldtype: 'Link',
target: 'Party',
label: 'Supplier Name',
fieldname: 'supplier',
2019-08-14 07:43:49 +00:00
size: 'small',
placeholder: 'Supplier Name',
getFilters: query => {
if (query)
return {
keywords: ['like', query],
supplier: 1
};
return {
supplier: 1
};
}
},
{
fieldtype: 'Date',
fieldname: 'fromDate',
2019-08-14 07:43:49 +00:00
size: 'small',
placeholder: 'From Date',
label: 'From Date',
required: 1
},
2019-08-14 07:43:49 +00:00
{
fieldtype: 'Date',
size: 'small',
placeholder: 'To Date',
fieldname: 'toDate',
label: 'To Date',
required: 1
}
],
linkFields: [
{
label: 'Clear Filters',
type: 'secondary',
action: async report => {
await report.getReportData({});
report.usedToReRender += 1;
}
}
],
getColumns() {
return [
{ label: 'PurchaseInvoice', fieldname: 'name' },
{ label: 'Posting Date', fieldname: 'date' },
{ label: 'Supplier', fieldname: 'supplier' },
{ label: 'Payable Account', fieldname: 'account' },
{ label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' },
{ label: 'Total Tax', fieldname: 'totalTax', fieldtype: 'Currency' },
{ label: 'Grand Total', fieldname: 'grandTotal', fieldtype: 'Currency' }
];
}
};