| {{ numberFormat(1) }} |
{{ dateFormat($client->created_at,'d/m/Y') }} |
{{ 'Past Balance' }} |
|
|
@if($client->type=='Customer')
|
@endif
|
|
|
{{ $client->balance_type=='Debit'? numberFormat($client->initial_balance,2) : '' }} |
{{ $client->balance_type=='Credit'? numberFormat($client->initial_balance,2) : '' }} |
|
@php($balance=$client->initial_balance)
@php($title=$client->balance_type)
@foreach($payments as $payment)
@php($row=null)
@php($total=0)
@if($client->type=='Customer')
@if($payment->row_id!=null)
{{-- @php($total=$payment->sale->total)--}}
@php($total=($payment->sale->product_cost+$payment->sale->vat-$payment->sale->discount))
@endif
@php($due = ($total - $payment->amount))
@php($newBalance = customerNewBalance($due,clientLastBalance($client->id,$payment->id)))
@elseif($client->type=='Supplier')
@if($payment->row_id!=null)
{{-- @php($total=$payment->purchase->total)--}}
@php($total=($payment->purchase->product_cost-$payment->purchase->discount))
@endif
@php($due = ($total - $payment->amount))
@php($newBalance = supplierNewBalance($due,clientLastBalance($client->id,$payment->id)))
@endif
@php($sl = $loop->iteration + 1)
| {{ numberFormat($sl) }} |
{{ dateFormat($payment->created_at,'d/m/Y') }} |
{{--Product Name--}}
@if($client->type=='Supplier')
@if(isset($row))
@foreach($row->details as $detail)
{{ $detail->product->name }},
@endforeach
@else
{{ 'Paid' }}
@endif
@else
@if(isset($row))
@foreach($row->details as $detail)
{{ $detail->product->name }},
@endforeach
@else
{{ 'Received' }}
@endif
@endif
|
{{ isset($row)? $row->note : '' }} |
{{ isset($row)? numberFormat($row->product_cost,2) : '' }} |
@if($client->type=='Customer')
{{ isset($row)? numberFormat($row->vat,2) : '' }} |
@endif
{{ isset($row)? numberFormat($row->discount,2) : '' }} |
{{-- {{ isset($row)? numberFormat($row->total,2) : '' }} | --}}
{{ numberFormat($payment->amount,2) }} |
@if($payment->media=='Cash')
@if($payment->amount>0){{ $payment->media }}@endif
@else
{{ $payment->bankPayment->bankAccount->bank->code }}-{{ $payment->bankPayment->bankAccount->ac_no }}
@endif
|
{{ $newBalance['title']=='Debit' ? numberFormat($newBalance['balance'],2):'' }} |
{{ $newBalance['title']=='Credit' ? numberFormat($newBalance['balance'],2):'' }} |
{{-- --}}
@if(role()->code=='developer')
@endif
|
@endforeach