Browse Source

update tambah transfer

master
Gunawan19621 1 year ago
parent
commit
63b0be2536
  1. 178
      app/Http/Controllers/M_assetController.php
  2. 2
      app/Http/Controllers/PeminjamanController.php
  3. 39
      app/Http/Controllers/PetiController.php
  4. 76
      app/Http/Controllers/TransferController.php
  5. 38
      app/Http/Controllers/WarehouseController.php
  6. 32
      app/Http/Requests/Transfer/ValidasiCreateTransfer.php
  7. 28
      app/Http/Requests/Transfer/ValidasiUpdateTransfer.php
  8. 6
      app/Http/Requests/ValidasiCreatePeminjaman.php
  9. 2
      app/Http/Requests/ValidasiCreateWarehouse.php
  10. 7
      app/Http/Requests/ValidasiUpdateCustomer.php
  11. 6
      app/Http/Requests/ValidasiUpdatePeminjaman.php
  12. 9
      app/Http/Requests/ValidasiUpdatePengembalian.php
  13. 27
      app/Models/BarangKeluar.php
  14. 24
      app/Models/BarangMasuk.php
  15. 28
      app/Models/Transfer.php
  16. 30
      app/Models/m_asset.php
  17. 1
      app/Models/m_warehouse.php
  18. 1
      database/migrations/2023_10_23_073314_create_m_warehouses_table.php
  19. 38
      database/migrations/2023_10_23_074754_create_m_assets_table.php
  20. 37
      database/migrations/2023_10_23_120702_create_barang_masuks_table.php
  21. 36
      database/migrations/2023_10_23_120927_create_barang_keluars_table.php
  22. 4
      database/migrations/2023_11_06_122033_create_asset_statuses_table.php
  23. 5
      database/migrations/2023_11_08_132316_create_transfers_table.php
  24. 1
      database/seeders/DatabaseSeeder.php
  25. 55
      database/seeders/PetiSeeder.php
  26. 2
      database/seeders/WarehouseSeeder.php
  27. 12
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/all_print.blade.php
  28. 4
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php
  29. 2
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/show.blade.php
  30. 69
      resources/views/dashboard/Transfer/create.blade.php
  31. 52
      resources/views/dashboard/Transfer/index.blade.php
  32. 2
      resources/views/layouts/sidebar.blade.php

178
app/Http/Controllers/M_assetController.php

@ -1,178 +0,0 @@
<?php
namespace App\Http\Controllers;
use Dompdf\Dompdf;
use App\Models\m_asset;
use BaconQrCode\Writer;
use Barryvdh\DomPDF\PDF;
use App\Models\m_warehouse;
use App\Exports\AssetExport;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
use Maatwebsite\Excel\Facades\Excel;
use BaconQrCode\Renderer\ImageRenderer;
use Illuminate\Support\Facades\Storage;
use SimpleSoftwareIO\QrCode\Facades\QrCode;
use BaconQrCode\Renderer\RendererStyle\RendererStyle;
class M_assetController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$data = [
'asset' => m_asset::get(),
'warehouse' => m_warehouse::all(),
'active' => 'menu-asset',
];
return view('dashboard.Master_Data.Asset.index', $data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
$latestAsset = \App\Models\m_asset::latest()->first();
$currentYear = date("Y-m-d");
if ($latestAsset == null) {
$nomorUrut = 1;
} else {
$lastCode = substr($latestAsset->seri, 7);
$nomorUrut = intval($lastCode) + 1;
}
$seri = 'AST' . $currentYear . '-' . str_pad($nomorUrut, STR_PAD_LEFT);
$request->validate([
'name' => 'required',
'description' => 'required',
'warehouse_id' => 'required',
'date' => 'required',
'qr_count' => 'nullable'
]);
// dd($request);
try {
$currentUser = Auth::user();
$validatedData = $request->except('_token');
$validatedData['seri'] = $seri;
$validatedData['created_by'] = $currentUser->fullname;
$validatedData['updated_by'] = $currentUser->fullname;
\App\Models\m_asset::create($validatedData);
return redirect()->back()->with('success', 'Data asset berhasil ditambah.');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data asset gagal ditambah.');
}
}
/**
* Display the specified resource.
*/
public function show($id)
{
$data = [
'asset' => m_asset::find($id),
'warehouse' => m_warehouse::all(),
'active' => 'menu-asset',
];
return view('dashboard.Master_Data.Asset.show', $data);
}
// Menampilkan data QR
// public function QR($id)
// {
// $asset = m_asset::find($id);
// return QrCode::generate(
// 'Hello, World!',
// );
// }
/**
* Show the form for editing the specified resource.
*/
public function edit()
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
$request->validate([
'name' => 'required',
'description' => 'required',
'warehouse_id' => 'required',
'date' => 'required',
]);
try {
$asset = m_asset::findOrFail($id);
$asset->update($request->all());
return redirect()->back()->with('success', 'Data asset berhasil diperbaharui');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data asset gagal diperbaharui');
}
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
// dd("oke");
try {
$asset = m_asset::findOrFail($id);
$asset->delete();
return redirect()->back()->with('success', 'Data asset berhasil dihapus');
} catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data asset gagal dihapus');
}
}
/**
* Cetak PDF.
*/
public function cetakpdf()
{
// dd('oke');
$asset = m_asset::all();
// Buat objek Dompdf
$dompdf = new Dompdf();
// Render tampilan ke PDF
$html = view('dashboard.Master_Data.Asset.asset_pdf', compact('asset'))->render();
// Muat HTML ke Dompdf
$dompdf->loadHtml($html);
// Atur ukuran dan orientasi kertas
$dompdf->setPaper('A4', 'portrait');
// Render PDF
$dompdf->render();
// Tampilkan PDF di browser
return $dompdf->stream('Laporan Assets');
}
/**
* Cetak Exel.
*/
public function export()
{
return Excel::download(new AssetExport, 'Laporan Assets.xlsx');
}
}

