@extends('index') @section('content')

Edit General Voucher

@csrf @method('POST')
Good job!
Select Payee Type
Good job!
Select Payee
Good job!
@php // Determine voucher type based on transaction_to and stored values if ($transaction->transaction_to == 'customer') { // For customer vouchers, cc_amount is used // If credit is 0/null, it's a debit voucher (charge to customer) // If debit is 0/null, it's a credit voucher (credit to customer) $voucherType = ($transaction->credit == 0 || $transaction->credit === null) ? 'debit' : 'credit'; } else { // For other payees (vendor, contractor, employee), use debit/credit $voucherType = !empty($transaction->credit) ? 'debit' : 'credit'; } @endphp
Good job!
Select Voucher Type
@php // For customer vouchers, amount is stored in cc_amount // For other payees, amount is stored in debit or credit if ($transaction->transaction_to == 'customer') { $displayAmount = $transaction->cc_amount ?? 0; } else { $displayAmount = abs($transaction->debit ?? $transaction->credit ?? 0); } @endphp
Good job!
Enter Amount
Good job!
Enter Description
@endsection