[Fix] Discount in offline POS is enabled even is it's disabled in POS Profile (#13233)
This commit is contained in:
parent
a3a63177a1
commit
a32e57ae82
@ -393,7 +393,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
this.frm = {}
|
||||
this.frm.doc = this.doc
|
||||
this.set_transaction_defaults("Customer");
|
||||
this.frm.doc["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false,
|
||||
this.frm.doc["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false;
|
||||
this.frm.doc["allow_user_to_edit_discount"] = this.pos_profile_data["allow_user_to_edit_discount"] ? true : false;
|
||||
this.wrapper.html(frappe.render_template("pos", this.frm.doc));
|
||||
this.make_search();
|
||||
this.make_customer();
|
||||
@ -1256,6 +1257,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
$(this.wrapper).find('.selected-item').empty();
|
||||
if(this.child_doc.length) {
|
||||
this.child_doc[0]["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false,
|
||||
this.child_doc[0]["allow_user_to_edit_discount"] = this.pos_profile_data["allow_user_to_edit_discount"] ? true : false;
|
||||
this.selected_row = $(frappe.render_template("pos_selected_item", this.child_doc[0]))
|
||||
$(this.wrapper).find('.selected-item').html(this.selected_row)
|
||||
}
|
||||
@ -1683,7 +1685,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
setInterval(function () {
|
||||
me.freeze_screen = false;
|
||||
me.sync_sales_invoice()
|
||||
}, 60000)
|
||||
}, 180000)
|
||||
},
|
||||
|
||||
sync_sales_invoice: function () {
|
||||
|
@ -37,20 +37,22 @@
|
||||
<div class="cell price-cell text-right tax-table">
|
||||
</div>
|
||||
</div>
|
||||
<div class="pos-list-row discount-amount-area">
|
||||
<div class="cell"></div>
|
||||
<div class="cell text-right">{%= __("Discount") %}</div>
|
||||
<div class="cell price-cell discount-field-col">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">%</span>
|
||||
<input type="text" class="form-control discount-percentage text-right">
|
||||
</div>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">{%= get_currency_symbol(currency) %}</span>
|
||||
<input type="text" class="form-control discount-amount text-right" placeholder="{%= 0.00 %}">
|
||||
{% if(allow_user_to_edit_discount) { %}
|
||||
<div class="pos-list-row discount-amount-area">
|
||||
<div class="cell"></div>
|
||||
<div class="cell text-right">{%= __("Discount") %}</div>
|
||||
<div class="cell price-cell discount-field-col">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">%</span>
|
||||
<input type="text" class="form-control discount-percentage text-right">
|
||||
</div>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">{%= get_currency_symbol(currency) %}</span>
|
||||
<input type="text" class="form-control discount-amount text-right" placeholder="{%= 0.00 %}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% } %}
|
||||
<div class="pos-list-row grand-total-area collapse-btn" style="border-bottom:1px solid #d1d8dd;">
|
||||
<div class="cell">
|
||||
<a class="">
|
||||
@ -71,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" {% 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>
|
||||
<button type="button" {% if((!allow_user_to_edit_rate && chartData[i] == __("Price")) || (!allow_user_to_edit_discount && chartData[i] == __("Disc"))) { %} 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">
|
||||
|
@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<div class="pos-list-row">
|
||||
<div class="cell">{{ __("Discount") }}: %</div>
|
||||
<input type="tel" class="form-control cell pos-item-disc" value="{%= discount_percentage %}">
|
||||
<input type="tel" class="form-control cell pos-item-disc" {% if !allow_user_to_edit_discount %} disabled {% endif %} value="{%= discount_percentage %}">
|
||||
</div>
|
||||
<div class="pos-list-row">
|
||||
<div class="cell">{{ __("Price") }}:</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user