diff --git a/static/js/index.js b/static/js/index.js index b70f7d8..cb3e281 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -133,11 +133,14 @@ window.app = Vue.createApp({ // Utility Methods formatCurrency(amount) { if (!amount) return 'Q 0.00'; - + + // Convert centavos to GTQ for display + const gtqAmount = amount / 100; + return new Intl.NumberFormat('es-GT', { style: 'currency', currency: 'GTQ', - }).format(amount); + }).format(gtqAmount); }, formatDate(dateString) { @@ -302,7 +305,7 @@ window.app = Vue.createApp({ try { const data = { client_id: this.quickDepositForm.selectedClient?.value, - amount: this.quickDepositForm.amount, + amount: Math.round(this.quickDepositForm.amount * 100), // Convert GTQ to centavos currency: 'GTQ', notes: this.quickDepositForm.notes } @@ -375,7 +378,7 @@ window.app = Vue.createApp({ try { const data = { client_id: this.depositFormDialog.data.client_id, - amount: this.depositFormDialog.data.amount, + amount: Math.round(this.depositFormDialog.data.amount * 100), // Convert GTQ to centavos currency: this.depositFormDialog.data.currency, notes: this.depositFormDialog.data.notes } diff --git a/templates/satmachineadmin/index.html b/templates/satmachineadmin/index.html index 6555d55..61099ce 100644 --- a/templates/satmachineadmin/index.html +++ b/templates/satmachineadmin/index.html @@ -116,10 +116,11 @@ filled dense type="number" + step="0.01" v-model.number="quickDepositForm.amount" label="Amount (GTQ) *" - placeholder="Amount in centavos (GTQ * 100)" - hint="Enter amount in centavos" + placeholder="150.00" + hint="Enter amount in GTQ (e.g., 150.00)" >