@extends('layouts.master') @section('css') @endsection @section('title') Stock Journal @endsection @section('content')
@method('put') @csrf
Edit Stock Journal
@if (str_contains($inventoryVoucher->voucher_number, '-')) {{ explode('-', $inventoryVoucher->voucher_number)[0] }} @else @endif

Note* : Extra consumptions/Buy products are added to be last and Extra consumptions only added after destination items.

Source/Input
@if (count($sourceInventoryVoucherItems) > 0) @foreach ($sourceInventoryVoucherItems as $key => $inventoryVoucherItem) @php $key = $key + 1; @endphp @if ($inventoryVoucherItem->dest_id == null) @endif @endforeach @endif
Location Item Variant Qty Unit Price Total
{{ number_format($sourceInventoryVoucherItems->sum('total'), 2) }}
Add
Destination/Output
@if (count($destinationInventoryVoucherItems) > 0) @foreach ($destinationInventoryVoucherItems as $key => $inventoryVoucherItem) @php $key = $key + 1; $hiddenQty = $inventoryVoucherItem->stockItem->baseStockItemUnit ->unit_qty; $manufacturersArray = []; $stockItemManufacturers = $inventoryVoucherItem->stockItem->stockItemManufacturers; foreach ($stockItemManufacturers as $manufacturer) { $manufacturersArray[] = $manufacturer->manufacturing_item_id; } $implodedString = implode(',', $manufacturersArray); @endphp @endforeach @endif
Location Item Variant Qty Unit Price Total
{{ number_format($destinationInventoryVoucherItems->sum('total'), 2) }}
Add
@endsection @section('script')