@php $voucherMode = old('voucher_type', request('mode', 'cash_receipt')); $voucherMode = in_array($voucherMode, ['cash_receipt', 'petty_cash', 'journal_voucher'], true) ? $voucherMode : 'cash_receipt'; $today = now()->format('Y-m-d'); $firstTreasury = $treasuries->first(); $firstAccount = $accounts->first(); $oldTreasuryAccountId = old('treasury_account_id'); $partyTypes = $partyTypes ?? []; $accountRequiresCostCenter = fn ($account) => str_contains(strtolower((string) $account->account_type), 'revenue') || str_contains(strtolower((string) $account->account_type), 'income') || str_contains(strtolower((string) $account->account_type), 'expense') || str_contains(strtolower((string) $account->account_type), 'cost') || str_contains(strtolower((string) ($account->account_subtype ?? '')), 'revenue') || str_contains(strtolower((string) ($account->account_subtype ?? '')), 'income') || str_contains(strtolower((string) ($account->account_subtype ?? '')), 'expense') || str_contains(strtolower((string) ($account->account_subtype ?? '')), 'cost'); @endphp
Latest vouchers posted from this treasury screen.