# HG changeset patch
# User Aaron Calero <aaron.calero@openbravo.com>
# Date 1432899462 -7200
# Node ID d34ec39b784011bc4ea70ac7c972f43d2f462620
# Parent  884bc2e75cd85ae243d0cf59fa9b5dc4f33837f9
Fixed issue 30034: 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: '',
