From 4e3df334dbf0442b724837538b3962294d20d825 Mon Sep 17 00:00:00 2001 From: Sun Howwrongbum Date: Thu, 23 Jul 2020 20:06:15 +0530 Subject: [PATCH] fix: [v12] incorrect available_qty being set (#22541) * fix: incorrect available_qty being set * style: descriptive variables --- erpnext/public/js/utils/serial_no_batch_selector.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js index e78ab9fb690..f29e42f8940 100644 --- a/erpnext/public/js/utils/serial_no_batch_selector.js +++ b/erpnext/public/js/utils/serial_no_batch_selector.js @@ -333,8 +333,8 @@ erpnext.SerialNoBatchSelector = Class.extend({ }; }, change: function () { - let val = this.get_value(); - if (val.length === 0) { + const batch_no = this.get_value(); + if (!batch_no) { this.grid_row.on_grid_fields_dict .available_qty.set_value(0); return; @@ -354,14 +354,11 @@ erpnext.SerialNoBatchSelector = Class.extend({ return; } - let batch_number = me.item.batch_no || - this.grid_row.on_grid_fields_dict.batch_no.get_value(); - if (me.warehouse_details.name) { frappe.call({ method: 'erpnext.stock.doctype.batch.batch.get_batch_qty', args: { - batch_no: batch_number, + batch_no, warehouse: me.warehouse_details.name, item_code: me.item_code },