feat: enhance invoice handling with success messages and payment data integration
Production CI / validate-and-build (push) Failing after 1m7s
Production CI / validate-and-build (push) Failing after 1m7s
This commit is contained in:
@@ -110,8 +110,10 @@ export class SharedSaleInvoiceSingleViewComponent {
|
||||
showQrCodeDialog = signal(false);
|
||||
showCorrectionPaymentDialog = signal(false);
|
||||
correctionRequiredPayment = signal(0);
|
||||
paymentData = signal<Maybe<IPayment>>(null);
|
||||
readonly isApplication = config.isPosApplication;
|
||||
private pendingCorrectionSubmitResolver: Maybe<(allowed: boolean) => void> = null;
|
||||
private pendingCorrectionSubmitResolver: Maybe<(allowed: boolean, payment?: IPayment) => void> =
|
||||
null;
|
||||
|
||||
publicInvoiceRoute = computed(() => {
|
||||
if (this.invoice) {
|
||||
@@ -282,6 +284,7 @@ export class SharedSaleInvoiceSingleViewComponent {
|
||||
total_amount,
|
||||
discount_amount,
|
||||
tax_amount,
|
||||
payments: this.paymentData() || undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -310,7 +313,12 @@ export class SharedSaleInvoiceSingleViewComponent {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (await this.beforeCorrectionSubmit?.(mapped)) ?? true;
|
||||
return (
|
||||
(await this.beforeCorrectionSubmit?.({
|
||||
...mapped,
|
||||
payments: this.paymentData() || undefined,
|
||||
})) ?? true
|
||||
);
|
||||
}
|
||||
|
||||
confirmCorrectionPayment(_event: {
|
||||
@@ -318,7 +326,8 @@ export class SharedSaleInvoiceSingleViewComponent {
|
||||
settlementType: 'CASH' | 'CREDIT' | 'MIXED';
|
||||
}) {
|
||||
this.showCorrectionPaymentDialog.set(false);
|
||||
this.pendingCorrectionSubmitResolver?.(true);
|
||||
this.paymentData.set(_event.payment);
|
||||
this.pendingCorrectionSubmitResolver?.(true, _event.payment);
|
||||
this.pendingCorrectionSubmitResolver = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user