{{date('d/m/Y',strtotime($d))}} |
@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 --}}
@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
|
{{-- BPC Sale --}}
@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
|
{{-- Airtime sale --}}
@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
|
{{-- Cash Purchase --}}
@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
|
{{-- Shop expense --}}
@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
|
{{-- Shop Staff --}}
|
{{-- Shop Refund --}}
@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
|
{{-- Shop Cashier Shortage --}}
@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
|
{{-- Cash Sale calculation --}}
@php
$cash_sale = $cash_sale - $cash_purchase - $total_shop_expense - $total_refund - $total_cashier_shortage;
@endphp
{{number_format(($cash_sale),2)}} |
{{-- Total Deposit --}}
@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)}}
|
{{-- Variance --}}
@php
$varience = $cash_sale - $total_deposit;
@endphp
{{number_format($varience,2)}} |
{{-- Cum variance --}}
{{number_format($varience + $last_varience,2)}}
|
@php
$last_varience += $varience;
@endphp
@endforeach