{{--*/ $invoice_amount = ['revenue'=>$client_inquiry_item->rate*$client_inquiry_item->tonnage] /*--}} {{--*/ $route = $client_inquiry_item->getRoute() /*--}} {{--*/ $type = $client_inquiry_item->cargo_type /*--}} @if($route) {{--*/ $revenue = $invoice_amount['revenue'] /*--}}
{{--*/ $cost_total = 0 /*--}} {{--*/ $cost_total_usd = 0 /*--}} @foreach($route->routeExpenses()->whereIn('cargo_type',['ALL',$type])->get() as $route_expense) {{--*/ $cost_total += $route_expense->amount /*--}} @endforeach ` {{--*/ $cost_total +=$route->getFuel($type)*$fuel_rate /*--}} ` {{--*/ $cost_total +=$route->go_distance*2*300 /*--}}
{{$route_expense->cost_name}} {{$route_expense->currency}}
FUEL EXPENSES: {{number_format(($route->getFuel($type))*$fuel_rate,2)}}
TYRE CONSUMPTION COST: {{number_format($route->go_distance*2*300)}}
TOTAL OPERATING COST {{number_format($cost_total,2)}}
TOTAL OPERATING COST(USD) {{number_format($cost_total_usd = \App\Logistics\Facades\Logistics::currencyConvert($cost_total, 'TSH', $exchange_rate, 'USD'),2)}}
Contribution in USD {{number_format($revenue - $cost_total_usd,2)}}
{{number_format($revenue-$cost_total_usd)}}
@endif