fix: account payable currency and value (#36859)
* fix: account payable currency and value * fix: added party_type and party in accounts payable report * chore: code cleanup * fix: customer group test case failure * fix: added test case of the issue * fix: filter toggle for party_type * fix: filter toggle for party_type * chore: fix typo --------- Co-authored-by: ruthra kumar <ruthra@erpnext.com>
This commit is contained in:
@@ -37,24 +37,6 @@ frappe.query_reports["Accounts Payable"] = {
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"fieldname": "supplier",
|
||||
"label": __("Supplier"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier",
|
||||
on_change: () => {
|
||||
var supplier = frappe.query_report.get_filter_value('supplier');
|
||||
if (supplier) {
|
||||
frappe.db.get_value('Supplier', supplier, "tax_id", function(value) {
|
||||
frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
|
||||
});
|
||||
} else {
|
||||
frappe.query_report.set_filter_value('tax_id', "");
|
||||
}
|
||||
|
||||
frappe.query_report.refresh();
|
||||
}
|
||||
},
|
||||
{
|
||||
"fieldname": "party_account",
|
||||
"label": __("Payable Account"),
|
||||
@@ -112,11 +94,38 @@ frappe.query_reports["Accounts Payable"] = {
|
||||
"fieldtype": "Link",
|
||||
"options": "Payment Terms Template"
|
||||
},
|
||||
{
|
||||
"fieldname": "party_type",
|
||||
"label": __("Party Type"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Party Type",
|
||||
get_query: () => {
|
||||
return {
|
||||
filters: {
|
||||
'account_type': 'Payable'
|
||||
}
|
||||
};
|
||||
},
|
||||
on_change: () => {
|
||||
frappe.query_report.set_filter_value('party', "");
|
||||
let party_type = frappe.query_report.get_filter_value('party_type');
|
||||
frappe.query_report.toggle_filter_display('supplier_group', frappe.query_report.get_filter_value('party_type') !== "Supplier");
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"fieldname":"party",
|
||||
"label": __("Party"),
|
||||
"fieldtype": "Dynamic Link",
|
||||
"options": "party_type",
|
||||
},
|
||||
{
|
||||
"fieldname": "supplier_group",
|
||||
"label": __("Supplier Group"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier Group"
|
||||
"options": "Supplier Group",
|
||||
"hidden": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "group_by_party",
|
||||
@@ -133,12 +142,6 @@ frappe.query_reports["Accounts Payable"] = {
|
||||
"label": __("Show Remarks"),
|
||||
"fieldtype": "Check",
|
||||
},
|
||||
{
|
||||
"fieldname": "tax_id",
|
||||
"label": __("Tax Id"),
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "show_future_payments",
|
||||
"label": __("Show Future Payments"),
|
||||
|
||||
Reference in New Issue
Block a user