Browse Source

update revisi peminjaman, pengembalian, transfer dan disposal

master
Gunawan19621 1 year ago
parent
commit
ead7f322bf
  1. 5
      app/Exports/PetternLotPetiExport.php
  2. 1
      app/Exports/StokOpNameExport.php
  3. 18
      app/Http/Controllers/DisposalController.php
  4. 9
      app/Http/Controllers/PeminjamanController.php
  5. 21
      app/Http/Controllers/PengembalianController.php
  6. 142
      app/Http/Controllers/RecycleDataController.php
  7. 16
      app/Http/Controllers/StokOpNameController.php
  8. 7
      app/Http/Controllers/TransferController.php
  9. 8
      app/Http/Requests/Disposal/ValidasiUpdateDisposal.php
  10. 1
      app/Imports/CustomerImport.php
  11. 1
      app/Models/Peti.php
  12. 2
      database/migrations/2023_11_06_085238_create_petis_table.php
  13. 3
      database/migrations/2023_11_06_122033_create_asset_statuses_table.php
  14. 2
      database/migrations/2023_11_08_132316_create_transfers_table.php
  15. 2
      database/migrations/2023_11_17_075418_create_disposals_table.php
  16. 10
      database/seeders/Type_Peti.php
  17. 2
      public/assets/file/Format Import Customer.csv
  18. 4
      resources/views/dashboard/Disposal/create.blade.php
  19. 11
      resources/views/dashboard/Disposal/edit.blade.php
  20. 4
      resources/views/dashboard/Disposal/index.blade.php
  21. 196
      resources/views/dashboard/Master_Data/Recycle_Data/index.blade.php
  22. 14
      resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/index.blade.php
  23. 16
      resources/views/dashboard/Master_Data/Report/Stok_opname/index.blade.php
  24. 6
      resources/views/dashboard/Master_Data/User/show.blade.php
  25. 2
      resources/views/dashboard/Peminjaman/edit.blade.php
  26. 4
      resources/views/dashboard/Pengembalian/edit.blade.php
  27. 68
      resources/views/dashboard/Pengembalian/index.blade.php
  28. 1
      resources/views/layouts/main.blade.php
  29. 6
      resources/views/layouts/sidebar.blade.php
  30. 22
      routes/web.php

5
app/Exports/PetternLotPetiExport.php

@ -18,6 +18,7 @@ class PetternLotPetiExport implements FromCollection, WithHeadings
'tipe_peti_id',
'packing_no',
'fix_lot',
'status'
)->get();
// Inisialisasi nomor awal
@ -27,7 +28,6 @@ class PetternLotPetiExport implements FromCollection, WithHeadings
$data = $petis->map(function ($peti) use (&$nomor) {
return [
'No' => $nomor++,
'User' => 'ISTW',
'Customer' => $peti->customer->name,
'Warehouse' => $peti->warehouse->name,
'CODE CUSTOMER' => $peti->customer->code_customer,
@ -36,6 +36,7 @@ class PetternLotPetiExport implements FromCollection, WithHeadings
'LOT NO' => $peti->customer->lot_no,
'PACKING NO' => $peti->packing_no,
'FIX LOT' => $peti->fix_lot,
'Status' => $peti->status,
];
});
@ -46,7 +47,6 @@ class PetternLotPetiExport implements FromCollection, WithHeadings
{
return [
'No',
'User',
'Customer',
'WH',
'CODE CUSTOMER',
@ -55,6 +55,7 @@ class PetternLotPetiExport implements FromCollection, WithHeadings
'LOT NO',
'PACKING NO',
'FIX LOT',
'STATUS'
];
}
}

1
app/Exports/StokOpNameExport.php

