From 29ca393a7f5cf6fe69c65e5093ff030efb4ad3dc Mon Sep 17 00:00:00 2001 From: edmondlang Date: Sun, 5 Nov 2023 17:07:36 +0800 Subject: [PATCH] update template --- ...untStatementTransactionToPDFController.php | 1 - ...ny_account_statement_transaction.blade.php | 36 ++++++++++++------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/app/Http/Controllers/Exports/ExportCustomersAccountStatementTransactionToPDFController.php b/app/Http/Controllers/Exports/ExportCustomersAccountStatementTransactionToPDFController.php index 83ddb6a2..08390759 100644 --- a/app/Http/Controllers/Exports/ExportCustomersAccountStatementTransactionToPDFController.php +++ b/app/Http/Controllers/Exports/ExportCustomersAccountStatementTransactionToPDFController.php @@ -73,7 +73,6 @@ class ExportCustomersAccountStatementTransactionToPDFController ) ) ->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]) - ->orderBy('created_at', 'desc') ->get(); $total_incoming = Transaction::where(function ($query) use ($companyId) { diff --git a/resources/views/pages/pdfs/company_account_statement_transaction.blade.php b/resources/views/pages/pdfs/company_account_statement_transaction.blade.php index 34057044..8b6122c4 100644 --- a/resources/views/pages/pdfs/company_account_statement_transaction.blade.php +++ b/resources/views/pages/pdfs/company_account_statement_transaction.blade.php @@ -23,13 +23,25 @@ Tel: 03-8082 1252 -
Account Statement Transactions
+
Account
Statement
Transactions
 
{{ $company->name }}
+ @php + $billingAddress = $company->addresses()->where('billing', '=', true)->first(); + @endphp +
+ {{ $billingAddress->street_one }} + {{ $billingAddress->street_two }}, + {{ $billingAddress->district()->first()->name }}, + {{ $billingAddress->postcode }} + {{ $billingAddress->state()->first()->name }}, + {{ $billingAddress->country()->first()->name }} +
+
Phone: {{ $company->contacts()->first()->phone }}
@@ -42,12 +54,11 @@ No - Date + Date Description - Marking Incoming Outgoing - Balance
(RM) + Balance (RM) @@ -68,28 +79,28 @@ switch ($transaction->type) { case 1: if ($transaction->owner_type === "App\Models\Booking") { - $description = "Payment - " . $transaction->bill_no; + $description = "Payment
" . $transaction->bill_no; $marking = $transaction->owner->marking; } else { - $description = "Payment - " . $transaction->bill_no; + $description = "Payment
" . $transaction->bill_no; $marking = App\Models\Transaction::where('payment_reference', $transaction->bill_no)->first()->owner->marking; } $outgoing = number_format($transaction->amount, $roundOff); $runningBalance = $runningBalance + $transaction->amount; break; case 2: - $description = "Invoice - " . $transaction->bill_no; + $description = "Invoice
" . $transaction->bill_no; $incoming = number_format(($transaction->amount / $transaction->currency_rate + $transaction->service_charge), $roundOff); $runningBalance = $runningBalance - ($transaction->amount / $transaction->currency_rate + $transaction->service_charge); $marking = $transaction->owner->marking; break; case 5: - $description = "Top Up - " . $transaction->payment_reference; + $description = "Top Up
" . $transaction->payment_reference; $incoming = number_format($transaction->amount, $roundOff); $runningBalance = $runningBalance - $transaction->amount; break; case 9: - $description = "Credit Note - " . $transaction->payment_reference; + $description = "Credit Note
" . $transaction->payment_reference; $incoming = number_format($transaction->amount, $roundOff); $runningBalance = $runningBalance - $transaction->amount; break; @@ -99,13 +110,12 @@ @endphp {{ $key + 1 }} - {{ $transaction->created_at }} - {{ $description }} - {{ $marking }} + {{ \Carbon\Carbon::parse($transaction->created_at)->format('Y-m-d') }} + {!! $description !!}
{{$marking}} {{ $incoming }} - + {{ $outgoing }}