2
app/Http/Controllers/PeminjamanController.php

@ -21,7 +21,6 @@ class PeminjamanController extends Controller
{ {
$data = [ $data = [
'asset' => m_asset::all(),
// 'peminjaman' => asset_status::get(), // 'peminjaman' => asset_status::get(),
'peminjaman' => asset_status::get(), 'peminjaman' => asset_status::get(),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
@ -38,7 +37,6 @@ class PeminjamanController extends Controller
{ {
$data = [ $data = [
'peti' => Peti::all(), 'peti' => Peti::all(),
'asset' => m_asset::all(),
'peminjaman' => asset_status::get(), 'peminjaman' => asset_status::get(),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
'peti_block' => Peti::whereNotIn('id', asset_status::pluck('peti_id')->toArray())->get(), 'peti_block' => Peti::whereNotIn('id', asset_status::pluck('peti_id')->toArray())->get(),

39
app/Http/Controllers/PetiController.php

@ -184,7 +184,7 @@ class PetiController extends Controller
$peti = Peti::find($id); $peti = Peti::find($id);
// Generate QR Code // Generate QR Code
$qrcode = base64_encode(QrCode::format('svg')->size(150)->errorCorrection('H')->generate( $qrcode = base64_encode(QrCode::format('svg')->size(150)->generate(
$peti->fix_lot . ';' . $peti->id . ';' . $peti->warehouse->id $peti->fix_lot . ';' . $peti->id . ';' . $peti->warehouse->id
)); ));
@ -220,43 +220,6 @@ class PetiController extends Controller
} }
} }
// public function AllPdf(Request $request)
// {
// $peti_ids = $request->input('peti_ids');
// $selectedIds = explode(',', $peti_ids);
// // Mengambil data dari database berdasarkan ID yang dipilih
// $peti = Peti::whereIn('id', $selectedIds)->get();
// // $peti = Peti::all();
// // Inisialisasi Dompdf
// $options = new Options();
// $options->set('isHtml5ParserEnabled', true);
// $options->set('isRemoteEnabled', true);
// $options->set('defaultFont', 'Arial');
// $dompdf = new Dompdf($options);
// // Load HTML dari view
// $html = view('dashboard.Master_Data.Manajemen_Peti.Peti.all_print', compact('peti'))->render();
// $dompdf->loadHtml($html);
// // Render PDF (portrait A4)
// $dompdf->setPaper('A4', 'portrait');
// $dompdf->render();
// $output = $dompdf->output();
// // Download file PDF dengan nama yang sesuai
// return response()->stream(
// function () use ($output) {
// echo $output;
// },
// 200,
// [
// 'Content-Type' => 'application/pdf',
// 'Content-Disposition' => 'inline; filename="label_Peti.pdf"',
// ]
// );
// }
public function AllPdf(Request $request) public function AllPdf(Request $request)
{ {
$peti_ids = $request->input('peti_ids'); $peti_ids = $request->input('peti_ids');

76
app/Http/Controllers/TransferController.php

@ -2,17 +2,20 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\m_warehouse;
use App\Models\Peti; use App\Models\Peti;
use App\Models\Transfer; use App\Models\Transfer;
use App\Models\m_warehouse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Requests\Transfer\ValidasiCreateTransfer;
use App\Models\Customer;
class TransferController extends Controller class TransferController extends Controller
{ {
public function index() public function index()
{ {
$data = [ $data = [
'peminjaman' => Transfer::all(), 'transfer' => Transfer::all(),
'active' => 'menu-transfer', 'active' => 'menu-transfer',
]; ];
return view('dashboard.Transfer.index', $data); return view('dashboard.Transfer.index', $data);
@ -24,6 +27,7 @@ class TransferController extends Controller
public function create() public function create()
{ {
$data = [ $data = [
'customer' => Customer::get(),
'peti' => Peti::get(), 'peti' => Peti::get(),
// 'warehouse' => Peti::with('warehouse_id')->get(), // 'warehouse' => Peti::with('warehouse_id')->get(),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
@ -35,10 +39,76 @@ class TransferController extends Controller
/** /**
* Store a newly created resource in storage. * Store a newly created resource in storage.
*/ */
public function store($request) // public function store(ValidasiCreateTransfer $request)
// {
// try {
// $currenttype = Auth::user();
// $validatedData = $request->except('_token');
// $validatedData['created_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai created_by
// $validatedData['updated_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai updated_by
// // dd($validatedData);
// Transfer::create($validatedData);
// return redirect()->route('dashboard.transfer.index')->with('success', 'Data Transfer Peti berhasil ditambahkan');
// } catch (\Throwable $th) {
// // dd($th->getMessage());
// return redirect()->back()->with('error', 'Data Transfer Peti Gagal Ditambah.');
// }
// }
// public function store(ValidasiCreateTransfer $request)
// {
// try {
// $currenttype = Auth::user();
// $validatedData = $request->except('_token');
// $validatedData['created_by'] = $currenttype->fullname;
// $validatedData['updated_by'] = $currenttype->fullname;
// // Membuat entitas Transfer
// $transfer = Transfer::create($validatedData);
// // Update kolom di tabel 'petis'
// Peti::where('customer_id', $transfer->customer_id)
// ->update(['customer_id' => $transfer->customer_id]);
// Peti::where('warehouse_id', $transfer->destination_warehouse)
// ->update(['warehouse_id' => $transfer->destination_warehouse]);
// return redirect()->route('dashboard.transfer.index')->with('success', 'Data Transfer Peti berhasil ditambahkan');
// } catch (\Throwable $th) {
// return redirect()->back()->with('error', 'Data Transfer Peti Gagal Ditambah.');
// }
// }
public function store(ValidasiCreateTransfer $request)
{ {
try {
$currenttype = Auth::user();
$validatedData = $request->except('_token');
$validatedData['created_by'] = $currenttype->fullname;
$validatedData['updated_by'] = $currenttype->fullname;
// Membuat entitas Transfer
$transfer = Transfer::create([
'name_customer' => $request->name_customer,
'peti_id' => $request->peti_id,
'source_warehouse' => $request->source_warehouse,
'destination_warehouse' => $request->destination_warehouse,
]);
// Mengupdate warehouse_id pada model Peti
$peti = Peti::where('id', $transfer->peti_id)
->update(['warehouse_id' => $transfer->destination_warehouse]);
// dd($peti);
return redirect()->route('dashboard.transfer.index')->with('success', 'Data Transfer Peti berhasil ditambahkan');
} catch (\Throwable $th) {
return redirect()->back()->withErrors($th->getMessage());
}
} }
/** /**
* Display the specified resource. * Display the specified resource.
*/ */

38
app/Http/Controllers/WarehouseController.php

@ -34,20 +34,50 @@ class WarehouseController extends Controller
*/ */
public function store(ValidasiCreateWarehouse $request) public function store(ValidasiCreateWarehouse $request)
{ {
try { try {
$currentUser = Auth::user(); $currentUser = Auth::user();
// Ambil nomor urutan otomatis untuk id_incre
$latestRecord = m_warehouse::latest()->first();
$nextIdIncre = ($latestRecord) ? $latestRecord->id_incre + 1 : 1;
$validatedData = $request->except('_token'); $validatedData = $request->except('_token');
$validatedData['created_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai created_by $validatedData['created_by'] = $currentUser->fullname;
$validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by $validatedData['updated_by'] = $currentUser->fullname;
$validatedData['id_incre'] = $nextIdIncre;
m_warehouse::create($validatedData); m_warehouse::create($validatedData);
return redirect()->back()->with('success', 'Data gudang berhasil ditambah.'); return redirect()->back()->with('success', 'Data gudang berhasil ditambah.');
} catch (\Throwable $th) { } catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data gudang gagal ditambah.'); return redirect()->back()->with('error', 'Data gudang gagal ditambah.');
} }
return redirect()->back()->with('success', 'Data gudang berhasil ditambah.');
} }
// public function store(ValidasiCreateWarehouse $request)
// {
// try {
// $currentUser = Auth::user();
// // Ambil nomor urutan otomatis untuk id_incre
// $nextIdIncre = m_warehouse::max('id_incre') + 1;
// $validatedData = $request->except('_token');
// $validatedData['created_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai created_by
// $validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by
// // Set nilai id_incre sebelum membuat entri
// $validatedData['id_incre'] = $nextIdIncre;
// m_warehouse::create($validatedData);
// return redirect()->back()->with('success', 'Data gudang berhasil ditambah.');
// } catch (\Throwable $th) {
// return redirect()->back()->with('error', 'Data gudang gagal ditambah.');
// }
// return redirect()->back()->with('success', 'Data gudang berhasil ditambah.');
// }
/** /**
* Display the specified resource. * Display the specified resource.
*/ */

32
app/Http/Requests/Transfer/ValidasiCreateTransfer.php

@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests\Transfer;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiCreateTransfer extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'peti_id' => 'nullable', // Optional, peti_id harus ada di tabel petis
'source_warehouse' => 'nullable', // Optional, source_warehouse harus ada di tabel m_warehouses
'destination_warehouse' => 'nullable', // Optional, destination_warehouse harus ada di tabel m_warehouses
'name_customer' => 'nullable', // Optional, name_customer harus ada di tabel customers
'date' => 'nullable', // Optional, harus berupa tanggal
];
}
}

28
app/Http/Requests/Transfer/ValidasiUpdateTransfer.php

@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests\Transfer;
use Illuminate\Foundation\Http\FormRequest;
class ValidasiUpdateTransfer extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
}

6
app/Http/Requests/ValidasiCreatePeminjaman.php

@ -22,10 +22,10 @@ class ValidasiCreatePeminjaman extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'peti_id' => 'required|integer', // Pastikan peti_id ada dalam tabel petis 'peti_id' => 'required', // Pastikan peti_id ada dalam tabel petis
'exit_at' => 'required|date', 'exit_at' => 'required|date',
'est_pengembalian' => 'required|date', // Estimasi pengembalian harus setelah exit_at 'est_pengembalian' => 'required|date', // Estimasi pengembalian harus setelah exit_at
'exit_warehouse' => 'required|integer', 'exit_warehouse' => 'required',
]; ];
} }
@ -33,13 +33,11 @@ class ValidasiCreatePeminjaman extends FormRequest
{ {
return [ return [
'peti_id.required' => 'Bidang Detail Peti wajib diisi.', 'peti_id.required' => 'Bidang Detail Peti wajib diisi.',
'peti_id.integer' => 'Detail Peti harus berupa angka.',
'exit_at.required' => 'Bidang Tanggal Peminjaman wajib diisi.', 'exit_at.required' => 'Bidang Tanggal Peminjaman wajib diisi.',
'exit_at.date' => 'Bidang Tanggal Peminjaman harus berupa tanggal.', 'exit_at.date' => 'Bidang Tanggal Peminjaman harus berupa tanggal.',
'est_pengembalian.required' => 'Bidang Estimasi Tanggal Pengembalian wajib diisi.', 'est_pengembalian.required' => 'Bidang Estimasi Tanggal Pengembalian wajib diisi.',
'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.', 'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.',
'exit_warehouse.required' => 'Bidang Asal Gudang wajib diisi.', 'exit_warehouse.required' => 'Bidang Asal Gudang wajib diisi.',
'exit_warehouse.integer' => 'Asal Gudang harus berupa angka.',
]; ];
} }
} }

2
app/Http/Requests/ValidasiCreateWarehouse.php

@ -22,6 +22,7 @@ class ValidasiCreateWarehouse extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'id_incre' => 'integer',
'name' => 'required|string|max:32', 'name' => 'required|string|max:32',
'description' => 'required|string|max:255', 'description' => 'required|string|max:255',
'address' => 'required|string|max:255', 'address' => 'required|string|max:255',
@ -31,6 +32,7 @@ class ValidasiCreateWarehouse extends FormRequest
public function messages() public function messages()
{ {
return [ return [
'id_incre.integer' => 'Kolom id incre harus berupa angka.',
'name.required' => 'Kolom nama wajib diisi.', 'name.required' => 'Kolom nama wajib diisi.',
'name.string' => 'Kolom nama harus berupa teks.', 'name.string' => 'Kolom nama harus berupa teks.',
'name.max' => 'Kolom nama tidak boleh lebih dari :max karakter.', 'name.max' => 'Kolom nama tidak boleh lebih dari :max karakter.',

7
app/Http/Requests/ValidasiUpdateCustomer.php

@ -23,9 +23,9 @@ class ValidasiUpdateCustomer extends FormRequest
{ {
return [ return [
'name' => 'required|string|max:50', 'name' => 'required|string|max:50',
'code_customer' => 'required|string|max:15|unique:customers,code_customer', 'code_customer' => 'required|string|max:15',
'lot_no' => 'required|string|max:50', 'lot_no' => 'required|string|max:50',
'no_tlp' => 'required|numeric', 'no_tlp' => 'required',
'address' => 'required|string', 'address' => 'required|string',
]; ];
} }
@ -39,12 +39,9 @@ class ValidasiUpdateCustomer extends FormRequest
'code_customer.required' => 'Kolom code_customer wajib diisi.', 'code_customer.required' => 'Kolom code_customer wajib diisi.',
'code_customer.string' => 'Kolom code_customer harus berupa teks.', 'code_customer.string' => 'Kolom code_customer harus berupa teks.',
'code_customer.max' => 'Kolom code_customer tidak boleh lebih dari :max karakter.', 'code_customer.max' => 'Kolom code_customer tidak boleh lebih dari :max karakter.',
'code_customer.unique' => 'Kolom code_customer sudah ada.',
'lot_no.required' => 'Kolom lot_no wajib diisi.', 'lot_no.required' => 'Kolom lot_no wajib diisi.',
'lot_no.string' => 'Kolom lot_no harus berupa teks.', 'lot_no.string' => 'Kolom lot_no harus berupa teks.',
'no_tlp.required' => 'Kolom no_tlp wajib diisi.', 'no_tlp.required' => 'Kolom no_tlp wajib diisi.',
'no_tlp.numeric' => 'Kolom no_tlp harus berisi angka.',
'no_tlp.max' => 'Kolom no_tlp tidak boleh lebih dari :max karakter.',
'address.required' => 'Kolom address wajib diisi.', 'address.required' => 'Kolom address wajib diisi.',
'address.string' => 'Kolom address harus berupa teks.', 'address.string' => 'Kolom address harus berupa teks.',
]; ];

6
app/Http/Requests/ValidasiUpdatePeminjaman.php

@ -22,10 +22,10 @@ class ValidasiUpdatePeminjaman extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'peti_id' => 'required|integer', // Pastikan peti_id ada dalam tabel petis 'peti_id' => 'required', // Pastikan peti_id ada dalam tabel petis
'exit_at' => 'required|date', 'exit_at' => 'required|date',
'est_pengembalian' => 'required|date', // Estimasi pengembalian harus setelah exit_at 'est_pengembalian' => 'required|date', // Estimasi pengembalian harus setelah exit_at
'exit_warehouse' => 'required|integer', 'exit_warehouse' => 'required',
]; ];
} }
@ -33,13 +33,11 @@ class ValidasiUpdatePeminjaman extends FormRequest
{ {
return [ return [
'peti_id.required' => 'Bidang Detail Peti wajib diisi.', 'peti_id.required' => 'Bidang Detail Peti wajib diisi.',
'peti_id.integer' => 'Detail Peti harus berupa angka.',
'exit_at.required' => 'Bidang Tanggal Peminjaman wajib diisi.', 'exit_at.required' => 'Bidang Tanggal Peminjaman wajib diisi.',
'exit_at.date' => 'Bidang Tanggal Peminjaman harus berupa tanggal.', 'exit_at.date' => 'Bidang Tanggal Peminjaman harus berupa tanggal.',
'est_pengembalian.required' => 'Bidang Estimasi Tanggal Pengembalian wajib diisi.', 'est_pengembalian.required' => 'Bidang Estimasi Tanggal Pengembalian wajib diisi.',
'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.', 'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.',
'exit_warehouse.required' => 'Bidang Asal Gudang wajib diisi.', 'exit_warehouse.required' => 'Bidang Asal Gudang wajib diisi.',
'exit_warehouse.integer' => 'Asal Gudang harus berupa angka.',
]; ];
} }
} }

