{{$campany->company_name}}

Address: {{$campany->company_address}}, {{$campany->city}}, Tanzania
Mob: {{$campany->compny_phone}}
Email: {{$campany->company_email}}

{{$client->name}}

INVOICES

{{--*/ $total = 0 /*--}} {{--*/ $i = 1 /*--}} {{--*/ $amount_total =0 /*--}} {{--*/ $amount_total_receivable =0 /*--}} {{--*/ $amount_paid_total =0 /*--}} @foreach($invoices as $index=>$invoice) @if($invoice->debit > $invoice->credit) {{--*/ $debit = $invoice->debit - $invoice->credit /*--}} {{--*/ $credit = 0 /*--}} @else {{--*/ $credit = $invoice->credit - $invoice->debit /*--}} {{--*/ $debit = 0 /*--}} @endif {{----}} {{----}} {{--*/ $total_amount = $amount /*--}} {{----}} {{--*/ $debit = 0 /*--}} {{--*/ $amount_total += $amount /*--}} {{--*/ $amount_total_receivable += $total_amount /*--}} {{--*/ $amount_paid_total += $total_amount_paid /*--}} {{--*/ $total += $balance /*--}} {{--*/ $i++ /*--}} @endforeach
S/N Inv. NO. Date. Description Receivable Paid Balance
{{$i}} {{$invoice->id}} {{\Carbon\Carbon::parse($invoice->date)->toFormattedDateString()}} @if($invoice->truck == 'MULTIPLE ROUTE') MULTIPLE ROUTE @else {{$invoice->truck}}/ {{$invoice->fileNumber}}/ {{$invoice->containerNumber}}/ {{$invoice->Consignee}} @endif {{number_format($amount =$invoice->amount,2)}}{{number_format($debit,2)}}{{number_format($credit,2)}}{{$total_amount_paid = $invoice->paidAmount}}{{number_format($total_amount_paid = $invoice->paidAmount,2)}}{{number_format($balance = $total_amount-$total_amount_paid,2)}}
TOTAL {{number_format($amount_total,2)}} {{number_format($amount_paid_total,2)}} {{number_format($total,2)}}