From 194ccc2c4a14902cb83485c309b610c6adcb15a0 Mon Sep 17 00:00:00 2001 From: Gunawan19621 Date: Sun, 26 Nov 2023 21:52:32 +0700 Subject: [PATCH] update status disposal dan peminjaman --- app/Exports/StokOpNameExport.php | 77 ++++++++++ app/Http/Controllers/DisposalController.php | 9 +- app/Http/Controllers/PeminjamanController.php | 21 ++- .../Controllers/PetternLotPetiController.php | 8 +- app/Http/Controllers/StokOpNameController.php | 69 ++++----- app/Http/Controllers/TransferController.php | 9 +- .../Requests/ValidasiCreatePeminjaman.php | 10 +- .../Requests/ValidasiUpdatePeminjaman.php | 14 +- app/Models/Peti.php | 11 ++ app/Models/asset_status.php | 7 + ..._06_122033_create_asset_statuses_table.php | 2 + database/seeders/Type_Peti.php | 2 +- database/seeders/WarehouseSeeder.php | 30 +++- .../Manajemen_Peti/Peti/create.blade.php | 5 +- .../Manajemen_Peti/Peti/index.blade.php | 6 +- .../detail_peti.blade.php | 0 .../index.blade.php | 4 +- .../Report/Stok_opname/index.blade.php | 133 ++++++++++-------- .../dashboard/Peminjaman/create.blade.php | 38 ++--- .../views/dashboard/Peminjaman/edit.blade.php | 87 +++++++----- .../dashboard/Peminjaman/index.blade.php | 2 +- .../dashboard/Pengembalian/edit.blade.php | 2 +- routes/web.php | 4 +- 23 files changed, 369 insertions(+), 181 deletions(-) create mode 100644 app/Exports/StokOpNameExport.php rename resources/views/dashboard/Master_Data/Report/{PATTERN LOT PETI => Pattern_lot_peti}/detail_peti.blade.php (100%) rename resources/views/dashboard/Master_Data/Report/{PATTERN LOT PETI => Pattern_lot_peti}/index.blade.php (95%) diff --git a/app/Exports/StokOpNameExport.php b/app/Exports/StokOpNameExport.php new file mode 100644 index 0000000..8c98351 --- /dev/null +++ b/app/Exports/StokOpNameExport.php @@ -0,0 +1,77 @@ +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', + ]; + } +} diff --git a/app/Http/Controllers/DisposalController.php b/app/Http/Controllers/DisposalController.php index 8f8d170..95f76e3 100644 --- a/app/Http/Controllers/DisposalController.php +++ b/app/Http/Controllers/DisposalController.php @@ -6,7 +6,6 @@ use App\Models\Peti; use App\Models\Customer; use App\Models\Disposal; use App\Models\m_warehouse; -use Illuminate\Http\Request; use Symfony\Component\Uid\Uuid; use Illuminate\Support\Facades\Auth; use App\Http\Requests\Disposal\ValidasiCreateDisposal; @@ -30,8 +29,14 @@ class DisposalController extends Controller */ public function create() { + $petiWithStatusNotZeroOrEmptyAndActive = Peti::where(function ($query) { + $query->whereHas('assetStatuses', function ($subquery) { + $subquery->where('status', '!=', 0); + })->orWhereDoesntHave('assetStatuses'); + })->where('status', 'aktif')->get(); + $data = [ - 'peti' => Peti::get(), + 'peti' => $petiWithStatusNotZeroOrEmptyAndActive, 'warehouse' => m_warehouse::get(), 'customer' => Customer::get(), 'active' => 'menu-disposal', diff --git a/app/Http/Controllers/PeminjamanController.php b/app/Http/Controllers/PeminjamanController.php index 04df902..8c8d1d5 100644 --- a/app/Http/Controllers/PeminjamanController.php +++ b/app/Http/Controllers/PeminjamanController.php @@ -34,13 +34,23 @@ class PeminjamanController extends Controller */ 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 = [ - 'peti' => Peti::all(), + // 'peti' => Peti::all(), 'peminjaman' => asset_status::get(), 'warehouse' => m_warehouse::get(), - 'peti_block' => Peti::whereNotIn('id', asset_status::where('status', 0)->pluck('peti_id')->toArray()) - ->where('status', 'AKTIF') // Sesuaikan dengan nama kolom yang benar - ->get(), + 'peti_block' => $petiWithStatusNotZeroOrEmptyAndActive, + // 'peti_block' => Peti::whereNotIn('id', asset_status::where('status', 0)->pluck('peti_id')->toArray()) + // ->where('status', 'AKTIF') // Sesuaikan dengan nama kolom yang benar + // ->get(), 'customer' => Customer::get(), 'existingPeti' => asset_status::pluck('peti_id')->toArray(), 'active' => 'menu-peminjaman', @@ -53,6 +63,7 @@ class PeminjamanController extends Controller */ public function store(ValidasiCreatePeminjaman $request) { + // dd($request->all()); // dd($request); try { $currentUser = Auth::user(); @@ -89,6 +100,7 @@ class PeminjamanController extends Controller 'peti' => Peti::all(), 'peminjaman' => asset_status::find($id), 'warehouse' => m_warehouse::get(), + 'customer' => Customer::get(), 'active' => 'menu-peminjaman', ]; return view('dashboard.Peminjaman.edit', $data); @@ -99,6 +111,7 @@ class PeminjamanController extends Controller */ public function update(ValidasiUpdatePeminjaman $request, $id) { + // dd($request->all()); // dd($request); try { $peminjaman = asset_status::findOrFail($id); diff --git a/app/Http/Controllers/PetternLotPetiController.php b/app/Http/Controllers/PetternLotPetiController.php index 1cbe293..7e3baf9 100644 --- a/app/Http/Controllers/PetternLotPetiController.php +++ b/app/Http/Controllers/PetternLotPetiController.php @@ -17,21 +17,23 @@ class PetternLotPetiController extends Controller 'peti' => Peti::get(), '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) { + // dd('test'); $data = [ 'peti' => Peti::find($id), 'assetStatus' => asset_status::where('peti_id', $id)->get(), '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() { - return Excel::download(new PetternLotPetiExport, 'PATTERN LOT PETI.xlsx'); + // dd('test'); + return Excel::download(new PetternLotPetiExport, 'PATTERN_LOT_PETI.xlsx'); } } diff --git a/app/Http/Controllers/StokOpNameController.php b/app/Http/Controllers/StokOpNameController.php index cb057b8..7b87176 100644 --- a/app/Http/Controllers/StokOpNameController.php +++ b/app/Http/Controllers/StokOpNameController.php @@ -2,16 +2,22 @@ namespace App\Http\Controllers; -use App\Models\asset_status; +use App\Exports\StokOpNameExport; use App\Models\Peti; +use App\Models\asset_status; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; +use Maatwebsite\Excel\Facades\Excel; class StokOpNameController extends Controller { 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 $todayStokOpnames = Peti::with('customer', 'tipe_peti') @@ -23,61 +29,48 @@ class StokOpNameController extends Controller // Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang $yesterdayStokOpnames = Peti::with('customer', 'tipe_peti') ->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') ->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 $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(); - $petis = Peti::get(); - $data = [ 'stokOpnames' => $stokOpnames, 'todayStokOpnames' => $todayStokOpnames, // tambahin ini di array data 'todayStokOpnames' => $todayStokOpnames, 'yesterdayStokOpnames' => $yesterdayStokOpnames, // tambahin ini di array data 'yesterdayStokOpnames' => $yesterdayStokOpnames, - 'totalPetiAssetStatus' => $petiIds, // Sesuaikan dengan model dan kolom yang sesuai - 'assetStatus' => asset_status::get(), - 'petis' => $petis, + 'gudangStokOpnames' => $gudangStokOpnames, // tambahin ini di array data 'gudangStokOpnames' => $gudangStokOpnames, 'active' => 'menu-Stok_Opname' ]; 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 - // // $gudangStokOpnames = 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 Tanggal Sekarang + $todayStokOpnames = Peti::with('customer', 'tipe_peti') + ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) + ->whereDate('created_at', today()) + ->groupBy('customer_id', 'tipe_peti_id') + ->get(); - // $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(); - // $data = [ - // 'stokOpnames ' => $stokOpnames, - // // 'todayStokOpnames' => $todayStokOpnames, - // // 'yesterdayStokOpnames' => $yesterdayStokOpnames, - // // 'gudangStokOpnames' => $gudangStokOpnames, - // 'active' => 'menu-Stok_Opname' - // ]; + // Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang + $yesterdayStokOpnames = Peti::with('customer', 'tipe_peti') + ->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(); - // return view('dashboard.Master_Data.Report.Stok_opname.index', $data); - // } + return Excel::download(new StokOpNameExport($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames), 'stok_opname.xlsx'); + } } diff --git a/app/Http/Controllers/TransferController.php b/app/Http/Controllers/TransferController.php index 0cf2fe6..f5a89b6 100644 --- a/app/Http/Controllers/TransferController.php +++ b/app/Http/Controllers/TransferController.php @@ -35,10 +35,15 @@ class TransferController extends Controller */ public function create() { + $petiWithStatusNotZeroOrEmptyAndActive = Peti::where(function ($query) { + $query->whereHas('assetStatuses', function ($subquery) { + $subquery->where('status', '!=', 0); + })->orWhereDoesntHave('assetStatuses'); + })->where('status', 'aktif')->get(); + $data = [ 'customer' => Customer::get(), - 'peti' => Peti::get(), - // 'warehouse' => Peti::with('warehouse_id')->get(), + 'peti' => $petiWithStatusNotZeroOrEmptyAndActive, 'warehouse' => m_warehouse::get(), 'active' => 'menu-transfer', ]; diff --git a/app/Http/Requests/ValidasiCreatePeminjaman.php b/app/Http/Requests/ValidasiCreatePeminjaman.php index 42a0eee..1285003 100644 --- a/app/Http/Requests/ValidasiCreatePeminjaman.php +++ b/app/Http/Requests/ValidasiCreatePeminjaman.php @@ -23,8 +23,10 @@ class ValidasiCreatePeminjaman extends FormRequest { return [ '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', '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', ]; } @@ -34,12 +36,16 @@ class ValidasiCreatePeminjaman extends FormRequest return [ '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.date' => 'Bidang Tanggal Peminjaman harus berupa tanggal.', 'est_pengembalian.required' => 'Bidang Estimasi Tanggal Pengembalian wajib diisi.', 'est_pengembalian.date' => 'Bidang Estimasi Tanggal Pengembalian harus berupa tanggal.', - 'exit_warehouse.required' => 'Bidang Asal Gudang wajib diisi.', - 'exit_warehouse.integer' => 'Bidang Asal Gudang harus berupa angka.', + '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.', ]; } } diff --git a/app/Http/Requests/ValidasiUpdatePeminjaman.php b/app/Http/Requests/ValidasiUpdatePeminjaman.php index 5a3eb52..7acdf27 100644 --- a/app/Http/Requests/ValidasiUpdatePeminjaman.php +++ b/app/Http/Requests/ValidasiUpdatePeminjaman.php @@ -22,10 +22,12 @@ class ValidasiUpdatePeminjaman extends FormRequest public function rules(): array { 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', '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 [ '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.date' => 'Bidang Tanggal Peminjaman harus berupa tanggal.', 'est_pengembalian.required' => 'Bidang Estimasi Tanggal Pengembalian wajib diisi.', '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.', ]; } } diff --git a/app/Models/Peti.php b/app/Models/Peti.php index ef38889..c401091 100644 --- a/app/Models/Peti.php +++ b/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'); } + + public function transfer() + { + return $this->hasOne(Transfer::class, 'peti_id'); + } + + // proses pengambilan data + public function assetStatuses() + { + return $this->hasMany(asset_status::class, 'peti_id'); + } } diff --git a/app/Models/asset_status.php b/app/Models/asset_status.php index ce6a187..7679654 100644 --- a/app/Models/asset_status.php +++ b/app/Models/asset_status.php @@ -20,6 +20,8 @@ class asset_status extends Model 'exit_at', 'est_pengembalian', 'exit_pic', + 'customer_id', + 'warehouse_id', 'exit_warehouse', 'enter_at', 'enter_pic', @@ -35,6 +37,11 @@ class asset_status extends Model 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() { return $this->belongsTo(m_warehouse::class, 'exit_warehouse')->select('id', 'name', 'address'); diff --git a/database/migrations/2023_11_06_122033_create_asset_statuses_table.php b/database/migrations/2023_11_06_122033_create_asset_statuses_table.php index ccb75cc..ceb9559 100644 --- a/database/migrations/2023_11_06_122033_create_asset_statuses_table.php +++ b/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('est_pengembalian')->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->date('enter_at')->nullable(); $table->string('enter_pic', 200)->nullable(); diff --git a/database/seeders/Type_Peti.php b/database/seeders/Type_Peti.php index ec9d884..428ecd5 100644 --- a/database/seeders/Type_Peti.php +++ b/database/seeders/Type_Peti.php @@ -15,7 +15,7 @@ class Type_Peti extends Seeder public function run(): void { DB::table('type_petis')->insert([ - 'type' => 'Bagus', + 'type' => 'Baik', 'size_peti' => '2 X 2 X 2 X 2', 'description' => 'Detail Barang Bagus', 'created_by' => 'Seeder', diff --git a/database/seeders/WarehouseSeeder.php b/database/seeders/WarehouseSeeder.php index 18cd16f..8d7f34c 100644 --- a/database/seeders/WarehouseSeeder.php +++ b/database/seeders/WarehouseSeeder.php @@ -15,18 +15,36 @@ class WarehouseSeeder extends Seeder { // Warehouse 1 m_warehouse::create([ - 'name' => 'Gudang A', - 'description' => 'Gudang utama', - 'address' => 'Alamat Gudang A', + 'name' => 'Jakarta', + 'description' => 'PT Indonesia Steel Tube Works Jakarta Office', + 'address' => 'Jln. Jakarta Timur', 'created_by' => 'Seeder', 'updated_by' => 'Seeder', ]); // Warehouse 2 m_warehouse::create([ - 'name' => 'Gudang B', - 'description' => 'Gudang cabang', - 'address' => 'Alamat Gudang B', + 'name' => 'Bekasi', + 'description' => 'PT Indonesia Steel Tube Works Bekasi Office', + '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', 'updated_by' => 'Seeder', ]); diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php index 388ffe9..fd91fc5 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php @@ -43,8 +43,9 @@ @endforeach - - @foreach ($kondisiPeti as $data_kondisiPeti) diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php index 389ad85..1a2f321 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php @@ -39,6 +39,7 @@ No + Fix Lot User Customer WH @@ -48,7 +49,7 @@ Lot No Kondisi Peti Packing No - Fix Lot + Status Action @@ -60,6 +61,7 @@ {{ $nopeti++ }} + {{ $data_peti->fix_lot }} {{ $data_peti->created_by }} {{ $data_peti->customer->name }} {{ $data_peti->warehouse->name }} @@ -69,7 +71,7 @@ {{ $data_peti->customer->lot_no }} {{ $data_peti->kondisipeti->nama_kondisi }} {{ $data_peti->packing_no }} - {{ $data_peti->fix_lot }} + {{ $data_peti->status }} diff --git a/resources/views/dashboard/Master_Data/Report/PATTERN LOT PETI/detail_peti.blade.php b/resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/detail_peti.blade.php similarity index 100% rename from resources/views/dashboard/Master_Data/Report/PATTERN LOT PETI/detail_peti.blade.php rename to resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/detail_peti.blade.php diff --git a/resources/views/dashboard/Master_Data/Report/PATTERN LOT PETI/index.blade.php b/resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/index.blade.php similarity index 95% rename from resources/views/dashboard/Master_Data/Report/PATTERN LOT PETI/index.blade.php rename to resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/index.blade.php index 32d7efa..9c58afc 100644 --- a/resources/views/dashboard/Master_Data/Report/PATTERN LOT PETI/index.blade.php +++ b/resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/index.blade.php @@ -17,9 +17,9 @@
Report Pettern Lot Peti
- + {{-- Cetak PDF - + --}} Cetak Exel diff --git a/resources/views/dashboard/Master_Data/Report/Stok_opname/index.blade.php b/resources/views/dashboard/Master_Data/Report/Stok_opname/index.blade.php index e8d33f0..26ce130 100644 --- a/resources/views/dashboard/Master_Data/Report/Stok_opname/index.blade.php +++ b/resources/views/dashboard/Master_Data/Report/Stok_opname/index.blade.php @@ -17,10 +17,10 @@
Report Stok Opname
- - Cetak PDF + {{-- + Cetak PDF --}} - Cetak Exel @@ -36,18 +36,17 @@ Customer Kode Ukuran Peti - Bagginning + Bagginning
Stok Add Total Stock - Stok Opname Total - DI ISTW - Gudang A - Gudang B - Gudang C + Jakarta + Bekasi + Semarang + Surabaya @@ -56,12 +55,12 @@ @endphp @forelse ($stokOpnames as $data_StokOpname) - {{ $noreport++ }} + {{ $noreport++ }} {{ $data_StokOpname->customer->name }} {{ $data_StokOpname->customer->code_customer }} - {{ $data_StokOpname->tipe_peti->type }} {{ $data_StokOpname->tipe_peti->size_peti }} - + @php // Temukan data dari tanggal sebelum sekarang (kemarin) berdasarkan id $yesterdayStokOpname = $yesterdayStokOpnames @@ -73,10 +72,10 @@ @if ($yesterdayStokOpname && $yesterdayStokOpname->total_petis > 0) {{ $yesterdayStokOpname->total_petis }} @else - - + 0 @endif - + @php $todayStokOpname = $todayStokOpnames ->where('customer_id', $data_StokOpname->customer_id) @@ -86,63 +85,85 @@ @if ($todayStokOpname && $todayStokOpname->total_petis > 0) {{ $todayStokOpname->total_petis }} @else - - + 0 @endif - + @if ($data_StokOpname->total_petis > 0) {{ $data_StokOpname->total_petis }} @else - - + 0 @endif - - - + + @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 - Gudang A - Gudang B - + @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 - - @foreach ($petis as $peti) - @php - $totalNullableCount += $assetStatus - ->where('peti_id', $peti->id) - ->where('enter_warehouse', '=', 0) - // ->where('customer_id', $peti->customer_id) - ->count(); - @endphp - @endforeach - - {{ $totalNullableCount }} - - - - - {{-- @foreach ($petis as $item) - @php - $totalAsset = \App\Models\asset_status::get(); - $totalAssetStatus = $totalAsset - ->where('customer_id', $item->customer_id) - ->where('peti_id', $item->id) - ->count(); - @endphp - @if ($totalAssetStatus > 0) - {{ $totalAssetStatus }} - @else - 0 - @endif - @endforeach --}} - + {{-- Jumlah total peti pada tanggal sebelum sekarang (kemarin) --}} + @if ($gudangStokOpname && $gudangStokOpname->total_petis > 0) + {{ $gudangStokOpname->total_petis }} + @else + 0 + @endif + + + @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', 3) + ->first(); + @endphp + {{-- Jumlah total peti pada tanggal sebelum sekarang (kemarin) --}} + @if ($gudangStokOpname && $gudangStokOpname->total_petis > 0) + {{ $gudangStokOpname->total_petis }} + @else + 0 + @endif + + + @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', 4) + ->first(); + @endphp + {{-- Jumlah total peti pada tanggal sebelum sekarang (kemarin) --}} + @if ($gudangStokOpname && $gudangStokOpname->total_petis > 0) + {{ $gudangStokOpname->total_petis }} + @else + 0 + @endif - - - + @if ($data_StokOpname->total_petis > 0) {{ $data_StokOpname->total_petis }} @else - - + 0 @endif diff --git a/resources/views/dashboard/Peminjaman/create.blade.php b/resources/views/dashboard/Peminjaman/create.blade.php index bc894fc..a827d7d 100644 --- a/resources/views/dashboard/Peminjaman/create.blade.php +++ b/resources/views/dashboard/Peminjaman/create.blade.php @@ -17,18 +17,24 @@
- @foreach ($peti_block as $data_peti) @endforeach - - + + @@ -39,13 +45,14 @@ class="text-danger">* - - @foreach ($warehouse as $data) @endforeach + - - @foreach ($peti as $data_peti) - - @endforeach - -
+ + + + {{-- --}} -
- - -
+ + -
- - -
+ + + + + + + + + + + -
- - -