[Fix] Searial no search issue, if serial no is similar with item code

This commit is contained in:
Rohit Waghchaure 2016-08-10 17:18:52 +05:30
parent 4b231c2692
commit ea5a32d304

View File

@ -421,19 +421,25 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
} }
key = this.search.$input.val().toLowerCase(); key = this.search.$input.val().toLowerCase();
search_status = true
if(key){ if(key){
return $.grep(window.items, function(item){ return $.grep(window.items, function(item){
if(in_list(item.batch_nos, me.search.$input.val())){ if(search_status){
return me.item_batch_no[item.item_code] = me.search.$input.val() if(in_list(item.batch_nos, me.search.$input.val())){
} else if((item.item_code.toLowerCase().match(key)) || search_status = false;
(item.item_name.toLowerCase().match(key)) || (item.item_group.toLowerCase().match(key))){ return me.item_batch_no[item.item_code] = me.search.$input.val()
return true } else if(in_list(Object.keys(item.serial_nos), me.search.$input.val())) {
}else if(item.barcode == me.search.$input.val()){ search_status = false;
return item.barcode == me.search.$input.val(); me.item_serial_no[item.item_code] = [me.search.$input.val(), item.serial_nos[me.search.$input.val()]]
} else if (in_list(Object.keys(item.serial_nos), me.search.$input.val())){ return true
me.item_serial_no[item.item_code] = [me.search.$input.val(), item.serial_nos[me.search.$input.val()]] } else if(item.barcode == me.search.$input.val()) {
return true search_status = false;
return item.barcode == me.search.$input.val();
} else if((item.item_code.toLowerCase().match(key)) ||
(item.item_name.toLowerCase().match(key)) || (item.item_group.toLowerCase().match(key))) {
return true
}
} }
}) })
}else{ }else{