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:
parent
1943da1fc3
commit
f0f38f73bf
2 changed files with 13 additions and 8 deletions
|
|
@ -133,11 +133,14 @@ window.app = Vue.createApp({
|
||||||
// Utility Methods
|
// Utility Methods
|
||||||
formatCurrency(amount) {
|
formatCurrency(amount) {
|
||||||
if (!amount) return 'Q 0.00';
|
if (!amount) return 'Q 0.00';
|
||||||
|
|
||||||
|
// Convert centavos to GTQ for display
|
||||||
|
const gtqAmount = amount / 100;
|
||||||
|
|
||||||
return new Intl.NumberFormat('es-GT', {
|
return new Intl.NumberFormat('es-GT', {
|
||||||
style: 'currency',
|
style: 'currency',
|
||||||
currency: 'GTQ',
|
currency: 'GTQ',
|
||||||
}).format(amount);
|
}).format(gtqAmount);
|
||||||
},
|
},
|
||||||
|
|
||||||
formatDate(dateString) {
|
formatDate(dateString) {
|
||||||
|
|
@ -302,7 +305,7 @@ window.app = Vue.createApp({
|
||||||
try {
|
try {
|
||||||
const data = {
|
const data = {
|
||||||
client_id: this.quickDepositForm.selectedClient?.value,
|
client_id: this.quickDepositForm.selectedClient?.value,
|
||||||
amount: this.quickDepositForm.amount,
|
amount: Math.round(this.quickDepositForm.amount * 100), // Convert GTQ to centavos
|
||||||
currency: 'GTQ',
|
currency: 'GTQ',
|
||||||
notes: this.quickDepositForm.notes
|
notes: this.quickDepositForm.notes
|
||||||
}
|
}
|
||||||
|
|
@ -375,7 +378,7 @@ window.app = Vue.createApp({
|
||||||
try {
|
try {
|
||||||
const data = {
|
const data = {
|
||||||
client_id: this.depositFormDialog.data.client_id,
|
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,
|
currency: this.depositFormDialog.data.currency,
|
||||||
notes: this.depositFormDialog.data.notes
|
notes: this.depositFormDialog.data.notes
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,10 +116,11 @@
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
type="number"
|
type="number"
|
||||||
|
step="0.01"
|
||||||
v-model.number="quickDepositForm.amount"
|
v-model.number="quickDepositForm.amount"
|
||||||
label="Amount (GTQ) *"
|
label="Amount (GTQ) *"
|
||||||
placeholder="Amount in centavos (GTQ * 100)"
|
placeholder="150.00"
|
||||||
hint="Enter amount in centavos"
|
hint="Enter amount in GTQ (e.g., 150.00)"
|
||||||
></q-input>
|
></q-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
@ -379,10 +380,11 @@
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
type="number"
|
type="number"
|
||||||
|
step="0.01"
|
||||||
v-model.number="depositFormDialog.data.amount"
|
v-model.number="depositFormDialog.data.amount"
|
||||||
label="Deposit Amount (GTQ) *"
|
label="Deposit Amount (GTQ) *"
|
||||||
placeholder="Amount in centavos (GTQ * 100)"
|
placeholder="150.00"
|
||||||
hint="Enter amount in centavos (1 GTQ = 100 centavos)"
|
hint="Enter amount in GTQ (e.g., 150.00)"
|
||||||
></q-input>
|
></q-input>
|
||||||
<q-select
|
<q-select
|
||||||
filled
|
filled
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue