{{--*/ $j=1 /*--}} @foreach($client_invoices as $client_invoice) {{--*/ $loaded = $client_invoice->destinations->quantity /*--}} {{--*/ $offloaded = $client_invoice->cargo_details->disport_volume_correction_factor * $client_invoice->cargo_details->disport_obs_volume /*--}} {{--*/ $allowable = $client_invoice->cargo_details->allowable_transit_loss /*--}} {{--*/ $net_loss = ($loaded - $offloaded) - $allowable /*--}} {{--*/ $loss = ($loaded - $offloaded) - $allowable /*--}} {{--*/ $invoice_amount = $client_invoice->invoiceItems[0]->amount /*--}} @elseif($net_loss < 0) @else @endif @if($loss > 0) @else @endif @if($loss > 0) @else @endif {{--*/ $j++ /*--}} @endforeach
S/N Date Inv. NO. D.O.NO. Destination Vehicle NO. Product QTY LOADED@20 QTY OFFLOADED@20 Rate Invoice Amount TRANSIT LOSS ALLOWABLE LOSS NET LOSS LOSS RATE LOSS RECEIVABLE
{{$j}} @if(isset($client_invoice->date)) {{\Carbon\Carbon::parse($client_invoice->date)->format('d.m.y')}} @endif {{$client_invoice->invoice_number}} {{$client_invoice->destinations->file_number}} {{$client_invoice->destinations->city_to->name}} {{$client_invoice->truck}} {{$client_invoice->cargo_details->product}} {{number_format($client_invoice->destinations->quantity)}} {{number_format($client_invoice->cargo_details->disport_volume_correction_factor * $client_invoice->cargo_details->disport_obs_volume)}} {{number_format($client_invoice->invoiceItems[0]->rate, 4)}} {{number_format($client_invoice->invoiceItems[0]->amount, 2)}}{{number_format($loaded - $offloaded)}} {{number_format($client_invoice->cargo_details->allowable_transit_loss)}} @if($net_loss > 0) {{(number_format($net_loss))}}{{(number_format(-1 * $net_loss))}}0{{number_format($client_invoice->cargo_details->transit_loss_rate, 4)}}{{number_format($loss * $client_invoice->cargo_details->transit_loss_rate, 2)}} - {{number_format($invoice_amount - ($loss * $client_invoice->cargo_details->transit_loss_rate), 2)}}{{number_format($invoice_amount, 2)}}