update template

This commit is contained in:
edmondlang
2023-11-05 17:07:36 +08:00
parent 7d94776543
commit 29ca393a7f
2 changed files with 23 additions and 14 deletions
@@ -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) {
@@ -23,13 +23,25 @@
Tel: 03-8082 1252
</td>
<td class="header-details">
<div class="title right"><strong>Account Statement Transactions</strong></div>
<div class="title right" style="font-size: 1.7em !important;"><strong>Account<br>Statement<br>Transactions</strong></div>
<div>&nbsp;</div>
</td>
</tr>
<tr>
<td colspan="3" class="address">
<div class="label">{{ $company->name }}</div>
@php
$billingAddress = $company->addresses()->where('billing', '=', true)->first();
@endphp
<div class="address">
{{ $billingAddress->street_one }}
{{ $billingAddress->street_two }},
{{ $billingAddress->district()->first()->name }},
{{ $billingAddress->postcode }}
{{ $billingAddress->state()->first()->name }},
{{ $billingAddress->country()->first()->name }}
</div>
<div>Phone: {{ $company->contacts()->first()->phone }}</div>
</td>
</tr>
</table>
@@ -42,12 +54,11 @@
<thead>
<tr>
<th width="5%">No</th>
<th class="stock-code" width="10%">Date</th>
<th class="stock-code" width="15%">Date</th>
<th class="description">Description</th>
<th width="10%">Marking</th>
<th width="15%">Incoming</th>
<th width="15%">Outgoing</th>
<th width="10%">Balance<br>(RM)</th>
<th width="20%">Balance (RM)</th>
</tr>
</thead>
<tbody>
@@ -68,28 +79,28 @@
switch ($transaction->type) {
case 1:
if ($transaction->owner_type === "App\Models\Booking") {
$description = "Payment - " . $transaction->bill_no;
$description = "Payment <br>" . $transaction->bill_no;
$marking = $transaction->owner->marking;
} else {
$description = "Payment - " . $transaction->bill_no;
$description = "Payment <br>" . $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 <br>" . $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 <br>" . $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 <br>" . $transaction->payment_reference;
$incoming = number_format($transaction->amount, $roundOff);
$runningBalance = $runningBalance - $transaction->amount;
break;
@@ -99,13 +110,12 @@
@endphp
<tr>
<td width="5%" class="center top">{{ $key + 1 }}</td>
<td class="stock-code top" width="10%" style="text-align: center;">{{ $transaction->created_at }}</td>
<td class="description">{{ $description }}</td>
<td width="10%" class="center top" style="text-align: center;">{{ $marking }}</td>
<td class="stock-code top" width="15%" style="text-align: center;">{{ \Carbon\Carbon::parse($transaction->created_at)->format('Y-m-d') }}</td>
<td class="description">{!! $description !!} <br> {{$marking}}</td>
<td width="15%" class="center top" style="text-align: center;">
{{ $incoming }}
</td>
<td width="20%" class="center top" style="text-align: center;">
<td width="15%" class="center top" style="text-align: center;">
{{ $outgoing }}
</td>
<td width="20%" class="center top" style="text-align: center;">