105 lines
6.2 KiB
PHP
105 lines
6.2 KiB
PHP
@extends('layouts.business.pdf.pdf_layout')
|
|
|
|
@section('pdf_title')
|
|
<div class="table-header justify-content-center border-0 d-none d-block d-print-block text-center">
|
|
@include('business::print.header')
|
|
<h4 style="text-align: center; margin: 0; padding: 0; font-size: 16px;">{{ __('Cash Flow Report List') }}</h4>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('pdf_content')
|
|
<table width="100%" cellpadding="6" cellspacing="0"
|
|
style="border-collapse: collapse; border: 1px solid gainsboro; font-size:12px;">
|
|
<thead>
|
|
<tr style="background-color: #C52127; color: white;">
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Date') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-center">{{ __('Invoice') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Name') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Type') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Cash In') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Cash Out') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Running Cash') }}</th>
|
|
</tr>
|
|
</thead>
|
|
@php $runningCash = $opening_balance; @endphp
|
|
<tbody>
|
|
@foreach ($cash_flows as $cash_flow)
|
|
@php
|
|
if ($cash_flow->type === 'credit') {
|
|
$runningCash += $cash_flow->amount;
|
|
} else {
|
|
$runningCash -= $cash_flow->amount;
|
|
}
|
|
@endphp
|
|
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
|
|
<td style="border:1px solid gainsboro; text-align:center;">{{ formatted_date($cash_flow->date) }}</td>
|
|
<td style="border:1px solid gainsboro; text-align:center;">{{ $cash_flow->invoice_no }}</td>
|
|
|
|
@if ($cash_flow->platform == 'sale')
|
|
<td style="border:1px solid gainsboro; text-align:center;">{{ $cash_flow->sale?->party?->name ?? 'Guest' }}
|
|
</td>
|
|
@elseif ($cash_flow->platform == 'sale_return')
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ $cash_flow->saleReturn?->sale?->party?->name ?? 'Guest' }}</td>
|
|
@elseif ($cash_flow->platform == 'purchase')
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ $cash_flow->purchase?->party?->name ?? 'Guest' }}</td>
|
|
@elseif ($cash_flow->platform == 'purchase_return')
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ $cash_flow->purchaseReturn?->purchase?->party?->name ?? 'Guest' }}</td>
|
|
@elseif ($cash_flow->platform == 'due_collect' || $cash_flow->platform == 'due_pay')
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ $cash_flow->dueCollect?->party?->name ?? 'Guest' }}</td>
|
|
@else
|
|
<td style="border:1px solid gainsboro; text-align:center;">N/A</td>
|
|
@endif
|
|
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ ucwords(str_replace('_', ' ', $cash_flow->platform)) }}</td>
|
|
|
|
<td
|
|
style="border:1px solid gainsboro; text-align:center; {{ $cash_flow->type === 'credit' ? 'color:green;' : '' }}">
|
|
{{ $cash_flow->type === 'credit' ? currency_format($cash_flow->amount, currency: business_currency()) : currency_format(0, currency: business_currency()) }}
|
|
</td>
|
|
|
|
<td
|
|
style="border:1px solid gainsboro; text-align:center; {{ $cash_flow->type === 'debit' ? 'color:red;' : '' }}">
|
|
{{ $cash_flow->type === 'debit' ? currency_format($cash_flow->amount, currency: business_currency()) : currency_format(0, currency: business_currency()) }}
|
|
</td>
|
|
|
|
<td
|
|
style="border:1px solid gainsboro; text-align:center; {{ $runningCash < 0 ? 'color:red;' : 'color:green;' }}">
|
|
{{ currency_format($runningCash, currency: business_currency()) }}
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
|
|
@php
|
|
$page_cash_in = $cash_flows->where('type', 'credit')->sum('amount');
|
|
$page_cash_out = $cash_flows->where('type', 'debit')->sum('amount');
|
|
$page_running_cash = $opening_balance + $page_cash_in - $page_cash_out;
|
|
@endphp
|
|
|
|
@if ($cash_flows->count() > 0)
|
|
<tfoot>
|
|
<tr style="background-color:#C52127; color:white; font-weight:bold;">
|
|
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">{{__('Total')}}
|
|
</td>
|
|
<td style="border:1px solid gainsboro;"></td>
|
|
<td style="border:1px solid gainsboro;"></td>
|
|
<td style="border:1px solid gainsboro;"></td>
|
|
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
|
{{ currency_format($page_cash_in, currency: business_currency()) }}
|
|
</td>
|
|
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
|
{{ currency_format($page_cash_out, currency: business_currency()) }}
|
|
</td>
|
|
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
|
{{ currency_format($page_running_cash, currency: business_currency()) }}
|
|
</td>
|
|
</tr>
|
|
</tfoot>
|
|
@endif
|
|
</table>
|
|
@endsection |