@extends('layouts.app') @section('title', isset($voucher) ? 'Edit '.$label : 'New '.$label) @section('breadcrumb') @endsection @push('styles') @endpush @section('content') @if($errors->any())
Please fix the errors below: @foreach($errors->all() as $err)
{{ $err }}
@endforeach
@endif
@csrf @if(isset($voucher)) @method('PUT') @endif {{-- ── Voucher Header ────────────────────────────────────────────────────────── --}}
Voucher Header @if(!isset($voucher)) Auto No: {{ $preview }} @endif
{{-- Voucher Date --}}
@error('voucher_date')
{{ $message }}
@enderror
{{-- Voucher No (manual override) --}}
Leave blank for auto number
{{-- Reference --}}
@include('accounting.vouchers._payment_method_field') @include('accounting.vouchers._cheque_fields', ['voucher' => $voucher ?? null]) {{-- Currency --}} @if(count($currencies) > 1)
@endif {{-- Paid To / Received From (payment/receipt vouchers only) --}} @php $partyLabel = match($voucherType) { 'cash_payment','bank_payment' => 'Paid To', 'cash_receipt','bank_receipt' => 'Received From', default => null, }; $partyTypes = ['cash_payment','bank_payment','cash_receipt','bank_receipt']; @endphp @if(in_array($voucherType, $partyTypes)) @include('accounting.vouchers._party_header_field', [ 'partyLabel' => $partyLabel, 'voucher' => $voucher ?? null, ]) @endif {{-- Narration --}}
{{-- ── Account Lines ─────────────────────────────────────────────────────────── --}}
Account Lines — Debit and Credit must balance
{{-- Balance bar --}}
Total Debit
0.00
Total Credit
0.00
Not Balanced
@if(count($taxCodes) > 0) @endif @foreach($dimensions as $dimension) @endforeach @php $existingLines = isset($voucher) ? $voucher->lines : collect(); @endphp @if($existingLines->count() > 0) @foreach($existingLines as $i => $line) @include('accounting.vouchers._line_row', [ 'i' => $i, 'line' => $line, 'accounts' => $accounts, 'taxCodes' => $taxCodes, 'dimensions' => $dimensions, 'isNew' => false, ]) @endforeach @else @include('accounting.vouchers._line_row', ['i'=>0,'line'=>null,'accounts'=>$accounts,'taxCodes'=>$taxCodes,'dimensions'=>$dimensions,'isNew'=>true]) @include('accounting.vouchers._line_row', ['i'=>1,'line'=>null,'accounts'=>$accounts,'taxCodes'=>$taxCodes,'dimensions'=>$dimensions,'isNew'=>true]) @endif
# Account * Debit Credit DescriptionTax Code{{ $dimension->name }}Name
{{-- JS line template --}} @endsection @push('scripts') @include('accounting.vouchers._cheque_register_scripts', ['voucher' => $voucher ?? null]) @endpush