@if($type == 'TANKERS')
{{----*/ $revenue = $invoice_amount['revenue'] /*----}} {{--$revenue = [--}} {{--'tonnage' => $request->tonnage,--}} {{--'rate' => $request->rate,--}} {{--'' => $request->tonnage * $request->rate,--}} {{--'number_of_trucks' => $request->number_of_trucks--}} {{--];--}}
Invoice Amount: {{number_format($revenue,2)}}
REVENUE {{number_format($revenue)}}
{{----*/ $cost_total = 0 /*----}} {{----*/ $cost_total += \App\Logistics\Facades\Logistics::currencyConvert(($route->fuel*2)*1650,'TSH', 2240, 'USD') /*----}} {{----*/ $cost_total += $route->getPrepaidExpensesBudgetAmount('TANKERS', $route->getDays('TANKERS'), 2240) /*----}} {{----*/ $cost_total +=0 /*----}} {{----*/ $cost_total +=0 /*----}} @foreach($route->routeExpenses()->whereIn('cargo_type',['ALL','TANKERS'])->get() as $route_expense) {{----*/ $cost_total += \App\Logistics\Facades\Logistics::currencyConvert($route_expense->amount, $route_expense->currency, 2240, 'USD') /*----}} @endforeach
FUEL EXPENSES: {{number_format(\App\Logistics\Facades\Logistics::currencyConvert(($route->fuel*2)*1650,'TSH', 2240, 'USD'),2)}}
PREPAID EXPENSES: {{number_format($route->getPrepaidExpensesBudgetAmount('TANKERS', $route->getDays('TANKERS'), 2240),2)}}
VEHICLE DEPRECIATION EXPENSES:
DRIVER SALARY:
{{$route_expense->cost_name}}: {{number_format(\App\Logistics\Facades\Logistics::currencyConvert($route_expense->amount, $route_expense->currency, 2240, 'USD'),2)}}
TOTAL EXPENSES {{number_format($expense_total= $cost_total)}}
{{number_format($revenue-$expense_total)}}
@elseif($type == 'LOOSE_CARGO')
Invoice Amount: {{number_format(4273.143,2)}}
REVENUE {{number_format($revenue = 4273.143)}}
{{----*/ $cost_total = 0 /*----}} {{----*/ $route = $route->routeCargoDetails()->where('type','LOOSE_CARGO')->first() /*----}} {{----*/ $cost_total += \App\Logistics\Facades\Logistics::currencyConvert(($route->fuel*2)*1650,'TSH', 2240, 'USD') /*----}} {{----*/ $cost_total += $route->getPrepaidExpensesBudgetAmount('LOOSE_CARGO', $route->getDays('LOOSE_CARGO'), 2240) /*----}} {{----*/ $cost_total +=0 /*----}} {{----*/ $cost_total +=0 /*----}} @foreach($route->routeExpenses()->whereIn('cargo_type',['ALL','LOOSE_CARGO'])->get() as $route_expense) {{----*/ $cost_total += \App\Logistics\Facades\Logistics::currencyConvert($route_expense->amount, $route_expense->currency, 2240, 'USD') /*----}} @endforeach
FUEL EXPENSES: {{number_format(\App\Logistics\Facades\Logistics::currencyConvert(($route->fuel*2)*1650,'TSH', 2240, 'USD'),2)}}
PREPAID EXPENSES: {{number_format($route->getPrepaidExpensesBudgetAmount('LOOSE_CARGO', $route->getDays('LOOSE_CARGO'), 2240),2)}}
VEHICLE DEPRECIATION EXPENSES:
DRIVER SALARY:
{{$route_expense->cost_name}}: {{number_format(\App\Logistics\Facades\Logistics::currencyConvert($route_expense->amount, $route_expense->currency, 2240, 'USD'),2)}}
TOTAL EXPENSES {{number_format($expense_total= $cost_total)}}
{{number_format($revenue-$expense_total)}}
@elseif($type == 'CONTAINERS')
Invoice Amount: {{number_format(4273.143,2)}}
REVENUE {{number_format($revenue = 4273.143)}}
{{----*/ $cost_total = 0 /*----}} {{----*/ $route = $route->routeCargoDetails()->where('type','LOOSE_CARGO')->first() /*----}} {{----*/ $cost_total += \App\Logistics\Facades\Logistics::currencyConvert(($route->fuel*2)*1650,'TSH', 2240, 'USD') /*----}} {{----*/ $cost_total += $route->getPrepaidExpensesBudgetAmount('CONTAINERS', $route->getDays('CONTAINERS'), 2240) /*----}} {{----*/ $cost_total +=0 /*----}} {{----*/ $cost_total +=0 /*----}} @foreach($route->routeExpenses()->whereIn('cargo_type',['ALL','CONTAINERS'])->get() as $route_expense) {{----*/ $cost_total += \App\Logistics\Facades\Logistics::currencyConvert($route_expense->amount, $route_expense->currency, 2240, 'USD') /*----}} @endforeach
FUEL EXPENSES: {{number_format(\App\Logistics\Facades\Logistics::currencyConvert(($route->fuel*2)*1650,'TSH', 2240, 'USD'),2)}}
PREPAID EXPENSES: {{number_format($route->getPrepaidExpensesBudgetAmount('CONTAINERS', $route->getDays('CONTAINERS'), 2240),2)}}
VEHICLE DEPRECIATION EXPENSES:
DRIVER SALARY:
{{$route_expense->cost_name}}: {{number_format(\App\Logistics\Facades\Logistics::currencyConvert($route_expense->amount, $route_expense->currency, 2240, 'USD'),2)}}
TOTAL EXPENSES {{number_format($expense_total= $cost_total)}}
{{number_format($revenue-$expense_total)}}
@endif