Browse Source

update status disposal dan peminjaman

master
Gunawan19621 12 months ago
parent
commit
194ccc2c4a
  1. 77
      app/Exports/StokOpNameExport.php
  2. 9
      app/Http/Controllers/DisposalController.php
  3. 21
      app/Http/Controllers/PeminjamanController.php
  4. 8
      app/Http/Controllers/PetternLotPetiController.php
  5. 69
      app/Http/Controllers/StokOpNameController.php
  6. 9
      app/Http/Controllers/TransferController.php
  7. 10
      app/Http/Requests/ValidasiCreatePeminjaman.php
  8. 14
      app/Http/Requests/ValidasiUpdatePeminjaman.php
  9. 11
      app/Models/Peti.php
  10. 7
      app/Models/asset_status.php
  11. 2
      database/migrations/2023_11_06_122033_create_asset_statuses_table.php
  12. 2
      database/seeders/Type_Peti.php
  13. 30
      database/seeders/WarehouseSeeder.php
  14. 5
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php
  15. 6
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php
  16. 0
      resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/detail_peti.blade.php
  17. 4
      resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/index.blade.php
  18. 133
      resources/views/dashboard/Master_Data/Report/Stok_opname/index.blade.php
  19. 38
      resources/views/dashboard/Peminjaman/create.blade.php
  20. 87
      resources/views/dashboard/Peminjaman/edit.blade.php
  21. 2
      resources/views/dashboard/Peminjaman/index.blade.php
  22. 2
      resources/views/dashboard/Pengembalian/edit.blade.php
  23. 4
      routes/web.php

77
app/Exports/StokOpNameExport.php

@ -0,0 +1,77 @@
<?php
namespace App\Exports;
use App\Models\Peti;
use Illuminate\Support\Carbon;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\FromCollection;
class StokOpNameExport implements FromCollection, WithHeadings
{
protected $stokOpnames;
protected $todayStokOpnames;
protected $yesterdayStokOpnames;
public function __construct($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames)
{
$this->stokOpnames = $stokOpnames;
$this->todayStokOpnames = $todayStokOpnames;
$this->yesterdayStokOpnames = $yesterdayStokOpnames;
}
public function collection()
{
$data = collect();
$nomor = 1;
foreach ($this->stokOpnames as $data_StokOpname) {
$yesterdayStokOpname = $this->yesterdayStokOpnames
->where('customer_id', $data_StokOpname->customer_id)
->where('tipe_peti_id', $data_StokOpname->tipe_peti_id)
->first();
$todayStokOpname = $this->todayStokOpnames
->where('customer_id', $data_StokOpname->customer_id)
->where('tipe_peti_id', $data_StokOpname->tipe_peti_id)
->first();
$data->push([
'No' => $nomor++,
'Customer' => $data_StokOpname->customer->name,
'Kode' => $data_StokOpname->customer->code_customer . ' 0 ' . $data_StokOpname->tipe_peti->type,
'Ukuran Peti' => $data_StokOpname->tipe_peti->size_peti,
'Bagging Stok' => $yesterdayStokOpname ? $yesterdayStokOpname->total_petis : '-',
'Add' => $todayStokOpname ? $todayStokOpname->total_petis : '0',
'Total' => $data_StokOpname->total_petis ?? '0',
'DI ISTW' => 'Belum',
'Gudang A' => 'Belum',
'Gudang B' => 'Belum',
'Gudang C' => 'Belum',
'Stok Opname' => 'Belum',
'Total Stok' => $data_StokOpname->total_petis ?? '0',
]);
}
return $data;
}
public function headings(): array
{
return [
'No',
'Customer',
'Kode',
'Ukuran Peti',
'Bagging Stok',
'Add',
'Total',
'DI ISTW',
'Gudang A',
'Gudang B',
'Gudang C',
'Stok Opname',
'Total Stok',
];
}
}

9
app/Http/Controllers/DisposalController.php

