Merge pull request #17969 from rohitwaghchaure/enabled_disabled_buttons_on_change_of_pos_profile_develop

fix: allow edit is enabled in the pos profile still user not able to edit the rates
This commit is contained in:
rohitwaghchaure 2019-06-17 17:24:29 +05:30 committed by GitHub
commit fdb79063a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -779,6 +779,17 @@ class POSCart {
const customer = this.frm.doc.customer;
this.customer_field.set_value(customer);
if (this.numpad) {
const disable_btns = this.disable_numpad_control()
const enable_btns = [__('Rate'), __('Disc')]
if (disable_btns) {
enable_btns.filter(btn => !disable_btns.includes(btn))
}
this.numpad.enable_buttons(enable_btns);
}
}
get_grand_total() {
@ -1551,6 +1562,16 @@ class NumberPad {
}
}
enable_buttons(btns) {
btns.forEach((btn) => {
const $btn = this.get_btn(btn);
$btn.prop("disabled", false)
$btn.hover(() => {
$btn.css('cursor','pointer');
})
})
}
set_class() {
for (const btn in this.add_class) {
const class_name = this.add_class[btn];