From 7d8fa8089a9a60536ab9616cb387fcd69abb038b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 30 Dec 2014 15:35:45 +0530 Subject: [PATCH 1/6] always calculate taxes and totals onchange of exchange rate --- erpnext/public/js/transaction.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index 5a56a6dc53..acb841b8a0 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -403,10 +403,14 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ _set_values_for_item_list: function(children) { var me = this; + var price_list_rate_changed = false; $.each(children, function(i, d) { var existing_pricing_rule = frappe.model.get_value(d.doctype, d.name, "pricing_rule"); $.each(d, function(k, v) { if (["doctype", "name"].indexOf(k)===-1) { + if(k=="price_list_rate") { + if(flt(v) != flt(d.price_list_rate)) price_list_rate_changed = true; + } frappe.model.set_value(d.doctype, d.name, k, v); } }); @@ -414,6 +418,8 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ if(!me.frm.doc.ignore_pricing_rule && existing_pricing_rule && !d.pricing_rule) { me.apply_price_list(frappe.get_doc(d.doctype, d.name)); } + + if(!price_list_rate_changed) me.calculate_taxes_and_totals(); }); }, From 54c31b498b4c716ac26cc4fcdc01a15a15cc8dff Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 30 Dec 2014 16:33:07 +0530 Subject: [PATCH 2/6] Fixes in Stock Analytics --- erpnext/public/js/stock_analytics.js | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js index 091836f95e..57b69cbb54 100644 --- a/erpnext/public/js/stock_analytics.js +++ b/erpnext/public/js/stock_analytics.js @@ -108,6 +108,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({ // otherwise, only reset values $.each(this.data, function(i, d) { me.reset_item_values(d); + d["closing_qty_value"] = 0; }); } From 40431cbf8936530f5e88862c1e7c4bb24bcfbb7a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 30 Dec 2014 17:53:16 +0530 Subject: [PATCH 3/6] focus on barcode field after adding a row --- erpnext/accounts/doctype/sales_invoice/pos.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/pos.js b/erpnext/accounts/doctype/sales_invoice/pos.js index d9ef6d8562..e7cbcb761e 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.js +++ b/erpnext/accounts/doctype/sales_invoice/pos.js @@ -492,7 +492,7 @@ erpnext.POS = Class.extend({ }); me.refresh_delete_btn(); - if(me.frm.doc[this.party]) { + if(me.frm.doc[this.party.toLowerCase()]) { this.barcode.$input.focus(); } else { this.party_field.$input.focus(); From a74468b35378eb01074295469fb1091d60c6d374 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 30 Dec 2014 18:33:52 +0530 Subject: [PATCH 4/6] set missing cost center using default --- erpnext/controllers/accounts_controller.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 49845f6868..f6d47dd420 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -119,6 +119,10 @@ class AccountsController(TransactionBase): item.get(fieldname) is None and value is not None: item.set(fieldname, value) + if fieldname == "cost_center" and item.meta.get_field("cost_center") \ + and not item.get("cost_center") and value is not None: + item.set(fieldname, value) + if ret.get("pricing_rule"): for field in ["base_price_list_rate", "price_list_rate", "discount_percentage", "base_rate", "rate"]: From 5604f987f2ad7c79b06b4e8b1fd3407922f43b5e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 31 Dec 2014 12:37:11 +0530 Subject: [PATCH 5/6] item validation in bom --- erpnext/manufacturing/doctype/bom/bom.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 199ade94c4..bab1b43b60 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -57,6 +57,9 @@ class BOM(Document): last_purchase_rate, is_manufactured_item from `tabItem` where name=%s""", item_code, as_dict = 1) + if not item: + frappe.throw(_("Item: {0} does not exist in the system").format(item_code)) + return item def validate_rm_item(self, item): From b094ee45d7e55efa77139643c084283db064f434 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Wed, 31 Dec 2014 13:11:14 +0600 Subject: [PATCH 6/6] bumped to version 4.15.4 --- erpnext/__version__.py | 2 +- erpnext/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/__version__.py b/erpnext/__version__.py index 418d94e7b0..349cc44bd0 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1 +1 @@ -__version__ = '4.15.3' +__version__ = '4.15.4' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 6b3f1e9170..f033d687be 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -4,7 +4,7 @@ app_publisher = "Web Notes Technologies Pvt. Ltd. and Contributors" app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "4.15.3" +app_version = "4.15.4" error_report_email = "support@erpnext.com" diff --git a/setup.py b/setup.py index aaa37737f9..24e0155468 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "4.15.3" +version = "4.15.4" with open("requirements.txt", "r") as f: install_requires = f.readlines()