@extends('layouts.master') @section('content')

Approve Purchase Order

@include('flash::message')

{{ $po->request_number }} - Final Approval

Request Type:
{{ ucfirst($po->request_type) }}
Quotation:
@if(isset($po->quotation_id) && $po->quotation_id) @php $quotation = \App\Models\Quotation::find($po->quotation_id); @endphp {{ $quotation ? $quotation->name : '-' }} @else - @endif
Date:
{{ $po->date->format('Y-m-d') ?? '-' }}
Status:
{{ $po->status }}
Dept Status:
{{ $po->department_status }}
Total Amount:
{{ number_format($po->total_amount, 2) }}

@if($po->department_notes)
Department Notes:

{{ $po->department_notes }}

@endif
@if($po->lpout_name)
LPOUT Information (to be created)
@if($po->lpout_payment_type === 'cheque') @endif @if($po->lpout_payment_preference_option === 'custom') @endif @if($po->lpout_pdc_payment_option) @endif
LPOUT Name: {{ $po->lpout_name }}
Vendor: @if($po->lpout_vendor_id && $po->vendor) {{ $po->vendor->name }} @else - @endif
TRN: {{ $po->lpout_trn_no ?? '-' }}
Kindly Attn: {{ $po->lpout_kindly_attn ?? '-' }}
Date: {{ $po->lpout_date->format('Y-m-d') ?? '-' }}
Payment Type: {{ $po->lpout_payment_type ?? '-' }}
Cheque Date: {{ $po->lpout_cheque_date ?? '-' }}
VAT: {{ $po->lpout_vat ?? 0 }}%
Payment Preference: {{ $po->lpout_payment_preference_option ?? '-' }}
Payment Preference Details: {{ $po->lpout_payment_preference ?? '-' }}
PDC Payment Option: {{ $po->lpout_pdc_payment_option ?? '-' }} ({{ $po->lpout_pdc_number_of_days ?? 0 }} days)
@if($po->lpout_items && is_array($po->lpout_items))
LPOUT Items
@foreach($po->lpout_items as $idx => $item) @endforeach
NO DESCRIPTION UNIT QUANTITY UNIT PRICE (AED) TOTAL (AED)
{{ $idx + 1 }} {{ $item['description'] ?? '-' }} {{ $item['unit'] ?? '-' }} {{ $item['qty'] ?? '-' }} {{ number_format($item['unit_price'] ?? 0, 2) }} {{ number_format($item['total'] ?? 0, 2) }}
@if($po->lpout_vat) @endif
TOTAL AMOUNT (IN AED) 0.00
VAT (5%) (IN AED) 0.00
TOTAL SUM VALUE INCLUDING VAT (5%) (IN AED) 0.00
@endif @if($po->lpout_terms)
Terms & Conditions:

{!! $po->lpout_terms !!}

@endif
@endif
Attached Files
@php $files = $po->getMedia(); @endphp @if($files->count() > 0)
@foreach($files as $file) @endforeach
File Name Type Actions
{{ $file->name }} {{ strtoupper($file->mime_type) }} View Download
@else

No files attached to this Purchase Order.

@endif
Make Final Decision
@if($po->status === 'Pending Admin Approval')
{!! Form::open(['route' => ['purchase-orders.adminApprove', $po->id], 'method' => 'POST']) !!}
Approve
{!! Form::label('notes', 'Approval Notes (Optional):') !!} {!! Form::textarea('notes', null, ['class' => 'form-control', 'rows' => 3]) !!}
{!! Form::submit('Approve', ['class' => 'btn btn-success btn-flat']) !!} {!! Form::close() !!}
{!! Form::open(['route' => ['purchase-orders.adminReject', $po->id], 'method' => 'POST']) !!}
Reject
{!! Form::label('notes', 'Rejection Reason:') !!} {!! Form::textarea('notes', null, ['class' => 'form-control', 'rows' => 3, 'required' => true]) !!}
{!! Form::submit('Reject', ['class' => 'btn btn-danger btn-flat']) !!} {!! Form::close() !!}
@else
Decision Already Made: This Purchase Order has been {{ $po->status }} And Lpout has been created. @if($po->admin_notes)
Notes: {{ $po->admin_notes }} @endif
@endif
@endsection