{{-- --}} {{-- Speed Point --}} @foreach ($machine as $key => $m) @endforeach @php $last_varience = 0; @endphp @foreach ($date as $dd) @php $d = date('Y-d-m',strtotime($dd)); $oil_sale = 0; $roa_sale = 0; $total_pd_cheque_deposit = 0; $cash_deposit = 0; $total_fs_expense = 0; $total_fs_purchase = 0; $total_maintenance = 0; $total_account = 0; $total_rand = 0; $speed_point_all = 0; $eft_total = 0; $total_shell_card = 0; $total_pd_cheque = 0; $total_fs_cashier_shortage = 0; $total_attendand_shortage = 0; $total_incentive_wages = 0; $total_loan = 0; $total_md_yusuf = 0; $total_fs_refund = 0; $total_pump_test = 0; @endphp {{-- Fuel sale --}} {{-- Computer sale --}} {{-- Oil sale --}} {{-- Leokwane Card --}} {{-- --}} {{-- Roa --}} {{-- Pd cheque deposit/payment --}} {{-- Speed points --}} @foreach ($machine as $id => $m) @endforeach {{-- Eft payment --}} {{-- Shell card --}} {{-- Pd cheque --}} {{-- Account --}} {{-- Rand --}} {{-- Cash Sale cal --}} {{-- Fs expense --}} {{-- Fs purchase --}} {{-- Maintenance --}} {{-- Cashier Shortage --}} {{-- Attendant Shortage --}} {{-- Incentive & wages --}} {{-- Loans --}} {{-- Mohammed & Yusuf --}} {{-- FS Refund --}} {{-- Pump Test --}} {{-- Cash Deposit --}} {{-- Cheque Deposit --}} {{-- Variance --}} {{-- Cum variance --}} @php $last_varience += $varience; @endphp @endforeach
{{ trans('cruds.creditPurchase.fields.date') }} {{ trans('cruds.report.fuelSale') }} {{ trans('cruds.report.computerSale') }} {{ trans('cruds.report.oilSale') }} {{ trans('cruds.report.leokwaneCard') }} {{ trans('cruds.report.roa') }} {{ trans('cruds.report.pdChequeDeposit') }} {{Str::upper($m)}} {{__('Settle')}} {{ trans('cruds.report.eftPayment') }} {{ trans('cruds.report.sheelCard') }} {{ trans('cruds.report.pdCheque') }} {{ trans('cruds.report.account') }} {{ trans('cruds.report.rand') }} {{ trans('cruds.report.cashSale') }} {{ trans('cruds.report.fsExpense') }} {{ trans('cruds.report.cashPurchase') }} {{ trans('cruds.report.maintenance') }} {{ trans('cruds.report.cashierShortage') }} {{ trans('cruds.report.attendantShortage') }} {{ trans('cruds.report.incentive_wages') }} {{ trans('cruds.report.loans') }} {{ trans('cruds.report.md_yusuf') }} {{ trans('cruds.report.refund') }} {{ trans('cruds.report.pump_test') }} {{ trans('cruds.report.cashDeposit') }} {{ trans('cruds.report.chequeDeposit') }} {{ trans('cruds.report.normalVariance') }} {{ trans('cruds.report.normalCumVariance') }}
{{$dd}} @php $total_fuel_sale = $drivewaysheet->where('date',$dd)->sum('stock_value'); @endphp @if ($total_fuel_sale != 0) {{number_format($total_fuel_sale,2)}} @endif @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 @if ($oil_sale != 0) {{number_format($oil_sale,2)}} @endif @if ($roa_sale != 0) {{number_format($roa_sale,2)}} @endif @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 @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 @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 @php $total_shell_card = $shell_card->where('date',$d)->sum('amount'); @endphp @if ($total_shell_card != 0) {{number_format($total_shell_card,2)}} @endif @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 @php $total_account = $driveway_account->where('date',$d)->sum('amount'); @endphp @if ($total_account != 0) {{number_format($total_account,2)}} @endif @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 @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 @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 @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 @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 @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 @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 @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 @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 @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 @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 @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 @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 @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 @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)}} {{number_format($varience + $last_varience,2)}}