From e2f054cc27e716b0a0e73c03fe9d9fb81d57dfa4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 9 Mar 2015 14:54:37 +0530 Subject: [PATCH] transaction date issue in pricing rule fixed --- erpnext/controllers/accounts_controller.py | 2 ++ erpnext/public/js/transaction.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 52193394768..fcc350a3eef 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -112,6 +112,8 @@ class AccountsController(TransactionBase): if item.get("item_code"): args = parent_dict.copy() args.update(item.as_dict()) + if not args.get("transaction_date"): + args["transaction_date"] = args.get("posting_date") ret = get_item_details(args) for fieldname, value in ret.items(): diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index e1e78a3c01f..ebdb136dd4c 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -148,7 +148,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ order_type: me.frm.doc.order_type, is_pos: cint(me.frm.doc.is_pos), is_subcontracted: me.frm.doc.is_subcontracted, - transaction_date: me.frm.doc.transaction_date, + transaction_date: me.frm.doc.transaction_date || me.frm.doc.posting_date, ignore_pricing_rule: me.frm.doc.ignore_pricing_rule, doctype: item.doctype, name: item.name,