Skip to content

Commit

Permalink
feat: disable keypad if no exchange rate (#94)
Browse files Browse the repository at this point in the history
* feat: disable keypad if no exchange rate
* prettier
* delete log and fix redundancy
  • Loading branch information
talvasconcelos authored Aug 20, 2024
1 parent ae4a8f9 commit 7c3bc0a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions static/js/tpos.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ const tposJS = async () => {
Math.floor(this.total - this.cartTax),
this.currency
)
},
keypadDisabled() {
return !this.exchangeRate
}
},
methods: {
Expand Down
14 changes: 14 additions & 0 deletions templates/tpos/tpos.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
color="primary"
:disable="keypadDisabled"
>1</q-btn
>
<q-btn
Expand All @@ -70,6 +71,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
color="primary"
:disable="keypadDisabled"
>2</q-btn
>
<q-btn
Expand All @@ -79,6 +81,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
color="primary"
:disable="keypadDisabled"
>3</q-btn
>
<q-btn
Expand All @@ -88,6 +91,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
color="primary"
:disable="keypadDisabled"
>4</q-btn
>
<q-btn
Expand All @@ -97,6 +101,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
color="primary"
:disable="keypadDisabled"
>5</q-btn
>
<q-btn
Expand All @@ -106,6 +111,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
color="primary"
:disable="keypadDisabled"
>6</q-btn
>
<q-btn
Expand All @@ -115,6 +121,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
color="primary"
:disable="keypadDisabled"
>7</q-btn
>
<q-btn
Expand All @@ -124,6 +131,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
color="primary"
:disable="keypadDisabled"
>8</q-btn
>
<q-btn
Expand All @@ -133,6 +141,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
color="primary"
:disable="keypadDisabled"
>9</q-btn
>
<q-btn
Expand All @@ -142,6 +151,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
:color="monochrome ? 'secondary' : 'negative'"
:disable="keypadDisabled"
>C</q-btn
>
<q-btn
Expand All @@ -151,6 +161,7 @@ <h5>
:outline="!($q.dark.isActive)"
rounded
color="primary"
:disable="keypadDisabled"
>0</q-btn
>
<q-btn
Expand All @@ -161,6 +172,7 @@ <h5>
rounded
:color="monochrome ? 'secondary' : 'warning'"
class="btn-cancel"
:disable="keypadDisabled"
></q-btn
>
<q-btn
Expand All @@ -171,6 +183,7 @@ <h5>
rounded
color="primary"
class="btn-plus"
:disable="keypadDisabled"
>+</q-btn
>
<q-btn
Expand All @@ -181,6 +194,7 @@ <h5>
rounded
:color="monochrome ? 'secondary' : 'positive'"
class="btn-confirm"
:disable="keypadDisabled"
>Ok</q-btn
>
</div>
Expand Down

0 comments on commit 7c3bc0a

Please sign in to comment.