From 022ab63a0fa98b484baae38bb49350b7691a38e3 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 10 Nov 2017 15:06:02 +0530 Subject: [PATCH 1/4] [fix] query param fixes --- erpnext/controllers/queries.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 37afed7a0e..353721e47a 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -185,7 +185,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals "page_len": page_len }, as_dict=as_dict) -def bom(doctype, txt, searchfield, filters, start=0, page_len=20): +def bom(doctype, txt, searchfield, start, page_len, filters): conditions = [] return frappe.db.sql("""select tabBOM.name, tabBOM.item @@ -204,8 +204,8 @@ def bom(doctype, txt, searchfield, filters, start=0, page_len=20): { 'txt': "%%%s%%" % frappe.db.escape(txt), '_txt': txt.replace("%", ""), - 'start': start, - 'page_len': page_len + 'start': start or 0, + 'page_len': page_len or 20 }) def get_project_name(doctype, txt, searchfield, start, page_len, filters): From cc97ec9202d4027fb0d0ca663cc75e101337badf Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 10 Nov 2017 15:06:58 +0530 Subject: [PATCH 2/4] [hotfix] Salary slip, leave considered in amount calculation even if depends on lwp is disabled in salary slip (#11507) --- erpnext/hr/doctype/salary_slip/salary_slip.js | 9 ++------- erpnext/hr/doctype/salary_slip/salary_slip.py | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js index 24f2016bd6..4679cbdda9 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.js +++ b/erpnext/hr/doctype/salary_slip/salary_slip.js @@ -161,18 +161,15 @@ var calculate_earning_total = function(doc, dt, dn, reset_amount) { tbl[i].amount = Math.round(tbl[i].default_amount)*(flt(doc.payment_days) / cint(doc.total_working_days)*100)/100; - refresh_field('amount', tbl[i].name, 'earnings'); - } else if(reset_amount) { tbl[i].amount = tbl[i].default_amount; - refresh_field('amount', tbl[i].name, 'earnings'); } if(!tbl[i].do_not_include_in_total) { total_earn += flt(tbl[i].amount); } } doc.gross_pay = total_earn; - refresh_many(['amount','gross_pay']); + refresh_many(['earnings', 'amount','gross_pay']); } // Calculate deduction total @@ -183,17 +180,15 @@ var calculate_ded_total = function(doc, dt, dn, reset_amount) { for(var i = 0; i < tbl.length; i++){ if(cint(tbl[i].depends_on_lwp) == 1) { tbl[i].amount = Math.round(tbl[i].default_amount)*(flt(doc.payment_days)/cint(doc.total_working_days)*100)/100; - refresh_field('amount', tbl[i].name, 'deductions'); } else if(reset_amount) { tbl[i].amount = tbl[i].default_amount; - refresh_field('amount', tbl[i].name, 'deductions'); } if(!tbl[i].do_not_include_in_total) { total_ded += flt(tbl[i].amount); } } doc.total_deduction = total_ded; - refresh_field('total_deduction'); + refresh_many(['deductions', 'total_deduction']); } // Calculate net payable amount diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 7581624bef..1f9c192e8d 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -348,7 +348,8 @@ class SalarySlip(TransactionBase): / cint(self.total_working_days)), self.precision("amount", component_type) ) - elif not self.payment_days and not self.salary_slip_based_on_timesheet: + elif not self.payment_days and not self.salary_slip_based_on_timesheet and \ + cint(d.depends_on_lwp): d.amount = 0 elif not d.amount: d.amount = d.default_amount From a5e3c3a79f1d81b76a369e4ea673f418fda1e084 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 10 Nov 2017 15:29:14 +0530 Subject: [PATCH 3/4] Add item directly in the cart only if serial no, batch, barcode has enter in the search field --- erpnext/selling/page/point_of_sale/point_of_sale.js | 8 ++++---- erpnext/selling/page/point_of_sale/point_of_sale.py | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index a0f8598ef8..adde913fb6 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -990,18 +990,18 @@ class POSItems { } this.get_items({search_value: search_term, item_group }) - .then(({ items, serial_no, batch_no }) => { + .then(({ items, serial_no, batch_no, barcode }) => { if (search_term) { this.search_index[search_term] = items; } this.items = items; this.render_items(items); - this.set_item_in_the_cart(items, serial_no, batch_no); + this.set_item_in_the_cart(items, serial_no, batch_no, barcode); }); } - set_item_in_the_cart(items, serial_no, batch_no) { + set_item_in_the_cart(items, serial_no, batch_no, barcode) { if (serial_no) { this.events.update_cart(items[0].item_code, 'serial_no', serial_no); @@ -1016,7 +1016,7 @@ class POSItems { return; } - if (items.length === 1) { + if (items.length === 1 && (serial_no || batch_no || barcode)) { this.events.update_cart(items[0].item_code, 'qty', '+1'); this.reset_search_field(); diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.py b/erpnext/selling/page/point_of_sale/point_of_sale.py index 20b5bb05b6..8dad0a3515 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.py +++ b/erpnext/selling/page/point_of_sale/point_of_sale.py @@ -67,6 +67,11 @@ def get_items(start, page_length, price_list, item_group, search_value=""): 'batch_no': batch_no }) + if barcode: + res.update({ + 'barcode': barcode + }) + return res def get_conditions(item_code, serial_no, batch_no, barcode): From a10cd1064080277e500569c9102fd8d8c28f410d Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 10 Nov 2017 16:23:43 +0600 Subject: [PATCH 4/4] bumped to version 9.2.9 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index f8cade95ab..aa52b834f3 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from erpnext.hooks import regional_overrides -__version__ = '9.2.8' +__version__ = '9.2.9' def get_default_company(user=None): '''Get default company for user'''