mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 14:33:59 +00:00
Merge branch 'account-statement-pagination' of gitlab.com:CIEFWorldwideSdnBhd/exchange-2.0 into development
This commit is contained in:
@@ -67,13 +67,13 @@
|
||||
if ($isPrecise) {
|
||||
$roundOff = 5;
|
||||
}
|
||||
$current_running_balance = 0;
|
||||
@endphp
|
||||
@foreach ($transactions as $key => $transaction)
|
||||
@php
|
||||
$description = "";
|
||||
$incoming = "";
|
||||
$outgoing = "";
|
||||
$current_running_balance = $runningBalance;
|
||||
$marking = "";
|
||||
|
||||
switch ($transaction->type) {
|
||||
@@ -86,27 +86,25 @@
|
||||
$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 <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 <br>" . $transaction->payment_reference;
|
||||
$incoming = number_format($transaction->amount, $roundOff);
|
||||
$runningBalance = $runningBalance - $transaction->amount;
|
||||
break;
|
||||
case 9:
|
||||
$description = "Credit Note <br>" . $transaction->payment_reference;
|
||||
$incoming = number_format($transaction->amount, $roundOff);
|
||||
$runningBalance = $runningBalance - $transaction->amount;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$current_running_balance = floatval($current_running_balance) + floatval($incoming) - floatval($outgoing);
|
||||
$current_running_balance = number_format($current_running_balance, $roundOff);
|
||||
|
||||
@endphp
|
||||
<tr>
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
|
||||
Reference in New Issue
Block a user