[Fix] Orders not creating from the POS for new customer if customer name is based on naming series (#8933)
* [Fix] Orders not creating from the POS for new customer if customer name is based on naming series
* [fix] Disabled price field in POS, if Allow User to Edit Rate field is disabled in POS profile
* added customer name in the search bar of the customer
* search customer by phone number and email id in the POS
diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js
index dc1db35..1437ee9 100644
--- a/erpnext/public/js/controllers/taxes_and_totals.js
+++ b/erpnext/public/js/controllers/taxes_and_totals.js
@@ -606,7 +606,7 @@
this.frm.doc.change_amount = 0.0;
this.frm.doc.base_change_amount = 0.0;
if(this.frm.doc.paid_amount > this.frm.doc.grand_total && !this.frm.doc.is_return) {
- var payment_types = $.map(cur_frm.doc.payments, function(d) { return d.type });
+ var payment_types = $.map(this.frm.doc.payments, function(d) { return d.type });
if (in_list(payment_types, 'Cash')) {
this.frm.doc.change_amount = flt(this.frm.doc.paid_amount - this.frm.doc.grand_total +
this.frm.doc.write_off_amount, precision("change_amount"));
diff --git a/erpnext/public/js/pos/pos.html b/erpnext/public/js/pos/pos.html
index 6065e60..485a945 100644
--- a/erpnext/public/js/pos/pos.html
+++ b/erpnext/public/js/pos/pos.html
@@ -73,7 +73,7 @@
{% for(var j=i*3; j
<(i+1)*3; j++) { %} <button type="button" class="btn btn-default numeric-keypad" val="{{j+1}}">{{j+1}}</button>
{% } %}
- <button type="button" id="pos-item-{{ chartData[i].toLowerCase() }}" class="btn text-center btn-default numeric-keypad pos-operation">{{ __(chartData[i]) }}</button>
+ <button type="button" {% if(!allow_user_to_edit_rate && chartData[i] == __("Price")) { %} disabled {% } %} id="pos-item-{{ chartData[i].toLowerCase() }}" class="btn text-center btn-default numeric-keypad pos-operation">{{ __(chartData[i]) }}</button>
</div>
{% } %}
<div class="row text-right">
diff --git a/erpnext/public/js/pos/pos_selected_item.html b/erpnext/public/js/pos/pos_selected_item.html
index a4bc49d..64f8c16 100644
--- a/erpnext/public/js/pos/pos_selected_item.html
+++ b/erpnext/public/js/pos/pos_selected_item.html
@@ -13,7 +13,7 @@
</div>
<div class="pos-list-row">
<div class="cell">{{ __("Price") }}:</div>
- <input type="tel" class="form-control cell pos-item-price" value="{%= rate %}"/>
+ <input type="tel" class="form-control cell pos-item-price" {% if !allow_user_to_edit_rate %} disabled {% endif %} value="{%= rate %}"/>
</div>
<div class="pos-list-row">
<div class="cell">{{ __("Amount") }}:</div>