Browse Source

update kedua revisi 17 desember

master
Gunawan19621 1 year ago
parent
commit
08b155c91b
  1. 4
      app/Exports/KondisiPetiExport.php
  2. 31
      app/Exports/PetternLotPetiExport.php
  3. 10
      app/Http/Controllers/CustomerController.php
  4. 3
      app/Http/Controllers/DisposalController.php
  5. 4
      app/Http/Controllers/HistoryController.php
  6. 4
      app/Http/Controllers/KondisiPetiController.php
  7. 14
      app/Http/Controllers/PeminjamanController.php
  8. 69
      app/Http/Controllers/PengembalianController.php
  9. 4
      app/Http/Controllers/PetiController.php
  10. 3
      app/Http/Controllers/Report/PetternLotPetiController.php
  11. 94
      app/Http/Controllers/TransferController.php
  12. 9
      app/Http/Controllers/TypePetiController.php
  13. 12
      app/Http/Controllers/WarehouseController.php
  14. 3
      app/Http/Requests/ValidasiCreatePeminjaman.php
  15. 3
      app/Http/Requests/ValidasiUpdatePeminjaman.php
  16. 6
      app/Http/Requests/ValidasiUpdatePengembalian.php
  17. 1
      app/Imports/CustomerImport.php
  18. 1
      app/Imports/KondisiPetiImport.php
  19. 1
      app/Imports/TipePetiImport.php
  20. 4
      app/Models/Peti.php
  21. 12
      app/Models/asset_status.php
  22. 23
      database/migrations/2023_11_06_122033_create_asset_statuses_table.php
  23. 2
      public/assets/file/Format_Import_Tipe_Peti.csv
  24. BIN
      public/assets/img/logo_istw.png
  25. 8
      resources/views/dashboard/History/Peminjaman/index.blade.php
  26. 12
      resources/views/dashboard/History/Pengembalian/index.blade.php
  27. 2
      resources/views/dashboard/History/Transfer/index.blade.php
  28. 6
      resources/views/dashboard/Master_Data/Customer/create.blade.php
  29. 5
      resources/views/dashboard/Master_Data/Customer/edit.blade.php
  30. 2
      resources/views/dashboard/Master_Data/Customer/index.blade.php
  31. 4
      resources/views/dashboard/Master_Data/Customer/show.blade.php
  32. 9
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php
  33. 10
      resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/detail_peti.blade.php
  34. 13
      resources/views/dashboard/Peminjaman/create.blade.php
  35. 22
      resources/views/dashboard/Peminjaman/edit.blade.php
  36. 6
      resources/views/dashboard/Peminjaman/index.blade.php
  37. 17
      resources/views/dashboard/Peminjaman/pengembalian.blade.php
  38. 15
      resources/views/dashboard/Pengembalian/edit.blade.php
  39. 12
      resources/views/dashboard/Pengembalian/index.blade.php
  40. 18
      resources/views/dashboard/Transfer/edit.blade.php

4
app/Exports/KondisiPetiExport.php

@ -24,7 +24,7 @@ class KondisiPetiExport implements FromCollection, WithHeadings
$data = $kondisipetis->map(function ($kondisipeti) use (&$nomor) { $data = $kondisipetis->map(function ($kondisipeti) use (&$nomor) {
return [ return [
'No' => $kondisipeti->id, 'No' => $kondisipeti->id,
'Nama Kondisi' => $kondisipeti->nama_kondisi, 'Kondisi Peti' => $kondisipeti->nama_kondisi,
'Deskripsi' => $kondisipeti->deskripsi_kondisi, 'Deskripsi' => $kondisipeti->deskripsi_kondisi,
]; ];
}); });
@ -36,7 +36,7 @@ class KondisiPetiExport implements FromCollection, WithHeadings
{ {
return [ return [
'No', 'No',
'NAMA KONDISI', 'KONDISI PETI',
'DESKRIPSI', 'DESKRIPSI',
]; ];
} }

31
app/Exports/PetternLotPetiExport.php

@ -16,9 +16,12 @@ class PetternLotPetiExport implements FromCollection, WithHeadings
'warehouse_id', 'warehouse_id',
'jumlah', 'jumlah',
'tipe_peti_id', 'tipe_peti_id',
'kondisipeti_id',
'packing_no', 'packing_no',
'fix_lot', 'fix_lot',
'status' 'status_isi',
'warna',
'status',
)->get(); )->get();
// Inisialisasi nomor awal // Inisialisasi nomor awal
@ -29,14 +32,17 @@ class PetternLotPetiExport implements FromCollection, WithHeadings
return [ return [
'No' => $nomor++, 'No' => $nomor++,
'FIX LOT' => $peti->fix_lot, 'FIX LOT' => $peti->fix_lot,
'Customer' => $peti->customer->name, 'CUSTOMER' => $peti->customer->name,
'Warehouse' => $peti->warehouse->name, 'KODE CUSTOMER' => $peti->customer->code_customer,
'CODE CUSTOMER' => $peti->customer->code_customer, 'TIPE PETI' => $peti->tipe_peti->type,
'TYPE PETI' => $peti->tipe_peti->type,
'UKURAN PETI' => $peti->tipe_peti->size_peti, 'UKURAN PETI' => $peti->tipe_peti->size_peti,
'LOT NO' => $peti->customer->lot_no, 'LOT NO' => $peti->customer->lot_no,
'PACKING NO' => $peti->packing_no, 'PACKING NO' => $peti->packing_no,
'Status' => $peti->status, 'GUDANG' => $peti->warehouse->name,
'KONDISI PETI' => $peti->kondisipeti->nama_kondisi,
'ISI PETI' => $peti->status_isi,
'WARNA PETI' => $peti->warna,
'STATUS' => $peti->status,
]; ];
}); });
@ -48,14 +54,17 @@ class PetternLotPetiExport implements FromCollection, WithHeadings
return [ return [
'No', 'No',
'FIX LOT', 'FIX LOT',
'Customer', 'CUSTOMER',
'WH', 'KODE CUSTOMER',
'CODE CUSTOMER', 'TIPE PETI',
'TYPE PETI',
'UKURAN PETI', 'UKURAN PETI',
'LOT NO', 'LOT NO',
'PACKING NO', 'PACKING NO',
'STATUS' 'GUDANG',
'KONDISI PETI',
'ISI PETI',
'WARNA PETI',
'STATUS',
]; ];
} }
} }

10
app/Http/Controllers/CustomerController.php

