@extends('layouts/contentLayoutMaster') @section('title', 'Customer PO Parts') @section('vendor-style') @endsection @section('page-style') {{-- Page Css files --}} @endsection @section('content')
@include('content.partial.form-message')

Customer PO Parts

@if($customer_po_part->inventory_id)
@csrf @method('patch') @else @csrf @method('put') @endif
@php $customers = \App\Models\Customer::orderBy('name', 'asc')->get(); if($customers->count()){ @endphp @php } @endphp @error('customer_id')
{{ $message }}
@enderror
@php $statuses = ['No Action', 'Under Process', 'In Shipping', 'Delivered', 'Invoiced', 'Cancelled', 'Hold']; if(!empty($statuses)){ @endphp @php } @endphp @error('customer_id')
{{ $message }}
@enderror
@php if( is_file(public_path('storage/' . $customer_po->file_path)) ){ echo "Attachment"; } @endphp
@php $our_quotations = \App\Models\OurQuotation::orderBy('quotation_number', 'asc')->get(); if($our_quotations->count()){ @endphp @php } @endphp @error('our_quotation_id')
{{ $message }}
@enderror
@php $parts = \App\Models\Inventory::orderBy('part_number', 'asc')->get(); if($parts->count()){ @endphp @php } @endphp @error('inventory_id')
{{ $message }}
@enderror
@error('quantity')
{{ $message }}
@enderror
@error('condition')
{{ $message }}
@enderror
@error('cert')
{{ $message }}
@enderror
@error('tag_date')
{{ $message }}
@enderror
@error('lead_time')
{{ $message }}
@enderror
@error('unit_price')
{{ $message }}
@enderror
@error('note')
{{ $message }}
@enderror
@if($customer_po_part->inventory_id) @else @endif Reset
date) }}" required disabled/> @error('date')
{{ $message }}
@enderror
edd) }}" required disabled/> @error('edd')
{{ $message }}
@enderror
@error('customer_po_number')
{{ $message }}
@enderror
@can('Order - Invoices - Add') Add Invoice @endcan

@php $i = 0; $sub_total = 0; @endphp @foreach( $customerPOParts as $customerPOPart ) @php $sub_total += $customerPOPart->unit_price * $customerPOPart->quantity; @endphp @endforeach
Row Our Quotation Part Number Description Quantity Condition Cert Tag Date Lead Time Unit Price Total Price Note Action
{{ ++$i }} {{ $customerPOPart->ourQuotation->quotation_number }} @can('Business - Inventories - List') @endcan {{ $customerPOPart->inventory->part_number }} @can('Business - Inventories - List') @endcan {{ $customerPOPart->inventory->description }} {{ $customerPOPart->quantity }} {{ $customerPOPart->condition }} {{ $customerPOPart->cert }} {{ $customerPOPart->tag_date }} {{ $customerPOPart->lead_time }} {{ number_format($customerPOPart->unit_price, 2) }} {{ number_format($customerPOPart->unit_price * $customerPOPart->quantity, 2) }} {{ $customerPOPart->note }}
Sub Total: {{ number_format($sub_total, 2) }}
@php $i = 0; @endphp @foreach( $customerPOParts as $customerPOPart ) @php $ordered_no = \App\Models\VendorPOPart::where('customer_po_id', '=', $customerPOPart->customer_po_id) ->where('inventory_id', '=', $customerPOPart->inventory_id)->sum('quantity'); $shipped_no = \App\Models\VendorPOPart::where('customer_po_id', '=', $customerPOPart->customer_po_id) ->where('inventory_id', '=', $customerPOPart->inventory_id)->sum('shipped_no'); $received_no = \App\Models\VendorPOPart::where('customer_po_id', '=', $customerPOPart->customer_po_id) ->where('inventory_id', '=', $customerPOPart->inventory_id)->sum('received_no'); $invoiced_no = DB::table('invoice_parts')->join('invoices', 'invoice_parts.invoice_id', '=', 'invoices.id') ->where('invoices.customer_po_id', '=', $customerPOPart->customer_po_id) ->where('invoice_parts.inventory_id', '=', $customerPOPart->inventory_id)->sum('invoice_parts.quantity'); @endphp @endforeach
Row Part Number Description Quantity Ordered Shipped Received Invoiced
{{ ++$i }} @can('Business - Inventories - List') @endcan {{ $customerPOPart->inventory->part_number }} @can('Business - Inventories - List') @endcan {{ $customerPOPart->inventory->description }} {{ $customerPOPart->quantity }} {{ $ordered_no }} {{ $shipped_no }} {{ $received_no }} {{ $invoiced_no }}
@endsection @section('vendor-script') {{-- Vendor js files --}} @endsection @section('page-script') @endsection