fix: Available qty not shown in item batch selector for batch

This commit is contained in:
deepeshgarg007 2019-06-10 17:33:36 +05:30
parent dde4f93137
commit 30f7e7be87

View File

@ -268,18 +268,19 @@ erpnext.SerialNoBatchSelector = Class.extend({
{fieldname: 'batches', fieldtype: 'Table', label: __('Batch Entries'),
fields: [
{
fieldtype:'Link',
fieldname:'batch_no',
options: 'Batch',
label: __('Select Batch'),
in_list_view:1,
'fieldtype': 'Link',
'read_only': 0,
'fieldname': 'batch_no',
'options': 'Batch',
'label': __('Select Batch'),
'in_list_view': 1,
get_query: function () {
return {
filters: { item: me.item_code },
query: 'erpnext.controllers.queries.get_batch_numbers'
};
},
onchange: function(e) {
change: function (e) {
let val = this.get_value();
if (val.length === 0) {
this.grid_row.on_grid_fields_dict
@ -323,23 +324,24 @@ erpnext.SerialNoBatchSelector = Class.extend({
}
},
{
fieldtype:'Float',
read_only:1,
fieldname:'available_qty',
label: __('Available'),
in_list_view:1,
default: 0,
onchange: function() {
'fieldtype': 'Float',
'read_only': 1,
'fieldname': 'available_qty',
'label': __('Available'),
'in_list_view': 1,
'default': 0,
change: function () {
this.grid_row.on_grid_fields_dict.selected_qty.set_value('0');
}
},
{
fieldtype:'Float',
fieldname:'selected_qty',
label: __('Qty'),
in_list_view:1,
'fieldtype': 'Float',
'read_only': 0,
'fieldname': 'selected_qty',
'label': __('Qty'),
'in_list_view': 1,
'default': 0,
onchange: function(e) {
change: function (e) {
var batch_no = this.grid_row.on_grid_fields_dict.batch_no.get_value();
var available_qty = this.grid_row.on_grid_fields_dict.available_qty.get_value();
var selected_qty = this.grid_row.on_grid_fields_dict.selected_qty.get_value();