@extends('print.layout-voucher') @section('title', 'Payment_Voucher_' . ($voucherNumber ?? 'N/A') . '_' . ($transaction['transaction_date'] ?? date('d-m-Y'))) @section('content') {{--
--}}
Payment Voucher
{{-- Voucher Header Information --}}
Voucher No: {{ $voucherNumber ?? 'N/A' }}
Date: {{ $transaction['transaction_date'] ?? 'N/A' }}
Transaction Type: @if($transaction['transaction_to'] == 'brs') Balance Adjustment @elseif($transaction['transaction_to'] == 'employee') @if($transaction['transaction_type'] == 'salary') Salary Payment @elseif($transaction['transaction_type'] == 'wages') Wages Payment @elseif($transaction['transaction_type'] == 'advance') Advance Payment to Employee @elseif($transaction['transaction_type'] == 'receiveAdvance') Loan Received from Employee @else {{ ucfirst($transaction['transaction_type'] ?? 'Employee Payment') }} @endif @elseif($transaction['transaction_to'] == 'customer') @if($transaction['transaction_type'] == 'orderPayment') Order Payment Received @elseif($transaction['transaction_type'] == 'receiveAdvance') Advance Payment Received @else Customer Payment @endif @else {{ ucfirst($transaction['transaction_to'] ?? 'N/A') }} Payment @endif
{{--
Payment Method: {{ $transaction['bank_id'] ? 'Bank Transfer' : 'Cash' }}
--}}
@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
{{-- Payment Details Table --}}

Payment Details

@if($transaction['transaction_to'] == 'brs') {{-- Balance Adjustment: Show only one column based on adjustment type --}} @else {{-- Regular transactions: Show both columns --}} @if($transaction['bank_id']) @else @endif @endif
{{-- Payment Summary --}}
Payment Amount:     {{ number_format(($transaction['debit'] > 0 ? $transaction['debit'] : $transaction['credit']) ?? 0, 2) }}
{{-- Amount in Words --}} @if(function_exists('numberToWordsWithCurrency'))
Amount in Words: {{ numberToWordsWithCurrency(($transaction['debit'] > 0 ? $transaction['debit'] : $transaction['credit']) ?? 0) }} {{--
{{ numberToWordsWithCurrency(($transaction['debit'] > 0 ? $transaction['debit'] : $transaction['credit']) ?? 0) }}
--}}
@endif {{-- Signatures --}}
Prepared By
Verified By
Approved By
Received By
@endsection