@ -6,7 +6,6 @@ use App\Models\Peti;
use App\Models\Customer; use App\Models\Customer;
use App\Models\Disposal; use App\Models\Disposal;
use App\Models\m_warehouse; use App\Models\m_warehouse;
use Illuminate\Http\Request;
use Symfony\Component\Uid\Uuid; use Symfony\Component\Uid\Uuid;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use App\Http\Requests\Disposal\ValidasiCreateDisposal; use App\Http\Requests\Disposal\ValidasiCreateDisposal;
@ -30,8 +29,14 @@ class DisposalController extends Controller
*/ */
public function create() public function create()
{ {
$petiWithStatusNotZeroOrEmptyAndActive = Peti::where(function ($query) {
$query->whereHas('assetStatuses', function ($subquery) {
$subquery->where('status', '!=', 0);
})->orWhereDoesntHave('assetStatuses');
})->where('status', 'aktif')->get();
$data = [ $data = [
'peti' => Peti::get(), 'peti' => $petiWithStatusNotZeroOrEmptyAndActive,
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
'customer' => Customer::get(), 'customer' => Customer::get(),
'active' => 'menu-disposal', 'active' => 'menu-disposal',

21
app/Http/Controllers/PeminjamanController.php

@ -34,13 +34,23 @@ class PeminjamanController extends Controller
*/ */
public function create() public function create()
{ {
$petiWithStatusNotZeroOrEmptyAndActive = Peti::where(function ($query) {
$query->whereHas('assetStatuses', function ($subquery) {
$subquery->where('status', '!=', 0);
})->orWhereDoesntHave('assetStatuses');
})->where('status', 'aktif')->get();
// $petiTransfer = Peti::where('id', $PetiId)
// ->leftJoin('category', 'product.category', '=', 'category.id')
// ->select('product.id','category.name')->first();
$data = [ $data = [
'peti' => Peti::all(), // 'peti' => Peti::all(),
'peminjaman' => asset_status::get(), 'peminjaman' => asset_status::get(),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
'peti_block' => Peti::whereNotIn('id', asset_status::where('status', 0)->pluck('peti_id')->toArray()) 'peti_block' => $petiWithStatusNotZeroOrEmptyAndActive,
->where('status', 'AKTIF') // Sesuaikan dengan nama kolom yang benar // 'peti_block' => Peti::whereNotIn('id', asset_status::where('status', 0)->pluck('peti_id')->toArray())
->get(), // ->where('status', 'AKTIF') // Sesuaikan dengan nama kolom yang benar
// ->get(),
'customer' => Customer::get(), 'customer' => Customer::get(),
'existingPeti' => asset_status::pluck('peti_id')->toArray(), 'existingPeti' => asset_status::pluck('peti_id')->toArray(),
'active' => 'menu-peminjaman', 'active' => 'menu-peminjaman',
@ -53,6 +63,7 @@ class PeminjamanController extends Controller
*/ */
public function store(ValidasiCreatePeminjaman $request) public function store(ValidasiCreatePeminjaman $request)
{ {
// dd($request->all());
// dd($request); // dd($request);
try { try {
$currentUser = Auth::user(); $currentUser = Auth::user();
@ -89,6 +100,7 @@ class PeminjamanController extends Controller
'peti' => Peti::all(), 'peti' => Peti::all(),
'peminjaman' => asset_status::find($id), 'peminjaman' => asset_status::find($id),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
'customer' => Customer::get(),
'active' => 'menu-peminjaman', 'active' => 'menu-peminjaman',
]; ];
return view('dashboard.Peminjaman.edit', $data); return view('dashboard.Peminjaman.edit', $data);
@ -99,6 +111,7 @@ class PeminjamanController extends Controller
*/ */
public function update(ValidasiUpdatePeminjaman $request, $id) public function update(ValidasiUpdatePeminjaman $request, $id)
{ {
// dd($request->all());
// dd($request); // dd($request);
try { try {
$peminjaman = asset_status::findOrFail($id); $peminjaman = asset_status::findOrFail($id);

8
app/Http/Controllers/PetternLotPetiController.php

@ -17,21 +17,23 @@ class PetternLotPetiController extends Controller
'peti' => Peti::get(), 'peti' => Peti::get(),
'active' => 'menu-Pettern_Lot_Peti' 'active' => 'menu-Pettern_Lot_Peti'
]; ];
return view('dashboard.Master_Data.Report.PATTERN LOT PETI.index', $data); return view('dashboard.Master_Data.Report.Pattern_lot_peti.index', $data);
} }
public function show($id) public function show($id)
{ {
// dd('test');
$data = [ $data = [
'peti' => Peti::find($id), 'peti' => Peti::find($id),
'assetStatus' => asset_status::where('peti_id', $id)->get(), 'assetStatus' => asset_status::where('peti_id', $id)->get(),
'active' => 'menu-Pettern_Lot_Peti' 'active' => 'menu-Pettern_Lot_Peti'
]; ];
return view('dashboard.Master_Data.Report.PATTERN LOT PETI.detail_peti', $data); return view('dashboard.Master_Data.Report.Pattern_lot_peti.detail_peti', $data);
} }
public function export() public function export()
{ {
return Excel::download(new PetternLotPetiExport, 'PATTERN LOT PETI.xlsx'); // dd('test');
return Excel::download(new PetternLotPetiExport, 'PATTERN_LOT_PETI.xlsx');
} }
} }

69
app/Http/Controllers/StokOpNameController.php

@ -2,16 +2,22 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\asset_status; use App\Exports\StokOpNameExport;
use App\Models\Peti; use App\Models\Peti;
use App\Models\asset_status;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Facades\Excel;
class StokOpNameController extends Controller class StokOpNameController extends Controller
{ {
public function index() public function index()
{ {
// Total Peti Berdasarkan Gudang
$gudangStokOpnames = Peti::with('customer', 'tipe_peti', 'warehouse')
->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 // Total Peti Berdasarkan Tanggal Sekarang
$todayStokOpnames = Peti::with('customer', 'tipe_peti') $todayStokOpnames = Peti::with('customer', 'tipe_peti')
@ -23,61 +29,48 @@ class StokOpNameController extends Controller
// Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang // Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang
$yesterdayStokOpnames = Peti::with('customer', 'tipe_peti') $yesterdayStokOpnames = Peti::with('customer', 'tipe_peti')
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', today()->subDays(1)) ->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini
->groupBy('customer_id', 'tipe_peti_id') ->groupBy('customer_id', 'tipe_peti_id')
->get(); ->get();
// Total Peti Berdasarkan Tabel asset_status
// $totalPetiAssetStatus = asset_status::select('peti_id', DB::raw('COUNT(*) as total_petis'))
// ->groupBy('peti_id')
// ->get();
$petiIds = asset_status::whereHas('peti', function ($query) {
$query->groupBy('customer_id', 'tipe_peti_id');
})
->pluck('peti_id');
// Total Peti // Total Peti
$stokOpnames = Peti::with('customer', 'tipe_peti') $stokOpnames = Peti::with('customer', 'tipe_peti')
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id') ->groupBy('customer_id', 'tipe_peti_id')
->get(); ->get();
$petis = Peti::get();
$data = [ $data = [
'stokOpnames' => $stokOpnames, 'stokOpnames' => $stokOpnames,
'todayStokOpnames' => $todayStokOpnames, // tambahin ini di array data 'todayStokOpnames' => $todayStokOpnames, 'todayStokOpnames' => $todayStokOpnames, // tambahin ini di array data 'todayStokOpnames' => $todayStokOpnames,
'yesterdayStokOpnames' => $yesterdayStokOpnames, // tambahin ini di array data 'yesterdayStokOpnames' => $yesterdayStokOpnames, 'yesterdayStokOpnames' => $yesterdayStokOpnames, // tambahin ini di array data 'yesterdayStokOpnames' => $yesterdayStokOpnames,
'totalPetiAssetStatus' => $petiIds, // Sesuaikan dengan model dan kolom yang sesuai 'gudangStokOpnames' => $gudangStokOpnames, // tambahin ini di array data 'gudangStokOpnames' => $gudangStokOpnames,
'assetStatus' => asset_status::get(),
'petis' => $petis,
'active' => 'menu-Stok_Opname' 'active' => 'menu-Stok_Opname'
]; ];
return view('dashboard.Master_Data.Report.Stok_opname.index', $data); return view('dashboard.Master_Data.Report.Stok_opname.index', $data);
} }
// public function index()
// {
public function export()
{
//total peti
$stokOpnames = Peti::with('customer', 'tipe_peti')
->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id')
->get();
// // // Total Peti Berdasarkan Gudang // Total Peti Berdasarkan Tanggal Sekarang
// // $gudangStokOpnames = Peti::with('customer', 'tipe_peti') $todayStokOpnames = Peti::with('customer', 'tipe_peti')
// // ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
// // ->groupBy('customer_id', 'tipe_peti_id') ->whereDate('created_at', today())
// // ->get(); ->groupBy('customer_id', 'tipe_peti_id')
->get();
// $stokOpnames = Peti::with('customer', 'tipe_peti') // Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang
// ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) $yesterdayStokOpnames = Peti::with('customer', 'tipe_peti')
// ->groupBy('customer_id', 'tipe_peti_id') ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
// ->get(); ->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini
// $data = [ ->groupBy('customer_id', 'tipe_peti_id')
// 'stokOpnames ' => $stokOpnames, ->get();
// // 'todayStokOpnames' => $todayStokOpnames,
// // 'yesterdayStokOpnames' => $yesterdayStokOpnames,
// // 'gudangStokOpnames' => $gudangStokOpnames,
// 'active' => 'menu-Stok_Opname'
// ];
// return view('dashboard.Master_Data.Report.Stok_opname.index', $data); return Excel::download(new StokOpNameExport($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames), 'stok_opname.xlsx');
// } }
} }

9
app/Http/Controllers/TransferController.php

@ -35,10 +35,15 @@ class TransferController extends Controller
*/ */
public function create() public function create()
{ {
$petiWithStatusNotZeroOrEmptyAndActive = Peti::where(function ($query) {
$query->whereHas('assetStatuses', function ($subquery) {
$subquery->where('status', '!=', 0);
})->orWhereDoesntHave('assetStatuses');
})->where('status', 'aktif')->get();
$data = [ $data = [
'customer' => Customer::get(), 'customer' => Customer::get(),
'peti' => Peti::get(), 'peti' => $petiWithStatusNotZeroOrEmptyAndActive,
// 'warehouse' => Peti::with('warehouse_id')->get(),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
'active' => 'menu-transfer', 'active' => 'menu-transfer',
]; ];

10
app/Http/Requests/ValidasiCreatePeminjaman.php

@ -23,8 +23,10 @@ class ValidasiCreatePeminjaman extends FormRequest
{ {
return [ return [
'peti_id' => 'required|integer', // Pastikan peti_id ada dalam tabel petis 'peti_id' => 'required|integer', // Pastikan peti_id ada dalam tabel petis
'customer_id' => 'required|integer', // Pastikan customer_id ada dalam tabel customers
'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
'exit_warehouse' => 'required|integer', 'exit_warehouse' => 'required|integer',
]; ];
} }
@ -34,12 +36,16 @@ class ValidasiCreatePeminjaman extends FormRequest
return [ return [
'peti_id.required' => 'Bidang Detail Peti wajib diisi.', 'peti_id.required' => 'Bidang Detail Peti wajib diisi.',
'peti_id.integer' => 'Bidang Detail Peti harus berupa angka.', 'peti_id.integer' => 'Bidang Detail Peti harus berupa angka.',
'customer_id.required' => 'Bidang Customer wajib diisi.',
'customer_id.integer' => 'Bidang Customer harus berupa angka.',
'exit_at.required' => 'Bidang Tanggal Peminjaman wajib diisi.', 'exit_at.required' => 'Bidang Tanggal Peminjaman wajib diisi.',
'exit_at.date' => 'Bidang Tanggal Peminjaman harus berupa tanggal.', 'exit_at.date' => 'Bidang Tanggal Peminjaman harus berupa tanggal.',
'est_pengembalian.required' => 'Bidang Estimasi Tanggal Pengembalian wajib diisi.', 'est_pengembalian.required' => 'Bidang Estimasi Tanggal Pengembalian wajib diisi.',
'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.', 'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.',
'exit_warehouse.required' => 'Bidang Asal Gudang wajib diisi.', 'warehouse_id.required' => 'Bidang Asal Gudang wajib diisi.',
'exit_warehouse.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.',
]; ];
} }
} }

14
app/Http/Requests/ValidasiUpdatePeminjaman.php

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

11
app/Models/Peti.php

@ -45,4 +45,15 @@ class Peti extends Model
{ {
return $this->belongsTo(Kondisi_Peti::class, 'kondisipeti_id')->select('id', 'nama_kondisi', 'deskripsi_kondisi'); return $this->belongsTo(Kondisi_Peti::class, 'kondisipeti_id')->select('id', 'nama_kondisi', 'deskripsi_kondisi');
} }
public function transfer()
{
return $this->hasOne(Transfer::class, 'peti_id');
}
// proses pengambilan data
public function assetStatuses()
{
return $this->hasMany(asset_status::class, 'peti_id');
}
} }

7
app/Models/asset_status.php

@ -20,6 +20,8 @@ class asset_status extends Model
'exit_at', 'exit_at',
'est_pengembalian', 'est_pengembalian',
'exit_pic', 'exit_pic',
'customer_id',
'warehouse_id',
'exit_warehouse', 'exit_warehouse',
'enter_at', 'enter_at',
'enter_pic', 'enter_pic',
@ -35,6 +37,11 @@ class asset_status extends Model
return $this->belongsTo(m_asset::class, 'asset_id'); return $this->belongsTo(m_asset::class, 'asset_id');
} }
public function warehouseId()
{
return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address');
}
public function warehouse() public function warehouse()
{ {
return $this->belongsTo(m_warehouse::class, 'exit_warehouse')->select('id', 'name', 'address'); return $this->belongsTo(m_warehouse::class, 'exit_warehouse')->select('id', 'name', 'address');

2
database/migrations/2023_11_06_122033_create_asset_statuses_table.php

@ -18,6 +18,8 @@ return new class extends Migration
$table->date('exit_at')->nullable(); $table->date('exit_at')->nullable();
$table->date('est_pengembalian')->nullable(); $table->date('est_pengembalian')->nullable();
$table->string('exit_pic', 200)->nullable(); $table->string('exit_pic', 200)->nullable();
$table->foreignId('customer_id')->nullable()->constrained('customers');
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses');
$table->foreignId('exit_warehouse')->nullable()->constrained('m_warehouses'); $table->foreignId('exit_warehouse')->nullable()->constrained('m_warehouses');
$table->date('enter_at')->nullable(); $table->date('enter_at')->nullable();
$table->string('enter_pic', 200)->nullable(); $table->string('enter_pic', 200)->nullable();

2
database/seeders/Type_Peti.php

@ -15,7 +15,7 @@ class Type_Peti extends Seeder
public function run(): void public function run(): void
{ {
DB::table('type_petis')->insert([ DB::table('type_petis')->insert([
'type' => 'Bagus', 'type' => 'Baik',
'size_peti' => '2 X 2 X 2 X 2', 'size_peti' => '2 X 2 X 2 X 2',
'description' => 'Detail Barang Bagus', 'description' => 'Detail Barang Bagus',
'created_by' => 'Seeder', 'created_by' => 'Seeder',

30
database/seeders/WarehouseSeeder.php

@ -15,18 +15,36 @@ class WarehouseSeeder extends Seeder
{ {
// Warehouse 1 // Warehouse 1
m_warehouse::create([ m_warehouse::create([
'name' => 'Gudang A', 'name' => 'Jakarta',
'description' => 'Gudang utama', 'description' => 'PT Indonesia Steel Tube Works Jakarta Office',
'address' => 'Alamat Gudang A', 'address' => 'Jln. Jakarta Timur',
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_by' => 'Seeder', 'updated_by' => 'Seeder',
]); ]);
// Warehouse 2 // Warehouse 2
m_warehouse::create([ m_warehouse::create([
'name' => 'Gudang B', 'name' => 'Bekasi',
'description' => 'Gudang cabang', 'description' => 'PT Indonesia Steel Tube Works Bekasi Office',
'address' => 'Alamat Gudang B', 'address' => 'Jln. Bekasi',
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
]);
// Warehouse 3
m_warehouse::create([
'name' => 'Semarang',
'description' => 'PT Indonesia Steel Tube Works Semarang Office',
'address' => 'Jln. Semarang',
'created_by' => 'Seeder',
'updated_by' => 'Seeder',
]);
// Warehouse 4
m_warehouse::create([
'name' => 'Surabaya',
'description' => 'PT Indonesia Steel Tube Works Surabaya Office',
'address' => 'Jln. Surabaya',
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_by' => 'Seeder', 'updated_by' => 'Seeder',
]); ]);

5
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php

@ -43,8 +43,9 @@
@endforeach @endforeach
</select> </select>
<label for="kondisipeti_id" class="col-form-label">Kondisi Peti:</label> <label for="kondisipeti_id" class="col-form-label">Kondisi Peti: <span
<select class="form-control" name="kondisipeti_id" id="kondisipeti_id"> class="text-danger">*</span></label>
<select class="form-control" name="kondisipeti_id" id="kondisipeti_id" required>
<option disabled selected>Pilih Kondisi Peti</option> <option disabled selected>Pilih Kondisi Peti</option>
@foreach ($kondisiPeti as $data_kondisiPeti) @foreach ($kondisiPeti as $data_kondisiPeti)
<option value="{{ $data_kondisiPeti->id }}">{{ $data_kondisiPeti->nama_kondisi }}</option> <option value="{{ $data_kondisiPeti->id }}">{{ $data_kondisiPeti->nama_kondisi }}</option>

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

@ -39,6 +39,7 @@
<tr> <tr>
<th class="text-center" style="width: 10px">No</th> <th class="text-center" style="width: 10px">No</th>
<th><input type="checkbox" class="checkbox " id="selectAll"></th> <th><input type="checkbox" class="checkbox " id="selectAll"></th>
<th>Fix Lot</th>
<th>User</th> <th>User</th>
<th>Customer</th> <th>Customer</th>
<th>WH</th> <th>WH</th>
@ -48,7 +49,7 @@
<th>Lot No</th> <th>Lot No</th>
<th>Kondisi Peti</th> <th>Kondisi Peti</th>
<th>Packing No</th> <th>Packing No</th>
<th>Fix Lot</th> <th>Status</th>
<th class="text-center">Action</th> <th class="text-center">Action</th>
</tr> </tr>
</thead> </thead>
@ -60,6 +61,7 @@
<tr> <tr>
<td class="text-center">{{ $nopeti++ }}</td> <td class="text-center">{{ $nopeti++ }}</td>
<td><input type="checkbox" class="checkbox" value="{{ $data_peti->id }}"></td> <td><input type="checkbox" class="checkbox" value="{{ $data_peti->id }}"></td>
<td>{{ $data_peti->fix_lot }}</td>
<td>{{ $data_peti->created_by }}</td> <td>{{ $data_peti->created_by }}</td>
<td>{{ $data_peti->customer->name }}</td> <td>{{ $data_peti->customer->name }}</td>
<td>{{ $data_peti->warehouse->name }}</td> <td>{{ $data_peti->warehouse->name }}</td>
@ -69,7 +71,7 @@
<td>{{ $data_peti->customer->lot_no }}</td> <td>{{ $data_peti->customer->lot_no }}</td>
<td>{{ $data_peti->kondisipeti->nama_kondisi }}</td> <td>{{ $data_peti->kondisipeti->nama_kondisi }}</td>
<td class="text-right">{{ $data_peti->packing_no }}</td> <td class="text-right">{{ $data_peti->packing_no }}</td>
<td>{{ $data_peti->fix_lot }}</td> <td>{{ $data_peti->status }}</td>
<td class="text-center"> <td class="text-center">
<a href="{{ route('dashboard.peti.show', [$data_peti->id]) }}"> <a href="{{ route('dashboard.peti.show', [$data_peti->id]) }}">
<i class="fa fa-eye mr-2" style="font-size: 20px"></i> <i class="fa fa-eye mr-2" style="font-size: 20px"></i>

0
resources/views/dashboard/Master_Data/Report/PATTERN LOT PETI/detail_peti.blade.php → resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/detail_peti.blade.php

4
resources/views/dashboard/Master_Data/Report/PATTERN LOT PETI/index.blade.php → resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/index.blade.php

@ -17,9 +17,9 @@
<h5 class="m-0 font-weight-bold text-primary mt-2">Report Pettern Lot Peti</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Report Pettern Lot Peti</h5>
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
<a href="#" class="btn btn-success btn-icon-split ml-auto" target="_blank"> {{-- <a href="#" class="btn btn-success btn-icon-split ml-auto" target="_blank">
<span class="text">Cetak PDF</span> <span class="text">Cetak PDF</span>
</a> </a> --}}
<a href="{{ route('dashboard.Pettern_Lot_Peti.export') }}" class="btn btn-info btn-icon-split ml-auto" <a href="{{ route('dashboard.Pettern_Lot_Peti.export') }}" class="btn btn-info btn-icon-split ml-auto"
target="_blank"> target="_blank">
<span class="text">Cetak Exel</span> <span class="text">Cetak Exel</span>

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

@ -17,10 +17,10 @@
<h5 class="m-0 font-weight-bold text-primary mt-2">Report Stok Opname</h5> <h5 class="m-0 font-weight-bold text-primary mt-2">Report Stok Opname</h5>
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
<a href="#" class="btn btn-success btn-icon-split ml-auto" target="_blank"> {{-- <a href="#" class="btn btn-success btn-icon-split ml-auto" target="_blank">
<span class="text">Cetak PDF</span> <span class="text">Cetak PDF</span> --}}
</a> </a>
<a href="{{ route('dashboard.Pettern_Lot_Peti.export') }}" class="btn btn-info btn-icon-split ml-auto" <a href="{{ route('dashboard.StokOpname.export') }}" class="btn btn-info btn-icon-split ml-auto"
target="_blank"> target="_blank">
<span class="text">Cetak Exel</span> <span class="text">Cetak Exel</span>
</a> </a>
@ -36,18 +36,17 @@
<th rowspan="2"style="vertical-align: middle; text-align: center;">Customer</th> <th rowspan="2"style="vertical-align: middle; text-align: center;">Customer</th>
<th rowspan="2"style="vertical-align: middle; text-align: center;">Kode</th> <th rowspan="2"style="vertical-align: middle; text-align: center;">Kode</th>
<th rowspan="2" style="vertical-align: middle; text-align: center;">Ukuran Peti</th> <th rowspan="2" style="vertical-align: middle; text-align: center;">Ukuran Peti</th>
<th rowspan="2" style="vertical-align: middle; text-align: center;">Bagginning</th> <th rowspan="2" style="vertical-align: middle; text-align: center;">Bagginning<br>Stok</th>
<th rowspan="2" style="vertical-align: middle; text-align: center;">Add</th> <th rowspan="2" style="vertical-align: middle; text-align: center;">Add</th>
<th rowspan="2" style="vertical-align: middle; text-align: center;">Total</th> <th rowspan="2" style="vertical-align: middle; text-align: center;">Total</th>
<th colspan="4" style="text-align: center; vertical-align: middle;">Stock</th> <th colspan="4" style="text-align: center; vertical-align: middle;">Stock</th>
<th rowspan="2" style="vertical-align: middle; text-align: center;">Stok Opname</th>
<th rowspan="2" style="vertical-align: middle; text-align: center;">Total</th> <th rowspan="2" style="vertical-align: middle; text-align: center;">Total</th>
</tr> </tr>
<tr> <tr>
<th>DI ISTW</th> <th>Jakarta</th>
<th>Gudang A</th> <th>Bekasi</th>
<th>Gudang B</th> <th>Semarang</th>
<th>Gudang C</th> <th>Surabaya</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -56,12 +55,12 @@
@endphp @endphp
@forelse ($stokOpnames as $data_StokOpname) @forelse ($stokOpnames as $data_StokOpname)
<tr> <tr>
<td>{{ $noreport++ }}</td> <td class="text-center">{{ $noreport++ }}</td>
<td>{{ $data_StokOpname->customer->name }}</td> <td>{{ $data_StokOpname->customer->name }}</td>
<td>{{ $data_StokOpname->customer->code_customer }} - <td>{{ $data_StokOpname->customer->code_customer }} -
{{ $data_StokOpname->tipe_peti->type }}</td> {{ $data_StokOpname->tipe_peti->type }}</td>
<td>{{ $data_StokOpname->tipe_peti->size_peti }}</td> <td>{{ $data_StokOpname->tipe_peti->size_peti }}</td>
<td> <td class="text-center">
@php @php
// Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id // Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id
$yesterdayStokOpname = $yesterdayStokOpnames $yesterdayStokOpname = $yesterdayStokOpnames
@ -73,10 +72,10 @@
@if ($yesterdayStokOpname && $yesterdayStokOpname->total_petis > 0) @if ($yesterdayStokOpname && $yesterdayStokOpname->total_petis > 0)
{{ $yesterdayStokOpname->total_petis }} {{ $yesterdayStokOpname->total_petis }}
@else @else
- 0
@endif @endif
</td> </td>
<td> <td class="text-center">
@php @php
$todayStokOpname = $todayStokOpnames $todayStokOpname = $todayStokOpnames
->where('customer_id', $data_StokOpname->customer_id) ->where('customer_id', $data_StokOpname->customer_id)
@ -86,63 +85,85 @@
@if ($todayStokOpname && $todayStokOpname->total_petis > 0) @if ($todayStokOpname && $todayStokOpname->total_petis > 0)
{{ $todayStokOpname->total_petis }} {{ $todayStokOpname->total_petis }}
@else @else
- 0
@endif @endif
</td> </td>
<td> <td class="text-center">
@if ($data_StokOpname->total_petis > 0) @if ($data_StokOpname->total_petis > 0)
{{ $data_StokOpname->total_petis }} {{ $data_StokOpname->total_petis }}
@else @else
- 0
@endif @endif
</td> </td>
<td> <td class="text-center">
- @php
// Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id
$gudangStokOpname = $gudangStokOpnames
->where('customer_id', $data_StokOpname->customer_id)
->where('tipe_peti_id', $data_StokOpname->tipe_peti_id)
->where('warehouse_id', 1)
->first();
@endphp
{{-- Jumlah total peti pada tanggal sebelum sekarang (kemarin) --}}
@if ($gudangStokOpname && $gudangStokOpname->total_petis > 0)
{{ $gudangStokOpname->total_petis }}
@else
0
@endif
</td> </td>
<td>Gudang A</td> <td class="text-center">
<td>Gudang B</td>
<td>
@php @php
$totalNullableCount = 0; // Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id
$gudangStokOpname = $gudangStokOpnames
->where('customer_id', $data_StokOpname->customer_id)
->where('tipe_peti_id', $data_StokOpname->tipe_peti_id)
->where('warehouse_id', 2)
->first();
@endphp @endphp
{{-- Jumlah total peti pada tanggal sebelum sekarang (kemarin) --}}
@foreach ($petis as $peti) @if ($gudangStokOpname && $gudangStokOpname->total_petis > 0)
@php {{ $gudangStokOpname->total_petis }}
$totalNullableCount += $assetStatus @else
->where('peti_id', $peti->id) 0
->where('enter_warehouse', '=', 0) @endif
// ->where('customer_id', $peti->customer_id) </td>
->count(); <td class="text-center">
@endphp @php
@endforeach // Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id
$gudangStokOpname = $gudangStokOpnames
{{ $totalNullableCount }} ->where('customer_id', $data_StokOpname->customer_id)
->where('tipe_peti_id', $data_StokOpname->tipe_peti_id)
->where('warehouse_id', 3)
->first();
@endphp
{{-- @foreach ($petis as $item) {{-- Jumlah total peti pada tanggal sebelum sekarang (kemarin) --}}
@php @if ($gudangStokOpname && $gudangStokOpname->total_petis > 0)
$totalAsset = \App\Models\asset_status::get(); {{ $gudangStokOpname->total_petis }}
$totalAssetStatus = $totalAsset @else
->where('customer_id', $item->customer_id) 0
->where('peti_id', $item->id) @endif
->count(); </td>
@endphp <td class="text-center">
@if ($totalAssetStatus > 0) @php
{{ $totalAssetStatus }} // Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id
@else $gudangStokOpname = $gudangStokOpnames
0 ->where('customer_id', $data_StokOpname->customer_id)
@endif ->where('tipe_peti_id', $data_StokOpname->tipe_peti_id)
@endforeach --}} ->where('warehouse_id', 4)
->first();
@endphp
{{-- Jumlah total peti pada tanggal sebelum sekarang (kemarin) --}}
@if ($gudangStokOpname && $gudangStokOpname->total_petis > 0)
{{ $gudangStokOpname->total_petis }}
@else
0
@endif
</td> </td>
<td> - </td> <td class="text-center">
<td>
@if ($data_StokOpname->total_petis > 0) @if ($data_StokOpname->total_petis > 0)
{{ $data_StokOpname->total_petis }} {{ $data_StokOpname->total_petis }}
@else @else
- 0
@endif @endif
</td> </td>
</tr> </tr>

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

@ -17,18 +17,24 @@
<div class="form-group"> <div class="form-group">
<label for="peti_id" class="col-form-label">Pilih Detail Peti: <span <label for="peti_id" class="col-form-label">Pilih Detail Peti: <span
class="text-danger">*</span></label> 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" id="peti_id" required>
<option disabled selected>Pilih Detail Peti</option> <option disabled selected>Pilih Detail Peti</option>
@foreach ($peti_block as $data_peti) @foreach ($peti_block as $data_peti)
<option value="{{ $data_peti->id }}" data-warehouse-id="{{ $data_peti->warehouse_id }}" <option value="{{ $data_peti->id }}" data-warehouse-id="{{ $data_peti->warehouse_id }}"
data-customer-name="{{ $data_peti->customer->name }}"> data-customer-id="{{ $data_peti->customer->id }}"
data-warehouse-name="{{ $data_peti->warehouse->name }}">
{{ $data_peti->fix_lot }} {{ $data_peti->fix_lot }}
</option> </option>
@endforeach @endforeach
</select> </select>
<label for="name" class="col-form-label">Customer:<span class="text-danger">*</span></label> <label for="customer_id" class="col-form-label">Customer:<span class="text-danger">*</span></label>
<input class="form-control" name="name" type="text" id="name" placeholder="Nama Customer"> <select class="form-control" name="customer_id" type="text" id="customer_id" required>
<option disabled selected>Pilih Nama Customer</option>
@foreach ($customer as $data)
<option value="{{ $data->id }}">{{ $data->name }}</option>
@endforeach
</select>
<label for="exit_at" class="col-form-label">Tanggal Peminjaman: <span <label for="exit_at" class="col-form-label">Tanggal Peminjaman: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
@ -39,13 +45,14 @@
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" class="col-form-label">Asal Gudang:</label> <label for="warehouse_id" class="col-form-label">Asal Gudang:</label>
<select class="form-control" name="warehouse" type="text" id="warehouse" required> <select class="form-control" name="warehouse_id" type="text" id="warehouse_id" required>
<option disabled selected>Pilih Asal Gudang</option> <option disabled selected>Pilih Asal Gudang</option>
@foreach ($warehouse as $data) @foreach ($warehouse as $data)
<option value="{{ $data->id }}">{{ $data->name }}</option> <option value="{{ $data->id }}">{{ $data->name }}</option>
@endforeach @endforeach
</select> </select>
<label for="exit_warehouse" class="col-form-label">Tujuan Gudang: <span <label for="exit_warehouse" class="col-form-label">Tujuan Gudang: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<select class="form-control" name="exit_warehouse" type="text" id="exit_warehouse" required> <select class="form-control" name="exit_warehouse" type="text" id="exit_warehouse" required>
@ -97,26 +104,25 @@
// Mendapatkan elemen select detail peti // Mendapatkan elemen select detail peti
const petiSelect = document.getElementById('peti_id'); const petiSelect = document.getElementById('peti_id');
// Mendapatkan elemen select asal gudang // Mendapatkan elemen select customer
const exitWarehouseSelect = document.getElementById('warehouse'); const customerSelect = document.getElementById('customer_id');
// Mendapatkan elemen input Customer // Mendapatkan elemen select asal gudang
const nameInput = document.getElementById('name'); const warehouseSelect = document.getElementById('warehouse_id');
// Menambahkan event listener ke select detail peti // Menambahkan event listener ke select detail peti
petiSelect.addEventListener('change', function() { petiSelect.addEventListener('change', function() {
// Mendapatkan data-warehouse-id dari option yang dipilih // Mendapatkan data-warehouse-id dari option yang dipilih
const selectedOption = this.options[this.selectedIndex]; const selectedOption = this.options[this.selectedIndex];
const warehouseId = selectedOption.getAttribute('data-warehouse-id'); const warehouseId = selectedOption.getAttribute('data-warehouse-id');
const customerId = selectedOption.getAttribute('data-customer-id');
// Mendapatkan data-customer-name dari option yang dipilih const warehouseName = selectedOption.getAttribute('data-warehouse-name');
const customerName = selectedOption.getAttribute('data-customer-name');
// Memilih asal gudang berdasarkan data-warehouse-id // Memilih asal gudang berdasarkan data-warehouse-id
exitWarehouseSelect.value = warehouseId; warehouseSelect.value = warehouseId;
// Mengisi input Customer dengan nama pelanggan // Memilih customer berdasarkan data-customer-id
nameInput.value = customerName; customerSelect.value = customerId;
}); });
</script> </script>

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

@ -15,47 +15,58 @@
enctype="multipart/form-data" id="editForm"> enctype="multipart/form-data" id="editForm">
@csrf @csrf
@method('PUT') @method('PUT')
<div class="form-group"> <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 <input type="hidden" name="peti_id" value="{{ $peminjaman->peti_id }}">
class="text-danger">*</span></label> <input class="form-control" name="coba"value="{{ $peminjaman->peti->fix_lot }}" @readonly(true)>
<select class="form-control" name="peti_id" id="peti_id"> {{-- <select class="form-control" name="peti_id" id="peti_id">
<option disabled selected>Pilih Detail Peti</option> <option disabled selected>Pilih Detail Peti</option>
@foreach ($peti as $data_peti) @foreach ($peti as $data_peti)
<option value="{{ $data_peti->id }}" data-warehouse-id="{{ $data_peti->warehouse_id }}" <option value="{{ $data_peti->id }}" data-warehouse-id="{{ $data_peti->warehouse_id }}"
{{ $data_peti->id == $peminjaman->peti_id ? 'selected' : '' }}> {{ $data_peti->id == $peminjaman->peti_id ? 'selected' : '' }}>
{{ $data_peti->fix_lot }} {{ $data_peti->fix_lot }}
</option> </option>
@endforeach @endforeach
</select> </select> --}}
</div>
<div class="form-group"> <label for="customer_id" class="col-form-label">Customer:<span class="text-danger">*</span></label>
<label for="exit_at" class="col-form-label">Tanggal Peminjaman: <span <select class="form-control" name="customer_id" type="text" id="customer_id" required>
class="text-danger">*</span></label> <option disabled selected>Pilih Nama Customer</option>
<input class="form-control" name="exit_at" type="date" id="exit_at" @foreach ($customer as $data_customer)
value="{{ $peminjaman->exit_at }}" required> <option value="{{ $data_customer->id }}"
</div> @if ($data_customer->id == $peminjaman->customer_id) selected
@else @endif>
{{ $data_customer->name }}
</option>
@endforeach
</select>
<div class="form-group"> <label for="exit_at" class="col-form-label">Tanggal Peminjaman: <span class="text-danger">*</span></label>
<label for="est_pengembalian" class="col-form-label">Estimasi Tanggal Pengembalian: <span <input class="form-control" name="exit_at" type="date" id="exit_at" value="{{ $peminjaman->exit_at }}"
class="text-danger">*</span></label> required>
<input class="form-control" name="est_pengembalian" type="date" id="est_pengembalian"
value="{{ $peminjaman->est_pengembalian }}" required> <label for="est_pengembalian" class="col-form-label">Estimasi Tanggal Pengembalian: <span
</div> class="text-danger">*</span></label>
<input class="form-control" name="est_pengembalian" type="date" id="est_pengembalian"
value="{{ $peminjaman->est_pengembalian }}" required>
<label for="warehouse_id" class="col-form-label">Asal Gudang:</label>
<select class="form-control" name="warehouse_id" type="text" id="warehouse_id" required>
<option disabled selected>Pilih Asal Gudang</option>
@foreach ($warehouse as $data)
<option value="{{ $data->id }}" @if ($data->id == $peminjaman->warehouse_id) selected @else @endif>
{{ $data->name }}</option>
@endforeach
</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="form-group">
<label for="exit_warehouse" class="col-form-label">Asal Gudang: <span
class="text-danger">*</span></label>
<select class="form-control" name="exit_warehouse" id="exit_warehouse" required>
<option disabled selected>Pilih Asal Gudang</option>
@foreach ($warehouse as $data)
<option value="{{ $data->id }}"
{{ $data->id == $peminjaman->exit_warehouse ? 'selected' : '' }}>
{{ $data->name }}
</option>
@endforeach
</select>
</div>
<div class="modal-footer"> <div class="modal-footer">
<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>

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

@ -36,7 +36,7 @@
<th>Kode</th> <th>Kode</th>
<th>Tgl Peminjaman</th> <th>Tgl Peminjaman</th>
<th>PJ Peminjaman</th> <th>PJ Peminjaman</th>
<th>WH Peminjam</th> <th>Tujuan WH Peminjam</th>
<th class="text-center">Action</th> <th class="text-center">Action</th>
</tr> </tr>
</thead> </thead>

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

@ -49,7 +49,7 @@
<option disabled selected>Pilih Tujuan Gudang</option> <option disabled selected>Pilih Tujuan Gudang</option>
@foreach ($warehouse as $data_warehouse) @foreach ($warehouse as $data_warehouse)
<option value="{{ $data_warehouse->id }}" <option value="{{ $data_warehouse->id }}"
@if ($data_warehouse->id == $peminjaman->enter_warehouse) selected @if ($data_warehouse->id == $peminjaman->warehouse_id) selected
@else @endif> @else @endif>
{{ $data_warehouse->name }}</option> {{ $data_warehouse->name }}</option>
@endforeach @endforeach

4
routes/web.php

@ -198,16 +198,16 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
//halaman Report Peti //halaman Report Peti
Route::controller(PetternLotPetiController::class)->group(function () { Route::controller(PetternLotPetiController::class)->group(function () {
Route::get('Pettern_Lot_Peti/export', 'export')->name('Pettern_Lot_Peti.export');
Route::get('Pettern_Lot_Peti', 'index')->name('Pettern_Lot_Peti.index'); Route::get('Pettern_Lot_Peti', 'index')->name('Pettern_Lot_Peti.index');
Route::get('Pettern_Lot_Peti/{id}', 'show')->name('Pettern_Lot_Peti.show'); Route::get('Pettern_Lot_Peti/{id}', 'show')->name('Pettern_Lot_Peti.show');
Route::get('Pettern_Lot_Peti/export', 'export')->name('Pettern_Lot_Peti.export');
}); });
//halaman Report Stok //halaman Report Stok
Route::controller(StokOpNameController::class)->group(function () { Route::controller(StokOpNameController::class)->group(function () {
Route::get('StokOpname', 'index')->name('StokOpname.index'); Route::get('StokOpname', 'index')->name('StokOpname.index');
// Route::get('StokOpname/{id}', 'show')->name('StokOpname.show'); // Route::get('StokOpname/{id}', 'show')->name('StokOpname.show');
// Route::get('StokOpname/export', 'export')->name('StokOpname.export'); Route::get('StokOpname/export', 'export')->name('StokOpname.export');
}); });
}); });

Loading…
Cancel
Save