9
app/Http/Requests/ValidasiUpdatePengembalian.php

@ -22,12 +22,12 @@ class ValidasiUpdatePengembalian extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'peti_id' => 'required|integer', 'peti_id' => 'required',
'exit_at' => 'required|date', 'exit_at' => 'required|date',
'est_pengembalian' => 'required|date', 'est_pengembalian' => 'required|date',
'exit_warehouse' => 'required|integer', 'exit_warehouse' => 'required',
'enter_at' => 'required|date', 'enter_at' => 'required|date',
'enter_warehouse' => 'required|integer', 'enter_warehouse' => 'required',
'kondisi_peti' => 'required|string', 'kondisi_peti' => 'required|string',
]; ];
} }
@ -36,17 +36,14 @@ class ValidasiUpdatePengembalian extends FormRequest
{ {
return [ return [
'peti_id.required' => 'Kolom peti_id wajib diisi.', 'peti_id.required' => 'Kolom peti_id wajib diisi.',
'peti_id.integer' => 'Kolom peti_id harus berupa angka bulat.',
'exit_at.required' => 'Kolom exit_at wajib diisi.', 'exit_at.required' => 'Kolom exit_at wajib diisi.',
'exit_at.date' => 'Kolom exit_at harus berupa tanggal.', 'exit_at.date' => 'Kolom exit_at harus berupa tanggal.',
'est_pengembalian.required' => 'Kolom est_pengembalian wajib diisi.', 'est_pengembalian.required' => 'Kolom est_pengembalian wajib diisi.',
'est_pengembalian.date' => 'Kolom est_pengembalian harus berupa tanggal.', 'est_pengembalian.date' => 'Kolom est_pengembalian harus berupa tanggal.',
'exit_warehouse.required' => 'Kolom exit_warehouse wajib diisi.', 'exit_warehouse.required' => 'Kolom exit_warehouse wajib diisi.',
'exit_warehouse.integer' => 'Kolom exit_warehouse harus berupa angka bulat.',
'enter_at.required' => 'Kolom enter_at wajib diisi.', 'enter_at.required' => 'Kolom enter_at wajib diisi.',
'enter_at.date' => 'Kolom enter_at harus berupa tanggal.', 'enter_at.date' => 'Kolom enter_at harus berupa tanggal.',
'enter_warehouse.required' => 'Kolom enter_warehouse wajib diisi.', 'enter_warehouse.required' => 'Kolom enter_warehouse wajib diisi.',
'enter_warehouse.integer' => 'Kolom enter_warehouse harus berupa angka bulat.',
'kondisi_peti.required' => 'Kolom kondisi_peti wajib diisi.', 'kondisi_peti.required' => 'Kolom kondisi_peti wajib diisi.',
'kondisi_peti.string' => 'Kolom kondisi_peti harus berupa teks.', 'kondisi_peti.string' => 'Kolom kondisi_peti harus berupa teks.',
]; ];

27
app/Models/BarangKeluar.php

@ -1,27 +0,0 @@
<?php
namespace App\Models;
use App\Traits\UUID;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class BarangKeluar extends Model
{
use HasFactory, UUID;
protected $table = 'barang_keluars';
protected $fillable = [
'asset_id',
'jumlah',
'tanggal_keluar',
'penerima_barang',
'exit_warehouse',
'keterangan',
];
public function asset()
{
return $this->belongsTo(m_asset::class, 'asset_id');
}
}

24
app/Models/BarangMasuk.php

@ -1,24 +0,0 @@
<?php
namespace App\Models;
use App\Traits\UUID;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class BarangMasuk extends Model
{
use HasFactory, UUID;
protected $table = 'barang_masuks';
protected $fillable = [
'asset_id',
'jumlah',
'tanggal_masuk',
'asal_barang',
'pengiriman_barang',
'penerima_barang',
'enter_warehouse',
'keterangan',
];
}

28
app/Models/Transfer.php

@ -11,11 +11,14 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
class Transfer extends Model class Transfer extends Model
{ {
use HasFactory, SoftDeletes, UUID; use HasFactory, SoftDeletes, UUID;
protected $table = 'petis'; protected $table = 'transfers';
protected $fillable = [ protected $fillable = [
'peti_id', 'peti_id',
'tanggal', 'source_warehouse',
'destination_warehouse',
'name_customer',
'date',
'created_by', 'created_by',
'updated_by', 'updated_by',
]; ];
@ -33,4 +36,25 @@ class Transfer extends Model
'updated_by', 'updated_by',
); );
} }
public function customer()
{
return $this->belongsTo(Customer::class, 'name_customer')->select(
'name',
'code_customer',
);
}
public function sourceWarehouse()
{
return $this->belongsTo(m_warehouse::class, 'source_warehouse')->select(
'name',
'address',
);
}
public function destinationWarehouse()
{
return $this->belongsTo(m_warehouse::class, 'destination_warehouse')->select(
'name',
'address',
);
}
} }

