Merge branch 'hotfix'
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index f8cade9..aa52b83 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -4,7 +4,7 @@
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'''
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 37afed7..353721e 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -185,7 +185,7 @@
"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 @@
{
'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):
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js
index 24f2016..4679cbd 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.js
@@ -161,18 +161,15 @@
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 @@
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 7581624..1f9c192 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -348,7 +348,8 @@
/ 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
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 a0f8598..adde913 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 @@
}
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 @@
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 20b5bb0..8dad0a3 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 @@
'batch_no': batch_no
})
+ if barcode:
+ res.update({
+ 'barcode': barcode
+ })
+
return res
def get_conditions(item_code, serial_no, batch_no, barcode):