@if($transaction['transaction_to'] == 'vendor')
Vendor:
{{ $transaction['vendor_no'] ?? '' }} - {{ $transaction['fname'] ?? 'N/A' }}
Payment For:
@if($transaction['transaction_type'] == 'wages')
Vendor Services/Wages
@elseif(isset($transaction['order_id']) && $transaction['order_id'])
Purchase #{{ $transaction['order_id'] }}
@if(isset($transaction['purchase_no']))
({{ $transaction['purchase_no'] }})
@endif
@else
Vendor Services/Bills
@endif
@elseif($transaction['transaction_to'] == 'employee')
Employee:
{{ $transaction['employee_no'] ?? '' }} - {{ $transaction['name'] ?? 'N/A' }}
@elseif($transaction['transaction_to'] == 'customer')
Customer:
{{ $transaction['customer_no'] ?? '' }} - {{ $transaction['fname'] ?? 'N/A' }}
Payment For:
@if($transaction['transaction_type'] == 'orderPayment' && isset($transaction['order_id']) && $transaction['order_id'])
Order #{{ $transaction['order_id'] }}
@if(isset($transaction['order_date']))
({{ $transaction['order_date'] }})
@endif
@elseif($transaction['transaction_type'] == 'receiveAdvance')
Advance Payment from Customer
@else
Customer Payment
@endif
@elseif($transaction['transaction_to'] == 'contractor')
Contractor:
{{ $transaction['vendor_no'] ?? '' }} - {{ $transaction['fname'] ?? 'N/A' }}
Payment For:
@if($transaction['transaction_type'] == 'wages')
Contractor Wages/Services
@elseif(isset($transaction['order_id']) && $transaction['order_id'])
Purchase #{{ $transaction['order_id'] }}
@if(isset($transaction['purchase_no']))
({{ $transaction['purchase_no'] }})
@endif
@else
Contractor Services
@endif
@elseif($transaction['transaction_to'] == 'brs')
Adjustment Type:
{{-- This is temporary reversed --}}
@if($transaction['debit'] < 0)
Decrease Balance
@else
Increase Balance
@endif
@elseif($transaction['transaction_type'] == 'generalVoucher')
@if($transaction['transaction_to'] == 'vendor')
Vendor:
{{ $transaction['vendor_no'] ?? '' }} - {{ $transaction['vendor_name'] ?? $transaction['fname'] ?? 'N/A' }}
@elseif($transaction['transaction_to'] == 'contractor')
Contractor:
{{ $transaction['vendor_no'] ?? '' }} - {{ $transaction['vendor_name'] ?? $transaction['fname'] ?? 'N/A' }}
@elseif($transaction['transaction_to'] == 'employee')
Employee:
{{ $transaction['employee_no'] ?? '' }} - {{ $transaction['employee_name'] ?? $transaction['name'] ?? 'N/A' }}
@elseif($transaction['transaction_to'] == 'customer')
Customer:
{{ $transaction['customer_no'] ?? '' }} - {{ $transaction['customer_name'] ?? $transaction['fname'] ?? 'N/A' }}
@endif
Charge Description:
{{ $transaction['description'] ?? 'General Voucher Charge' }}
@endif
@if($transaction['bank_id'])
Payment Bank:
{{ $transaction['bname'] ?? 'N/A' }}
Account Title:
{{ $transaction['account_title'] ?? 'N/A' }}
{{--
Account No:
{{ $transaction['account'] ?? 'N/A' }}
--}}
@endif
{{-- Customer Payment Breakdown (inline) --}}
@if($transaction['transaction_to'] == 'customer')
@php
$grossAmount = $transaction['debit'] ?? $transaction['credit'] ?? 0;
$netAmount = $grossAmount - ($transaction['fees_expenses'] ?? 0);
@endphp
@if($grossAmount > 0)
Amount Received:
{{ number_format($grossAmount, 2) }}
@if(isset($transaction['fees_expenses']) && $transaction['fees_expenses'] > 0)
Fees/Expenses:
{{ number_format($transaction['fees_expenses'], 2) }}
Net Amount:
{{ number_format($netAmount, 2) }}
@endif
@endif
@endif