mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 11:39:18 +00:00
fix: Total taxes and charges in payment entry for multicurrency payments
(cherry picked from commit b1a46c80d5)
This commit is contained in:
committed by
mergify-bot
parent
aa684e6f3d
commit
6ed01fedd4
@@ -196,8 +196,14 @@ frappe.ui.form.on('Payment Entry', {
|
|||||||
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency));
|
frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency));
|
||||||
|
|
||||||
frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency);
|
frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency);
|
||||||
frm.toggle_display("base_total_taxes_and_charges", frm.doc.total_taxes_and_charges &&
|
|
||||||
(frm.doc.paid_from_account_currency != company_currency));
|
if (frm.doc.payment_type == "Pay") {
|
||||||
|
frm.toggle_display("base_total_taxes_and_charges", frm.doc.total_taxes_and_charges &&
|
||||||
|
(frm.doc.paid_to_account_currency != company_currency));
|
||||||
|
} else {
|
||||||
|
frm.toggle_display("base_total_taxes_and_charges", frm.doc.total_taxes_and_charges &&
|
||||||
|
(frm.doc.paid_from_account_currency != company_currency));
|
||||||
|
}
|
||||||
|
|
||||||
frm.toggle_display("base_received_amount", (
|
frm.toggle_display("base_received_amount", (
|
||||||
frm.doc.paid_to_account_currency != company_currency
|
frm.doc.paid_to_account_currency != company_currency
|
||||||
@@ -232,7 +238,8 @@ frappe.ui.form.on('Payment Entry', {
|
|||||||
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
|
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
|
||||||
|
|
||||||
frm.set_currency_labels(["base_paid_amount", "base_received_amount", "base_total_allocated_amount",
|
frm.set_currency_labels(["base_paid_amount", "base_received_amount", "base_total_allocated_amount",
|
||||||
"difference_amount", "base_paid_amount_after_tax", "base_received_amount_after_tax"], company_currency);
|
"difference_amount", "base_paid_amount_after_tax", "base_received_amount_after_tax",
|
||||||
|
"base_total_taxes_and_charges"], company_currency);
|
||||||
|
|
||||||
frm.set_currency_labels(["paid_amount"], frm.doc.paid_from_account_currency);
|
frm.set_currency_labels(["paid_amount"], frm.doc.paid_from_account_currency);
|
||||||
frm.set_currency_labels(["received_amount"], frm.doc.paid_to_account_currency);
|
frm.set_currency_labels(["received_amount"], frm.doc.paid_to_account_currency);
|
||||||
|
|||||||
@@ -66,7 +66,9 @@
|
|||||||
"tax_withholding_category",
|
"tax_withholding_category",
|
||||||
"section_break_56",
|
"section_break_56",
|
||||||
"taxes",
|
"taxes",
|
||||||
|
"section_break_60",
|
||||||
"base_total_taxes_and_charges",
|
"base_total_taxes_and_charges",
|
||||||
|
"column_break_61",
|
||||||
"total_taxes_and_charges",
|
"total_taxes_and_charges",
|
||||||
"deductions_or_loss_section",
|
"deductions_or_loss_section",
|
||||||
"deductions",
|
"deductions",
|
||||||
@@ -715,12 +717,21 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"label": "Paid To Account Type"
|
"label": "Paid To Account Type"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_61",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_60",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"hide_border": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-11-24 18:58:24.919764",
|
"modified": "2022-02-23 20:08:39.559814",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Entry",
|
"name": "Payment Entry",
|
||||||
@@ -763,6 +774,7 @@
|
|||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
"states": [],
|
||||||
"title_field": "title",
|
"title_field": "title",
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
||||||
@@ -946,8 +946,12 @@ class PaymentEntry(AccountsController):
|
|||||||
|
|
||||||
tax.base_total = tax.total * self.source_exchange_rate
|
tax.base_total = tax.total * self.source_exchange_rate
|
||||||
|
|
||||||
self.total_taxes_and_charges += current_tax_amount
|
if self.payment_type == 'Pay':
|
||||||
self.base_total_taxes_and_charges += current_tax_amount * self.source_exchange_rate
|
self.base_total_taxes_and_charges += current_tax_amount * self.source_exchange_rate
|
||||||
|
self.total_taxes_and_charges += current_tax_amount * self.target_exchange_rate
|
||||||
|
else:
|
||||||
|
self.base_total_taxes_and_charges += current_tax_amount * self.target_exchange_rate
|
||||||
|
self.total_taxes_and_charges += current_tax_amount * self.source_exchange_rate
|
||||||
|
|
||||||
if self.get('taxes'):
|
if self.get('taxes'):
|
||||||
self.paid_amount_after_tax = self.get('taxes')[-1].base_total
|
self.paid_amount_after_tax = self.get('taxes')[-1].base_total
|
||||||
|
|||||||
Reference in New Issue
Block a user