fix: Taxes and Charges template not getting copied from Purchase Order/Receipt to Invoice

(cherry picked from commit 6a75e8d283bb76214af832bb0a29c20eefae328c)
This commit is contained in:
Deepesh Garg 2021-11-30 20:34:53 +05:30 committed by mergify-bot
parent 0991ec9a7f
commit f12be3001d
2 changed files with 7 additions and 4 deletions

View File

@ -68,10 +68,12 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
party_details["tax_category"] = get_address_tax_category(party.get("tax_category"), party_details["tax_category"] = get_address_tax_category(party.get("tax_category"),
party_address, shipping_address if party_type != "Supplier" else party_address) party_address, shipping_address if party_type != "Supplier" else party_address)
if not party_details.get("taxes_and_charges"): tax_template = set_taxes(party.name, party_type, posting_date, company,
party_details["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, customer_group=party_details.customer_group, supplier_group=party_details.supplier_group, tax_category=party_details.tax_category,
customer_group=party_details.customer_group, supplier_group=party_details.supplier_group, tax_category=party_details.tax_category, billing_address=party_address, shipping_address=shipping_address)
billing_address=party_address, shipping_address=shipping_address)
if tax_template:
party_details['taxes_and_charges'] = tax_template
if cint(fetch_payment_terms_template): if cint(fetch_payment_terms_template):
party_details["payment_terms_template"] = get_payment_terms_template(party.name, party_type, company) party_details["payment_terms_template"] = get_payment_terms_template(party.name, party_type, company)

View File

@ -77,6 +77,7 @@ erpnext.utils.get_party_details = function(frm, method, args, callback) {
if (args) { if (args) {
args.posting_date = frm.doc.posting_date || frm.doc.transaction_date; args.posting_date = frm.doc.posting_date || frm.doc.transaction_date;
args.fetch_payment_terms_template = cint(!frm.doc.ignore_default_payment_terms_template); args.fetch_payment_terms_template = cint(!frm.doc.ignore_default_payment_terms_template);
args.taxes_and_charges = frm.doc.taxes_and_charges;
} }
} }
if (!args || !args.party) return; if (!args || !args.party) return;