@php $last_varience = 0; @endphp @foreach ($date as $dd) @php $d = date('Y-d-m',strtotime($dd)); @endphp @php $cash_sale = 0; $total_deposit = 0; $cash_purchase = 0; $total_shop_expense = 0; $tota_staff = 0; $total_refund = 0; $total_cashier_shortage =0; @endphp {{-- Shop Sale --}} {{-- BPC Sale --}} {{-- Airtime sale --}} {{-- Cash Purchase --}} {{-- Shop expense --}} {{-- Shop Staff --}} {{-- Shop Refund --}} {{-- Shop Cashier Shortage --}} {{-- Cash Sale calculation --}} @php $cash_sale = $cash_sale - $cash_purchase - $total_shop_expense - $total_refund - $total_cashier_shortage; @endphp {{-- Total Deposit --}} {{-- Variance --}} @php $varience = $cash_sale - $total_deposit; @endphp {{-- Cum variance --}} @php $last_varience += $varience; @endphp @endforeach
{{ trans('cruds.report.date') }} {{ trans('cruds.report.shop_sale') }} {{ trans('cruds.report.bpcSale') }} {{ trans('cruds.report.airTime') }} {{ trans('cruds.report.cashPurchase') }} {{ trans('cruds.report.shopExpense') }} {{ trans('cruds.report.staff') }} {{ trans('cruds.report.refund') }} {{ trans('cruds.report.cashierShortage') }} {{ trans('cruds.report.cashSale') }} {{ trans('cruds.report.totalDeposit') }} {{ trans('cruds.report.normalVariance') }} {{ trans('cruds.report.normalCumVariance') }}
{{date('d/m/Y',strtotime($d))}} @php $sub_id = $shop_sale_sub_cat->where('code','sub7')->first()->id; $data = $sale->where('date',$d)->where('sub_category_id',$sub_id)->first(); @endphp @if ($data != null) {{$data->amount}} @php $cash_sale += $data->amount; @endphp @endif @php $sub_id = $shop_sale_sub_cat->where('code','sub13')->first()->id; $data = $sale->where('date',$d)->where('sub_category_id',$sub_id)->first(); @endphp @if ($data != null) {{$data->amount}} @php $cash_sale += $data->amount; @endphp @endif @php $sub_id = $shop_sale_sub_cat->where('code','sub12')->first()->id; $data = $sale->where('date',$d)->where('sub_category_id',$sub_id)->first(); @endphp @if ($data != null) {{$data->amount}} @php $cash_sale += $data->amount; @endphp @endif @php $shop_cash_purchase_sub_cat != null ? $cash_purchase = $purchase->where('date',$d)->where('financial_category_id',$shop_cash_purchase_sub_cat->where('code','sub17')->first()->id)->sum('amount') : $cash_purchase = 0; //if (!empty($data)) { //$cash_purchase += $data->amount; //} @endphp @if ($cash_purchase != 0) {{number_format($cash_purchase,2)}} @endif @php $shop_exp_sub_cat != null ? $total_shop_expense = $expense->where('date',$d)->where('financial_category_id',$shop_exp_sub_cat->where('code','sub43')->first()->id)->sum('amount') : $total_shop_expense = 0; //if (!empty($data)) { // $total_shop_expense += $data->amount; //} @endphp @if ($total_shop_expense != 0) {{number_format($total_shop_expense,2)}} @endif @php $shop_refund_sub_cat != null ? $total_refund = $general_ledger->where('date',$d)->where('sub_category_id',$shop_refund_sub_cat->where('code','sub53')->first()->id)->sum('amount') : $total_refund = 0; //if (!empty($data)) { // $total_refund += $data->amount; //} @endphp @if ($total_refund != 0) {{number_format($total_refund,2)}} @endif @php $shop_cashier_short_sub_cat != null ? $total_cashier_shortage = $general_ledger->where('date',$d)->where('sub_category_id',$shop_cashier_short_sub_cat->where('code','sub48')->first()->id)->sum('amount') : $total_cashier_shortage = 0; //if (!empty($data)) { // $total_cashier_shortage += $data->amount; // } @endphp @if ($total_cashier_shortage != 0) {{number_format($total_cashier_shortage,2)}} @endif {{number_format(($cash_sale),2)}} @foreach ($shop_deposit_sub_cat as $shop_d) @php $data = $deposit->where('date',$d)->where('sub_category_id',$shop_d->id)->first(); if (!empty($data)) { $total_deposit += $data->amount; } @endphp @endforeach {{number_format($total_deposit,2)}} {{number_format($varience,2)}} {{number_format($varience + $last_varience,2)}}