@extends('layouts.app') @php($editing = isset($item) && $item !== null) @php($selectedType = old('voucher_type', $item->voucher_type ?? $defaultType)) @php($formLines = old('lines', $item->form_lines ?? [])) @php($standardLines = $selectedType === 'contra' ? [] : ($formLines ?: ($selectedType === 'journal' ? [['account_id' => '', 'entry_type' => 'debit', 'amount' => ''], ['account_id' => '', 'entry_type' => 'credit', 'amount' => '']] : [['account_id' => '', 'amount' => '']]))) @php($contraLines = $selectedType === 'contra' ? ($formLines ?: [['debit_account_id' => '', 'debit_amount' => '', 'credit_account_id' => '', 'credit_amount' => '']]) : []) @php($selectedLabel = $selectedType === 'receipt' ? 'Receive' : ucfirst($selectedType)) @section('title', $selectedLabel . ' Voucher Create') @push('styles') @endpush @section('content') {{-- ✅ Header Section --}}
Enter accounting details and ledger lines to save the voucher.