# HG changeset patch
# User Aaron Calero <aaron.calero@openbravo.com>
# Date 1432899462 -7200
# Node ID e0e061b75b21efc50f769a07aa2620748f6e93eb
# Parent  43ee0d7b35fe8b1cc7b2a71793c8720a3c5143d2
Fixed issue 30035: Pay button is enabled in the Receipt discounts tab

Take into account the isEnabled attribute of the button when changing its status

diff --git a/web/org.openbravo.retail.posterminal/js/pointofsale/view/toolbar-left.js b/web/org.openbravo.retail.posterminal/js/pointofsale/view/toolbar-left.js
--- a/web/org.openbravo.retail.posterminal/js/pointofsale/view/toolbar-left.js
+++ b/web/org.openbravo.retail.posterminal/js/pointofsale/view/toolbar-left.js
@@ -217,8 +217,8 @@
         }
       }
     }
-    this.disabled = isDisabled; // for getDisabled() to return the correct value
-    this.setAttribute('disabled', isDisabled); // to effectively turn the button enabled or disabled
+    this.disabled = isDisabled || !this.isEnabled; // for getDisabled() to return the correct value
+    this.setAttribute('disabled', this.disabled); // to effectively turn the button enabled or disabled
   },
   events: {
     onTabChange: '',