@ -44,6 +44,11 @@ class CustomerController extends Controller
try { try {
$currentUser = Auth::user(); $currentUser = Auth::user();
$validatedData = $request->except('_token'); $validatedData = $request->except('_token');
$validatedData['name'] = strtoupper($validatedData['name']);
$validatedData['code_customer'] = strtoupper($validatedData['code_customer']);
$validatedData['lot_no'] = strtoupper($validatedData['lot_no']);
$validatedData['address'] = strtoupper($validatedData['address']);
$validatedData['created_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai created_by $validatedData['created_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai created_by
$validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by $validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by
Customer::create($validatedData); Customer::create($validatedData);
@ -87,6 +92,11 @@ class CustomerController extends Controller
$customerData = $request->all(); $customerData = $request->all();
// Menambahkan nama pengguna yang melakukan pembaruan // Menambahkan nama pengguna yang melakukan pembaruan
$customerData['name'] = strtoupper($customerData['name']);
$customerData['code_customer'] = strtoupper($customerData['code_customer']);
$customerData['lot_no'] = strtoupper($customerData['lot_no']);
$customerData['address'] = strtoupper($customerData['address']);
$customerData['updated_by'] = Auth::user()->fullname; $customerData['updated_by'] = Auth::user()->fullname;
$customer->update($customerData); $customer->update($customerData);

3
app/Http/Controllers/DisposalController.php

@ -68,6 +68,7 @@ class DisposalController extends Controller
$validatedData['mobile_id'] = Uuid::v4(); // Menambahkan ID Mobile $validatedData['mobile_id'] = Uuid::v4(); // Menambahkan ID Mobile
$validatedData['created_by'] = $currentUser->fullname; $validatedData['created_by'] = $currentUser->fullname;
$validatedData['updated_by'] = $currentUser->fullname; $validatedData['updated_by'] = $currentUser->fullname;
$validatedData['description'] = strtoupper($validatedData['description']);
$validatedData['status_disposal'] = 'INAKTIF'; $validatedData['status_disposal'] = 'INAKTIF';
// Membuat entitas Disposal // Membuat entitas Disposal
$disposal = Disposal::create($validatedData); $disposal = Disposal::create($validatedData);
@ -114,6 +115,8 @@ class DisposalController extends Controller
// Menambahkan informasi pengguna ke dalam data yang akan disimpan // Menambahkan informasi pengguna ke dalam data yang akan disimpan
$validatedData['updated_by'] = $currentUser->fullname; $validatedData['updated_by'] = $currentUser->fullname;
$validatedData['description'] = strtoupper($validatedData['description']);
// Mencari transfer berdasarkan ID // Mencari transfer berdasarkan ID
$disposal = Disposal::find($id); $disposal = Disposal::find($id);

4
app/Http/Controllers/HistoryController.php

@ -16,7 +16,7 @@ class HistoryController extends Controller
{ {
$perPage = $request->input('perPage', 5); $perPage = $request->input('perPage', 5);
$query = asset_status::with(['customer', 'warehouseId', 'warehouse', 'warehouseEnter', 'kondisi_peti']) $query = asset_status::with(['customer', 'warehouse', 'warehouseEnter', 'kondisi_peti'])
->orderBy('created_at', 'desc'); ->orderBy('created_at', 'desc');
//logika pencarian //logika pencarian
@ -110,7 +110,7 @@ class HistoryController extends Controller
public function historyPengembalian(Request $request) public function historyPengembalian(Request $request)
{ {
$perPage = $request->input('perPage', 5); $perPage = $request->input('perPage', 5);
$query = asset_status::with(['customer', 'warehouseId', 'warehouse', 'warehouseEnter', 'kondisi_peti']) $query = asset_status::with(['customer', 'warehouse', 'warehouseEnter', 'kondisi_peti'])
->where('status', '=', 1) ->where('status', '=', 1)
->orderBy('created_at', 'desc'); ->orderBy('created_at', 'desc');

4
app/Http/Controllers/KondisiPetiController.php

@ -27,6 +27,8 @@ class KondisiPetiController extends Controller
try { try {
$currentUser = Auth::user(); $currentUser = Auth::user();
$validatedData = $request->except('_token'); $validatedData = $request->except('_token');
$validatedData['nama_kondisi'] = strtoupper($validatedData['nama_kondisi']); // Menggunakan nama pengguna sebagai created_by
$validatedData['deskripsi_kondisi'] = strtoupper($validatedData['deskripsi_kondisi']); // Menggunakan nama pengguna sebagai created_by
$validatedData['created_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai created_by $validatedData['created_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai created_by
$validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by $validatedData['updated_by'] = $currentUser->fullname; // Menggunakan nama pengguna sebagai updated_by
// dd($validatedData); // dd($validatedData);
@ -44,6 +46,8 @@ class KondisiPetiController extends Controller
$kondisiPeti = Kondisi_Peti::findOrFail($id); $kondisiPeti = Kondisi_Peti::findOrFail($id);
$validatedData = $request->except('_token'); $validatedData = $request->except('_token');
$validatedData['nama_kondisi'] = strtoupper($validatedData['nama_kondisi']); // Menggunakan nama pengguna sebagai created_by
$validatedData['deskripsi_kondisi'] = strtoupper($validatedData['deskripsi_kondisi']);
$validatedData['updated_by'] = $currentUser->fullname; $validatedData['updated_by'] = $currentUser->fullname;
$kondisiPeti->update($validatedData); $kondisiPeti->update($validatedData);

14
app/Http/Controllers/PeminjamanController.php

@ -25,7 +25,7 @@ class PeminjamanController extends Controller
{ {
$perPage = $request->input('perPage', 5); $perPage = $request->input('perPage', 5);
$query = asset_status::with(['customer', 'warehouseId', 'warehouse', 'warehouseEnter', 'kondisi_peti']) $query = asset_status::with(['customer', 'warehouse', 'warehouseEnter', 'kondisi_peti'])
->where('status', '=', 0) ->where('status', '=', 0)
->orderBy('created_at', 'desc'); ->orderBy('created_at', 'desc');
@ -117,7 +117,6 @@ class PeminjamanController extends Controller
return view('dashboard.Peminjaman.index', $data); return view('dashboard.Peminjaman.index', $data);
} }
/** /**
* Halaman tambah data * Halaman tambah data
*/ */
@ -215,6 +214,7 @@ class PeminjamanController extends Controller
'peminjaman' => asset_status::findOrFail($id), 'peminjaman' => asset_status::findOrFail($id),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
'kondisiPeti' => Kondisi_Peti::get(), 'kondisiPeti' => Kondisi_Peti::get(),
'customer' => Customer::get(),
'active' => 'menu-pengembalian', 'active' => 'menu-pengembalian',
]; ];
return view('dashboard.Peminjaman.pengembalian', $data); return view('dashboard.Peminjaman.pengembalian', $data);
@ -284,7 +284,7 @@ class PeminjamanController extends Controller
$petiId = $request->get('peti_id'); $petiId = $request->get('peti_id');
// Fetch customer data and warehouse based on the selected peti // Fetch customer data and warehouse based on the selected peti
$peti = Peti::with(['customer', 'warehouse']) $peti = Peti::with(['customer', 't_warehouse'])
->where('id', $petiId) ->where('id', $petiId)
->first(); ->first();
@ -305,16 +305,16 @@ class PeminjamanController extends Controller
$selectedCustomer = $peti->customer->id; $selectedCustomer = $peti->customer->id;
} }
if ($peti && $peti->warehouse) { if ($peti && $peti->t_warehouse) {
// Extract warehouse data from the related relationship // Extract warehouse data from the related relationship
$warehouseData[] = [ $warehouseData[] = [
'id' => $peti->warehouse->id, 'id' => $peti->t_warehouse->id,
'name' => $peti->warehouse->name, 'name' => $peti->t_warehouse->name,
// Add any other fields you want to include // Add any other fields you want to include
]; ];
// Set the selectedWarehouse to the warehouse id // Set the selectedWarehouse to the warehouse id
$selectedWarehouse = $peti->warehouse->id; $selectedWarehouse = $peti->t_warehouse->id;
} }
return response()->json([ return response()->json([

69
app/Http/Controllers/PengembalianController.php

@ -3,6 +3,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\Peti; use App\Models\Peti;
use App\Models\Customer;
use App\Models\m_warehouse; use App\Models\m_warehouse;
use App\Models\asset_status; use App\Models\asset_status;
use App\Models\Kondisi_Peti; use App\Models\Kondisi_Peti;
@ -18,7 +19,7 @@ class PengembalianController extends Controller
public function index(Request $request) public function index(Request $request)
{ {
$perPage = $request->input('perPage', 5); $perPage = $request->input('perPage', 5);
$query = asset_status::with(['customer', 'warehouseId', 'warehouse', 'warehouseEnter', 'kondisi_peti']) $query = asset_status::with(['customer', 'warehouse', 'warehouseEnter', 'kondisi_peti'])
->where('status', '=', 1) ->where('status', '=', 1)
->join(DB::raw('(SELECT peti_id, MAX(updated_at) as latest_update FROM asset_statuses GROUP BY peti_id) as latest_peti'), function ($join) { ->join(DB::raw('(SELECT peti_id, MAX(updated_at) as latest_update FROM asset_statuses GROUP BY peti_id) as latest_peti'), function ($join) {
$join->on('asset_statuses.peti_id', '=', 'latest_peti.peti_id') $join->on('asset_statuses.peti_id', '=', 'latest_peti.peti_id')
@ -162,6 +163,7 @@ class PengembalianController extends Controller
'peminjaman' => asset_status::findOrFail($id), 'peminjaman' => asset_status::findOrFail($id),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
'kondisiPeti' => Kondisi_Peti::get(), 'kondisiPeti' => Kondisi_Peti::get(),
'customer' => Customer::get(),
'active' => 'menu-pengembalian', 'active' => 'menu-pengembalian',
]; ];
return view('dashboard.Pengembalian.edit', $data); return view('dashboard.Pengembalian.edit', $data);
@ -174,23 +176,32 @@ class PengembalianController extends Controller
{ {
// dd($request); // dd($request);
try { try {
// Mendapatkan informasi pengguna yang sedang login
$currentUser = Auth::user();
// Validasi data dari request
$validatedData = $request->validated();
$peminjaman = asset_status::findOrFail($id); $peminjaman = asset_status::findOrFail($id);
// Update atribut-atribut yang diperlukan $validatedData['updated_by'] = $currentUser->fullname;
$peminjaman->enter_pic = Auth::user()->fullname; $validatedData['enter_pic'] = $currentUser->fullname;
$peminjaman->updated_by = Auth::user()->fullname; $validatedData['status'] = 1;
$peminjaman->peti_id = $request->input('peti_id'); $peminjaman = asset_status::find($id);
$peminjaman->exit_at = $request->input('exit_at');
$peminjaman->est_pengembalian = $request->input('est_pengembalian'); if (!$peminjaman) {
$peminjaman->exit_warehouse = $request->input('exit_warehouse'); return redirect()->route('dashboard.peminjaman.index')->with('error', 'Proses Pengembalian Peti tidak ditemukan');
$peminjaman->enter_at = $request->input('enter_at'); }
$peminjaman->enter_warehouse = $request->input('enter_warehouse'); // dd($validatedData);
$peminjaman->kondisi_peti_id = $request->input('kondisi_peti_id'); $peminjaman->update($validatedData);
// Mengatur status menjadi 1 secara otomatis
$peminjaman->status = 1;
// dd($peminjaman); // dd($peminjaman);
$peminjaman->save(); // Mengupdate warehouse_id pada model Peti
Peti::where('id', $peminjaman->peti_id)
->update([
't_warehouse_id' => $peminjaman->enter_warehouse,
// 'customer_id' => $transfer->name_customer,
'updated_by' => $currentUser->fullname,
]);
return redirect()->route('dashboard.pengembalian.index')->with('success', 'Data peminjaman berhasil diperbaharui'); return redirect()->route('dashboard.pengembalian.index')->with('success', 'Data peminjaman berhasil diperbaharui');
} catch (\Throwable $th) { } catch (\Throwable $th) {
@ -198,6 +209,34 @@ class PengembalianController extends Controller
return redirect()->back()->with('error', 'Data peminjaman gagal diperbaharui: ' . $th->getMessage()); return redirect()->back()->with('error', 'Data peminjaman gagal diperbaharui: ' . $th->getMessage());
} }
} }
// public function update(ValidasiUpdatePengembalian $request, $id)
// {
// dd($request);
// try {
// $peminjaman = asset_status::findOrFail($id);
// // Update atribut-atribut yang diperlukan
// $peminjaman->enter_pic = Auth::user()->fullname;
// $peminjaman->updated_by = Auth::user()->fullname;
// $peminjaman->peti_id = $request->input('peti_id');
// $peminjaman->exit_at = $request->input('exit_at');
// $peminjaman->est_pengembalian = $request->input('est_pengembalian');
// $peminjaman->exit_warehouse = $request->input('exit_warehouse');
// $peminjaman->enter_at = $request->input('enter_at');
// $peminjaman->enter_warehouse = $request->input('enter_warehouse');
// $peminjaman->kondisi_peti_id = $request->input('kondisi_peti_id');
// // Mengatur status menjadi 1 secara otomatis
// $peminjaman->status = 1;
// // dd($peminjaman);
// $peminjaman->save();
// return redirect()->route('dashboard.pengembalian.index')->with('success', 'Data peminjaman berhasil diperbaharui');
// } catch (\Throwable $th) {
// // Tampilkan pesan kesalahan untuk debugging
// return redirect()->back()->with('error', 'Data peminjaman gagal diperbaharui: ' . $th->getMessage());
// }
// }
/** /**
* Remove the specified resource from storage. * Remove the specified resource from storage.

4
app/Http/Controllers/PetiController.php

@ -198,15 +198,13 @@ class PetiController extends Controller
// Generate nilai 'fix_lot' sesuai format yang diinginkan // Generate nilai 'fix_lot' sesuai format yang diinginkan
$fixLot = $code_customer . $type . $size_peti . $lot_no . $packing_no; $fixLot = $code_customer . $type . $size_peti . $lot_no . $packing_no;
$validatedData['fix_lot'] = $fixLot; $validatedData['fix_lot'] = $fixLot;
$validatedData['warna'] = strtoupper($validatedData['warna']);
$validatedData['updated_by'] = $currentuser->fullname; $validatedData['updated_by'] = $currentuser->fullname;
$validatedData['t_warehouse_id'] = $validatedData['warehouse_id']; $validatedData['t_warehouse_id'] = $validatedData['warehouse_id'];
// Tambahkan perubahan yang diperlukan ke entitas Peti // Tambahkan perubahan yang diperlukan ke entitas Peti
$typepeti->update($validatedData); $typepeti->update($validatedData);
// // Menambahkan nama pengguna yang melakukan pembaruan
// $typepeti->update(['updated_by' => $currentuser->fullname]);
return redirect()->route('dashboard.peti.index')->with('success', 'Data peti berhasil diperbaharui'); return redirect()->route('dashboard.peti.index')->with('success', 'Data peti berhasil diperbaharui');
} catch (\Throwable $th) { } catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data peti gagal diperbaharui'); return redirect()->back()->with('error', 'Data peti gagal diperbaharui');

3
app/Http/Controllers/Report/PetternLotPetiController.php

@ -12,6 +12,7 @@ use App\Exports\PetternLotPetiExport;
class PetternLotPetiController extends Controller class PetternLotPetiController extends Controller
{ {
//report peti
public function index(Request $request) public function index(Request $request)
{ {
$perPage = $request->input('perPage', 5); $perPage = $request->input('perPage', 5);
@ -85,6 +86,6 @@ class PetternLotPetiController extends Controller
public function export() public function export()
{ {
// dd('test'); // dd('test');
return Excel::download(new PetternLotPetiExport, 'PATTERN_LOT_PETI.xlsx'); return Excel::download(new PetternLotPetiExport, 'REPORT_PETI.xlsx');
} }
} }

94
app/Http/Controllers/TransferController.php

@ -75,44 +75,21 @@ class TransferController extends Controller
$validatedData['updated_by'] = $currentUser->fullname; $validatedData['updated_by'] = $currentUser->fullname;
// Membuat entitas Transfer // Membuat entitas Transfer
Transfer::create($validatedData); $transfer = Transfer::create($validatedData);
// dd($transfer);
// Mengupdate warehouse_id pada model Peti
Peti::where('id', $transfer->peti_id)
->update([
't_warehouse_id' => $transfer->destination_warehouse,
'updated_by' => $currentUser->fullname,
// 'customer_id' => $transfer->name_customer, // tambahan update customer id
]);
return redirect()->route('dashboard.transfer.index')->with('success', 'Data Transfer Peti berhasil ditambahkan'); return redirect()->route('dashboard.transfer.index')->with('success', 'Data Transfer Peti berhasil ditambahkan');
} catch (\Throwable $th) { } catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data Transfer Peti gagal ditransfer'); return redirect()->back()->with('error', 'Data Transfer Peti gagal ditransfer');
} }
} }
//proses tambah data transfer beserta update data peti
// public function store(ValidasiCreateTransfer $request)
// {
// // dd($request);
// try {
// // Mendapatkan informasi pengguna yang sedang login
// $currentUser = Auth::user();
// // Validasi data dari request
// $validatedData = $request->validated();
// // Menambahkan informasi pengguna ke dalam data yang akan disimpan
// $validatedData['mobile_id'] = Uuid::v4(); // Menambahkan ID Mobile
// $validatedData['created_by'] = $currentUser->fullname;
// $validatedData['updated_by'] = $currentUser->fullname;
// // Membuat entitas Transfer
// $transfer = Transfer::create($validatedData);
// // dd($transfer);
// // Mengupdate warehouse_id pada model Peti
// Peti::where('id', $transfer->peti_id)
// ->update([
// 'warehouse_id' => $transfer->destination_warehouse,
// 'customer_id' => $transfer->name_customer, // tambahan update customer id
// ]);
// 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 ditransfer');
// }
// }
/** /**
* Show the form for editing the specified resource. * Show the form for editing the specified resource.
@ -155,46 +132,19 @@ class TransferController extends Controller
// Memperbarui data transfer // Memperbarui data transfer
$transfer->update($validatedData); $transfer->update($validatedData);
// Mengupdate warehouse_id pada model Peti
Peti::where('id', $transfer->peti_id)
->update([
't_warehouse_id' => $transfer->destination_warehouse,
// 'customer_id' => $transfer->name_customer,
'updated_by' => $currentUser->fullname,
]);
return redirect()->route('dashboard.transfer.index')->with('success', 'Data Transfer Peti berhasil diperbaharui'); return redirect()->route('dashboard.transfer.index')->with('success', 'Data Transfer Peti berhasil diperbaharui');
} catch (\Throwable $th) { } catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data Transfer Peti gagal diperbaharui'); return redirect()->back()->with('error', 'Data Transfer Peti gagal diperbaharui');
} }
} }
//proses tambah data transfer beserta update data peti
// public function update(ValidasiUpdateTransfer $request, $id)
// {
// try {
// // Mendapatkan informasi pengguna yang sedang login
// $currentUser = Auth::user();
// // Validasi data dari request
// $validatedData = $request->validated();
// // Menambahkan informasi pengguna ke dalam data yang akan disimpan
// $validatedData['updated_by'] = $currentUser->fullname;
// // Mencari transfer berdasarkan ID
// $transfer = Transfer::find($id);
// if (!$transfer) {
// return redirect()->route('dashboard.transfer.index')->with('error', 'Data Transfer Peti tidak ditemukan');
// }
// // Memperbarui data transfer
// $transfer->update($validatedData);
// // Mengupdate warehouse_id pada model Peti
// Peti::where('id', $transfer->peti_id)
// ->update([
// 'warehouse_id' => $transfer->destination_warehouse,
// 'customer_id' => $transfer->name_customer,
// ]);
// return redirect()->route('dashboard.transfer.index')->with('success', 'Data Transfer Peti berhasil diperbaharui');
// } catch (\Throwable $th) {
// return redirect()->back()->with('error', 'Data Transfer Peti gagal diperbaharui');
// }
// }
/** /**
* Remove the specified resource from storage. * Remove the specified resource from storage.
@ -268,7 +218,7 @@ class TransferController extends Controller
$petiId = $request->get('peti_id'); $petiId = $request->get('peti_id');
// Fetch customer data and warehouse based on the selected peti // Fetch customer data and warehouse based on the selected peti
$peti = Peti::with(['customer', 'warehouse']) $peti = Peti::with(['customer', 't_warehouse'])
->where('id', $petiId) ->where('id', $petiId)
->first(); ->first();
@ -289,16 +239,16 @@ class TransferController extends Controller
$selectedCustomer = $peti->customer->id; $selectedCustomer = $peti->customer->id;
} }
if ($peti && $peti->warehouse) { if ($peti && $peti->t_warehouse) {
// Extract warehouse data from the related relationship // Extract warehouse data from the related relationship
$warehouseData[] = [ $warehouseData[] = [
'id' => $peti->warehouse->id, 'id' => $peti->t_warehouse->id,
'name' => $peti->warehouse->name, 'name' => $peti->t_warehouse->name,
// Add any other fields you want to include // Add any other fields you want to include
]; ];
// Set the selectedWarehouse to the warehouse id // Set the selectedWarehouse to the warehouse id
$selectedWarehouse = $peti->warehouse->id; $selectedWarehouse = $peti->t_warehouse->id;
} }
return response()->json([ return response()->json([

9
app/Http/Controllers/TypePetiController.php

@ -43,6 +43,10 @@ class TypePetiController extends Controller
try { try {
$currenttype = Auth::user(); $currenttype = Auth::user();
$validatedData = $request->except('_token'); $validatedData = $request->except('_token');
$validatedData['type'] = strtoupper($validatedData['type']);
$validatedData['size_peti'] = strtoupper($validatedData['size_peti']);
$validatedData['description'] = strtoupper($validatedData['description']);
$validatedData['created_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai created_by $validatedData['created_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai created_by
$validatedData['updated_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai updated_by $validatedData['updated_by'] = $currenttype->fullname; // Menggunakan nama pengguna sebagai updated_by
// dd($validatedData); // dd($validatedData);
@ -88,9 +92,12 @@ class TypePetiController extends Controller
$typepetiData = $request->all(); $typepetiData = $request->all();
// Menambahkan nama pengguna yang melakukan pembaruan // Menambahkan nama pengguna yang melakukan pembaruan
$typepetiData['type'] = strtoupper($typepetiData['type']);
$typepetiData['size_peti'] = strtoupper($typepetiData['size_peti']);
$typepetiData['description'] = strtoupper($typepetiData['description']);
$typepetiData['updated_by'] = Auth::user()->fullname; $typepetiData['updated_by'] = Auth::user()->fullname;
$typepeti->update($typepetiData); $typepeti->update($typepetiData);
return redirect()->route('dashboard.typepeti.index')->with('success', 'Data typepeti berhasil diperbaharui'); return redirect()->route('dashboard.typepeti.index')->with('success', 'Data typepeti berhasil diperbaharui');
} catch (\Throwable $th) { } catch (\Throwable $th) {
return redirect()->back()->with('error', 'Data typepeti gagal diperbaharui'); return redirect()->back()->with('error', 'Data typepeti gagal diperbaharui');

12
app/Http/Controllers/WarehouseController.php

@ -36,6 +36,10 @@ class WarehouseController extends Controller
$currentUser = Auth::user(); $currentUser = Auth::user();
$validatedData = $request->except('_token'); $validatedData = $request->except('_token');
$validatedData['name'] = strtoupper($validatedData['name']);
$validatedData['description'] = strtoupper($validatedData['description']);
$validatedData['address'] = strtoupper($validatedData['address']);
$validatedData['created_by'] = $currentUser->fullname; $validatedData['created_by'] = $currentUser->fullname;
$validatedData['updated_by'] = $currentUser->fullname; $validatedData['updated_by'] = $currentUser->fullname;
@ -54,10 +58,14 @@ class WarehouseController extends Controller
{ {
try { try {
$warehouse = m_warehouse::findOrFail($id); $warehouse = m_warehouse::findOrFail($id);
$warehouseData = $request->all();
$warehouseData['name'] = strtoupper($warehouseData['name']);
$warehouseData['description'] = strtoupper($warehouseData['description']);
$warehouseData['address'] = strtoupper($warehouseData['address']);
// Menambahkan nama pengguna yang melakukan pembaruan
$warehouseData['updated_by'] = Auth::user()->fullname;
$warehouse->update($request->all()); $warehouse->update($request->all());
// Menambahkan nama pengguna yang melakukan pembaruan
$userData['updated_by'] = Auth::user()->fullname;
return redirect()->back()->with('success', 'Data Gudang Berhasil Diperbaharui'); return redirect()->back()->with('success', 'Data Gudang Berhasil Diperbaharui');
} catch (\Throwable $th) { } catch (\Throwable $th) {

3
app/Http/Requests/ValidasiCreatePeminjaman.php

@ -27,7 +27,6 @@ class ValidasiCreatePeminjaman extends FormRequest
'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
'warehouse_id' => 'required|integer', // Pastikan warehouse_id ada dalam tabel m_warehouses 'warehouse_id' => 'required|integer', // Pastikan warehouse_id ada dalam tabel m_warehouses
'exit_warehouse' => 'required|integer',
]; ];
} }
@ -44,8 +43,6 @@ class ValidasiCreatePeminjaman extends FormRequest
'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.', 'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.',
'warehouse_id.required' => 'Bidang Asal Gudang wajib diisi.', 'warehouse_id.required' => 'Bidang Asal Gudang wajib diisi.',
'warehouse_id.integer' => 'Bidang Asal Gudang harus berupa angka.', 'warehouse_id.integer' => 'Bidang Asal Gudang harus berupa angka.',
'exit_warehouse.required' => 'Bidang Tujuan Gudang wajib diisi.',
'exit_warehouse.integer' => 'Bidang Tujuan Gudang harus berupa angka.',
]; ];
} }
} }

3
app/Http/Requests/ValidasiUpdatePeminjaman.php

@ -27,7 +27,6 @@ class ValidasiUpdatePeminjaman extends FormRequest
'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
'warehouse_id' => 'required|integer', // Pastikan warehouse_id ada dalam tabel m_warehouses 'warehouse_id' => 'required|integer', // Pastikan warehouse_id ada dalam tabel m_warehouses
'exit_warehouse' => 'required|integer',
]; ];
} }
@ -44,8 +43,6 @@ class ValidasiUpdatePeminjaman extends FormRequest
'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.', 'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.',
'warehouse_id.required' => 'Bidang Asal Gudang wajib diisi.', 'warehouse_id.required' => 'Bidang Asal Gudang wajib diisi.',
'warehouse_id.integer' => 'Bidang Asal Gudang harus berupa angka.', 'warehouse_id.integer' => 'Bidang Asal Gudang harus berupa angka.',
'exit_warehouse.required' => 'Bidang Tujuan Gudang wajib diisi.',
'exit_warehouse.integer' => 'Bidang Tujuan Gudang harus berupa angka.',
]; ];
} }
} }

6
app/Http/Requests/ValidasiUpdatePengembalian.php

@ -25,10 +25,10 @@ class ValidasiUpdatePengembalian extends FormRequest
'peti_id' => 'required|integer', 'peti_id' => 'required|integer',
'exit_at' => 'required|date', 'exit_at' => 'required|date',
'est_pengembalian' => 'required|date', 'est_pengembalian' => 'required|date',
'exit_warehouse' => 'required|integer',
'enter_at' => 'required|date', 'enter_at' => 'required|date',
'enter_warehouse' => 'required|integer', 'enter_warehouse' => 'required|integer',
'kondisi_peti_id' => 'required|integer', 'kondisi_peti_id' => 'required|integer',
'customer_id' => 'required|integer',
'status' => '', 'status' => '',
]; ];
} }
@ -42,14 +42,14 @@ class ValidasiUpdatePengembalian extends FormRequest
'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.integer' => 'Kolom exit_warehouse harus berupa angka.',
'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.', 'enter_warehouse.integer' => 'Kolom enter_warehouse harus berupa angka.',
'kondisi_peti_id.required' => 'Kolom kondisi_peti_id wajib diisi.', 'kondisi_peti_id.required' => 'Kolom kondisi_peti_id wajib diisi.',
'kondisi_peti_id.integer' => 'Kolom kondisi_peti_id harus berupa angka.', 'kondisi_peti_id.integer' => 'Kolom kondisi_peti_id harus berupa angka.',
'customer_id.required' => 'Kolom customer_id wajib diisi.',
'customer_id.integer' => 'Kolom customer_id harus berupa angka.',
]; ];
} }
} }

1
app/Imports/CustomerImport.php

@ -56,6 +56,7 @@ class CustomerImport implements ToModel, WithHeadingRow
'no_tlp' => $row['no_telepon'], 'no_tlp' => $row['no_telepon'],
'address' => strtoupper($row['alamat']), 'address' => strtoupper($row['alamat']),
'created_by' => $user->fullname, 'created_by' => $user->fullname,
'updated_by' => $user->fullname,
]); ]);
} }

1
app/Imports/KondisiPetiImport.php

@ -53,6 +53,7 @@ class KondisiPetiImport implements ToModel, WithHeadingRow
'nama_kondisi' => strtoupper($row['kondisi_peti']), 'nama_kondisi' => strtoupper($row['kondisi_peti']),
'deskripsi_kondisi' => strtoupper($row['deskripsi_kondisi']), 'deskripsi_kondisi' => strtoupper($row['deskripsi_kondisi']),
'created_by' => $user->fullname, 'created_by' => $user->fullname,
'updated_by' => $user->fullname,
]); ]);
} }

1
app/Imports/TipePetiImport.php

@ -55,6 +55,7 @@ class TipePetiImport implements ToModel, WithHeadingRow
'size_peti' => strtoupper($row['ukuran_peti']), 'size_peti' => strtoupper($row['ukuran_peti']),
'description' => strtoupper($row['deskripsi_tipe']), 'description' => strtoupper($row['deskripsi_tipe']),
'created_by' => $user->fullname, 'created_by' => $user->fullname,
'updated_by' => $user->fullname,
]); ]);
} }

4
app/Models/Peti.php

@ -45,6 +45,10 @@ class Peti extends Model
{ {
return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address')->withTrashed(); return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address')->withTrashed();
} }
public function t_warehouse()
{
return $this->belongsTo(m_warehouse::class, 't_warehouse_id');
}
public function tipe_peti() public function tipe_peti()
{ {
return $this->belongsTo(Type_peti::class, 'tipe_peti_id')->select( return $this->belongsTo(Type_peti::class, 'tipe_peti_id')->select(

12
app/Models/asset_status.php

@ -23,7 +23,7 @@ class asset_status extends Model
'exit_pic', 'exit_pic',
'customer_id', 'customer_id',
'warehouse_id', 'warehouse_id',
'exit_warehouse', // 'exit_warehouse',
'enter_at', 'enter_at',
'enter_pic', 'enter_pic',
'enter_warehouse', 'enter_warehouse',
@ -33,14 +33,14 @@ class asset_status extends Model
'updated_by', 'updated_by',
]; ];
public function warehouseId() // public function warehouseId()
{ // {
return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address')->withTrashed(); // return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address')->withTrashed();
} // }
public function warehouse() public function warehouse()
{ {
return $this->belongsTo(m_warehouse::class, 'exit_warehouse')->select('id', 'name', 'address')->withTrashed(); return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address')->withTrashed();
} }
public function warehouseEnter() public function warehouseEnter()

23
database/migrations/2023_11_06_122033_create_asset_statuses_table.php

@ -13,18 +13,17 @@ return new class extends Migration
{ {
Schema::create('asset_statuses', function (Blueprint $table) { Schema::create('asset_statuses', function (Blueprint $table) {
$table->id(); $table->id();
$table->uuid('mobile_id')->nullable(); $table->uuid('mobile_id')->nullable(); // proses untuk mobile_app
// $table->foreignId('peti_id')->nullable()->constrained('petis'); $table->foreignId('peti_id')->nullable()->constrained('petis')->onDelete('cascade'); // proses untuk inputan kode peti
$table->foreignId('peti_id')->nullable()->constrained('petis')->onDelete('cascade'); $table->date('exit_at')->nullable(); // proses untuk inputan tanggal keluar peti
$table->date('exit_at')->nullable(); $table->date('est_pengembalian')->nullable(); // proses untuk inputan tanggal estimasi pengembalian peti
$table->date('est_pengembalian')->nullable(); $table->string('exit_pic', 200)->nullable(); // proses untuk pj keluar peti
$table->string('exit_pic', 200)->nullable(); $table->foreignId('customer_id')->nullable()->constrained('customers'); // proses untuk inputan customer
$table->foreignId('customer_id')->nullable()->constrained('customers'); $table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses'); // proses untuk asal peminjaman gudang peti
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses'); // $table->foreignId('exit_warehouse')->nullable()->constrained('m_warehouses'); // tidak di pakai
$table->foreignId('exit_warehouse')->nullable()->constrained('m_warehouses'); $table->date('enter_at')->nullable(); // proses untuk inputan tanggal masuk peti
$table->date('enter_at')->nullable(); $table->string('enter_pic', 200)->nullable(); // proses untuk pj masuk peti
$table->string('enter_pic', 200)->nullable(); $table->foreignId('enter_warehouse')->nullable()->constrained('m_warehouses'); // proses untuk tujuan pengembalian gudang peti
$table->foreignId('enter_warehouse')->nullable()->constrained('m_warehouses');
$table->foreignId('kondisi_peti_id')->nullable()->constrained('kondisi_petis'); $table->foreignId('kondisi_peti_id')->nullable()->constrained('kondisi_petis');
$table->boolean('status')->default(0); $table->boolean('status')->default(0);
$table->timestamps(); $table->timestamps();

2
public/assets/file/Format_Import_Tipe_Peti.csv

@ -1 +1 @@
TIpe Peti,Ukuran Peti,Deskripsi Tipe Tipe Peti,Ukuran Peti,Deskripsi Tipe

1 TIpe Peti Tipe Peti Ukuran Peti Deskripsi Tipe

BIN
public/assets/img/logo_istw.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

8
resources/views/dashboard/History/Peminjaman/index.blade.php

@ -53,12 +53,13 @@
<thead> <thead>
<tr> <tr>
<th class="text-center">No</th> <th class="text-center">No</th>
<th>Kode Peti</th> <th>Fix Lot</th>
<th>Nama Customer</th> <th>Nama Customer</th>
<th>Kode</th> <th>Kode</th>
<th>Tgl Peminjaman</th> <th>Tgl Peminjaman</th>
<th>Est Pengembalian</th>
<th>Asal Gudang</th>
<th>PJ Peminjaman</th> <th>PJ Peminjaman</th>
<th>GD Peminjam</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -70,8 +71,9 @@
<td>{{ $data_peminjaman->peti->customer->code_customer }} - <td>{{ $data_peminjaman->peti->customer->code_customer }} -
{{ $data_peminjaman->peti->tipe_peti->type }}</td> {{ $data_peminjaman->peti->tipe_peti->type }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d-m-Y') }}</td> <td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d-m-Y') }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td> <td>{{ \Carbon\Carbon::parse($data_peminjaman->est_pengembalian)->format('d-m-Y') }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td> <td>{{ $data_peminjaman->warehouse->name }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td>
</tr> </tr>
@empty @empty
<tr> <tr>

12
resources/views/dashboard/History/Pengembalian/index.blade.php

@ -52,15 +52,15 @@
<thead> <thead>
<tr> <tr>
<th>No</th> <th>No</th>
<th>Kode Peti</th> <th>Fix Lot</th>
<th>Customer</th> <th>Nama Customer</th>
<th>Tgl Peinjaman</th> <th>Tgl Peminjaman</th>
<th>Estimasi Pengembalian</th> <th>Estimasi Pengembalian</th>
<th>PJ Peminjaman</th> <th>PJ Peminjaman</th>
<th>Asal GD Peminjaman</th> <th>GD Peminjaman</th>
<th>Tgl Pengembalian</th> <th>Tgl Pengembalian</th>
<th>PJ Pengembalian</th> <th>PJ Pengembalian</th>
<th>Tujuan GD Pengembalian</th> <th>GD Pengembalian</th>
<th>Kondisi Peti</th> <th>Kondisi Peti</th>
<th>Status</th> <th>Status</th>
</tr> </tr>
@ -75,7 +75,7 @@
<td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d-m-Y') }}</td> <td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d-m-Y') }}</td>
<td>{{ $data->exit_pic }}</td> <td>{{ $data->exit_pic }}</td>
<td> <td>
@if ($data->exit_warehouse) @if ($data->warehouse_id)
{{ $data->warehouse->name }} {{ $data->warehouse->name }}
@else @else
<p class="text-center font-weight-bold">-</p> <p class="text-center font-weight-bold">-</p>

2
resources/views/dashboard/History/Transfer/index.blade.php

@ -23,7 +23,7 @@
<thead> <thead>
<tr> <tr>
<th class="text-center">No</th> <th class="text-center">No</th>
<th>Kode Peti</th> <th>Fix Lot</th>
<th>Nama Customer</th> <th>Nama Customer</th>
<th>Tgl Transfer</th> <th>Tgl Transfer</th>
<th>Asal Gudang</th> <th>Asal Gudang</th>

6
resources/views/dashboard/Master_Data/Customer/create.blade.php

@ -31,8 +31,10 @@
<label for="no_tlp" class="col-form-label">Nomor Telepon Customer: <span <label for="no_tlp" class="col-form-label">Nomor Telepon Customer: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input class="form-control" name="no_tlp" type="tel" id="no_tlp" value="{{ old('no_tlp') }}" <input class="form-control" name="no_tlp" type="tel" id="no_tlp" value="{{ old('no_tlp') }}"
placeholder="Masukkan Nomor Telepon customer" pattern="[^A-Za-z]+" placeholder="Masukkan Nomor Telepon customer" pattern="[0-9\+\-\(\)\s]+"
title="Hanya karakter selain huruf yang diperbolehkan" required> title="Hanya angka, simbol +, -, (, ), dan spasi yang diperbolehkan"
oninput="this.value = this.value.replace(/[^0-9\+\-\(\)\s]+/, '')" required>
<label for="address" class="col-form-label">Alamat Customer: <span class="text-danger">*</span></label> <label for="address" class="col-form-label">Alamat Customer: <span class="text-danger">*</span></label>
<textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required></textarea> <textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required></textarea>

5
resources/views/dashboard/Master_Data/Customer/edit.blade.php

@ -31,13 +31,12 @@
<input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}" <input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}"
placeholder="Masukan lot number" required> placeholder="Masukan lot number" required>
<label for="no_tlp" class="col-form-label">Nomor Telepon Customer: <span <label for="no_tlp" class="col-form-label">Nomor Telepon: <span class="text-danger">*</span></label>
class="text-danger">*</span></label>
<input class="form-control" name="no_tlp" type="tel" id="no_tlp" value="{{ $customer->no_tlp }}" <input class="form-control" name="no_tlp" type="tel" id="no_tlp" value="{{ $customer->no_tlp }}"
placeholder="Masukkan Nomor Telepon customer" pattern="[^A-Za-z]+" placeholder="Masukkan Nomor Telepon customer" pattern="[^A-Za-z]+"
title="Hanya karakter selain huruf yang diperbolehkan" required> title="Hanya karakter selain huruf yang diperbolehkan" required>
<label for="address" class="col-form-label">Alamat Customer: <span class="text-danger">*</span></label> <label for="address" class="col-form-label">Alamat: <span class="text-danger">*</span></label>
<textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required>{{ $customer->address }}</textarea> <textarea class="form-control" name="address" id="address" placeholder="Masukkan alamat customer" required>{{ $customer->address }}</textarea>
</div> </div>

2
resources/views/dashboard/Master_Data/Customer/index.blade.php

@ -30,7 +30,7 @@
<thead> <thead>
<tr> <tr>
<th class="text-center">No</th> <th class="text-center">No</th>
<th>Nama</th> <th>Nama Customer</th>
<th>Kode Customer</th> <th>Kode Customer</th>
<th>No. Telepon</th> <th>No. Telepon</th>
<th>Alamat</th> <th>Alamat</th>

4
resources/views/dashboard/Master_Data/Customer/show.blade.php

@ -20,10 +20,10 @@
<input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}" <input class="form-control" name="lot_no" type="text" id="lot_no" value="{{ $customer->lot_no }}"
readonly> readonly>
<label for="no_tlp" class="col-form-label">No. Telepon Customer:</label> <label for="no_tlp" class="col-form-label">No. Telepon:</label>
<input class="form-control" value="{{ $customer->no_tlp }}" readonly> <input class="form-control" value="{{ $customer->no_tlp }}" readonly>
<label for="address" class="col-form-label">Alamat Customer:</label> <label for="address" class="col-form-label">Alamat:</label>
<textarea class="form-control" readonly>{{ $customer->address }}</textarea> <textarea class="form-control" readonly>{{ $customer->address }}</textarea>
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">

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

@ -33,7 +33,8 @@
</form> </form>
<a class="dropdown-item" data-toggle="modal" data-target="#importDataModal" <a class="dropdown-item" data-toggle="modal" data-target="#importDataModal"
href="#">Import Data Peti</a> href="#">Import Data Peti</a>
<a class="dropdown-item" href="'dashboard.Pettern_Lot_Peti.export') }}" target="_blank">Export <a class="dropdown-item" href="{{ route('dashboard.Pettern_Lot_Peti.export') }}"
target="_blank">Export
Data Peti</a> Data Peti</a>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" id="hapusPetiBtn">Hapus Peti</a> <a class="dropdown-item" href="#" id="hapusPetiBtn">Hapus Peti</a>
@ -108,11 +109,11 @@
<td>{{ $data_peti->kondisipeti->nama_kondisi }}</td> <td>{{ $data_peti->kondisipeti->nama_kondisi }}</td>
<td> <td>
@if ($data_peti->status_isi == 1) @if ($data_peti->status_isi == 1)
Ada ADA
@elseif($data_peti->status_isi == 0) @elseif($data_peti->status_isi == 0)
Tidak Ada TIDAK ADA
@else @else
Tidak Ada TIDAK ADA
@endif @endif
</td> </td>
<td>{{ $data_peti->warna }}</td> <td>{{ $data_peti->warna }}</td>

10
resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/detail_peti.blade.php

@ -23,15 +23,15 @@
<thead> <thead>
<tr> <tr>
<th>No</th> <th>No</th>
<th>Kode Peti</th> <th>Fix Lot</th>
<th>Customer</th> <th>Nama Customer</th>
<th>Tgl Peinjaman</th> <th>Tgl Peminjaman</th>
<th>Estimasi Pengembalian</th> <th>Estimasi Pengembalian</th>
<th>PJ Peminjaman</th> <th>PJ Peminjaman</th>
<th>Asal WH Peminjaman</th> <th>GD Peminjaman</th>
<th>Tgl Pengembalian</th> <th>Tgl Pengembalian</th>
<th>PJ Pengembalian</th> <th>PJ Pengembalian</th>
<th>Tujuan WH Pengembalian</th> <th>GD Pengembalian</th>
<th>Kondisi Peti</th> <th>Kondisi Peti</th>
<th>Status</th> <th>Status</th>
</tr> </tr>

13
resources/views/dashboard/Peminjaman/create.blade.php

@ -20,7 +20,7 @@
class="text-danger">*</span></label> class="text-danger">*</span></label>
<select class="form-control" id="searchPeti" name="peti_id"></select> <select class="form-control" id="searchPeti" name="peti_id"></select>
<label for="customer_id" class="col-form-label">Customer:<span class="text-danger">*</span></label> <label for="customer_id" class="col-form-label">Nama Customer:<span class="text-danger">*</span></label>
<select class="form-control" id="searchCustomer" name="customer_id"></select> <select class="form-control" id="searchCustomer" name="customer_id"></select>
<label for="exit_at" class="col-form-label">Tanggal Peminjaman: <span <label for="exit_at" class="col-form-label">Tanggal Peminjaman: <span
@ -28,21 +28,12 @@
<input class="form-control" name="exit_at" type="date" id="exit_at" value="{{ old('exit_at') }}" <input class="form-control" name="exit_at" type="date" id="exit_at" value="{{ old('exit_at') }}"
required> required>
<label for="est_pengembalian" class="col-form-label">Estimasi Tanggal Pengembalian: <span <label for="est_pengembalian" class="col-form-label">Estimasi Pengembalian: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input class="form-control" name="est_pengembalian" type="date" id="est_pengembalian" required> <input class="form-control" name="est_pengembalian" type="date" id="est_pengembalian" required>
<label for="warehouse_id" class="col-form-label">Asal Gudang:</label> <label for="warehouse_id" class="col-form-label">Asal Gudang:</label>
<select class="form-control" id="searchWarehouse" name="warehouse_id"></select> <select class="form-control" id="searchWarehouse" name="warehouse_id"></select>
<label for="exit_warehouse" class="col-form-label">Tujuan Gudang: <span
class="text-danger">*</span></label>
<select class="form-control" name="exit_warehouse" type="text" id="exit_warehouse" required>
<option disabled selected>Pilih Tujuan Gudang</option>
@foreach ($warehouse as $data)
<option value="{{ $data->id }}">{{ $data->name }}</option>
@endforeach
</select>
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.peminjaman.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.peminjaman.index') }}" class="btn btn-secondary">Kembali</a>

22
resources/views/dashboard/Peminjaman/edit.blade.php

@ -18,17 +18,8 @@
<label for="peti_id" class="col-form-label">Pilih Detail Peti: <span class="text-danger">*</span></label> <label for="peti_id" class="col-form-label">Pilih Detail Peti: <span class="text-danger">*</span></label>
<input type="hidden" name="peti_id" value="{{ $peminjaman->peti_id }}"> <input type="hidden" name="peti_id" value="{{ $peminjaman->peti_id }}">
<input class="form-control" name="coba"value="{{ $peminjaman->peti->fix_lot }}" @readonly(true)> <input class="form-control" name="coba"value="{{ $peminjaman->peti->fix_lot }}" @readonly(true)>
{{-- <select class="form-control" name="peti_id" id="peti_id">
<option disabled selected>Pilih Detail Peti</option>
@foreach ($peti as $data_peti)
<option value="{{ $data_peti->id }}" data-warehouse-id="{{ $data_peti->warehouse_id }}"
{{ $data_peti->id == $peminjaman->peti_id ? 'selected' : '' }}>
{{ $data_peti->fix_lot }}
</option>
@endforeach
</select> --}}
<label for="customer_id" class="col-form-label">Customer:<span class="text-danger">*</span></label> <label for="customer_id" class="col-form-label">Nama Customer:<span class="text-danger">*</span></label>
<select class="form-control" name="customer_id" type="text" id="customer_id" required> <select class="form-control" name="customer_id" type="text" id="customer_id" required>
<option disabled selected>Pilih Nama Customer</option> <option disabled selected>Pilih Nama Customer</option>
@foreach ($customer as $data_customer) @foreach ($customer as $data_customer)
@ -44,7 +35,7 @@
<input class="form-control" name="exit_at" type="date" id="exit_at" value="{{ $peminjaman->exit_at }}" <input class="form-control" name="exit_at" type="date" id="exit_at" value="{{ $peminjaman->exit_at }}"
required> required>
<label for="est_pengembalian" class="col-form-label">Estimasi Tanggal Pengembalian: <span <label for="est_pengembalian" class="col-form-label">Estimasi Pengembalian: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input class="form-control" name="est_pengembalian" type="date" id="est_pengembalian" <input class="form-control" name="est_pengembalian" type="date" id="est_pengembalian"
value="{{ $peminjaman->est_pengembalian }}" required> value="{{ $peminjaman->est_pengembalian }}" required>
@ -58,15 +49,6 @@
@endforeach @endforeach
</select> </select>
<label for="exit_warehouse" class="col-form-label">Tujuan Gudang: <span class="text-danger">*</span></label>
<select class="form-control" name="exit_warehouse" type="text" id="exit_warehouse" required>
<option disabled selected>Pilih Tujuan Gudang</option>
@foreach ($warehouse as $data)
<option value="{{ $data->id }}" @if ($data->id == $peminjaman->exit_warehouse) selected @else @endif>
{{ $data->name }}</option>
@endforeach
</select>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.peminjaman.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.peminjaman.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary" id="submitButton">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>

6
resources/views/dashboard/Peminjaman/index.blade.php

@ -60,13 +60,13 @@
<thead> <thead>
<tr> <tr>
<th class="text-center">No</th> <th class="text-center">No</th>
<th>Kode Peti</th> <th>Fix Lot</th>
<th>Nama Customer</th> <th>Nama Customer</th>
<th>Kode</th> <th>Kode</th>
<th>Tgl Peminjaman</th> <th>Tgl Peminjaman</th>
<th>Est Pengembalian</th> <th>Est Pengembalian</th>
<th>Asal Gudang</th>
<th>PJ Peminjaman</th> <th>PJ Peminjaman</th>
<th>Tujuan WH Peminjam</th>
<th class="text-center">Action</th> <th class="text-center">Action</th>
</tr> </tr>
</thead> </thead>
@ -82,8 +82,8 @@
{{ $data_peminjaman->peti->tipe_peti->type }}</td> {{ $data_peminjaman->peti->tipe_peti->type }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d-m-Y') }}</td> <td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d-m-Y') }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->est_pengembalian)->format('d-m-Y') }}</td> <td>{{ \Carbon\Carbon::parse($data_peminjaman->est_pengembalian)->format('d-m-Y') }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td> <td>{{ $data_peminjaman->warehouse->name }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td>
<td class="text-center"> <td class="text-center">
<a href="{{ route('dashboard.peminjaman.pengembalian', $data_peminjaman->id) }}" <a href="{{ route('dashboard.peminjaman.pengembalian', $data_peminjaman->id) }}"
title="Pengembalian"> title="Pengembalian">

17
resources/views/dashboard/Peminjaman/pengembalian.blade.php

@ -26,16 +26,19 @@
<input class="form-control" name="exit_at" type="date" id="exit_at" <input class="form-control" name="exit_at" type="date" id="exit_at"
value="{{ $peminjaman->exit_at }}" readonly> value="{{ $peminjaman->exit_at }}" readonly>
<label for="est_pengembalian" class="col-form-label">Estimasi Tanggal Pengembalian:</label> <label for="est_pengembalian" class="col-form-label">Estimasi Pengembalian:</label>
<input class="form-control" name="est_pengembalian" type="date" id="est_pengembalian" <input class="form-control" name="est_pengembalian" type="date" id="est_pengembalian"
value="{{ $peminjaman->est_pengembalian }}" readonly> value="{{ $peminjaman->est_pengembalian }}" readonly>
<label for="exit_warehouse" class="col-form-label">Asal Gudang :</label> <label for="customer_id" class="col-form-label">Customer:</label>
<div> <select class="form-control" name="customer_id" type="text" id="customer_id" required>
<input class="form-control" hidden name="exit_warehouse" type="text" id="exit_warehouse" @foreach ($customer as $data_customer)
value="{{ $peminjaman->exit_warehouse }}" readonly> <option value="{{ $data_customer->id }}"
<input class="form-control" value="{{ $peminjaman->warehouse->name }}" readonly> @if ($data_customer->id == $peminjaman->warehouse_id) selected
</div> @else @endif>
{{ $data_customer->name }}</option>
@endforeach
</select>
<label for="enter_at" class="col-form-label">Tanggal Pengembalian: <span <label for="enter_at" class="col-form-label">Tanggal Pengembalian: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>

15
resources/views/dashboard/Pengembalian/edit.blade.php

@ -26,7 +26,7 @@
<input class="form-control" name="exit_at" type="date" id="exit_at" <input class="form-control" name="exit_at" type="date" id="exit_at"
value="{{ $peminjaman->exit_at }}" readonly> value="{{ $peminjaman->exit_at }}" readonly>
<label for="est_pengembalian" class="col-form-label">Estimasi Tanggal Pengembalian:</label> <label for="est_pengembalian" class="col-form-label">Estimasi Pengembalian:</label>
<input class="form-control" name="est_pengembalian" type="date" id="est_pengembalian" <input class="form-control" name="est_pengembalian" type="date" id="est_pengembalian"
value="{{ $peminjaman->est_pengembalian }}" readonly> value="{{ $peminjaman->est_pengembalian }}" readonly>
@ -37,12 +37,23 @@
<input class="form-control" value="{{ $peminjaman->warehouse->name }}" readonly> <input class="form-control" value="{{ $peminjaman->warehouse->name }}" readonly>
</div> </div>
<label for="customer_id" class="col-form-label">Customer: <span class="text-danger">*</span></label>
<select class="form-control" name="customer_id" type="text" id="customer_id" required>
<option disabled selected>Pilih Customer</option>
@foreach ($customer as $data_customer)
<option value="{{ $data_customer->id }}"
@if ($data_customer->id == $peminjaman->customer_id) selected
@else @endif>
{{ $data_customer->name }}</option>
@endforeach
</select>
<label for="enter_at" class="col-form-label">Tanggal Pengembalian: <span <label for="enter_at" class="col-form-label">Tanggal Pengembalian: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<input class="form-control" name="enter_at" type="date" id="enter_at" <input class="form-control" name="enter_at" type="date" id="enter_at"
value="{{ \Carbon\Carbon::parse($peminjaman->enter_at)->format('Y-m-d') }}" required> value="{{ \Carbon\Carbon::parse($peminjaman->enter_at)->format('Y-m-d') }}" required>
<label for="enter_warehouse" class="col-form-label">Tujuan Pengembalian Gudang: <span <label for="enter_warehouse" class="col-form-label">Pengembalian Gudang: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<select class="form-control" name="enter_warehouse" type="text" id="enter_warehouse" required> <select class="form-control" name="enter_warehouse" type="text" id="enter_warehouse" required>
<option disabled selected>Pilih Tujuan Gudang</option> <option disabled selected>Pilih Tujuan Gudang</option>

12
resources/views/dashboard/Pengembalian/index.blade.php

@ -53,15 +53,15 @@
<thead> <thead>
<tr> <tr>
<th>No</th> <th>No</th>
<th>Kode Peti</th> <th>Fix Lot</th>
<th>Customer</th> <th>Nama Customer</th>
<th>Tgl Peinjaman</th> <th>Tgl Peminjaman</th>
<th>Estimasi Pengembalian</th> <th>Estimasi Pengembalian</th>
<th>PJ Peminjaman</th> <th>PJ Peminjaman</th>
<th>WH Peminjam</th> <th>GD Peminjaman</th>
<th>Tgl Pengembalian</th> <th>Tgl Pengembalian</th>
<th>PJ Pengembalian</th> <th>PJ Pengembalian</th>
<th>WH Pengembalian</th> <th>GD Pengembalian</th>
<th>Kondisi Peti</th> <th>Kondisi Peti</th>
<th>Status</th> <th>Status</th>
<th class="text-center">Action</th> <th class="text-center">Action</th>
@ -84,7 +84,7 @@
<td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d-m-Y') }}</td> <td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d-m-Y') }}</td>
<td>{{ $data->exit_pic }}</td> <td>{{ $data->exit_pic }}</td>
<td> <td>
@if ($data->exit_warehouse) @if ($data->warehouse_id)
{{ $data->warehouse->name }} {{ $data->warehouse->name }}
@else @else
<p class="text-center font-weight-bold">-</p> <p class="text-center font-weight-bold">-</p>

18
resources/views/dashboard/Transfer/edit.blade.php

@ -23,17 +23,6 @@
<!-- Input terbaca untuk menampilkan nama --> <!-- Input terbaca untuk menampilkan nama -->
<input type="text" class="form-control" value="{{ $transfer->peti->fix_lot ?? '' }}" readonly> <input type="text" class="form-control" value="{{ $transfer->peti->fix_lot ?? '' }}" readonly>
{{-- <select class="form-control" name="peti_id" id="peti_id" disabled>
<option disabled selected>Pilih Detail Peti</option>
@foreach ($peti as $data_peti)
<option value="{{ $data_peti->id }}"
{{ $data_peti->id == $transfer->peti_id ? 'selected' : '' }}>
{{ $data_peti->fix_lot }}
</option>
@endforeach
</select> --}}
<label for="date" 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="date" type="date" id="date" value="{{ $transfer->date }}"> <input class="form-control" name="date" type="date" id="date" value="{{ $transfer->date }}">
@ -55,7 +44,7 @@
<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 }}" <option value="{{ $data->id }}"
{{ $data->id == $transfer->destination_warehouse ? 'selected' : '' }}> {{ $data->id == $transfer->source_warehouse ? 'selected' : '' }}>
{{ $data->name }} {{ $data->name }}
</option> </option>
@endforeach @endforeach
@ -66,7 +55,10 @@
<select class="form-control" name="destination_warehouse" type="text"> <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->id == $transfer->destination_warehouse ? 'selected' : '' }}>
{{ $data->name }}
</option>
@endforeach @endforeach
</select> </select>
</div> </div>

Loading…
Cancel
Save