@php
function rupiah($n)
{
return 'Rp ' . number_format($n ?? 0, 0, ',', '.');
}
// Data fake untuk bahan (jika belum ada di database)
$fakeMaterials = [
[
'name' => 'Besi Hollow 40x40',
'code' => 'BH-4040',
'quantity' => 12,
'unit' => 'batang',
'type' => 'Bahan Utama',
'cost' => 450000,
],
[
'name' => 'Plat Besi 3mm',
'code' => 'PB-3MM',
'quantity' => 8,
'unit' => 'lembar',
'type' => 'Bahan Utama',
'cost' => 320000,
],
[
'name' => 'Stainless Steel 304',
'code' => 'SS-304',
'quantity' => 15,
'unit' => 'kg',
'type' => 'Bahan Utama',
'cost' => 675000,
],
[
'name' => 'Baut M8x25',
'code' => 'BT-M825',
'quantity' => 50,
'unit' => 'pcs',
'type' => 'Pengikat',
'cost' => 125000,
],
[
'name' => 'Mur M8',
'code' => 'MR-M8',
'quantity' => 50,
'unit' => 'pcs',
'type' => 'Pengikat',
'cost' => 75000,
],
[
'name' => 'Cat Epoxy Biru',
'code' => 'CE-BIRU',
'quantity' => 3,
'unit' => 'kaleng',
'type' => 'Finishing',
'cost' => 450000,
],
[
'name' => 'Dinamo Listrik 1 HP',
'code' => 'DN-1HP',
'quantity' => 1,
'unit' => 'unit',
'type' => 'Komponen',
'cost' => 1200000,
],
[
'name' => 'Bearing 6205',
'code' => 'BR-6205',
'quantity' => 4,
'unit' => 'pcs',
'type' => 'Komponen',
'cost' => 320000,
],
[
'name' => 'Kabel Listrik NYA 2.5mm',
'code' => 'KB-25',
'quantity' => 20,
'unit' => 'meter',
'type' => 'Elektrik',
'cost' => 180000,
],
[
'name' => 'Saklar ON/OFF',
'code' => 'SK-ONOFF',
'quantity' => 1,
'unit' => 'pcs',
'type' => 'Elektrik',
'cost' => 85000,
],
];
// Data fake untuk sparepart (jika belum ada di database)
$fakeSpareparts = [
[
'name' => 'Gear Reducer 1:30',
'type' => 'Transmisi',
'brand' => 'NORD',
'part_no' => 'NORD-GR-130',
'quantity' => 1,
'unit' => 'unit',
'cost' => 2500000,
],
[
'name' => 'V-Belt A-50',
'type' => 'Transmisi',
'brand' => 'Bando',
'part_no' => 'BND-VB-A50',
'quantity' => 2,
'unit' => 'pcs',
'cost' => 180000,
],
[
'name' => 'Pulley 4 Inch',
'type' => 'Transmisi',
'brand' => 'Standard',
'part_no' => 'STD-PLY-4IN',
'quantity' => 2,
'unit' => 'pcs',
'cost' => 320000,
],
[
'name' => 'Seal Shaft 25mm',
'type' => 'Seal',
'brand' => 'NOK',
'part_no' => 'NOK-SL-25',
'quantity' => 2,
'unit' => 'pcs',
'cost' => 150000,
],
[
'name' => 'O-Ring 25x3',
'type' => 'Seal',
'brand' => 'NOK',
'part_no' => 'NOK-OR-25X3',
'quantity' => 4,
'unit' => 'pcs',
'cost' => 80000,
],
[
'name' => 'Bearing 6206',
'type' => 'Bearing',
'brand' => 'SKF',
'part_no' => 'SKF-BR-6206',
'quantity' => 2,
'unit' => 'pcs',
'cost' => 450000,
],
[
'name' => 'Thermal Overload Relay',
'type' => 'Elektrik',
'brand' => 'Schneider',
'part_no' => 'SCH-TOR-10A',
'quantity' => 1,
'unit' => 'pcs',
'cost' => 350000,
],
[
'name' => 'Contact Switch',
'type' => 'Elektrik',
'brand' => 'Omron',
'part_no' => 'OMR-CS-24V',
'quantity' => 2,
'unit' => 'pcs',
'cost' => 280000,
],
];
// Merge dengan data real jika ada
$allMaterials =
$product->materials && $product->materials->count() > 0
? $product->materials
->map(function ($m) {
return [
'name' => $m->name,
'code' => $m->code ?? '-',
'quantity' => $m->quantity,
'unit' => $m->unit,
'type' => $m->type ?? 'Bahan Utama',
'cost' => $m->usage_cost,
];
})
->toArray()
: $fakeMaterials;
$allSpareparts =
$product->spareparts && $product->spareparts->count() > 0
? $product->spareparts
->map(function ($s) {
return [
'name' => $s->name,
'type' => $s->type ?? 'Sparepart',
'brand' => $s->brand ?? '-',
'part_no' => $s->part_no ?? '-',
'quantity' => $s->quantity,
'unit' => $s->unit,
'cost' => $s->usage_cost,
];
})
->toArray()
: $fakeSpareparts;
$totalMaterialCost = array_sum(array_column($allMaterials, 'cost'));
$totalSparepartCost = array_sum(array_column($allSpareparts, 'cost'));
$serviceFee = $product->service_fee ?? 0;
$totalProductionCost = $totalMaterialCost + $totalSparepartCost + $serviceFee;
$productPrice = $product->product_prices ?? 0;
@endphp
DOKUMEN SPESIFIKASI TEKNIS
PENGADAAN BARANG
| PAKET PENGADAAN |
{{ strtoupper($product->product_title) }} |
| PPK |
POLJAMTECH |
| ID PRODUK |
#{{ $product->id }} |
SPESIFIKASI FUNGSI UMUM
| Fungsi Utama |
{{ $product->product_description ?? 'Mesin produksi untuk meningkatkan efisiensi dan produktivitas industri' }}
|
| Kategori Produk |
{{ $product->category->name ?? '-' }} |
SPESIFIKASI MUTU/KUALITAS
Berdasarkan Spesifikasi Teknis:
{{ $product->product_title }}
@if ($product->specifications && $product->specifications->count() > 0)
| Spesifikasi |
Nilai |
@foreach ($product->specifications as $spec)
| {{ $spec->key }} |
{{ $spec->value }} |
@endforeach
@else
| Jenis Mesin |
{{ $product->product_title }} |
| Kapasitas |
Menyesuaikan kebutuhan produksi |
| Daya Listrik |
Menyesuaikan spesifikasi teknis |
| Material Utama |
Besi, Stainless Steel, dan komponen berkualitas |
@endif
SPESIFIKASI JUMLAH
Untuk pengadaan barang:
| No |
Uraian Barang |
Satuan |
Volume |
| 1 |
{{ $product->product_title }} |
Unit |
1 |
@if (!empty($allMaterials))
DAFTAR BAHAN YANG DIGUNAKAN
| No |
Kode |
Nama Bahan |
Jumlah |
Satuan |
Biaya (Rp) |
@foreach ($allMaterials as $index => $material)
| {{ $index + 1 }} |
{{ $material['code'] }} |
{{ $material['name'] }} |
{{ $material['quantity'] }} |
{{ $material['unit'] }} |
{{ rupiah($material['cost']) }} |
@endforeach
| Total Biaya Bahan: |
{{ rupiah($totalMaterialCost) }} |
@endif
@if (!empty($allSpareparts))
DAFTAR SPAREPART YANG DIGUNAKAN
| No |
No. Part |
Nama Sparepart |
Merek |
Jumlah |
Satuan |
Biaya (Rp) |
@foreach ($allSpareparts as $index => $sparepart)
| {{ $index + 1 }} |
{{ $sparepart['part_no'] }} |
{{ $sparepart['name'] }} |
{{ $sparepart['brand'] }} |
{{ $sparepart['quantity'] }} |
{{ $sparepart['unit'] }} |
{{ rupiah($sparepart['cost']) }} |
@endforeach
| Total Biaya Sparepart: |
{{ rupiah($totalSparepartCost) }} |
@endif
SPESIFIKASI WAKTU
| Jangka kedatangan barang/jasa (untuk pengadaan barang) |
{{ $product->product_work_duration ?? '2 (Dua) Minggu' }} |
| Lokasi kedatangan barang |
Jl. Lingkar Barat II Lr. Veteran Rt. 04 Kel. Bagan Pete, Kec. Alam Barajo, Kota Jambi |
| Metode transportasi dan pengepakan (jika ditentukan) |
Transportasi Darat dengan pengemasan yang aman dan rapi |
@if ($product->product_garansi)
SPESIFIKASI GARANSI
| Periode Garansi |
{{ $product->product_garansi }} |
| Jenis Garansi |
Garansi suku cadang dan jasa perbaikan |
@endif
RINGKASAN BIAYA
| Harga Jual Produk |
{{ rupiah($productPrice) }} |
| Upah Jasa Pengerjaan |
{{ rupiah($serviceFee) }} |
| Total Biaya Bahan |
{{ rupiah($totalMaterialCost) }} |
| Total Biaya Sparepart |
{{ rupiah($totalSparepartCost) }} |
| Total Biaya Produksi |
{{ rupiah($totalProductionCost) }} |