@extends('layouts/layoutMaster') @section('title', 'Detail dan Riwayat Bahan Baku') @section('vendor-style') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-buttons-bs5/buttons.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-checkboxes-jquery/datatables.checkboxes.scss', 'resources/assets/vendor/libs/select2/select2.scss', 'resources/assets/vendor/libs/@form-validation/form-validation.scss' ]) @endsection @section('vendor-script') @vite([ 'resources/assets/vendor/libs/moment/moment.js', 'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js', 'resources/assets/vendor/libs/select2/select2.js', 'resources/assets/vendor/libs/@form-validation/popular.js', 'resources/assets/vendor/libs/@form-validation/bootstrap5.js', 'resources/assets/vendor/libs/cleavejs/cleave.js', 'resources/assets/vendor/libs/cleavejs/cleave-phone.js' ]) @endsection @section('page-script') @vite(['Modules/Stockist/resources/assets/js/ingredients-detail.js']) @endsection @section('content')
Detail Bahan Baku: {{ $ingredient->name }}

Stok: {{ rtrim(rtrim(number_format($ingredient->remaining_stock, 8, '.', ','), '0'), '.') }}

Satuan: @if($ingredient->latestPurchase && $ingredient->latestPurchase->unit) {{ $ingredient->latestPurchase->unit->name }} @else N/A @endif

@if($purchases && $purchases->isNotEmpty())
Riwayat Pembelian
@foreach ($purchases as $purchase) @endforeach
Tanggal Jumlah Harga per Unit Total Harga
{{ $purchase->created_at->format('d M Y') }} {{ rtrim(rtrim(number_format($purchase->quantity, 8, '.', ','), '0'), '.') }} {{ isset($purchase->purchase) ? rupiah_format($purchase->purchase->unit_price, 2) : '-' }} {{ isset($purchase->purchase) ? rupiah_format($purchase->purchase->total_price, 2) : '-' }}
@else

Belum ada riwayat pembelian untuk bahan baku ini.

@endif @if($usages && $usages->isNotEmpty())
Riwayat Penggunaan
@foreach ($usages as $usage) @endforeach
Tanggal Jumlah Harga per Unit Jenis Transaksi Jenis Produk
{{ $usage->created_at->format('d M Y') }} {{ rtrim(rtrim(number_format($usage->quantity, 8, '.', ','), '0'), '.') }} {{ rupiah_format($usage->unit_price, 2) }} @if($usage->movement_type === 'sell') Penjualan @elseif($usage->movement_type === 'adjustment') Penyesuaian @else Lainnya @endif @if($usage->product_type === 'product') Produk @elseif($usage->product_type === 'variant') Varian @elseif($usage->product_type === 'addition') Tambahan @else Tidak Diketahui @endif
@else

Belum ada riwayat penggunaan untuk bahan baku ini.

@endif @endsection