Amount: {{$booking->fix_amount.' '.$booking->fixedCurrency->short_code}}
+Status: {{$booking->status === 3 ? 'Complete' : 'In Progress'}}
+Purchase Order Status: {{$purchaseOrder ? ($purchaseOrder->status === 3 ? 'Approved' : ($purchaseOrder->status === 1 ? 'Pending Approval' : 'Incomplete Submission')) : 'Pending Submission'}}
+ @foreach($payments as $payment) + @php + $bill = $payment->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::BILL)->first(); + $transferProof = null; + $status = 'Pending Submission'; + if($payment->status === 1) { + $status = 'Pending Approval'; + } + + if($payment->status === 2) { + $status = 'Pending Confirmation'; + } + + if(in_array($payment->status, [4, 5])) { + $status = 'Rejected/Failed Payment'; + } + + if($bill->status === 1) { + $status = 'Pending Transfer Proof'; + } + + if(in_array($bill->status, [2, 3])) { + $status = 'Transfer Complete'; + $transferProof = $bill->documents()->first(); + } + + @endphp +Amount: {{$payment->original_amount.' '.$payment->originalCurrency->short_code}}
+Status: {{$status}}
+Payment Date: {{$payment->created_at->format('d-m-Y')}}
+ @if($bill) +Supplier: {{$bill->issuer->name}}
+Supplier Order Date: {{$bill->created_at->format('d-m-Y')}}
+ @if($transferProof)Transfer Proof Upload Date: {{$transferProof->created_at->format('d-m-Y')}}
@endif + @endif + @endforeach +Amount: {{$booking->fix_amount.' '.$booking->fixedCurrency->short_code}}
--}} +{{--Status: {{$booking->status === 3 ? 'Complete' : 'In Progress'}}
--}} +{{--Purchase Order Status: {{$purchaseOrder ? ($purchaseOrder->status === 3 ? 'Approved' : ($purchaseOrder->status === 1 ? 'Pending Approval' : 'Incomplete Submission')) : 'Pending Submission'}}
--}} +{{-- @foreach($payments as $payment)--}} +{{-- @php--}} +{{-- $bill = $payment->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::BILL)->first();--}} +{{-- $transferProof = null;--}} +{{-- $status = 'Pending Submission';--}} + +{{-- if($payment->status === 1) {--}} +{{-- $status = 'Pending Approval';--}} +{{-- }--}} + +{{-- if($payment->status === 2) {--}} +{{-- $status = 'Pending Confirmation';--}} +{{-- }--}} + +{{-- if(in_array($payment->status, [4, 5])) {--}} +{{-- $status = 'Rejected/Failed Payment';--}} +{{-- }--}} + +{{-- if($bill->status === 1) {--}} +{{-- $status = 'Pending Transfer Proof';--}} +{{-- }--}} + +{{-- if(in_array($bill->status, [2, 3])) {--}} +{{-- $status = 'Transfer Complete';--}} +{{-- $transferProof = $bill->documents()->first();--}} +{{-- }--}} + +{{-- @endphp--}} +{{--Amount: {{$payment->original_amount.' '.$payment->originalCurrency->short_code}}
--}} +{{--Status: {{$status}}
--}} +{{--Payment Date: {{$payment->created_at->format('d-m-Y')}}
--}} +{{-- @if($bill)--}} +{{--Supplier: {{$bill->issuer->name}}
--}} +{{--Supplier Order Date: {{$bill->created_at->format('d-m-Y')}}
--}} +{{-- @if($transferProof)Transfer Proof Upload Date: {{$transferProof->created_at->format('d-m-Y')}}
@endif--}} +{{-- @endif--}} +{{-- @endforeach--}} +{{--