Merge pull request #13094 from rohitwaghchaure/pos_discount_v10_1

[Hotfix] POS discount issue
This commit is contained in:
rohitwaghchaure 2018-02-27 11:58:33 +05:30 committed by GitHub
commit f1755fb5b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -257,6 +257,7 @@ erpnext.pos.PointOfSale = class PointOfSale {
frappe.msgprint(__("Quantity must be positive")); frappe.msgprint(__("Quantity must be positive"));
value = item.qty; value = item.qty;
} else { } else {
if (in_list(["qty", "serial_no", "batch"], field)) {
item[field] = value; item[field] = value;
if (field == "serial_no" && value) { if (field == "serial_no" && value) {
let serial_nos = value.split("\n"); let serial_nos = value.split("\n");
@ -264,6 +265,9 @@ erpnext.pos.PointOfSale = class PointOfSale {
return d!==""; return d!=="";
}).length; }).length;
} }
} else {
return frappe.model.set_value(item.doctype, item.name, field, value);
}
} }
return this.frm.script_manager.trigger('qty', item.doctype, item.name) return this.frm.script_manager.trigger('qty', item.doctype, item.name)
@ -1475,7 +1479,7 @@ class Payment {
fieldname: p.mode_of_payment, fieldname: p.mode_of_payment,
default: p.amount, default: p.amount,
onchange: () => { onchange: () => {
const value = this.dialog.get_value(this.fieldname); const value = this.dialog.get_value(this.fieldname) || 0;
me.update_payment_value(this.fieldname, value); me.update_payment_value(this.fieldname, value);
} }
}; };