From 996e28433f2164d8e6b2a64fa26e33311c4a96f1 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Sat, 22 Jun 2024 16:20:55 +0800 Subject: [PATCH] Test run a long running query with pdf upload to S3 bucket --- ...ny_account_statement_transaction.blade.php | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 resources/views/pages/pdfs/company_account_statement_transaction.blade.php diff --git a/resources/views/pages/pdfs/company_account_statement_transaction.blade.php b/resources/views/pages/pdfs/company_account_statement_transaction.blade.php new file mode 100644 index 00000000..28c8e792 --- /dev/null +++ b/resources/views/pages/pdfs/company_account_statement_transaction.blade.php @@ -0,0 +1,135 @@ +@extends('layouts.base_pdf') + +@section('inner_content') + +
+ +

+
{{ $company->reference }}
+
+ + + + + + + + + + + +
+ CIEF WORLDWIDE SDN BHD + (1134596-M)
+ No. 72-3, Jalan Jalil 1,
+ The Earth Bukit Jalil,
+ 57000 Kuala Lumpur
+ Tel: 03-8082 1252 +
+
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 }}
+
+ +
+ + + + + + + + + + + + + + + @php + $roundOff = 2; + if ($isPrecise) { + $roundOff = 5; + } + $current_running_balance = 0; + @endphp + @foreach ($transactions as $key => $transaction) + @php + $description = ""; + $incoming = ""; + $outgoing = ""; + $marking = ""; + + switch ($transaction->type) { + case 1: + if ($transaction->owner_type === "App\Models\Booking") { + $description = "Payment
" . $transaction->bill_no; + $marking = $transaction->owner->marking; + } else { + $description = "Payment
" . $transaction->bill_no; + $marking = App\Models\Transaction::where('payment_reference', $transaction->bill_no)->first()->owner->marking; + } + $outgoing = number_format($transaction->amount, $roundOff); + break; + case 2: + $description = "Invoice
" . $transaction->bill_no; + $incoming = number_format(($transaction->amount / $transaction->currency_rate + $transaction->service_charge), $roundOff); + $marking = $transaction->owner->marking; + break; + case 5: + $description = "Top Up
" . $transaction->payment_reference; + $incoming = number_format($transaction->amount, $roundOff); + break; + case 9: + $description = "Credit Note
" . $transaction->payment_reference; + $incoming = number_format($transaction->amount, $roundOff); + break; + } + + $current_running_balance = floatval($current_running_balance) + floatval($incoming) - floatval($outgoing); + $current_running_balance = number_format($current_running_balance, $roundOff); + + @endphp + + + + + + + + + @endforeach + +
NoDateDescriptionIncomingOutgoingBalance (RM)
{{ $key + 1 }}{{ \Carbon\Carbon::parse($transaction->created_at)->format('Y-m-d') }}{!! $description !!}
{{$marking}}
+ {{ $incoming }} + + {{ $outgoing }} + + {{ number_format($current_running_balance, $roundOff) }} +
+ +
+ + + + + + +
This is generated by computer. No signature required.Page {PAGENO} of {nbpg}
+
+@endsection