Update currency handling in frontend and backend: Adjusted amount formatting to display GTQ instead of centavos in the UI. Modified data submission logic to convert GTQ to centavos for backend processing, ensuring consistency in currency representation across the application.

This commit is contained in:
padreug 2025-07-05 17:35:11 +02:00
parent 1943da1fc3
commit f0f38f73bf
2 changed files with 13 additions and 8 deletions

View file

@ -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
}