fix: Changing item prices on converting orders/receipts to invoices

This commit is contained in:
Deepesh Garg 2022-03-22 23:03:41 +05:30
parent 01fd3adedf
commit 66ca085e39
5 changed files with 12 additions and 1 deletions

View File

@ -442,6 +442,8 @@ def make_purchase_receipt(source_name, target_doc=None):
}
}, target_doc, set_missing_values)
doc.set_onload('ignore_price_list', True)
return doc
@frappe.whitelist()
@ -509,6 +511,7 @@ def get_mapped_purchase_invoice(source_name, target_doc=None, ignore_permissions
doc = get_mapped_doc("Purchase Order", source_name, fields,
target_doc, postprocess, ignore_permissions=ignore_permissions)
doc.set_onload('ignore_price_list', True)
return doc

View File

@ -1070,7 +1070,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
}
if(flt(this.frm.doc.conversion_rate)>0.0) {
if(this.frm.doc.ignore_pricing_rule) {
if(this.frm.doc.__onload.ignore_price_list) {
this.calculate_taxes_and_totals();
} else if (!this.in_apply_price_list){
this.apply_price_list();
@ -1884,6 +1884,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
callback: function(r) {
if(!r.exc) {
item.item_tax_rate = r.message;
me.add_taxes_from_item_tax_template(item.item_tax_rate);
me.calculate_taxes_and_totals();
}
}

View File

@ -584,6 +584,8 @@ def make_delivery_note(source_name, target_doc=None, skip_item_mapping=False):
target_doc = get_mapped_doc("Sales Order", source_name, mapper, target_doc, set_missing_values)
target_doc.set_onload('ignore_price_list', True)
return target_doc
@frappe.whitelist()
@ -664,6 +666,8 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
if automatically_fetch_payment_terms:
doclist.set_payment_schedule()
doclist.set_onload('ignore_price_list', True)
return doclist
@frappe.whitelist()

View File

@ -519,6 +519,8 @@ def make_sales_invoice(source_name, target_doc=None):
if automatically_fetch_payment_terms:
doc.set_payment_schedule()
doc.set_onload('ignore_price_list', True)
return doc
@frappe.whitelist()

View File

@ -823,6 +823,7 @@ def make_purchase_invoice(source_name, target_doc=None):
}
}, target_doc, set_missing_values)
doclist.set_onload('ignore_price_list', True)
return doclist
def get_invoiced_qty_map(purchase_receipt):