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 4b3bd789..c04b20b9 100644 --- a/resources/views/pages/pdfs/company_account_statement_transaction.blade.php +++ b/resources/views/pages/pdfs/company_account_statement_transaction.blade.php @@ -61,65 +61,7 @@ - @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 - - {{ $key + 1 }} - {{ \Carbon\Carbon::parse($transaction->created_at)->format('Y-m-d') }} - {!! $description !!}
{{$marking}} - - {{ $incoming }} - - - {{ $outgoing }} - - - {{ number_format($current_running_balance, $roundOff) }} - - - @endforeach