mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
Show Batch Selector Dialog Only If There Are Multiple Batches (#11794)
* check if multiple batches available before showing dialog * Update point_of_sale.js
This commit is contained in:
@@ -168,7 +168,10 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
value = item.serial_no + '\n'+ value;
|
value = item.serial_no + '\n'+ value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(field === 'qty' && (item.serial_no || item.batch_no)) {
|
// if actual_batch_qty and actual_qty if there is only one batch. In such
|
||||||
|
// a case, no point showing the dialog
|
||||||
|
if(field === 'qty' && (item.serial_no || item.batch_no)
|
||||||
|
&& (item.actual_batch_qty != item.actual_qty)) {
|
||||||
this.select_batch_and_serial_no(item);
|
this.select_batch_and_serial_no(item);
|
||||||
} else {
|
} else {
|
||||||
this.update_item_in_frm(item, field, value)
|
this.update_item_in_frm(item, field, value)
|
||||||
@@ -192,7 +195,10 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
.trigger('item_code', item.doctype, item.name)
|
.trigger('item_code', item.doctype, item.name)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const show_dialog = item.has_serial_no || item.has_batch_no;
|
const show_dialog = item.has_serial_no || item.has_batch_no;
|
||||||
if (show_dialog && field == 'qty') {
|
|
||||||
|
// if actual_batch_qty and actual_qty if then there is only one batch. In such
|
||||||
|
// a case, no point showing the dialog
|
||||||
|
if (show_dialog && field == 'qty' && (item.actual_batch_qty != item.actual_qty)) {
|
||||||
// check has serial no/batch no and update cart
|
// check has serial no/batch no and update cart
|
||||||
this.select_batch_and_serial_no(item);
|
this.select_batch_and_serial_no(item);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user