From 6b5ae9b0b78842a46f56b66ac6d252bc9a706df3 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Fri, 24 Feb 2023 18:06:39 +0800 Subject: [PATCH] export invoice for PAID INVOICE and PENDING PAYMENT --- .../Services/ExportsPaymentTransactions.php | 10 +++- ...dminPaymentsBillingWithSearchComponent.vue | 47 ++++++++++++------ .../DownloadBillingWithDatesComponent.vue | 49 +++++++++---------- .../AdminPaymentsBillingSectionComponent.vue | 9 +--- routes/web.php | 2 +- 5 files changed, 67 insertions(+), 50 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php index d63fc67b..ab1af2d0 100644 --- a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php @@ -60,7 +60,15 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading $query = Transaction::query(); - $query->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::COMPLETED]); + // paidInvoiceSection + $approvalStatus = ApprovalStatus::COMPLETED; + + if ($this->request->route('section') == 'pendingPaymentSection') { + // pendingPaymentSection + $approvalStatus = ApprovalStatus::APPROVED; + } + + $query->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [$approvalStatus]); if($start_date && $end_date) { $query->whereBetween('updated_at', [ diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchComponent.vue index cb683e08..746e6c71 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingWithSearchComponent.vue @@ -1,25 +1,36 @@