Prompt for mandatory batch number in POS (#8928)

* Prompt for mandatory batch number in POS

* Whitespaces correction
This commit is contained in:
Charles-Henri Decultot 2017-05-19 12:32:30 +02:00 committed by Rushabh Mehta
parent 56549fd3d9
commit 8bec0239b9

View File

@ -1757,9 +1757,13 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
mandatory_batch_no: function () { mandatory_batch_no: function () {
var me = this; var me = this;
if (this.items[0].has_batch_no && !this.item_batch_no[this.items[0].item_code]) { if (this.items[0].has_batch_no && !this.item_batch_no[this.items[0].item_code]) {
frappe.throw(__(repl("Error: Batch no is mandatory for item %(item)s", { frappe.prompt([
'item': this.items[0].item_code {'fieldname': 'batch', 'fieldtype': 'Select', 'label': __('Batch No'), 'reqd': 1, 'options':this.batch_no_data[this.items[0].item_code]}
}))) ],
function(values){
me.item_batch_no[me.items[0].item_code] = values.batch;
},
__('Select Batch No'))
} }
}, },