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

Cash & Bank Receipt Register

@csrf
{{-- 👈 Add this --}} @php $totalAmount = 0; $totalDiscount = 0; $totalExpenses = 0; $grandTotal = 0; $paymentModes = [ '1' => 'Cheque Received', '2' => 'Draft Received', '3' => 'Received Cash into Bank', '4' => 'Bank Transfer from Another Account', '5' => 'Credit Card Payment Received', '6' => '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->drLedger->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