diff --git a/app/Http/Controllers/TransferController.php b/app/Http/Controllers/TransferController.php new file mode 100644 index 0000000..1c0c9d3 --- /dev/null +++ b/app/Http/Controllers/TransferController.php @@ -0,0 +1,85 @@ + Transfer::all(), + 'active' => 'menu-transfer', + ]; + return view('dashboard.Transfer.index', $data); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + $data = [ + 'peti' => Peti::get(), + // 'warehouse' => Peti::with('warehouse_id')->get(), + 'warehouse' => m_warehouse::get(), + 'active' => 'menu-transfer', + ]; + return view('dashboard.Transfer.create', $data); + } + + /** + * Store a newly created resource in storage. + */ + public function store($request) + { + } + + /** + * Display the specified resource. + */ + public function show($id) + { + $data = [ + 'active' => 'menu-transfer', + ]; + return view('dashboard.Transfer.show', $data); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id) + { + $data = [ + 'active' => 'menu-transfer', + ]; + return view('dashboard.Transfer.edit', $data); + } + + /** + * Update the specified resource in storage. + */ + public function update($request, $id) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy($id) + { + // try { + // $typepeti = Peti::findOrFail($id); + // $typepeti->delete(); + // return redirect()->back()->with('success', 'Data peti berhasil dihapus'); + // } catch (\Throwable $th) { + // return redirect()->back()->with('error', 'Data peti gagal dihapus'); + // } + } +} diff --git a/app/Http/Requests/ValidasiCreatePeti.php b/app/Http/Requests/ValidasiCreatePeti.php index 1024a87..3d65dd7 100644 --- a/app/Http/Requests/ValidasiCreatePeti.php +++ b/app/Http/Requests/ValidasiCreatePeti.php @@ -28,7 +28,7 @@ class ValidasiCreatePeti extends FormRequest 'warehouse_id' => 'required|exists:m_warehouses,id', 'jumlah' => 'required|numeric|min:1', 'date_pembuatan' => 'required|date', - 'status_disposal' => 'nullable|string', + 'kondisipeti_id' => 'nullable', 'packing_no' => 'nullable|integer', 'fix_lot' => 'nullable|string|max:100', ]; @@ -51,7 +51,6 @@ class ValidasiCreatePeti extends FormRequest 'jumlah.min' => 'Jumlah minimal 1', 'date_pembuatan.required' => 'Tanggal Pembuatan harus diisi', 'date_pembuatan.date' => 'Tanggal Pembuatan harus berupa tanggal', - 'status_disposal.string' => 'Status Disposal harus berupa string', 'packing_no.integer' => 'Packing No harus berupa angka', 'fix_lot.string' => 'Fix Lot harus berupa string', 'fix_lot.max' => 'Fix Lot maksimal 100 karakter', diff --git a/app/Http/Requests/ValidasiUpdatePeti.php b/app/Http/Requests/ValidasiUpdatePeti.php index b8ddbc5..4cba131 100644 --- a/app/Http/Requests/ValidasiUpdatePeti.php +++ b/app/Http/Requests/ValidasiUpdatePeti.php @@ -27,7 +27,7 @@ class ValidasiUpdatePeti extends FormRequest 'customer_id' => 'required|exists:customers,id', 'warehouse_id' => 'required|exists:m_warehouses,id', 'date_pembuatan' => 'required|date', - 'status_disposal' => 'nullable|string', + 'kondisipeti_id' => 'nullable', 'packing_no' => 'nullable|integer', 'fix_lot' => 'nullable|string|max:100', ]; @@ -50,7 +50,6 @@ class ValidasiUpdatePeti extends FormRequest 'jumlah.min' => 'Jumlah minimal 1', 'date_pembuatan.required' => 'Tanggal Pembuatan harus diisi', 'date_pembuatan.date' => 'Tanggal Pembuatan harus berupa tanggal', - 'status_disposal.string' => 'Status Disposal harus berupa string', 'packing_no.integer' => 'Packing No harus berupa angka', 'fix_lot.string' => 'Fix Lot harus berupa string', 'fix_lot.max' => 'Fix Lot maksimal 100 karakter', diff --git a/app/Models/Transfer.php b/app/Models/Transfer.php new file mode 100644 index 0000000..b0f8c71 --- /dev/null +++ b/app/Models/Transfer.php @@ -0,0 +1,35 @@ +belongsTo(Peti::class, 'peti_id')->select( + 'id', + 'tipe_peti_id', + 'customer_id', + 'warehouse_id', + 'date_pembuatan', + 'kondisipeti_id', + 'fix_lot', + 'updated_by', + ); + } +} diff --git a/app/Models/asset_status.php b/app/Models/asset_status.php index af7b97f..b8ed253 100644 --- a/app/Models/asset_status.php +++ b/app/Models/asset_status.php @@ -44,7 +44,7 @@ class asset_status extends Model public function peti() { - return $this->belongsTo(Peti::class, 'peti_id')->select('id', 'tipe_peti_id', 'warna', 'fix_lot', 'packing_no', 'customer_id', 'jumlah', 'date_pembuatan', 'warehouse_id', 'status_disposal'); + return $this->belongsTo(Peti::class, 'peti_id')->select('id', 'tipe_peti_id', 'warna', 'fix_lot', 'packing_no', 'customer_id', 'jumlah', 'date_pembuatan', 'warehouse_id', 'kondisipeti_id'); } public function tipe_peti() diff --git a/database/migrations/2023_11_06_085238_create_petis_table.php b/database/migrations/2023_11_06_085238_create_petis_table.php index 36e9b8d..0f89c9a 100644 --- a/database/migrations/2023_11_06_085238_create_petis_table.php +++ b/database/migrations/2023_11_06_085238_create_petis_table.php @@ -26,7 +26,6 @@ return new class extends Migration $table->foreign('warehouse_id')->references('id')->on('m_warehouses')->onDelete('set null'); $table->unsignedBigInteger('kondisipeti_id')->nullable(); $table->foreign('kondisipeti_id')->references('id')->on('kondisi_petis')->onDelete('set null'); - // $table->string('status_disposal')->nullable(); $table->timestamps(); $table->softDeletes(); $table->string('created_by', 200)->nullable(); diff --git a/database/migrations/2023_11_08_132316_create_transfers_table.php b/database/migrations/2023_11_08_132316_create_transfers_table.php new file mode 100644 index 0000000..fbce8a4 --- /dev/null +++ b/database/migrations/2023_11_08_132316_create_transfers_table.php @@ -0,0 +1,33 @@ +id(); + $table->bigInteger('peti_id')->unsigned()->nullable(); + $table->foreign('peti_id')->references('id')->on('petis')->onDelete('set null'); + $table->date('tanggal')->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('transfers'); + } +}; diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php index c571e3d..db0139a 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php @@ -64,12 +64,6 @@ @else @endif> {{ $data_kondisiPeti->nama_kondisi }} @endforeach - {{-- Baru - Bekas - Recycle - - Lainnya - --}} Tanggal Pembuatan Peti: - + + + + +@endsection diff --git a/resources/views/dashboard/Transfer/edit.blade.php b/resources/views/dashboard/Transfer/edit.blade.php new file mode 100644 index 0000000..494f9c3 --- /dev/null +++ b/resources/views/dashboard/Transfer/edit.blade.php @@ -0,0 +1,5 @@ +@extends('layouts.main') +@section('content') + @include('layouts.components.alert-prompt') + Halaman edit transfer +@endsection diff --git a/resources/views/dashboard/Transfer/index.blade.php b/resources/views/dashboard/Transfer/index.blade.php new file mode 100644 index 0000000..2ca2804 --- /dev/null +++ b/resources/views/dashboard/Transfer/index.blade.php @@ -0,0 +1,83 @@ +@extends('layouts.main') +@section('content') + + @include('layouts.components.alert-prompt') + + + + + Data Transfer + + + + Transfer Peti + + + + + + + + + + + No + Kode Peti + Nama Customer + Kode + Tgl Peminjaman + PJ Peminjaman + Asal Gudang + Action + + + + {{-- @php + $no_peminjaman = 1; + @endphp + @forelse ($peminjaman as $data_peminjaman) + @if ($data_peminjaman->enter_warehouse == null) + + {{ $no_peminjaman++ }} + {{ $data_peminjaman->peti->fix_lot }} + {{ $data_peminjaman->peti->customer->name }} + {{ $data_peminjaman->peti->customer->code_customer }} - + {{ $data_peminjaman->peti->tipe_peti->type }} + {{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }} + {{ $data_peminjaman->exit_pic }} + {{ $data_peminjaman->warehouse->name }} + + + + + + @csrf + @method('DELETE') + + + + + + + @endif + @empty + Data Kosong + @endforelse --}} + + + + + +@endsection diff --git a/resources/views/dashboard/Transfer/show.blade.php b/resources/views/dashboard/Transfer/show.blade.php new file mode 100644 index 0000000..169d25d --- /dev/null +++ b/resources/views/dashboard/Transfer/show.blade.php @@ -0,0 +1,5 @@ +@extends('layouts.main') +@section('content') + @include('layouts.components.alert-prompt') + Halaman show transfer +@endsection diff --git a/resources/views/dashboard/index.blade.php b/resources/views/dashboard/index.blade.php index 06ea35c..74c43a8 100644 --- a/resources/views/dashboard/index.blade.php +++ b/resources/views/dashboard/index.blade.php @@ -1,177 +1,157 @@ @extends('layouts.main') @section('content') - - - Dashboard - Generate Report - - - - - - - - - Pengadaan - - - {{ $jumlahPeti }} - + + Dashboard + Generate Report + + + + + + + + + Pengadaan - - + + {{ $jumlahPeti }} + + + + - - - - - - - - Peminjaman - - - {{ $jumlahPeminjaman }} - - - + + + + + + + + Peminjaman + + {{ $jumlahPeminjaman }} + + + + - - - - - - - - Pengembalian - - - {{ $jumlahPengembalian }} - - - + + + + + + + + Pengembalian + + {{ $jumlahPengembalian }} + + + + - - - - - - - - Reminder Pengembalian - - - {{ $reminder }} - - - + + + + + + + + Reminder Pengembalian + + {{ $reminder }} + + + + - - - - Grafik Peminjaman VS Pengembalian - - @php - $chartData = app('App\Http\Controllers\HomeController')->generateChartData(); - @endphp - - {{-- - Pilih Tahun: - - @foreach ($chartData['years'] as $year) - @if ($chartData['exitData'][$loop->index] || $chartData['enterData'][$loop->index]) - {{ $year }} - @endif - @endforeach - - - - - --}} - - Pilih Tahun: - - @foreach ($chartData['years'] as $year) - @if ($chartData['exitData'][$loop->index] || $chartData['enterData'][$loop->index]) - {{ $year }} - @endif - @endforeach - - - - - + + + + + Grafik Peminjaman VS Pengembalian + @php + $chartData = app('App\Http\Controllers\HomeController')->generateChartData(); + @endphp + + Pilih Tahun: + + @foreach ($chartData['years'] as $year) + @if ($chartData['exitData'][$loop->index] || $chartData['enterData'][$loop->index]) + {{ $year }} + @endif + @endforeach + + + + + + - - - - - - Grafik Pengadaan Barang - - - - - - Dropdown Header: - Action - Another action - - Something else here - - - - - - - - - - - Direct - - - Social - - - Referral - - + + + + + + Grafik Pengadaan Peti + + + + + + @push('script') + + + + +
Halaman edit transfer
Data Kosong
Halaman show transfer