@extends('layouts.master') @section('title', 'Cash & Bank Book') @section('page-header') Cash & Bank Book Report @stop @push('style') @endpush @section('content')
@include('partials._alert_message') @php $from = request('from', date('Y-m-d')); $to = request('to', date('Y-m-d')); @endphp

@yield('page-header')

@php $date1 = isset($from) ? $from : ''; $date2 = isset($to) ? $to : ''; $isReadOnly = isset($is_read_only) ? $is_read_only : false; @endphp
Date

Cash & Bank Book

@if(request('to') && request('from'))

From : {{ fdate(request('from'), 'd/m/Y') }}

To : {{ fdate(request('to'), 'd/m/Y') }}

@elseif(fdate(request('to') ?? today(), 'd/m/Y'))

As On {{ fdate(request('to') ?? today(), 'd/m/Y') }}

@endif
@php $totalCash_receipt = 0; $totalCash_payment = 0; $totalBank_receipt = 0; $totalBank_payment = 0; @endphp @foreach($main_data as $voucher_data) @foreach($voucher_data->details as $voucher_details) @php // Check if the current record should be included $includeRecord = true; // Apply condition only if voucher type is NOT 'Contra' if ($voucher_data->voucher_type != 'Contra') { $includeRecord = $voucher_details->account->account_subsidiary_id != 112; } // Skip this iteration if the condition doesn't match if (!$includeRecord) { continue; } // Totals Calculation $totalCash_receipt += ($voucher_data->v_payment_type == 'Cash' && $voucher_details->balance_type == "Credit") ? $voucher_details->amount:0; $totalCash_payment += ($voucher_data->v_payment_type == 'Cash' && $voucher_details->balance_type == "Debit") ? $voucher_details->amount:0; $totalBank_receipt += ($voucher_data->v_payment_type == 'Bank' && $voucher_details->balance_type == "Credit") ? $voucher_details->amount:0; $totalBank_payment += ($voucher_data->v_payment_type == 'Bank' && $voucher_details->balance_type == "Debit") ? $voucher_details->amount:0; @endphp @endforeach @endforeach
Voucher No Account Name Description Cash Bank
Receipt Payment Receipt Payment
Opening Balance 0.00 {{number_format( $main_opening_balance,2)}}
{{$voucher_details->voucher->invoice_no ?? ''}} {{$voucher_details->account->name ?? ''}} {{$voucher_details->voucher_description ?? "N/A"}} {{($voucher_data->v_payment_type == 'Cash' && $voucher_details->balance_type == "Credit") ? number_format($voucher_details->amount,2):''}} {{($voucher_data->v_payment_type == 'Cash' && $voucher_details->balance_type == "Debit") ? number_format($voucher_details->amount,2):''}} {{($voucher_data->v_payment_type == 'Bank' && $voucher_details->balance_type == "Credit") ? number_format($voucher_details->amount,2):''}} {{($voucher_data->v_payment_type == 'Bank' && $voucher_details->balance_type == "Debit" ) ? number_format($voucher_details->amount,2):''}}
Total {{number_format($totalCash_receipt,2)}} {{number_format($totalCash_payment,2)}} {{number_format($totalBank_receipt + $main_opening_balance,2) }} {{number_format($totalBank_payment,2)}}
Closing Balance 0.00 {{number_format( $totalBank_receipt + $main_opening_balance - $totalBank_payment,2) }}

@endsection @section('js') @endsection