30
app/Models/m_asset.php

@ -1,30 +0,0 @@
<?php
namespace App\Models;
use App\Traits\UUID;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class m_asset extends Model
{
use HasFactory, SoftDeletes, UUID;
protected $table = 'm_assets';
protected $fillable = [
'seri',
'name',
'description',
'warehouse_id',
'date',
'qr_count',
'created_by',
'updated_by',
];
public function warehouse()
{
return $this->belongsTo(m_warehouse::class, 'warehouse_id');
}
}

1
app/Models/m_warehouse.php

@ -12,6 +12,7 @@ class m_warehouse extends Model
protected $table = 'm_warehouses'; protected $table = 'm_warehouses';
protected $fillable = [ protected $fillable = [
'id_incre',
'name', 'name',
'description', 'description',
'address', 'address',

1
database/migrations/2023_10_23_073314_create_m_warehouses_table.php

@ -13,6 +13,7 @@ return new class extends Migration
{ {
Schema::create('m_warehouses', function (Blueprint $table) { Schema::create('m_warehouses', function (Blueprint $table) {
$table->uuid('id')->primary(); $table->uuid('id')->primary();
$table->bigInteger('id_incre')->default(1)->unsigned();
$table->string('name', 32)->nullable(); $table->string('name', 32)->nullable();
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->text('address')->nullable(); $table->text('address')->nullable();

38
database/migrations/2023_10_23_074754_create_m_assets_table.php

@ -1,38 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('m_assets', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('seri', 50)->nullable();
$table->string('name', 200)->nullable();
$table->text('description')->nullable();
// $table->unsignedBigInteger('warehouse_id')->nullable();
// $table->foreign('warehouse_id')->references('id')->on('m_warehouses')->onDelete('set null');
$table->foreignUuid('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null');
$table->date('date')->nullable();
$table->string('qr_count', 255)->nullable();
$table->timestamps();
$table->softDeletes();
$table->string('created_by', 200)->nullable();
$table->string('updated_by', 200)->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('m_assets');
}
};

37
database/migrations/2023_10_23_120702_create_barang_masuks_table.php

@ -1,37 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('barang_masuks', function (Blueprint $table) {
$table->uuid('id')->primary();
// $table->bigInteger('asset_id')->unsigned()->nullable();
// $table->foreign('asset_id')->references('id')->on('m_assets')->onDelete('set null');
$table->foreignUuid('asset_id')->nullable()->constrained('m_assets')->onDelete('set null');
$table->integer('jumlah')->nullable();
$table->date('tanggal_masuk')->nullable();
$table->string('asal_barang', 200)->nullable();
$table->string('pengiriman_barang', 200)->nullable();
$table->string('penerima_barang', 200)->nullable();
$table->string('enter_warehouse', 200)->nullable();
$table->string('keterangan', 255)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('barang_masuks');
}
};

36
database/migrations/2023_10_23_120927_create_barang_keluars_table.php

@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('barang_keluars', function (Blueprint $table) {
$table->uuid('id')->primary();
// $table->bigInteger('assets_id')->unsigned()->nullable();
// $table->foreign('assets_id')->references('id')->on('m_assets')->onDelete('set null');
$table->foreignUuid('assets_id')->nullable()->constrained('m_assets')->onDelete('set null');
$table->integer('jumlah')->nullable();
$table->date('tanggal_keluar')->nullable();
$table->string('penerima_barang', 200)->nullable();
$table->string('exit_warehouse', 200)->nullable();
$table->string('keterangan', 255)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('barang_keluars');
}
};

4
database/migrations/2023_11_06_122033_create_asset_statuses_table.php

@ -17,10 +17,10 @@ return new class extends Migration
$table->date('exit_at')->nullable(); $table->date('exit_at')->nullable();
$table->date('est_pengembalian')->nullable(); $table->date('est_pengembalian')->nullable();
$table->string('exit_pic', 200)->nullable(); $table->string('exit_pic', 200)->nullable();
$table->bigInteger('exit_warehouse')->unsigned()->nullable(); $table->foreignUuid('exit_warehouse')->nullable()->constrained('m_warehouses');
$table->date('enter_at')->nullable(); $table->date('enter_at')->nullable();
$table->string('enter_pic', 200)->nullable(); $table->string('enter_pic', 200)->nullable();
$table->bigInteger('enter_warehouse')->unsigned()->nullable(); $table->foreignUuid('enter_warehouse')->nullable()->constrained('m_warehouses');
$table->string('kondisi_peti')->nullable(); $table->string('kondisi_peti')->nullable();
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();

5
database/migrations/2023_11_08_132316_create_transfers_table.php

@ -14,7 +14,10 @@ return new class extends Migration
Schema::create('transfers', function (Blueprint $table) { Schema::create('transfers', function (Blueprint $table) {
$table->uuid('id')->primary(); $table->uuid('id')->primary();
$table->foreignUuid('peti_id')->nullable()->constrained('petis')->onDelete('set null'); $table->foreignUuid('peti_id')->nullable()->constrained('petis')->onDelete('set null');
$table->date('tanggal')->nullable(); $table->foreignUuid('name_customer')->nullable()->constrained('customers');
$table->foreignUuid('source_warehouse')->nullable()->constrained('m_warehouses');
$table->foreignUuid('destination_warehouse')->nullable()->constrained('m_warehouses');
$table->date('date')->nullable();
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();
$table->string('created_by', 200)->nullable(); $table->string('created_by', 200)->nullable();

1
database/seeders/DatabaseSeeder.php

@ -27,6 +27,7 @@ class DatabaseSeeder extends Seeder
Type_Peti::class, Type_Peti::class,
Customer::class, Customer::class,
Kondisi_PetiSeeder::class, Kondisi_PetiSeeder::class,
PetiSeeder::class,
]); ]);
} }
} }

55
database/seeders/PetiSeeder.php

@ -0,0 +1,55 @@
<?php
namespace Database\Seeders;
use Illuminate\Support\Str;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
class PetiSeeder extends Seeder
{
/**
* Run the database seeds.
*/
// public function run(): void
// {
// //
// }
public function run()
{
// Generate 5 dummy data
for ($i = 0; $i < 5; $i++) {
DB::table('petis')->insert([
'id' => Str::uuid(),
'id_incre' => $i + 1, // Increment id_incre from 1 to 5
'tipe_peti_id' => $this->getRandomId('type_petis'),
'warna' => 'Dummy Warna ' . ($i + 1),
'fix_lot' => 'Dummy Fix Lot ' . ($i + 1),
'packing_no' => rand(1, 100),
'customer_id' => $this->getRandomId('customers'),
'jumlah' => rand(1, 10),
'date_pembuatan' => now(),
'warehouse_id' => $this->getRandomId('m_warehouses'),
'kondisipeti_id' => $this->getRandomId('kondisi_petis'),
'created_at' => now(),
'updated_at' => now(),
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
]);
}
}
/**
* Get a random ID from a specific table
*
* @param string $tableName
* @return string|null
*/
private function getRandomId($tableName)
{
$record = DB::table($tableName)->inRandomOrder()->first();
return $record ? $record->id : null;
}
}

2
database/seeders/WarehouseSeeder.php

@ -16,6 +16,7 @@ class WarehouseSeeder extends Seeder
// Warehouse 1 // Warehouse 1
m_warehouse::create([ m_warehouse::create([
'id' => 'd961ad96-211b-4f68-9ff2-111111111111', 'id' => 'd961ad96-211b-4f68-9ff2-111111111111',
'id_incre' => 1,
'name' => 'Gudang A', 'name' => 'Gudang A',
'description' => 'Gudang utama', 'description' => 'Gudang utama',
'address' => 'Alamat Gudang A', 'address' => 'Alamat Gudang A',
@ -26,6 +27,7 @@ class WarehouseSeeder extends Seeder
// Warehouse 2 // Warehouse 2
m_warehouse::create([ m_warehouse::create([
'id' => 'a5c7b207-1a1c-43b8-89bf-222222222222', 'id' => 'a5c7b207-1a1c-43b8-89bf-222222222222',
'id_incre' => 2,
'name' => 'Gudang B', 'name' => 'Gudang B',
'description' => 'Gudang cabang', 'description' => 'Gudang cabang',
'address' => 'Alamat Gudang B', 'address' => 'Alamat Gudang B',

12
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/all_print.blade.php

@ -57,12 +57,20 @@
@foreach ($peti as $item => $data) @foreach ($peti as $item => $data)
<?php <?php
// $qrcode = base64_encode(
// QrCode::format('svg')
// ->size(150)
// ->errorCorrection('H')
// ->generate($data->fix_lot . ';' . $data->id_incre . ';' . $data->warehouse->id_incre),
// );
$qrcode = base64_encode( $qrcode = base64_encode(
QrCode::format('svg') QrCode::format('svg')
->size(150) ->size(150)
->errorCorrection('H') // ->errorCorrection('H')
->generate($data->fix_lot . ';' . $data->id . ';' . $data->warehouse_id), ->generate($data->fix_lot . ';' . $data->id_incre . ';' . $data->warehouse->id_incre),
); );
?> ?>
<table style="width:100%; margin-top: 10px;" class="table table-bordered"> <table style="width:100%; margin-top: 10px;" class="table table-bordered">
<tr> <tr>

4
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php

@ -23,8 +23,8 @@
<span class="text">Tambah Peti</span> <span class="text">Tambah Peti</span>
</a> </a>
<form action="{{ route('dashboard.all-pdf.cetakpdf') }}" method="GET" id="pdfForm" <form action="{{ route('dashboard.all-pdf.cetakpdf') }}" method="GET" id="pdfForm" class="ml-2"
class="ml-2"> target="_blank">
@csrf @csrf
<input type="hidden" name="peti_ids" id="peti_ids" value=""> <input type="hidden" name="peti_ids" id="peti_ids" value="">
<button type="submit" class="btn btn-primary">Cetak PDF</button> <button type="submit" class="btn btn-primary">Cetak PDF</button>

2
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/show.blade.php

@ -36,7 +36,7 @@
<label for="fix_lot" class="col-form-label d-flex justify-content-center align-items-center">QR <label for="fix_lot" class="col-form-label d-flex justify-content-center align-items-center">QR
Code:</label> Code:</label>
<div class="d-flex justify-content-center align-items-center mb-2"> <div class="d-flex justify-content-center align-items-center mb-2">
{!! QrCode::size(150)->generate($peti->fix_lot . ';' . $peti->id . ';' . $peti->warehouse->id) !!} {!! QrCode::size(150)->generate($peti->fix_lot . ';' . $peti->id_incre . ';' . $peti->warehouse->id_incre) !!}
</div> </div>
<div class="d-flex justify-content-center mt-2 mb-3"> <div class="d-flex justify-content-center mt-2 mb-3">
<a href="{{ route('dashboard.peticetakpdf.cetakpdf', $peti->id) }}" class="btn btn-info" <a href="{{ route('dashboard.peticetakpdf.cetakpdf', $peti->id) }}" class="btn btn-info"

69
resources/views/dashboard/Transfer/create.blade.php

@ -26,26 +26,29 @@
@endforeach @endforeach
</select> </select>
<label for="tanggal" class="col-form-label">Tanggal Transfer: <span <label for="date" class="col-form-label">Tanggal Transfer: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input class="form-control" name="tanggal" type="date" id="tanggal" value="{{ old('tanggal') }}" <input class="form-control" name="date" type="date" id="date" value="{{ old('date') }}">
required>
<label for="name" class="col-form-label">Customer: <span class="text-danger">*</span></label> <label for="name_customer" class="col-form-label">Customer: <span class="text-danger">*</span></label>
<input class="form-control" name="name" type="text" id="name" <select class="form-control" name="name_customer" type="text" id="name_customer">
placeholder="Nama Customer akan otomatis terpilih ketika memilih detail peti."> <option disabled selected>Nama Customer akan otomatis terpilih ketika memilih detail peti.</option>
@foreach ($customer as $data_customer)
<option value="{{ $data_customer->id }}">{{ $data_customer->name }}</option>
@endforeach
</select>
<label for="exit_warehouse" class="col-form-label">Asal Gudang: <span <label for="source_warehouse" class="col-form-label">Asal Gudang: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<select class="form-control" name="exit_warehouse" type="text" id="exit_warehouse" required> <select class="form-control" name="source_warehouse" type="text" id="source_warehouse">
<option disabled selected>Pilih Asal Gudang</option> <option disabled selected>Pilih Asal Gudang</option>
@foreach ($warehouse as $data) @foreach ($warehouse as $data)
<option value="{{ $data->id }}">{{ $data->name }}</option> <option value="{{ $data->id }}">{{ $data->name }}</option>
@endforeach @endforeach
</select> </select>
<label for="exit_warehouse" class="col-form-label">Tujuan Gudang: <span <label for="destination_warehouse" class="col-form-label">Tujuan Gudang: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<select class="form-control" name="exit_warehouse" type="text" id="" required> <select class="form-control" name="destination_warehouse" type="text">
<option disabled selected>Pilih Tujuan Gudang</option> <option disabled selected>Pilih Tujuan Gudang</option>
@foreach ($warehouse as $data) @foreach ($warehouse as $data)
<option value="{{ $data->id }}">{{ $data->name }}</option> <option value="{{ $data->id }}">{{ $data->name }}</option>
@ -73,10 +76,10 @@
const petiSelect = document.getElementById('peti_id'); const petiSelect = document.getElementById('peti_id');
// Mendapatkan elemen select asal gudang // Mendapatkan elemen select asal gudang
const exitWarehouseSelect = document.getElementById('exit_warehouse'); const source_warehouseSelect = document.getElementById('source_warehouse');
// Mendapatkan elemen input Customer // Mendapatkan elemen select Customer
const nameInput = document.getElementById('name'); const name_customerSelect = document.getElementById('name_customer');
// Menambahkan event listener ke select detail peti // Menambahkan event listener ke select detail peti
petiSelect.addEventListener('change', function() { petiSelect.addEventListener('change', function() {
@ -88,10 +91,44 @@
const customerName = selectedOption.getAttribute('data-customer-name'); const customerName = selectedOption.getAttribute('data-customer-name');
// Memilih asal gudang berdasarkan data-warehouse-id // Memilih asal gudang berdasarkan data-warehouse-id
exitWarehouseSelect.value = warehouseId; source_warehouseSelect.value = warehouseId;
// Mengisi input Customer dengan nama pelanggan // Memilih customer berdasarkan data-customer-name
nameInput.value = customerName; for (let i = 0; i < name_customerSelect.options.length; i++) {
if (name_customerSelect.options[i].text === customerName) {
name_customerSelect.selectedIndex = i;
break;
}
}
}); });
</script> </script>
{{-- <script>
// Mendapatkan elemen select detail peti
const petiSelect = document.getElementById('peti_id');
// Mendapatkan elemen select asal gudang
const source_warehouseSelect = document.getElementById('source_warehouse');
// Mendapatkan elemen input Customer
const name_customerInput = document.getElementById('name_customer');
// Menambahkan event listener ke select detail peti
petiSelect.addEventListener('change', function() {
// Mendapatkan data-warehouse-id dari option yang dipilih
const selectedOption = this.options[this.selectedIndex];
const warehouseId = selectedOption.getAttribute('data-warehouse-id');
// Mendapatkan data-customer-name dari option yang dipilih
const customerName = selectedOption.getAttribute('data-customer-id');
// Memilih asal gudang berdasarkan data-warehouse-id
source_warehouseSelect.value = warehouseId;
// Mengisi input Customer dengan nama pelanggan
name_customerInput.value = customerName;
});
</script> --}}
@endsection @endsection

52
resources/views/dashboard/Transfer/index.blade.php

@ -39,13 +39,17 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@php
$notransfer = 1;
@endphp
@foreach ($transfer as $data_transfer)
<tr> <tr>
<td>1</td> <td>{{ $notransfer++ }}</td>
<td>kode dari Peti</td> <td>{{ $data_transfer->peti->fix_lot }}</td>
<td>Gunawan</td> <td>{{ $data_transfer->customer->name ?? '' }}</td>
<td>13-11-2023</td> <td>{{ \Carbon\Carbon::parse($data_transfer->date)->format('d/m/Y') }}</td>
<td>Gudang A</td> <td>{{ $data_transfer->sourceWarehouse->name ?? '' }}</td>
<td>Gudang B</td> <td>{{ $data_transfer->destinationWarehouse->name }}</td>
<td class="text-center"> <td class="text-center">
<a href="#" title="Edit"> <a href="#" title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i> <i class="fa fa-edit mr-2" style="font-size: 20px"></i>
@ -61,41 +65,7 @@
</form> </form>
</td> </td>
</tr> </tr>
{{-- @php @endforeach
$no_peminjaman = 1;
@endphp
@forelse ($peminjaman as $data_peminjaman)
@if ($data_peminjaman->enter_warehouse == null)
<tr>
<td class="text-center">{{ $no_peminjaman++ }}</td>
<td>{{ $data_peminjaman->peti->fix_lot }}</td>
<td>{{ $data_peminjaman->peti->customer->name }}</td>
<td>{{ $data_peminjaman->peti->customer->code_customer }} -
{{ $data_peminjaman->peti->tipe_peti->type }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td>
<td class="text-center">
<a href="{{ route('dashboard.peminjaman.edit', $data_peminjaman->id) }}"
title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form action="{{ route('dashboard.peminjaman.destroy', $data_peminjaman->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
title="Delete" style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr>
@endif
@empty
<p>Data Kosong</p>
@endforelse --}}
</tbody> </tbody>
</table> </table>
</div> </div>

2
resources/views/layouts/sidebar.blade.php

@ -27,7 +27,7 @@
<li class="nav-item {{ $active == 'menu-peminjaman' ? 'active' : '' }}"> <li class="nav-item {{ $active == 'menu-peminjaman' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.peminjaman.index') }}"> <a class="nav-link" href="{{ route('dashboard.peminjaman.index') }}">
<i class="fas fa-fw fa-upload"></i> <i class="fas fa-fw fa-upload"></i>
<span>Peminjaman Gunawan</span> <span>Peminjaman</span>
</a> </a>
</li> </li>
<li class="nav-item {{ $active == 'menu-pengembalian' ? 'active' : '' }}"> <li class="nav-item {{ $active == 'menu-pengembalian' ? 'active' : '' }}">

Loading…
Cancel
Save