@extends('admin.master') @section('title','Purchase Details') @section('content')
PO Reference: {{ $purchase->po_reference }}
--}}Date: {{ $purchase->purchase_date }}
Status: @if($purchase->status== 1) {{ "Received" }} @elseif($purchase->status== 2) {{ "Pending" }} @else {{ "Ordered" }} @endif
Payment Status: @if($purchase->payment_status == \App\Lib\Enumerations\PaymentStatus::$PAID) {{ "Paid" }} @elseif($purchase->payment_status == \App\Lib\Enumerations\PaymentStatus::$DUE) {{ "Due" }} @else {{ "Partial paid" }} @endif
| No. | Description | Quantity | Unit Cost | Subtotal |
|---|---|---|---|---|
| {{ $sl }} | @if(isset($purchaseDetails->product)) {{ $purchaseDetails->product->name ." ". $purchaseDetails->product->code}} @endif | {{ $purchaseDetails->quantity }} | {{ $purchaseDetails->product_cost }} | {{ $purchaseDetails->total_item_cost }} |
| Total Amount | {{ $purchase->purchaseDetails->sum('total_item_cost') }} | |||
| Discount | {{ $purchase->discount }} | |||
| Shipping Cost | {{ $purchase->shipping_cost }} | |||
| VAT | {{ $purchase->vat }} | |||
| Tax | {{ $purchase->tax }} | |||
| Grand Total | {{ $grandTotal=($purchase->purchaseDetails->sum('total_item_cost')+$purchase->shipping_cost + $purchase->vat + $purchase->tax) -$purchase->discount }} | |||
| Paid | @if(isset($purchase->purchasePayment)){{ $payment_amount=$purchase->purchasePayment->sum('payment_amount') }} @else {{ $payment_amount=0 }} @endif | |||
| Due | {{ $grandTotal - $payment_amount }} | |||
NOTE : @if(isset($purchase->note)){{ $purchase->note }} @endif
Created by : @if(isset($purchase->createdBy)){{ $purchase->createdBy->full_name }} @endif
Date: {{ $purchase->purchase_date }}
| Date | Account | Payment Reference | Paying by | Amount | Payment by |
|---|---|---|---|---|---|
| {{ $purchasePayments->payment_date }} | @if(isset($purchasePayments->paymentFromAccount)) {{ $purchasePayments->paymentFromAccount->account_name }} @endif | {{ $purchasePayments->reference_no }} | {{ $purchasePayments->paying_by }} | {{ $purchasePayments->payment_amount }} | @if(isset($purchasePayments->paymentBy)) {{ $purchasePayments->paymentBy->full_name }} @endif |