From 5ecbaa408bdd7c8f4c3fa5452dd13b45eda092a8 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 28 Mar 2017 12:09:07 +0530 Subject: [PATCH] [fix] During making credit note from sales invoice, system fetching new serial no instead of old serial no from the sales invoice --- erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 2 +- erpnext/public/js/controllers/transaction.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index 3c622972c4..f9e51acf27 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -117,7 +117,7 @@ def apply_pricing_rule(args): args_copy = copy.deepcopy(args) args_copy.update(item) out.append(get_pricing_rule_for_item(args_copy)) - if set_serial_nos_based_on_fifo: + if set_serial_nos_based_on_fifo and not args.get('is_return'): out.append(get_serial_no_for_item(args_copy)) return out diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index f8aa7cff57..908b8693e2 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -728,7 +728,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ "sales_partner": me.frm.doc.sales_partner, "ignore_pricing_rule": me.frm.doc.ignore_pricing_rule, "doctype": me.frm.doc.doctype, - "name": me.frm.doc.name + "name": me.frm.doc.name, + "is_return": cint(me.frm.doc.is_return) }; },