refactor: show total pay split

This commit is contained in:
Thanaphon Frappet 2024-11-01 10:50:39 +07:00
parent 2264686a34
commit 88d0e1df14
2 changed files with 6 additions and 2 deletions

View file

@ -1458,13 +1458,14 @@ const view = ref<View>(View.Quotation);
</div> </div>
</q-expansion-item> </q-expansion-item>
</template> </template>
<QuotationFormReceipt <QuotationFormReceipt
v-if="view === View.Receipt" v-if="view === View.Receipt"
v-for="v in receiptList" v-for="(v, i) in receiptList"
:amount="v.amount" :amount="v.amount"
:date="v.date" :date="v.date"
:pay-type="quotationFormData.payCondition" :pay-type="quotationFormData.payCondition"
:index="i"
:pay-split-count="quotationFormData.paySplitCount || 0"
/> />
</div> </div>
</section> </section>

View file

@ -7,6 +7,8 @@ withDefaults(
payType: string; payType: string;
amount: number; amount: number;
date: string | Date; date: string | Date;
index: number;
paySplitCount: number;
}>(), }>(),
{ payType: 'Full', amount: 0, date: () => new Date() }, { payType: 'Full', amount: 0, date: () => new Date() },
); );
@ -22,6 +24,7 @@ withDefaults(
</span> </span>
<span class="row items-center"> <span class="row items-center">
{{ $t(`quotation.type.${payType}`) }} {{ $t(`quotation.type.${payType}`) }}
{{ payType !== 'Full' ? `${index + 1} / ${paySplitCount}` : `` }}
<q-icon name="mdi-minus" class="q-px-xs" /> <q-icon name="mdi-minus" class="q-px-xs" />
<article class="app-text-positive text-weight-medium"> <article class="app-text-positive text-weight-medium">
{{ $t('quotation.receiptDialog.PaymentSuccess') }} {{ $t('quotation.receiptDialog.PaymentSuccess') }}