@extends('layouts.admin') @section('title', 'Product | Mintavia Admin') @section('content')
@if (isset($message) && $message) @endif

Cash & Bank Payment Register

@csrf
{{-- From and To Date --}}
{{-- 👈 Add this --}} @php $totalAmount = 0; $totalDiscount = 0; $totalExpenses = 0; $grandTotal = 0; $paymentModes = [ 'cheque_issued' => 'Cheque Issued', 'draft_issued' => 'Draft Issued', 'withdraw_cash_from_bank' => 'Withdraw Cash From Bank', 'bank_expense' => 'Bank Expense', 'online_transfer' => 'Online Transfer', ]; @endphp @foreach ($vouchers as $voucher) @php $rowTotal = $voucher->net_amount - $voucher->bill_discount_amount - $voucher->expenses; $totalAmount += $rowTotal; @endphp @php $totalAmount += $voucher->net_amount; $totalDiscount += $voucher->bill_discount_amount; $totalExpenses += $voucher->expenses; $grandTotal += $voucher->net_amount - $voucher->bill_discount_amount - $voucher->expenses; @endphp @endforeach
Date Receipt No. Payment Mode Bank Entry Party Name Cheque No Cheque Date Narration Amount Discount Expenses Total Amt. Action
{{ \Carbon\Carbon::parse($voucher->date)->format('d/m/Y') }} {{ $voucher->voucher_no }} {{ $voucher->cqLedger->account->name ?? 'N/A' }} {{ $paymentModes[$voucher->payment_mode_bank] ?? 'N/A' }} {{ $voucher->account->name ?? 'N/A' }} {{ $voucher->cheque_number }} {{ $voucher->cheque_date }} {{ $voucher->narration }} {{ number_format($voucher->net_amount, 2) }} {{ number_format($voucher->bill_discount_amount, 2) }} {{ number_format($voucher->expenses, 2) }} {{ number_format($rowTotal, 2) }} {{-- View Button --}} {{-- Print Button --}}
Total Amount

₹{{ number_format($totalAmount, 2) }}
Total Discount

₹{{ number_format($totalDiscount, 2) }}
Total Expenses

₹{{ number_format($totalExpenses, 2) }}
Grand Total

₹{{ number_format($grandTotal, 2) }}
@endsection @section('js') @endsection