brotherton-erpnext/erpnext/accounts/report/accounts_payable/accounts_payable.js
Shreya Shah 9bcadf8126 Tax Id in some reports and print formats (#13373)
* tax-id in sales and purchase registers

* tax-id in general ledger print_format

* tax-id in accounts payable

* tax-id in accounts receivable
2018-03-23 15:04:37 +05:30

76 lines
1.8 KiB
JavaScript

// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.query_reports["Accounts Payable"] = {
"filters": [
{
"fieldname":"company",
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_user_default("Company")
},
{
"fieldname":"supplier",
"label": __("Supplier"),
"fieldtype": "Link",
"options": "Supplier",
on_change: () => {
var supplier = frappe.query_report_filters_by_name.supplier.get_value();
frappe.db.get_value('Supplier', supplier, "tax_id", function(value) {
frappe.query_report_filters_by_name.tax_id.set_value(value["tax_id"]);
});
}
},
{
"fieldname":"report_date",
"label": __("As on Date"),
"fieldtype": "Date",
"default": frappe.datetime.get_today()
},
{
"fieldname":"ageing_based_on",
"label": __("Ageing Based On"),
"fieldtype": "Select",
"options": 'Posting Date\nDue Date',
"default": "Posting Date"
},
{
"fieldtype": "Break",
},
{
"fieldname":"range1",
"label": __("Ageing Range 1"),
"fieldtype": "Int",
"default": "30",
"reqd": 1
},
{
"fieldname":"range2",
"label": __("Ageing Range 2"),
"fieldtype": "Int",
"default": "60",
"reqd": 1
},
{
"fieldname":"range3",
"label": __("Ageing Range 3"),
"fieldtype": "Int",
"default": "90",
"reqd": 1
},
{
"fieldname":"tax_id",
"label": __("Tax Id"),
"fieldtype": "Data",
"hidden": 1
}
],
onload: function(report) {
report.page.add_inner_button(__("Accounts Payable Summary"), function() {
var filters = report.get_values();
frappe.set_route('query-report', 'Accounts Payable Summary', {company: filters.company});
});
}
}