{{$dd}}
|
{{-- Fuel sale --}}
@php
$total_fuel_sale = $drivewaysheet->where('date',$dd)->sum('stock_value');
@endphp
@if ($total_fuel_sale != 0)
{{number_format($total_fuel_sale,2)}}
@endif
|
{{-- Computer sale --}}
@php
if ($fuel_sale_sub != null) {
// oil sale
$data = $sale->where('date',$d)->where('sub_category_id',$fuel_sale_sub->where('code','sub41')->first()->id)->first();
if (!empty($data)) {
$oil_sale = $data->amount;
}
// roa sale
$data = $sale->where('date',$d)->where('sub_category_id',$fuel_sale_sub->where('code','sub42')->first()->id)->first();
if (!empty($data)) {
$roa_sale = $data->amount;
}
}
$computer_sale = $total_fuel_sale + $oil_sale + $roa_sale
@endphp
@if ($computer_sale != 0)
{{number_format($computer_sale,2)}}
@endif
|
{{-- Oil sale --}}
@if ($oil_sale != 0)
{{number_format($oil_sale,2)}}
@endif
|
{{-- Leokwane Card --}}
{{--
| --}}
{{-- Roa --}}
@if ($roa_sale != 0)
{{number_format($roa_sale,2)}}
@endif
|
{{-- Pd cheque deposit/payment --}}
@if ($pd_pay_sub_category != null)
@foreach ($pd_pay_sub_category as $pd_pay)
@php
$pd_pay_data = $deposit_fs->where('date',$d)->where('sub_category_id',$pd_pay->id)->first();
if (!empty($pd_pay_data)) {
$total_pd_cheque_deposit += $pd_pay_data->amount;
}
@endphp
@endforeach
@if ($total_pd_cheque_deposit != 0)
{{number_format($total_pd_cheque_deposit,2)}}
@endif
@endif
|
{{-- Speed points --}}
@foreach ($machine as $id => $m)
@php
$speed_point_total = $speed_point->where('date',$d)->where('type',$m)->sum('amount');
$speed_point_all += $speed_point_total;
@endphp
@if ($speed_point_total != 0)
{{number_format($speed_point_total,2)}}
@endif
|
@endforeach
{{-- Eft payment --}}
@if ($eft_sub_category != null)
@foreach ($eft_sub_category as $eft)
@php
$eft_data = $deposit_fs->where('date',$d)->where('sub_category_id',$eft->id)->first();
if (!empty($eft_data)) {
$eft_total += $eft_data->amount;
}
@endphp
@endforeach
@if ($eft_total != 0)
{{number_format($eft_total,2)}}
@endif
@endif
|
{{-- Shell card --}}
@php
$total_shell_card = $shell_card->where('date',$d)->sum('amount');
@endphp
@if ($total_shell_card != 0)
{{number_format($total_shell_card,2)}}
@endif
|
{{-- Pd cheque --}}
@if ($pd_chq_sub_category != null)
@foreach ($pd_chq_sub_category as $pd_chq)
@php
$pd_chq_data = $deposit_fs->where('date',$d)->where('sub_category_id',$pd_chq->id)->first();
if (!empty($pd_chq_data)) {
$total_pd_cheque += $pd_chq_data->amount;
}
@endphp
@endforeach
@if ($total_pd_cheque != 0)
{{number_format($total_pd_cheque,2)}}
@endif
@endif
|
{{-- Account --}}
@php
$total_account = $driveway_account->where('date',$d)->sum('amount');
@endphp
@if ($total_account != 0)
{{number_format($total_account,2)}}
@endif
|
{{-- Rand --}}
@if ($rand_sub_category != null)
@foreach ($rand_sub_category as $rand)
@php
$rand_data = $deposit_fs->where('date',$d)->where('sub_category_id',$rand->id)->first();
if (!empty($rand_data)) {
$total_rand += $rand_data->amount;
}
@endphp
@endforeach
@if ($total_rand != 0)
{{number_format($total_rand,2)}}
@endif
@endif
|
{{-- Cash Sale cal --}}
@php
if($total_rand != 0)
{
$total_rand = $total_rand * 0.6;
}
$total_subtract = $speed_point_all + $eft_total + $total_shell_card + $total_pd_cheque + $total_account;
$total_add= $total_fuel_sale + $oil_sale + $roa_sale + $total_pd_cheque_deposit;
$cash_sale = ($total_add - $total_subtract) - $total_rand;
@endphp
@if ($cash_sale != 0)
{{number_format($cash_sale,2)}}
@endif
|
{{-- Fs expense --}}
@if ($fs_exp_sub_cat != null)
{{-- @foreach ($fs_exp_sub_cat as $fs_expense) --}}
@php
$total_fs_expense = $expense->where('date',$d)->where('financial_category_id',$fs_exp_sub_cat->where('code','sub57')->first()->id)->sum('amount');
@endphp
{{-- @endforeach --}}
@endif
@if ($total_fs_expense != 0)
{{number_format($total_fs_expense,2)}}
@endif
|
{{-- Fs purchase --}}
@if ($fs_pur_sub_cat != null)
@php
$total_fs_purchase = $purchase->where('date',$d)->where('financial_category_id',$fs_pur_sub_cat->where('code','sub20')->first()->id)->sum('amount');
@endphp
@endif
@if ($total_fs_purchase != 0)
{{number_format($total_fs_purchase,2)}}
@endif
|
{{-- Maintenance --}}
@if ($other_sub != null)
@php
$header_sub = $other_sub->where('code','cat17')->first();
if ($header_sub != null) {
count($header_sub->subcategories) ? $total_maintenance = $general_ledger->where('date',$d)->where('sub_category_id',$header_sub->subcategories->where('code','sub46')->first()->id)->sum('amount') : $total_maintenance = 0;
}
@endphp
@endif
@if ($total_maintenance != 0)
{{number_format($total_maintenance,2)}}
@endif
|
{{-- Cashier Shortage --}}
@if ($other_sub != null)
@php
$header_sub = $other_sub->where('code','cat27')->first();
if ($header_sub != null) {
count($header_sub->subcategories) ? $total_fs_cashier_shortage = $general_ledger->where('date',$d)->where('sub_category_id',$header_sub->subcategories->where('code','sub49')->first()->id)->sum('amount') : $total_fs_cashier_shortage = 0;
}
@endphp
@endif
@if ($total_fs_cashier_shortage != 0)
{{number_format($total_fs_cashier_shortage,2)}}
@endif
|
{{-- Attendant Shortage --}}
@if ($other_sub != null)
@php
$header_sub = $other_sub->where('code','cat30')->first();
if ($header_sub != null) {
count($header_sub->subcategories) ? $total_attendand_shortage = $general_ledger->where('date',$d)->where('sub_category_id',$header_sub->subcategories->where('code','sub47')->first()->id)->sum('amount') : $total_attendand_shortage = 0 ;
}
@endphp
@endif
@if ($total_attendand_shortage != 0)
{{number_format($total_attendand_shortage,2)}}
@endif
|
{{-- Incentive & wages --}}
@if ($other_sub != null)
@php
$header_sub = $other_sub->where('code','cat18')->first();
if ($header_sub != null) {
count($header_sub->subcategories) ? $total_incentive_wages = $general_ledger->where('date',$d)->where('sub_category_id',$header_sub->subcategories->where('code','sub45')->first()->id)->sum('amount') : $total_incentive_wages = 0;
}
@endphp
@endif
@if ($total_incentive_wages != 0)
{{number_format($total_incentive_wages,2)}}
@endif
|
{{-- Loans --}}
@if ($other_sub != null)
@php
$header_sub = $other_sub->where('code','cat19')->first();
if ($header_sub != null) {
count($header_sub->subcategories) ? $total_loan = $general_ledger->where('date',$d)->where('sub_category_id',$header_sub->subcategories->where('code','sub44')->first()->id)->sum('amount') : $total_loan = 0;
}
@endphp
@endif
@if ($total_loan != 0)
{{number_format($total_loan,2)}}
@endif
|
{{-- Mohammed & Yusuf --}}
@if ($other_sub != null)
@php
$header_sub = $other_sub->where('code','cat35')->first();
if ($header_sub != null) {
count($header_sub->subcategories) ? $total_md_yusuf = $general_ledger->where('date',$d)->where('sub_category_id',$header_sub->subcategories->where('code','sub63')->first()->id)->sum('amount') : $total_md_yusuf = 0;
}
@endphp
@endif
@if ($total_md_yusuf != 0)
{{number_format($total_md_yusuf,2)}}
@endif
|
{{-- FS Refund --}}
@if ($other_sub != null)
@php
$header_sub = $other_sub->where('code','cat28')->first();
if ($header_sub != null) {
count($header_sub->subcategories) ? $total_fs_refund = $general_ledger->where('date',$d)->where('sub_category_id',$header_sub->subcategories->where('code','sub55')->first()->id)->sum('amount') : $total_fs_refund = 0;
}
@endphp
@endif
@if ($total_fs_refund != 0)
{{number_format($total_fs_refund,2)}}
@endif
|
{{-- Pump Test --}}
@if ($other_sub != null)
@php
$header_sub = $other_sub->where('code','cat31')->first();
if ($header_sub != null) {
count($header_sub->subcategories) ? $total_pump_test = $general_ledger->where('date',$d)->where('sub_category_id',$header_sub->subcategories->where('code','sub62')->first()->id)->sum('amount') : $total_pump_test = 0;
}
@endphp
@endif
@if ($total_pump_test != 0)
{{number_format($total_pump_test,2)}}
@endif
|
{{-- Cash Deposit --}}
@foreach ($fs_cash_deposit_sub_category as $depo_sub)
@php
$deposit_data = $deposit_fs->where('date',$d)->where('sub_category_id',$depo_sub->id)->first();
if (!empty($deposit_data)) {
$cash_deposit += $deposit_data->amount;
}
@endphp
@endforeach
@if ($cash_deposit != 0)
{{number_format($cash_deposit,2)}}
@endif
|
{{-- Cheque Deposit --}}
@php
$cheque1_total = 0;
$cheque2_total = 0;
@endphp
{{-- FNB cheque --}}
@foreach ($cheque_sub_category as $fnb_cheque)
@php
$data = $deposit_fs->where('date',$d)->where('sub_category_id',$fnb_cheque->id);
$cheque1_total += $data->sum('amount');
@endphp
@endforeach
{{-- Non FNB cheque --}}
@foreach ($non_cheque_sub_category as $non_fnb_cheque)
@php
$cheque2_data = $deposit_fs->where('date',$d)->where('sub_category_id',$non_fnb_cheque->id);
$cheque2_total += $cheque2_data->sum('amount');
@endphp
@endforeach
@php
$cheque_deposit = $cheque1_total + $cheque2_total;
@endphp
@if ($cheque_deposit != 0)
{{number_format($cheque_deposit,2)}}
@endif
|
{{-- Variance --}}
@php
$total_expense = $total_fs_expense + $total_fs_purchase + $total_maintenance + $total_fs_cashier_shortage + $total_attendand_shortage + $total_incentive_wages + $total_loan + $total_md_yusuf + $total_fs_refund + $total_pump_test;
$varience = $cash_sale - $cheque_deposit - $cash_deposit - $total_expense;
@endphp
{{number_format($varience,2)}}
|
{{-- Cum variance --}}
{{number_format($varience + $last_varience,2)}}
|
@php
$last_varience += $varience;
@endphp
@endforeach