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
|
{{ $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 }}
|
|