From e987838d5aa90f0183a729044bb7fe7ab3c2115d Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 30 Nov 2023 13:36:38 +0800 Subject: [PATCH] Fix 2 problem with generating storage invoice and export payment transaction in excel by date range --- .../Modules/Exports/Services/ExportsPaymentTransactions.php | 3 ++- resources/views/pages/pdfs/shipping_invoice_inner.blade.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php index 8b04dd16..bf82e7e2 100644 --- a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php @@ -74,7 +74,8 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading $approvalStatus = ApprovalStatus::APPROVED; } - $query->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [$approvalStatus]); + // $query->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [$approvalStatus]); + $query->whereIn('type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->whereIn('status', [$approvalStatus]); if($start_date && $end_date) { $query->whereBetween('updated_at', [ diff --git a/resources/views/pages/pdfs/shipping_invoice_inner.blade.php b/resources/views/pages/pdfs/shipping_invoice_inner.blade.php index e1460a64..a79dbc5a 100644 --- a/resources/views/pages/pdfs/shipping_invoice_inner.blade.php +++ b/resources/views/pages/pdfs/shipping_invoice_inner.blade.php @@ -52,12 +52,14 @@ @php $addresses = $companyModule->addresses()->where('status', '=', \App\Classes\ValueObjects\Constants\ApprovalStatus::APPROVED)->where('type', '=', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first(); @endphp + @if($addresses) {{ $addresses->street_one }} {{ $addresses->street_two }} , {{ $addresses->district()->first()->name }}, {{ $addresses->postcode }} {{ $addresses->state()->first()->name }}, {{ $addresses->country()->first()->name }} + @endif
@php @@ -126,4 +128,4 @@ - \ No newline at end of file +