@ -29,6 +29,7 @@ class StokOpNameExport implements FromCollection, WithHeadings
foreach ($this->stokOpnames as $data_StokOpname) {
$yesterdayStokOpname = $this->yesterdayStokOpnames
// ->where('status', 'AKTIF')
->where('customer_id', $data_StokOpname->customer_id)
->where('tipe_peti_id', $data_StokOpname->tipe_peti_id)
->first();

18
app/Http/Controllers/DisposalController.php

@ -34,7 +34,12 @@ class DisposalController extends Controller
{
$petiWithStatusNotZeroOrEmptyAndActive = Peti::where(function ($query) {
$query->whereHas('assetStatuses', function ($subquery) {
$subquery->where('status', '!=', 0);
$subquery->where('status', '!=', 0)
->where('created_at', '=', function ($maxQuery) {
$maxQuery->selectRaw('MAX(created_at)')
->from('asset_statuses')
->whereColumn('peti_id', 'petis.id');
});
})->orWhereDoesntHave('assetStatuses');
})->where('status', 'aktif')->get();
@ -52,8 +57,6 @@ class DisposalController extends Controller
*/
public function store(ValidasiCreateDisposal $request)
{
// dd($request->all());
// dd($request);
try {
// Mendapatkan informasi pengguna yang sedang login
$currentUser = Auth::user();
@ -65,7 +68,7 @@ class DisposalController extends Controller
$validatedData['mobile_id'] = Uuid::v4(); // Menambahkan ID Mobile
$validatedData['created_by'] = $currentUser->fullname;
$validatedData['updated_by'] = $currentUser->fullname;
$validatedData['status_disposal'] = 'INAKTIF';
// Membuat entitas Disposal
$disposal = Disposal::create($validatedData);
@ -97,7 +100,7 @@ class DisposalController extends Controller
*/
public function edit($id)
{
$jenis_disposal = ['Pemusnaan', 'Perbaikan'];
// $jenis_disposal = ['Pemusnaan', 'Perbaikan'];
$data = [
'disposal' => Disposal::findOrFail($id),
'peti' => Peti::get(),
@ -105,7 +108,7 @@ class DisposalController extends Controller
'warehouse' => m_warehouse::get(),
'active' => 'menu-disposal',
];
return view('dashboard.Disposal.edit', compact('jenis_disposal'), $data);
return view('dashboard.Disposal.edit', $data);
}
/**
@ -113,6 +116,7 @@ class DisposalController extends Controller
*/
public function update(ValidasiUpdateDisposal $request, $id)
{
// dd($request->all());
// dd("oke");
try {
// Mendapatkan informasi pengguna yang sedang login
@ -130,7 +134,7 @@ class DisposalController extends Controller
if (!$disposal) {
return redirect()->route('dashboard.disposal.index')->with('error', 'Data Disposal Peti tidak ditemukan');
}
// dd($validatedData);
// Memperbarui data transfer
$disposal->update($validatedData);

9
app/Http/Controllers/PeminjamanController.php

@ -36,9 +36,14 @@ class PeminjamanController extends Controller
{
$petiWithStatusNotZeroOrEmptyAndActive = Peti::where(function ($query) {
$query->whereHas('assetStatuses', function ($subquery) {
$subquery->where('status', '!=', 0);
$subquery->where('status', '!=', 0)
->where('created_at', '=', function ($maxQuery) {
$maxQuery->selectRaw('MAX(created_at)')
->from('asset_statuses')
->whereColumn('peti_id', 'petis.id');
});
})->orWhereDoesntHave('assetStatuses');
})->where('status', 'aktif')->get();
})->where('status', 'AKTIF')->get();
$data = [
// 'peti' => Peti::all(),

21
app/Http/Controllers/PengembalianController.php

@ -12,18 +12,29 @@ use Illuminate\Support\Facades\Auth;
class PengembalianController extends Controller
{
// public function index()
// {
// $pengembalian = asset_status::orderBy('created_at', 'desc')->get();
// $latestpengembalian = $pengembalian->groupBy('peti_id')->map(function ($group) {
// return $group->first();
// });
// $data = [
// 'peminjaman' => $latestpengembalian,
// 'active' => 'menu-pengembalian',
// ];
// return view('dashboard.Pengembalian.index', $data);
// }
public function index()
{
$pengembalian = asset_status::orderBy('created_at', 'desc')->get();
$latestpengembalian = $pengembalian->groupBy('peti_id')->map(function ($group) {
return $group->first();
});
$data = [
'peminjaman' => $latestpengembalian,
'peminjaman' => $pengembalian,
'active' => 'menu-pengembalian',
];
return view('dashboard.Pengembalian.index', $data);
}

142
app/Http/Controllers/RecycleDataController.php

@ -0,0 +1,142 @@
<?php
namespace App\Http\Controllers;
use App\Models\Peti;
use App\Models\Customer;
use Illuminate\Http\Request;
class RecycleDataController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$peti = Peti::onlyTrashed()->get();
$customer = Customer::onlyTrashed()->get();
$data = [
'peti' => Peti::onlyTrashed()->get(),
'customer' => Customer::onlyTrashed()->get(),
'active' => 'menu-Recycle_Data',
];
return view('dashboard.Master_Data.Recycle_Data.index', $data);
}
// public function pulihkanData($id)
// {
// // dd('oke');
// $peti = Customer::withTrashed()->find($id);
// if ($peti) {
// $peti->restore();
// return redirect()->back()->with('success', 'Data berhasil dipulihkan.');
// } else {
// return redirect()->back()->with('error', 'Data tidak ditemukan.');
// }
// }
// public function hapusPermanenData($id)
// {
// // dd('oke');
// $peti = Peti::withTrashed()->find($id);
// if ($peti) {
// $peti->forceDelete();
// return redirect()->back()->with('success', 'Data berhasil dihapus permanen.');
// } else {
// return redirect()->back()->with('error', 'Data tidak ditemukan.');
// }
// }
// public function pulihkanData(Request $request)
// {
// $peti = Peti::withTrashed()
// ->where('id', '=', $request->id)
// ->first();
// $customer = Customer::withTrashed()
// ->where('id', '=', $request->id)
// ->first();
// if ($peti) {
// $peti->restore();
// return redirect()->back()->with('success', 'Data Peti berhasil dipulihkan.');
// } elseif ($customer) {
// $customer->restore();
// return redirect()->back()->with('success', 'Data Customer berhasil dipulihkan.');
// } else {
// return redirect()->back()->with('error', 'Data tidak ditemukan.');
// }
// }
// public function hapusPermanenData($id)
// {
// $peti = Peti::withTrashed()->find($id);
// $customer = Customer::withTrashed()->find($id);
// if ($peti) {
// $peti->forceDelete();
// return redirect()->back()->with('success', 'Data Peti berhasil dihapus permanen.');
// } elseif ($customer) {
// $customer->forceDelete();
// return redirect()->back()->with('success', 'Data Customer berhasil dihapus permanen.');
// } else {
// return redirect()->back()->with('error', 'Data tidak ditemukan.');
// }
// }
public function pulihkanData(Request $request, $model, $id)
{
$data = null;
switch ($model) {
case 'peti':
$data = Peti::withTrashed()->find($id);
break;
case 'customer':
$data = Customer::withTrashed()->find($id);
break;
// Add more cases for other models if needed
default:
return redirect()->back()->with('error', 'Model tidak valid.');
}
if ($data) {
$data->restore();
return redirect()->back()->with('success', "Data $model berhasil dipulihkan.");
} else {
return redirect()->back()->with('error', 'Data tidak ditemukan.');
}
}
public function hapusPermanenData($model, $id)
{
$data = null;
switch ($model) {
case 'peti':
$data = Peti::withTrashed()->find($id);
break;
case 'customer':
$data = Customer::withTrashed()->find($id);
break;
// Add more cases for other models if needed
default:
return redirect()->back()->with('error', 'Model tidak valid.');
}
if ($data) {
$data->forceDelete();
return redirect()->back()->with('success', "Data $model berhasil dihapus permanen.");
} else {
return redirect()->back()->with('error', 'Data tidak ditemukan.');
}
}
}

16
app/Http/Controllers/StokOpNameController.php

@ -14,27 +14,31 @@ class StokOpNameController extends Controller
public function index()
{
// Total Peti Berdasarkan Gudang
$gudangStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti', 'warehouse')
$gudangStokOpnames = Peti::with('customer', 'tipe_peti', 'warehouse')
->where('status', 'AKTIF') // Menambahkan kondisi untuk status Aktif
->select('customer_id', 'tipe_peti_id', 'warehouse_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id', 'warehouse_id')
->get();
// Total Peti Berdasarkan Tanggal Sekarang
$todayStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
$todayStokOpnames = Peti::with('customer', 'tipe_peti')
->where('status', 'AKTIF') // Menambahkan kondisi untuk status Aktif
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', today())
->groupBy('customer_id', 'tipe_peti_id')
->get();
// Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang
$yesterdayStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
$yesterdayStokOpnames = Peti::with('customer', 'tipe_peti')
->where('status', 'AKTIF') // Menambahkan kondisi untuk status Aktif
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini
->groupBy('customer_id', 'tipe_peti_id')
->get();
// Total Peti
$stokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
$stokOpnames = Peti::with('customer', 'tipe_peti')
->where('status', 'AKTIF') // Menambahkan kondisi untuk status Aktif
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id')
->get();
@ -53,12 +57,14 @@ class StokOpNameController extends Controller
{
//total peti
$stokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
->where('status', 'AKTIF') // Menambahkan kondisi untuk status Aktif
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id')
->get();
// Total Peti Berdasarkan Tanggal Sekarang
$todayStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
->where('status', 'AKTIF') // Menambahkan kondisi untuk status Aktif
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', today())
->groupBy('customer_id', 'tipe_peti_id')
@ -66,6 +72,7 @@ class StokOpNameController extends Controller
// Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang
$yesterdayStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti')
->where('status', 'AKTIF') // Menambahkan kondisi untuk status Aktif
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini
->groupBy('customer_id', 'tipe_peti_id')
@ -73,6 +80,7 @@ class StokOpNameController extends Controller
// Total Peti Berdasarkan Gudang
$gudangStokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti', 'warehouse')
->where('status', 'AKTIF') // Menambahkan kondisi untuk status Aktif
->select('customer_id', 'tipe_peti_id', 'warehouse_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id', 'warehouse_id')
->get();

7
app/Http/Controllers/TransferController.php

@ -37,7 +37,12 @@ class TransferController extends Controller
{
$petiWithStatusNotZeroOrEmptyAndActive = Peti::where(function ($query) {
$query->whereHas('assetStatuses', function ($subquery) {
$subquery->where('status', '!=', 0);
$subquery->where('status', '!=', 0)
->where('created_at', '=', function ($maxQuery) {
$maxQuery->selectRaw('MAX(created_at)')
->from('asset_statuses')
->whereColumn('peti_id', 'petis.id');
});
})->orWhereDoesntHave('assetStatuses');
})->where('status', 'aktif')->get();

8
app/Http/Requests/Disposal/ValidasiUpdateDisposal.php

@ -22,20 +22,20 @@ class ValidasiUpdateDisposal extends FormRequest
public function rules(): array
{
return [
'peti_id' => 'required|integer',
// 'peti_id' => 'required|integer',
'customer_id' => 'required|integer',
'warehouse_id' => 'required|integer',
'date_disposal' => 'nullable|date',
'description' => 'nullable|string',
'status_disposal' => 'nullable',
// 'status_disposal' => 'nullable',
];
}
public function messages(): array
{
return [
'peti_id.required' => 'Peti harus dipilih.',
'peti_id.integer' => 'Peti harus berupa angka.',
// 'peti_id.required' => 'Peti harus dipilih.',
// 'peti_id.integer' => 'Peti harus berupa angka.',
'customer_id.required' => 'Customer harus dipilih.',
'customer_id.integer' => 'Customer harus berupa angka.',
'warehouse_id.required' => 'Gudang harus dipilih.',

1
app/Imports/CustomerImport.php

@ -21,7 +21,6 @@ class CustomerImport implements ToModel, WithHeadingRow
'code_customer' => $row['code_customer'],
'lot_no' => $row['lot_no'],
'no_tlp' => $row['no_tlp'],
'email' => $row['email'],
'address' => $row['address'],
]);
}

1
app/Models/Peti.php

@ -25,6 +25,7 @@ class Peti extends Model
'kondisipeti_id',
'packing_no',
'fix_lot',
'status',
'created_by',
'updated_by',
];

2
database/migrations/2023_11_06_085238_create_petis_table.php

@ -17,7 +17,7 @@ return new class extends Migration
$table->string('warna', 50);
$table->string('fix_lot', 100);
$table->integer('packing_no');
$table->foreignId('customer_id')->nullable()->constrained('customers');
$table->foreignId('customer_id')->nullable()->constrained('customers')->onDelete('cascade');
$table->integer('jumlah')->nullable();
$table->date('date_pembuatan', 100)->nullable();
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses');

3
database/migrations/2023_11_06_122033_create_asset_statuses_table.php

@ -14,7 +14,8 @@ return new class extends Migration
Schema::create('asset_statuses', function (Blueprint $table) {
$table->id();
$table->uuid('mobile_id')->nullable();
$table->foreignId('peti_id')->nullable()->constrained('petis');
// $table->foreignId('peti_id')->nullable()->constrained('petis');
$table->foreignId('peti_id')->nullable()->constrained('petis')->onDelete('cascade');
$table->date('exit_at')->nullable();
$table->date('est_pengembalian')->nullable();
$table->string('exit_pic', 200)->nullable();

2
database/migrations/2023_11_08_132316_create_transfers_table.php

@ -14,7 +14,7 @@ return new class extends Migration
Schema::create('transfers', function (Blueprint $table) {
$table->id();
$table->uuid('mobile_id')->nullable();
$table->foreignId('peti_id')->nullable()->constrained('petis');
$table->foreignId('peti_id')->nullable()->constrained('petis')->onDelete('cascade');
$table->foreignId('name_customer')->nullable()->constrained('customers');
$table->foreignId('source_warehouse')->nullable()->constrained('m_warehouses');
$table->foreignId('destination_warehouse')->nullable()->constrained('m_warehouses');

2
database/migrations/2023_11_17_075418_create_disposals_table.php

@ -14,7 +14,7 @@ return new class extends Migration
Schema::create('disposals', function (Blueprint $table) {
$table->id('id');
$table->uuid('mobile_id')->nullable();
$table->foreignId('peti_id')->constrained('petis');
$table->foreignId('peti_id')->constrained('petis')->onDelete('cascade');
$table->foreignId('customer_id')->constrained('customers');
$table->foreignId('warehouse_id')->constrained('m_warehouses');
$table->date('date_disposal');

10
database/seeders/Type_Peti.php

@ -15,16 +15,16 @@ class Type_Peti extends Seeder
public function run(): void
{
DB::table('type_petis')->insert([
'type' => 'Baik',
'size_peti' => '2 X 2 X 2 X 2',
'description' => 'Detail Barang Bagus',
'type' => 'Kecil',
'size_peti' => '2 X 2 X 2',
'description' => 'Peti dengan ukuran kecil',
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
]);
DB::table('type_petis')->insert([
'type' => 'Standar',
'size_peti' => '3 X 3 X 3 X 3',
'description' => 'Detail Barang Standar',
'size_peti' => '3 X 3 X 3',
'description' => 'Peti dengan ukuran standar',
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
]);

2
public/assets/file/Format Import Customer.csv

@ -1 +1 @@
name,code_customer,lot_no,no_tlp,email,address
name,code_customer,lot_no,no_tlp,address

1 name code_customer lot_no no_tlp email address

4
resources/views/dashboard/Disposal/create.blade.php

@ -47,13 +47,13 @@
@endforeach
</select>
<label for="status_disposal" class="col-form-label">Status Peti: <span
{{-- <label for="status_disposal" class="col-form-label">Status Peti: <span
class="text-danger">*</span></label>
<select class="form-control" name="status_disposal" id="status_disposal" required>
<option disabled selected>Pilih Jenis Status Peti</option>
<option value="AKTIF">AKTIF</option>
<option value="INAKTIF">INAKTIF</option>
</select>
</select> --}}
<label for="description" class="col-form-label">Alasan Disposal: <span
class="text-danger">*</span></label>

11
resources/views/dashboard/Disposal/edit.blade.php

@ -18,7 +18,7 @@
<div class="form-group">
<label for="peti_id" class="col-form-label">Pilih Detail Peti: <span
class="text-danger">*</span></label>
<select class="form-control" name="peti_id" type="text" id="peti_id" required>
<select class="form-control" name="peti_id" type="text" id="peti_id" required @readonly(true)>
<option disabled selected>Pilih Detail Peti</option>
@foreach ($peti as $data_peti)
<option value="{{ $data_peti->id }}" data-warehouse-id="{{ $data_peti->warehouse_id }}"
@ -62,20 +62,13 @@
{{-- <label for="status_disposal" class="col-form-label">Status Peti: <span
class="text-danger">*</span></label>
<select class="form-control" name="status_disposal" id="status_disposal">
<option disabled selected>Pilih Jenis Status Peti</option>
<option value="AKTIF">AKTIF</option>
<option value="INAKTIF">INAKTIF</option>
</select> --}}
<label for="status_disposal" class="col-form-label">Status Peti: <span
class="text-danger">*</span></label>
<select class="form-control" name="status_disposal" id="status_disposal">
<option disabled>Pilih Jenis Status Peti</option>
<option value="AKTIF" {{ $disposal->status_disposal === 'AKTIF' ? 'selected' : '' }}>AKTIF
</option>
<option value="INAKTIF" {{ $disposal->status_disposal === 'INAKTIF' ? 'selected' : '' }}>INAKTIF
</option>
</select>
</select> --}}
</div>
<div class="modal-footer d-flex justify-content-center">

4
resources/views/dashboard/Disposal/index.blade.php

@ -35,7 +35,7 @@
<th>Nama Customer</th>
<th>Tanggal Disposal</th>
<th>Alasan Disposal</th>
<th>Status Peti</th>
{{-- <th>Status Peti</th> --}}
<th class="text-center">Action</th>
</tr>
</thead>
@ -50,7 +50,7 @@
<td>{{ optional($data_disposal->customer)->name }}</td>
<td>{{ \Carbon\Carbon::parse($data_disposal->date_disposal)->format('d/m/Y') }}</td>
<td>{{ $data_disposal->description }}</td>
<td>{{ $data_disposal->status_disposal }}</td>
{{-- <td>{{ $data_disposal->status_disposal }}</td> --}}
<td class="text-center">
<a href="{{ route('dashboard.disposal.edit', $data_disposal->id) }}" title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>

196
resources/views/dashboard/Master_Data/Recycle_Data/index.blade.php

@ -0,0 +1,196 @@
{{-- @extends('layouts.main')
@section('title', 'Warehouse')
@section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Recycle Data</h5>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center" style="width: 50px;">No.</th>
<th>Kategori Data</th>
<th>Data</th>
<th>Tanggal di hapus</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$norecycle = 1;
@endphp
<!-- Data Peti -->
@foreach ($peti as $data_peti)
<tr>
<td class="text-center" style="width: 50px;">{{ $norecycle++ }}</td>
<td>Data Peti</td>
<td>{{ $data_peti->fix_lot }}</td>
<td>{{ optional($data_peti->deleted_at)->format('d-m-Y') ?? '-' }}</td>
<td class="text-center">
<form
action="{{ route('dashboard.recycle_data.pulihkanData', ['id' => $data_peti->id]) }}"
method="post">
@csrf
@method('POST')
<button type="submit" class="btn btn-sm btn-success aksi-link"
onclick="return confirm('Apakah Anda yakin ingin memulihkan data ini?')">Pulihkan</button>
</form>
<!-- Hapus Permanen Data -->
<form
action="{{ route('dashboard.recycle_data.hapusPermanenData', ['id' => $data_peti->id]) }}"
method="post">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-sm btn-danger aksi-link"
onclick="return confirm('Apakah Anda yakin ingin menghapus permanen data ini?')">Hapus
Permanen</button>
</form>
</td>
</tr>
@endforeach
<!-- Data Customer -->
@foreach ($customer as $data_items)
<tr>
<td class="text-center" style="width: 50px;">{{ $norecycle++ }}</td>
<td>Data Customer</td>
<td>{{ $data_items->name }}</td>
<td>{{ optional($data_items->deleted_at)->format('d-m-Y') ?? '-' }}</td>
<td class="text-center">
<form
action="{{ route('dashboard.recycle_data.pulihkanData', ['id' => $data_items->id]) }}"
method="post">
@csrf
@method('POST')
<button type="submit" class="btn btn-sm btn-success aksi-link"
onclick="return confirm('Apakah Anda yakin ingin memulihkan data ini?')">Pulihkan</button>
</form>
<!-- Hapus Permanen Data -->
<form
action="{{ route('dashboard.recycle_data.hapusPermanenData', ['id' => $data_items->id]) }}"
method="post">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-sm btn-danger aksi-link"
onclick="return confirm('Apakah Anda yakin ingin menghapus permanen data ini?')">Hapus
Permanen</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection --}}
@extends('layouts.main')
@section('title', 'Warehouse')
@section('content')
@include('layouts.components.alert-prompt')
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Recycle Data</h5>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead>
<tr>
<th class="text-center" style="width: 50px;">No.</th>
<th>Kategori Data</th>
<th>Data</th>
<th>Tanggal di hapus</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@php
$norecycle = 1;
@endphp
<!-- Data Peti -->
@foreach ($peti as $data_peti)
<tr>
<td class="text-center" style="width: 50px;">{{ $norecycle++ }}</td>
<td>Data Peti</td>
<td>{{ $data_peti->fix_lot }}</td>
<td>{{ optional($data_peti->deleted_at)->format('d-m-Y') ?? '-' }}</td>
<td class="text-center">
<form
action="{{ route('dashboard.recycle_data.pulihkanData', ['model' => 'peti', 'id' => $data_peti->id]) }}"
method="post">
@csrf
@method('POST')
<button type="submit" class="btn btn-sm btn-success aksi-link"
onclick="return confirm('Apakah Anda yakin ingin memulihkan data ini?')">Pulihkan</button>
</form>
<!-- Hapus Permanen Data -->
<form
action="{{ route('dashboard.recycle_data.hapusPermanenData', ['model' => 'peti', 'id' => $data_peti->id]) }}"
method="post">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-sm btn-danger aksi-link"
onclick="return confirm('Apakah Anda yakin ingin menghapus permanen data ini?')">Hapus
Permanen</button>
</form>
</td>
</tr>
@endforeach
<!-- Data Customer -->
@foreach ($customer as $data_items)
<tr>
<td class="text-center" style="width: 50px;">{{ $norecycle++ }}</td>
<td>Data Customer</td>
<td>{{ $data_items->name }}</td>
<td>{{ optional($data_items->deleted_at)->format('d-m-Y') ?? '-' }}</td>
<td class="text-center">
<form
action="{{ route('dashboard.recycle_data.pulihkanData', ['model' => 'customer', 'id' => $data_items->id]) }}"
method="post">
@csrf
@method('POST')
<button type="submit" class="btn btn-sm btn-success aksi-link"
onclick="return confirm('Apakah Anda yakin ingin memulihkan data ini?')">Pulihkan</button>
</form>
<!-- Hapus Permanen Data -->
<form
action="{{ route('dashboard.recycle_data.hapusPermanenData', ['model' => 'customer', 'id' => $data_items->id]) }}"
method="post">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-sm btn-danger aksi-link"
onclick="return confirm('Apakah Anda yakin ingin menghapus permanen data ini?')">Hapus
Permanen</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection

14
resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/index.blade.php

@ -30,7 +30,8 @@
<thead>
<tr>
<th>No</th>
<th>User</th>
{{-- <th>User</th> --}}
<th>FIX LOT</th>
<th>Customer</th>
<th>WH</th>
<th>CODE CUSTOMER</th>
@ -38,7 +39,6 @@
<th>UKURAN PETI</th>
<th>LOT NO</th>
<th>PACKING NO</th>
<th>FIX LOT</th>
<th>STATUS</th>
</tr>
</thead>
@ -49,7 +49,11 @@
@forelse ($peti as $data_peti)
<tr>
<td>{{ $noreport++ }}</td>
<td>ISTW</td>
<td>
<a
href="{{ route('dashboard.Pettern_Lot_Peti.show', $data_peti->id) }}">{{ $data_peti->fix_lot }}</a>
</td>
{{-- <td>ISTW</td> --}}
<td>{{ $data_peti->customer->name }}</td>
<td>{{ $data_peti->warehouse->name }}</td>
<td>{{ $data_peti->customer->code_customer }}</td>
@ -57,10 +61,6 @@
<td>{{ $data_peti->tipe_peti->size_peti }}</td>
<td>{{ $data_peti->customer->lot_no }}</td>
<td class="text-right">{{ $data_peti->packing_no }}</td>
<td>
<a
href="{{ route('dashboard.Pettern_Lot_Peti.show', $data_peti->id) }}">{{ $data_peti->fix_lot }}</a>
</td>
<td>{{ $data_peti->status }}</td>
</tr>
@empty

16
resources/views/dashboard/Master_Data/Report/Stok_opname/index.blade.php

@ -57,6 +57,8 @@
<td>{{ $data_StokOpname->customer->code_customer }} -
{{ $data_StokOpname->tipe_peti->type }}</td>
<td>{{ $data_StokOpname->tipe_peti->size_peti }}</td>
<!-- Bagginning Stok -->
<td class="text-center">
@php
// Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id
@ -72,6 +74,8 @@
0
@endif
</td>
<!-- ADD -->
<td class="text-center">
@php
$todayStokOpname = $todayStokOpnames
@ -85,6 +89,8 @@
0
@endif
</td>
<!-- Total -->
<td class="text-center">
@if ($data_StokOpname->total_petis > 0)
{{ $data_StokOpname->total_petis }}
@ -92,6 +98,8 @@
0
@endif
</td>
<!-- Jakarta-->
<td class="text-center">
@php
// Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id
@ -108,6 +116,8 @@
0
@endif
</td>
<!-- Bekasi-->
<td class="text-center">
@php
// Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id
@ -124,6 +134,8 @@
0
@endif
</td>
<!-- Semarang -->
<td class="text-center">
@php
// Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id
@ -140,6 +152,8 @@
0
@endif
</td>
<!-- Surabaya -->
<td class="text-center">
@php
// Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id
@ -156,6 +170,8 @@
0
@endif
</td>
<!-- Total -->
<td class="text-center">
@if ($data_StokOpname->total_petis > 0)
{{ $data_StokOpname->total_petis }}

6
resources/views/dashboard/Master_Data/User/show.blade.php

@ -40,8 +40,10 @@
readonly>
<label for="jenis_kelamin" class="col-form-label">Jenis Kelamin:</label>
<input class="form-control" name="jenis_kelamin" type="text" id="jenis_kelamin"
value="{{ $user->jenis_kelamin }}" readonly>
<select class="form-control" name="jenis_kelamin" id="jenis_kelamin" disabled>
<option value="L" {{ $user->jenis_kelamin === 'L' ? 'selected' : '' }}>Laki-laki</option>
<option value="P" {{ $user->jenis_kelamin === 'P' ? 'selected' : '' }}>Perempuan</option>
</select>
<label for="agama" class="col-form-label">Agama:</label>
<input class="form-control" name="agama" type="text" id="agama" value="{{ $user->agama }}"

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

@ -67,7 +67,7 @@
@endforeach
</select>
<div class="modal-footer">
<div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.peminjaman.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div>

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

@ -6,7 +6,7 @@
<div class="card-header py-3">
<div class="row">
<div class="col-6">
<h5 class="m-0 font-weight-bold text-primary mt-2">Update Pengembalian</h5>
<h5 class="m-0 font-weight-bold text-primary mt-2">Pengembalian Peti</h5>
</div>
</div>
</div>
@ -65,7 +65,7 @@
</select>
</div>
<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.pengembalian.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div>
</form>

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

@ -40,10 +40,14 @@
</thead>
<tbody>
@php
$no_peminjaman = 1;
$shownPeti = []; // Array untuk melacak peti yang telah ditampilkan
$no_peminjaman = 1; // Inisialisasi nomor peminjaman
@endphp
@forelse ($peminjaman as $data)
@if ($data->enter_warehouse !== null)
@if ($data->enter_warehouse !== null && !in_array($data->peti->fix_lot, $shownPeti))
@php
$shownPeti[] = $data->peti->fix_lot; // Menambahkan peti ke dalam array
@endphp
<tr>
<td>{{ $no_peminjaman++ }}</td>
<td>{{ $data->peti->fix_lot }}</td>
@ -102,6 +106,66 @@
@endif
@empty
@endforelse
{{-- @forelse ($peminjaman as $data)
@if ($data->enter_warehouse !== null)
<tr>
<td>{{ $no_peminjaman++ }}</td>
<td>{{ $data->peti->fix_lot }}</td>
<td>{{ $data->peti->customer->name }}</td>
<td>{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}</td>
<td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}</td>
<td>{{ $data->exit_pic }}</td>
<td>
@if ($data->exit_warehouse)
{{ $data->warehouse->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->enter_at)
{{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->enter_pic)
{{ $data->enter_pic }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->enter_warehouse)
{{ $data->warehouseEnter->name }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->kondisi_peti)
{{ $data->kondisi_peti->nama_kondisi }}
@else
<p class="text-center font-weight-bold">-</p>
@endif
</td>
<td>
@if ($data->enter_warehouse === null)
Not Return
@else
Return
@endif
</td>
<td class="text-center">
<a href="{{ route('dashboard.pengembalian.edit', [$data->id]) }}" title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
</td>
</tr>
@endif
@empty
@endforelse --}}
</tbody>
</table>
</div>

1
resources/views/layouts/main.blade.php

@ -7,6 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>SIOPAS - Dashboard</title>
@include('layouts.link')
</head>

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

@ -153,6 +153,12 @@
</div>
</div>
</li>
{{-- <li class="nav-item {{ $active == 'menu-Recycle_Data' ? 'active' : '' }}">
<a class="nav-link" href="{{ route('dashboard.recycle_data.index') }}">
<i class="fas fa-fw fa-recycle"></i>
<span>Recycle Data</span>
</a>
</li> --}}
@else
@include('pages.layouts.sidebar_user')
@endif

22
routes/web.php

@ -13,10 +13,11 @@ use App\Http\Controllers\TransferController;
use App\Http\Controllers\TypePetiController;
use App\Http\Controllers\WarehouseController;
use App\Http\Controllers\PeminjamanController;
use App\Http\Controllers\StokOpNameController;
use App\Http\Controllers\KondisiPetiController;
use App\Http\Controllers\RecycleDataController;
use App\Http\Controllers\PengembalianController;
use App\Http\Controllers\PetternLotPetiController;
use App\Http\Controllers\StokOpNameController;
use App\Http\Controllers\TransaksiKeluarMasukController;
/*
@ -88,7 +89,6 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
Route::get('transfer', 'index')->name('transfer.index');
Route::get('transfer/create', 'create')->name('transfer.create');
Route::post('transfer/store', 'store')->name('transfer.store');
// Route::get('transfer/{id}', 'show')->name('transfer.show');
Route::get('transfer/{id}/edit', 'edit')->name('transfer.edit');
Route::put('transfer/{id}', 'update')->name('transfer.update');
Route::delete('transfer/delete/{id}', 'destroy')->name('transfer.destroy');
@ -99,7 +99,6 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
Route::get('disposal', 'index')->name('disposal.index');
Route::get('disposal/create', 'create')->name('disposal.create');
Route::post('disposal/store', 'store')->name('disposal.store');
// Route::get('disposal/{id}', 'show')->name('disposal.show');
Route::get('disposal/{id}/edit', 'edit')->name('disposal.edit');
Route::put('disposal/{id}', 'update')->name('disposal.update');
Route::delete('disposal/delete/{id}', 'destroy')->name('disposal.destroy');
@ -110,12 +109,6 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
Route::get('history/peminjaman', 'historyPeminjaman')->name('history.historyPeminjaman');
Route::get('history/pengembalian', 'historyPengembalian')->name('history.historyPengembalian');
Route::get('history/transfer', 'historyTransfer')->name('history.historyTransfer');
// Route::get('history/create', 'create')->name('history.create');
// Route::post('history/store', 'store')->name('history.store');
// Route::get('history/{id}', 'show')->name('history.show');
// Route::get('history/{id}/edit', 'edit')->name('history.edit');
// Route::put('history/{id}', 'update')->name('history.update');
// Route::delete('history/delete/{id}', 'destroy')->name('history.destroy');
});
@ -147,17 +140,13 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
Route::get('customer/{id}/edit', 'edit')->name('customer.edit');
Route::put('customer/{id}', 'update')->name('customer.update');
Route::delete('customer/delete/{id}', 'destroy')->name('customer.destroy');
// Route::post('customer/import', 'importCustomer')->name('customer.importCustomer');
Route::post('customers/import', 'importCustomer')->name('customer.import');
});
//Halaman Kondisi Peti
Route::controller(KondisiPetiController::class)->group(function () {
Route::get('kondisipeti', 'index')->name('kondisipeti.index');
// Route::get('kondisipeti/create', 'create')->name('kondisipeti.create');
Route::post('kondisipeti/store', 'store')->name('kondisipeti.store');
// Route::get('kondisipeti/{id}', 'show')->name('kondisipeti.show');
// Route::get('kondisipeti/{id}/edit', 'edit')->name('kondisipeti.edit');
Route::put('kondisipeti/{id}', 'update')->name('kondisipeti.update');
Route::delete('kondisipeti/delete/{id}', 'destroy')->name('kondisipeti.destroy');
});
@ -196,6 +185,13 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
Route::delete('warehouse/delete/{id}', 'destroy')->name('warehouse.destroy');
});
//Halaman Recycle Data
// Route::controller(RecycleDataController::class)->group(function () {
// Route::get('recycle_data', 'index')->name('recycle_data.index');
// Route::post('/recycle-data/pulihkan/{model}/{id}', 'pulihkanData')->name('recycle_data.pulihkanData');
// Route::delete('/recycle-data/hapus-permanen/{model}/{id}', 'hapusPermanenData')->name('recycle_data.hapusPermanenData');
// });
//halaman Report Peti
Route::controller(PetternLotPetiController::class)->group(function () {
Route::get('Pettern_Lot_Peti/export', 'export')->name('Pettern_Lot_Peti.export');

Loading…
Cancel
Save