2015-03-03 14:55:30 +05:30
|
|
|
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
2013-08-05 14:59:54 +05:30
|
|
|
// License: GNU General Public License v3. See license.txt
|
|
|
|
|
2014-02-14 15:47:51 +05:30
|
|
|
frappe.query_reports["Accounts Payable"] = {
|
2013-04-23 15:36:26 +05:30
|
|
|
"filters": [
|
|
|
|
{
|
|
|
|
"fieldname":"company",
|
2014-04-14 16:25:30 +05:30
|
|
|
"label": __("Company"),
|
2013-04-23 15:36:26 +05:30
|
|
|
"fieldtype": "Link",
|
|
|
|
"options": "Company",
|
2015-12-23 16:37:00 +05:30
|
|
|
"default": frappe.defaults.get_user_default("Company")
|
2013-04-23 15:36:26 +05:30
|
|
|
},
|
2018-04-23 02:49:30 +05:30
|
|
|
{
|
|
|
|
"fieldname":"finance_book",
|
|
|
|
"label": __("Finance Book"),
|
|
|
|
"fieldtype": "Link",
|
2018-05-09 15:10:29 +05:30
|
|
|
"options": "Finance Book"
|
2018-04-23 02:49:30 +05:30
|
|
|
},
|
2013-04-23 15:36:26 +05:30
|
|
|
{
|
2014-09-11 19:27:24 +05:30
|
|
|
"fieldname":"supplier",
|
|
|
|
"label": __("Supplier"),
|
2013-04-23 15:36:26 +05:30
|
|
|
"fieldtype": "Link",
|
2018-03-23 15:04:37 +05:30
|
|
|
"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"]);
|
|
|
|
});
|
|
|
|
}
|
2013-04-23 15:36:26 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname":"report_date",
|
2015-08-24 14:31:07 +05:30
|
|
|
"label": __("As on Date"),
|
2013-04-23 15:36:26 +05:30
|
|
|
"fieldtype": "Date",
|
2017-05-30 12:54:42 +05:30
|
|
|
"default": frappe.datetime.get_today()
|
2013-04-23 15:36:26 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname":"ageing_based_on",
|
2014-04-14 16:25:30 +05:30
|
|
|
"label": __("Ageing Based On"),
|
2013-04-23 15:36:26 +05:30
|
|
|
"fieldtype": "Select",
|
2018-04-26 18:02:37 +05:30
|
|
|
"options": 'Posting Date\nDue Date\nSupplier Invoice Date',
|
2013-04-23 15:36:26 +05:30
|
|
|
"default": "Posting Date"
|
2014-10-03 15:27:53 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
"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
|
2018-03-23 15:04:37 +05:30
|
|
|
},
|
|
|
|
{
|
|
|
|
"fieldname":"tax_id",
|
|
|
|
"label": __("Tax Id"),
|
|
|
|
"fieldtype": "Data",
|
|
|
|
"hidden": 1
|
2013-04-23 15:36:26 +05:30
|
|
|
}
|
2017-01-03 16:29:41 +05:30
|
|
|
],
|
|
|
|
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});
|
|
|
|
});
|
|
|
|
}
|
2014-04-25 18:35:45 +05:30
|
|
|
}
|