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

Finish Good : create

Page for create Finish Good

PO Buyer No : @foreach ($poBuyerInvoice->purchaseOrders as $po) {{ $po->no }} @if (!$loop->last) , @endif @endforeach
Invoice No : {{ $poBuyerInvoice->no }}
Invoice Date : {{ $poBuyerInvoice->date }}
Buyer Code : {{ $poBuyerInvoice->buyer_code }}
Invoice PIC : {{ $poBuyerInvoice->createdBy->full_contact }}
BC Type : {{ $poBuyerInvoice->bc_data['type'] }}
BC No : {{ $poBuyerInvoice->bc_data['no'] }}
BC Date : {{ $poBuyerInvoice->bc_data['date'] }}
Nomor Polisi : {{ $poBuyerInvoice->bc_data['nopol'] }}
Pengangkut : {{ $poBuyerInvoice->bc_data['pengangkut'] }}
Forwarder : {{ $poBuyerInvoice->bc_data['forwarder'] }}
Nama Kapal : {{ $poBuyerInvoice->bc_data['nama_kapal'] }}
AWB : {{ $poBuyerInvoice->bc_data['awb'] }}
ETA : {{ $poBuyerInvoice->bc_data['eta'] }}
ETD : {{ $poBuyerInvoice->bc_data['etd'] }}
No Karantina : {{ $poBuyerInvoice->bc_data['no_karantina'] }}
Tanggal Karantina : {{ $poBuyerInvoice->bc_data['tanggal_karantina'] }}
No Kontainer : {{ $poBuyerInvoice->bc_data['no_kontainer'] }}
Jumlah Kontainer : {{ $poBuyerInvoice->bc_data['jumlah_kontainer'] }}
Create Delivery Order
You only can take from Divisi where "is_finish_good" are true
@csrf
@error('license_plate')
{{ $message }}
@enderror
@error('driver')
{{ $message }}
@enderror
@foreach ($poBuyerInvoice->details as $detail) @endforeach
Material Fullname Material Code Material Name Material Type Material UoM Qty Total Qty Delivered Qty Delivered
{{ $detail->material->formatted_material }} {{ $detail->material_code }} {{ $detail->material->name }} {{ $detail->material->material_type_code }} {{ $detail->material->uom_code }} {{ $detail->qty }} {{ $detail->qty_send }} @error('qty.' . $detail->id)
{{ $message }}
@enderror
@error('qty')
{{ $message }}
@enderror
@error('actual_date')
{{ $message }}
@enderror
@error('take_from_divisi')
{{ $message }}
@enderror

Are you sure want to create this ? .

List Delivery Order

Below is the list of Delivery Order that you have created on this page.

@foreach ($poBuyerInvoice->finishGoods as $finishGood) @php $details = $finishGood->details; @endphp @endforeach
No Date Actual Date Material PIC Take From License Plate Driver Status Action
{{ $finishGood->no }} {{ $finishGood->date }} {{ $finishGood->actual_date }} @foreach ($finishGood->details as $detail) @php $lastStock = \App\Models\Stock::getCurrentStock( $finishGood->take_from_divisi, $detail->material_code, ); @endphp @endforeach
Material Fullname Materual Code Material UoM Material Color Stock Qty Send
{{ $detail->material->formatted_material }} {{ $detail->material_code }} {{ $detail->material->uom_code }} {{ $detail->material->color_code }} {{ $lastStock }} {{ $detail->qty }}
{{ $finishGood->createdBy->full_contact }} {{ $finishGood->take_from_divisi }} {{ $finishGood->license_plate }} {{ $finishGood->driver }} @switch($finishGood->status) @case(false) Not complete @break @case(true) Complete @break @default @endswitch
    @switch($finishGood->status) @case(false)
  • Are you sure want to finish this ?

    Once finish you cannot edit or remove and your stock card will update

    @csrf @method('PUT')
  • Are you sure want to delete this ?

    @csrf @method('DELETE')
  • @break @case(true) @break @default @endswitch
Total Qty Send: {{ number_format($poBuyerInvoice->finishGoods->flatMap->details->sum('qty'), 0, ',', '.') }}

Are you sure want to finish this ?

Once you finished, you cannot add more Delivery Order and status will change to complete

All Finish Good with Not complete status will change to Complete

And will decrease stock from Stock Card for all this Material Code

@csrf @method('PUT')
@endsection @section('js') @endsection