Merge pull request #6587 from rohitwaghchaure/pos_wildcard_search_issue

[Fix] wildcard search for pos not working
This commit is contained in:
Nabin Hait 2016-10-10 11:50:01 +05:30 committed by GitHub
commit 1ca7a27b2f

View File

@ -93,7 +93,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
me.get_data_from_server(function(){
me.load_data(false);
me.make_customer();
me.make_item_list(true);
me.make_item_list();
me.set_missing_values();
})
});
@ -266,7 +266,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
make: function() {
this.make_search();
this.make_customer();
this.make_item_list(true);
this.make_item_list();
this.make_discount_field()
},
@ -287,7 +287,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.search.$input.on("keyup", function() {
setTimeout(function() {
me.items = me.get_items();
me.make_item_list(false);
me.make_item_list();
}, 1000);
});
@ -363,7 +363,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
}
},
make_item_list: function(index_search) {
make_item_list: function() {
var me = this;
if(!this.price_list) {
msgprint(__("Price List not found or disabled"));
@ -377,7 +377,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
if (this.items) {
$.each(this.items, function(index, obj) {
if(!index_search || index < 16){
if(index < 30){
$(frappe.render_template("pos_item", {
item_code: obj.name,
item_price: format_currency(obj.price_list_rate, obj.currency),
@ -423,7 +423,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
key = this.search.$input.val().toLowerCase();
var re = new RegExp('%', 'g');
var reg = new RegExp(key.replace(re, '\\w*\\s*[a-zA-Z0-9]*'))
var reg = new RegExp(key.replace(re, '[\\w*\\s*[a-zA-Z0-9]*]*'))
search_status = true
if(key){