Revert "Prompt for mandatory batch number in POS (#8928)"
This reverts commit ce9ac7885e15f9ed511b29e70f579a46ffb2799f.
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index 6a2e0cf..9261fa4 100644
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -398,7 +398,7 @@
this.make_item_list();
this.make_discount_field()
},
-
+
make_control: function() {
this.frm = {}
this.frm.doc = this.doc
@@ -543,7 +543,7 @@
me.toggle_totals_area();
});
},
-
+
bind_numeric_keypad: function() {
var me = this;
$(this.numeric_keypad).find('.pos-operation').on('click', function(){
@@ -572,7 +572,7 @@
me.selected_field.closest('.pos-list-row').addClass('active');
}
})
-
+
$(this.numeric_keypad).find('.numeric-del').click(function(){
me.selected_field = $(me.wrapper).find('.selected-item').find('.' + me.numeric_id)
me.numeric_val = cstr(flt(me.selected_field.val())).slice(0, -1);
@@ -580,7 +580,7 @@
me.selected_field.trigger("change")
// me.render_selected_item()
})
-
+
$(this.numeric_keypad).find('.pos-pay').click(function(){
me.validate();
me.update_paid_amount_status(true);
@@ -988,7 +988,7 @@
})).tooltip().appendTo($wrap);
}
});
-
+
$wrap.append(`
<div class="image-view-item btn-more text-muted text-center">
<div class="image-view-body">
@@ -1070,7 +1070,7 @@
});
}
},
-
+
bind_items_event: function() {
var me = this;
$(this.wrapper).on('click', '.pos-bill-item', function() {
@@ -1107,7 +1107,7 @@
var qty = flt($(this).parents(".pos-bill-item").find('.pos-item-qty').val()) - 1;
me.update_qty(item_code, qty)
})
-
+
$(this.wrapper).on("change", ".pos-item-disc", function () {
var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code");
var discount = $(this).val();
@@ -1763,14 +1763,10 @@
mandatory_batch_no: function () {
var me = this;
if (this.items[0].has_batch_no && !this.item_batch_no[this.items[0].item_code]) {
- frappe.prompt([
- {'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'))
- }
+ frappe.throw(__(repl("Error: Batch no is mandatory for item %(item)s", {
+ 'item': this.items[0].item_code
+ })))
+ }
},
apply_pricing_rule: function () {
@@ -1792,7 +1788,7 @@
item.pricing_rule = null;
me.apply_pricing_rule_on_item(item)
}
-
+
if(item.discount_percentage > 0) {
me.apply_pricing_rule_on_item(item)
}