diff --git a/app/Exports/StokOpNameExport.php b/app/Exports/StokOpNameExport.php index 8c98351..51201d4 100644 --- a/app/Exports/StokOpNameExport.php +++ b/app/Exports/StokOpNameExport.php @@ -12,12 +12,14 @@ class StokOpNameExport implements FromCollection, WithHeadings protected $stokOpnames; protected $todayStokOpnames; protected $yesterdayStokOpnames; + protected $gudangStokOpnames; - public function __construct($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames) + public function __construct($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames, $gudangStokOpnames) { $this->stokOpnames = $stokOpnames; $this->todayStokOpnames = $todayStokOpnames; $this->yesterdayStokOpnames = $yesterdayStokOpnames; + $this->gudangStokOpnames = $gudangStokOpnames; } public function collection() @@ -36,6 +38,11 @@ class StokOpNameExport implements FromCollection, WithHeadings ->where('tipe_peti_id', $data_StokOpname->tipe_peti_id) ->first(); + $gudangData = $this->gudangStokOpnames + ->where('customer_id', $data_StokOpname->customer_id) + ->where('tipe_peti_id', $data_StokOpname->tipe_peti_id) + ->keyBy('warehouse_id'); + $data->push([ 'No' => $nomor++, 'Customer' => $data_StokOpname->customer->name, @@ -44,11 +51,10 @@ class StokOpNameExport implements FromCollection, WithHeadings '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', + 'Jakarta' => $gudangData->get(1)->total_petis ?? '0', + 'Bekasi' => $gudangData->get(2)->total_petis ?? '0', + 'Semarang' => $gudangData->get(3)->total_petis ?? '0', + 'Surabaya' => $gudangData->get(4)->total_petis ?? '0', 'Total Stok' => $data_StokOpname->total_petis ?? '0', ]); } @@ -66,11 +72,10 @@ class StokOpNameExport implements FromCollection, WithHeadings 'Bagging Stok', 'Add', 'Total', - 'DI ISTW', - 'Gudang A', - 'Gudang B', - 'Gudang C', - 'Stok Opname', + 'Jakarta', + 'Bekasi', + 'Semarang', + 'Surabaya', 'Total Stok', ]; } diff --git a/app/Http/Controllers/Auth/RedirectAuthController.php b/app/Http/Controllers/Auth/RedirectAuthController.php index fa5d439..6cec6ab 100644 --- a/app/Http/Controllers/Auth/RedirectAuthController.php +++ b/app/Http/Controllers/Auth/RedirectAuthController.php @@ -11,12 +11,13 @@ class RedirectAuthController extends Controller public function redirectAuth() { if (Auth::check()) { - if (Auth::user()->role_id == 1) { - // Admin - return redirect()->route('dashboard.home.admin'); - } else { - return redirect()->route('dashboard.home.user'); - } + return redirect()->route('dashboard.home.admin'); + // if (Auth::user()->role_id == 1) { + // // Admin + // return redirect()->route('dashboard.home.admin'); + // } else { + // return redirect()->route('dashboard.home.user'); + // } } else { // Tidak ada akun atau kesalahan login return redirect()->route('login')->with('error', 'Kesalahan email atau password.'); diff --git a/app/Http/Controllers/DisposalController.php b/app/Http/Controllers/DisposalController.php index 95f76e3..8317552 100644 --- a/app/Http/Controllers/DisposalController.php +++ b/app/Http/Controllers/DisposalController.php @@ -16,14 +16,17 @@ class DisposalController extends Controller public function index() { $data = [ - 'disposal' => Disposal::where('status_disposal', 'INAKTIF')->orderBy('created_at', 'desc')->get(), - // 'disposal' => Disposal::orderBy('created_at', 'desc')->get(), + 'disposal' => Disposal::where('status_disposal', 'INAKTIF') + ->orderBy('created_at', 'desc') + ->get(), 'active' => 'menu-disposal', ]; + return view('dashboard.Disposal.index', $data); } + /** * Show the form for creating a new resource. */ diff --git a/app/Http/Controllers/HistoryController.php b/app/Http/Controllers/HistoryController.php index f7902fc..ed8f847 100644 --- a/app/Http/Controllers/HistoryController.php +++ b/app/Http/Controllers/HistoryController.php @@ -14,7 +14,7 @@ class HistoryController extends Controller $data = [ // 'peminjaman' => asset_status::get(), - 'peminjaman' => asset_status::orderBy('created_at', 'desc')->get(), + 'peminjaman' => asset_status::withTrashed()->orderBy('created_at', 'desc')->get(), 'warehouse' => m_warehouse::get(), 'active' => 'history-peminjaman', ]; @@ -25,7 +25,7 @@ class HistoryController extends Controller public function historyPengembalian() { $data = [ - 'peminjaman' => asset_status::orderBy('created_at', 'desc')->get(), + 'peminjaman' => asset_status::withTrashed()->orderBy('created_at', 'desc')->get(), 'active' => 'history-pengembalian', ]; return view('dashboard.History.Pengembalian.index', $data); @@ -34,7 +34,7 @@ class HistoryController extends Controller public function historyTransfer() { $data = [ - 'transfer' => Transfer::orderBy('created_at', 'desc')->get(), + 'transfer' => Transfer::withTrashed()->orderBy('created_at', 'desc')->get(), 'active' => 'history-transfer', ]; return view('dashboard.History.Transfer.index', $data); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 3a378d5..0c45ff7 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\Auth; class HomeController extends Controller { - + //halaman Admin public function index() { $data = [ @@ -20,29 +20,34 @@ class HomeController extends Controller return view('dashboard.index', $data); } + + //halaman User + // public function indexUser() + // { + // $data = [ + // 'reminder' => \App\Models\asset_status::whereNull('enter_at')->count(), + // 'jumlahPeti' => \App\Models\Peti::count(), + // 'jumlahPeminjaman' => \App\Models\asset_status::count(), + // 'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(), + // 'active' => 'menu-admin', + // ]; + + // return view('pages.user.index', $data); + // } + public function notification() { + $notification = \App\Models\asset_status::whereNull('enter_at') + ->whereDate('est_pengembalian', \Carbon\Carbon::today()) + ->get(); + $data = [ - 'reminder' => \App\Models\asset_status::whereNull('enter_at')->count(), - 'jumlahPeti' => \App\Models\Peti::count(), - 'jumlahPeminjaman' => \App\Models\asset_status::count(), - 'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(), + 'notifikasi' => $notification, 'active' => 'menu-admin', ]; return view('layouts.navbar_list', $data); } - public function indexUser() - { - $data = [ - 'reminder' => \App\Models\asset_status::whereNull('enter_at')->count(), - 'jumlahPeminjaman' => \App\Models\asset_status::count(), - 'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(), - 'active' => 'menu-user', - ]; - - return view('pages.user.index', $data); - } //data pertahun untuk bar chart public function generateChartData() diff --git a/app/Http/Controllers/PeminjamanController.php b/app/Http/Controllers/PeminjamanController.php index 8c8d1d5..3ef1879 100644 --- a/app/Http/Controllers/PeminjamanController.php +++ b/app/Http/Controllers/PeminjamanController.php @@ -39,18 +39,12 @@ class PeminjamanController extends Controller $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(), 'peminjaman' => asset_status::get(), 'warehouse' => m_warehouse::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', diff --git a/app/Http/Controllers/PetternLotPetiController.php b/app/Http/Controllers/PetternLotPetiController.php index 7e3baf9..ed225cf 100644 --- a/app/Http/Controllers/PetternLotPetiController.php +++ b/app/Http/Controllers/PetternLotPetiController.php @@ -13,8 +13,7 @@ class PetternLotPetiController extends Controller public function index() { $data = [ - // 'warehouses' => m_warehouse::orderBy('created_at', 'desc')->get(), - 'peti' => Peti::get(), + 'peti' => Peti::withTrashed()->get(), 'active' => 'menu-Pettern_Lot_Peti' ]; return view('dashboard.Master_Data.Report.Pattern_lot_peti.index', $data); diff --git a/app/Http/Controllers/StokOpNameController.php b/app/Http/Controllers/StokOpNameController.php index 7b87176..f1e0999 100644 --- a/app/Http/Controllers/StokOpNameController.php +++ b/app/Http/Controllers/StokOpNameController.php @@ -14,27 +14,27 @@ class StokOpNameController extends Controller public function index() { // Total Peti Berdasarkan Gudang - $gudangStokOpnames = Peti::with('customer', 'tipe_peti', 'warehouse') + $gudangStokOpnames = Peti::withTrashed()->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') + $todayStokOpnames = Peti::withTrashed()->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(); // Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang - $yesterdayStokOpnames = Peti::with('customer', 'tipe_peti') + $yesterdayStokOpnames = Peti::withTrashed()->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(); // Total Peti - $stokOpnames = Peti::with('customer', 'tipe_peti') + $stokOpnames = Peti::withTrashed()->with('customer', 'tipe_peti') ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis')) ->groupBy('customer_id', 'tipe_peti_id') ->get(); @@ -52,25 +52,31 @@ class StokOpNameController extends Controller public function export() { //total peti - $stokOpnames = Peti::with('customer', 'tipe_peti') + $stokOpnames = Peti::withTrashed()->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') + $todayStokOpnames = Peti::withTrashed()->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(); // Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang - $yesterdayStokOpnames = Peti::with('customer', 'tipe_peti') + $yesterdayStokOpnames = Peti::withTrashed()->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 Excel::download(new StokOpNameExport($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames), 'stok_opname.xlsx'); + // Total Peti Berdasarkan Gudang + $gudangStokOpnames = Peti::withTrashed()->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(); + + return Excel::download(new StokOpNameExport($stokOpnames, $todayStokOpnames, $yesterdayStokOpnames, $gudangStokOpnames), 'stok_opname.xlsx'); } } diff --git a/app/Http/Controllers/TransaksiKeluarMasukController.php b/app/Http/Controllers/TransaksiKeluarMasukController.php index 8b556d1..3aee8cd 100644 --- a/app/Http/Controllers/TransaksiKeluarMasukController.php +++ b/app/Http/Controllers/TransaksiKeluarMasukController.php @@ -14,7 +14,7 @@ class TransaksiKeluarMasukController extends Controller public function index() { $data = [ - 'peminjaman' => asset_status::all(), + 'peminjaman' => asset_status::withTrashed()->all(), 'active' => 'menu-transaksi', ]; return view('dashboard.transaksi.index', $data); diff --git a/app/Http/Requests/Disposal/ValidasiCreateDisposal.php b/app/Http/Requests/Disposal/ValidasiCreateDisposal.php index 5090760..b1a60c3 100644 --- a/app/Http/Requests/Disposal/ValidasiCreateDisposal.php +++ b/app/Http/Requests/Disposal/ValidasiCreateDisposal.php @@ -22,9 +22,9 @@ class ValidasiCreateDisposal extends FormRequest public function rules(): array { return [ - 'peti_id' => 'required', - 'customer_id' => 'nullable', - 'warehouse_id' => 'nullable', + 'peti_id' => 'required|integer', + 'customer_id' => 'required|integer', + 'warehouse_id' => 'required|integer', 'date_disposal' => 'nullable|date', 'description' => 'nullable|string', 'status_disposal' => 'nullable', @@ -34,6 +34,12 @@ class ValidasiCreateDisposal extends FormRequest public function messages(): array { return [ + '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.', + 'warehouse_id.integer' => 'Gudang harus berupa angka.', 'date_disposal.date' => 'Format tanggal disposal tidak valid.', 'description.string' => 'Deskripsi harus berupa teks.', ]; diff --git a/app/Http/Requests/Disposal/ValidasiUpdateDisposal.php b/app/Http/Requests/Disposal/ValidasiUpdateDisposal.php index e400920..511b52c 100644 --- a/app/Http/Requests/Disposal/ValidasiUpdateDisposal.php +++ b/app/Http/Requests/Disposal/ValidasiUpdateDisposal.php @@ -22,9 +22,9 @@ class ValidasiUpdateDisposal extends FormRequest public function rules(): array { return [ - 'peti_id' => 'required', - 'customer_id' => 'nullable', - 'warehouse_id' => 'nullable', + 'peti_id' => 'required|integer', + 'customer_id' => 'required|integer', + 'warehouse_id' => 'required|integer', 'date_disposal' => 'nullable|date', 'description' => 'nullable|string', 'status_disposal' => 'nullable', @@ -34,6 +34,12 @@ class ValidasiUpdateDisposal extends FormRequest public function messages(): array { return [ + '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.', + 'warehouse_id.integer' => 'Gudang harus berupa angka.', 'date_disposal.date' => 'Format tanggal disposal tidak valid.', 'description.string' => 'Deskripsi harus berupa teks.', ]; diff --git a/app/Models/Disposal.php b/app/Models/Disposal.php index 9e8bf0d..fd57ffd 100644 --- a/app/Models/Disposal.php +++ b/app/Models/Disposal.php @@ -35,13 +35,14 @@ class Disposal extends Model 'kondisipeti_id', 'fix_lot', 'updated_by', - ); + )->withTrashed(); } + public function customer() { return $this->belongsTo(Customer::class, 'customer_id')->select( 'name', 'code_customer', - ); + )->withTrashed(); } } diff --git a/app/Models/Peti.php b/app/Models/Peti.php index c401091..545ca4e 100644 --- a/app/Models/Peti.php +++ b/app/Models/Peti.php @@ -31,29 +31,43 @@ class Peti extends Model public function customer() { - return $this->belongsTo(Customer::class, 'customer_id')->select('id', 'name', 'code_customer', 'lot_no'); + return $this->belongsTo(Customer::class, 'customer_id')->select( + 'id', + 'name', + 'code_customer', + 'lot_no' + )->withTrashed(); } public function warehouse() { - return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address'); + return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address')->withTrashed(); } public function tipe_peti() { - return $this->belongsTo(Type_peti::class, 'tipe_peti_id')->select('id', 'type', 'size_peti', 'description'); + return $this->belongsTo(Type_peti::class, 'tipe_peti_id')->select( + 'id', + 'type', + 'size_peti', + 'description' + )->withTrashed(); } public function kondisipeti() { - 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' + )->withTrashed(); } public function transfer() { - return $this->hasOne(Transfer::class, 'peti_id'); + return $this->hasOne(Transfer::class, 'peti_id')->withTrashed(); } // proses pengambilan data public function assetStatuses() { - return $this->hasMany(asset_status::class, 'peti_id'); + return $this->hasMany(asset_status::class, 'peti_id')->withTrashed(); } } diff --git a/app/Models/Transfer.php b/app/Models/Transfer.php index 744dbef..addde0e 100644 --- a/app/Models/Transfer.php +++ b/app/Models/Transfer.php @@ -35,27 +35,27 @@ class Transfer extends Model 'kondisipeti_id', 'fix_lot', 'updated_by', - ); + )->withTrashed(); } public function customer() { return $this->belongsTo(Customer::class, 'name_customer')->select( 'name', 'code_customer', - ); + )->withTrashed(); } public function sourceWarehouse() { return $this->belongsTo(m_warehouse::class, 'source_warehouse')->select( 'name', 'address', - ); + )->withTrashed(); } public function destinationWarehouse() { return $this->belongsTo(m_warehouse::class, 'destination_warehouse')->select( 'name', 'address', - ); + )->withTrashed(); } } diff --git a/app/Models/User.php b/app/Models/User.php index c2a3446..8cb2de9 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -8,11 +8,12 @@ use Laravel\Sanctum\HasApiTokens; use Illuminate\Notifications\Notifiable; use PHPOpenSourceSaver\JWTAuth\Contracts\JWTSubject; use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable implements JWTSubject { - use HasApiTokens, HasFactory, Notifiable; + use HasApiTokens, HasFactory, Notifiable, SoftDeletes; /** * The attributes that are mass assignable. @@ -40,7 +41,7 @@ class User extends Authenticatable implements JWTSubject public function warehouse() { - return $this->belongsTo(m_warehouse::class, 'warehouse_id'); + return $this->belongsTo(m_warehouse::class, 'warehouse_id')->withTrashed(); } /** diff --git a/app/Models/asset_status.php b/app/Models/asset_status.php index 7679654..3e5d7c2 100644 --- a/app/Models/asset_status.php +++ b/app/Models/asset_status.php @@ -7,11 +7,12 @@ use App\Traits\UUID; use App\Models\Customer; use App\Models\Type_peti; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\Factories\HasFactory; class asset_status extends Model { - use HasFactory; + use HasFactory, SoftDeletes; protected $table = 'asset_statuses'; protected $fillable = [ @@ -34,41 +35,52 @@ class asset_status extends Model public function asset() { - return $this->belongsTo(m_asset::class, 'asset_id'); + return $this->belongsTo(m_asset::class, 'asset_id')->withTrashed(); } public function warehouseId() { - return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address'); + return $this->belongsTo(m_warehouse::class, 'warehouse_id')->select('id', 'name', 'address')->withTrashed(); } 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')->withTrashed(); } public function warehouseEnter() { - return $this->belongsTo(m_warehouse::class, 'enter_warehouse')->select('id', 'name', 'address'); + return $this->belongsTo(m_warehouse::class, 'enter_warehouse')->select('id', 'name', 'address')->withTrashed(); } public function peti() { - return $this->belongsTo(Peti::class, 'peti_id')->select('id', 'tipe_peti_id', 'warna', 'fix_lot', 'packing_no', 'customer_id', 'jumlah', 'date_pembuatan', 'warehouse_id', 'kondisipeti_id'); + return $this->belongsTo(Peti::class, 'peti_id')->select( + 'id', + 'tipe_peti_id', + 'warna', + 'fix_lot', + 'packing_no', + 'customer_id', + 'jumlah', + 'date_pembuatan', + 'warehouse_id', + 'kondisipeti_id' + )->withTrashed(); } public function tipe_peti() { - return $this->belongsTo(Type_peti::class, 'type')->select('id', 'type', 'size_peti', 'description'); + return $this->belongsTo(Type_peti::class, 'type')->select('id', 'type', 'size_peti', 'description')->withTrashed(); } public function customer() { - return $this->belongsTo(Customer::class, 'customer_id'); + return $this->belongsTo(Customer::class, 'customer_id')->withTrashed(); } public function kondisi_peti() { - return $this->belongsTo(kondisi_peti::class, 'kondisi_peti_id'); + return $this->belongsTo(kondisi_peti::class, 'kondisi_peti_id')->withTrashed(); } } diff --git a/database/migrations/2023_10_23_075245_create_users_table.php b/database/migrations/2023_10_23_075245_create_users_table.php index 0deee1e..3431ce6 100644 --- a/database/migrations/2023_10_23_075245_create_users_table.php +++ b/database/migrations/2023_10_23_075245_create_users_table.php @@ -25,8 +25,8 @@ return new class extends Migration $table->string('foto', 255)->nullable(); $table->string('jenis_kelamin', 20)->nullable(); $table->string('agama', 15)->nullable(); - $table->foreignId('role_id')->nullable()->constrained('m_roles')->onDelete('set null'); - $table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null'); + $table->foreignId('role_id')->nullable()->constrained('m_roles'); + $table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses'); $table->text('address')->nullable(); $table->timestamp('email_verified_at')->nullable(); $table->string('password', 255)->nullable(); diff --git a/database/migrations/2023_11_06_085238_create_petis_table.php b/database/migrations/2023_11_06_085238_create_petis_table.php index 1281ae8..6466944 100644 --- a/database/migrations/2023_11_06_085238_create_petis_table.php +++ b/database/migrations/2023_11_06_085238_create_petis_table.php @@ -13,15 +13,15 @@ return new class extends Migration { Schema::create('petis', function (Blueprint $table) { $table->id(); - $table->foreignId('tipe_peti_id')->nullable()->constrained('type_petis')->onDelete('set null'); + $table->foreignId('tipe_peti_id')->nullable()->constrained('type_petis'); $table->string('warna', 50); $table->string('fix_lot', 100); $table->integer('packing_no'); - $table->foreignId('customer_id')->nullable()->constrained('customers')->onDelete('set null'); + $table->foreignId('customer_id')->nullable()->constrained('customers'); $table->integer('jumlah')->nullable(); $table->date('date_pembuatan', 100)->nullable(); - $table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null'); - $table->foreignId('kondisipeti_id')->nullable()->constrained('kondisi_petis')->onDelete('set null'); + $table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses'); + $table->foreignId('kondisipeti_id')->nullable()->constrained('kondisi_petis'); $table->string('status', 50)->default('AKTIF'); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2023_11_08_132316_create_transfers_table.php b/database/migrations/2023_11_08_132316_create_transfers_table.php index 6e72b31..ec0f37a 100644 --- a/database/migrations/2023_11_08_132316_create_transfers_table.php +++ b/database/migrations/2023_11_08_132316_create_transfers_table.php @@ -17,7 +17,7 @@ return new class extends Migration $table->foreignId('peti_id')->nullable()->constrained('petis'); $table->foreignId('name_customer')->nullable()->constrained('customers'); $table->foreignId('source_warehouse')->nullable()->constrained('m_warehouses'); - $table->foreignId('destination_warehouse')->nullable()->constrained('m_warehouses')->onDelete('set null'); + $table->foreignId('destination_warehouse')->nullable()->constrained('m_warehouses'); $table->date('date'); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2023_11_17_075418_create_disposals_table.php b/database/migrations/2023_11_17_075418_create_disposals_table.php index 3dc4d3f..7687e8f 100644 --- a/database/migrations/2023_11_17_075418_create_disposals_table.php +++ b/database/migrations/2023_11_17_075418_create_disposals_table.php @@ -15,8 +15,8 @@ return new class extends Migration $table->id('id'); $table->uuid('mobile_id')->nullable(); $table->foreignId('peti_id')->constrained('petis'); - $table->foreignId('customer_id')->nullable()->constrained('customers')->onDelete('set null'); - $table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null'); + $table->foreignId('customer_id')->constrained('customers'); + $table->foreignId('warehouse_id')->constrained('m_warehouses'); $table->date('date_disposal'); $table->text('description')->nullable(); $table->string('status_disposal', 50); diff --git a/database/seeders/PetiSeeder.php b/database/seeders/PetiSeeder.php index cedcd46..d1fc4ee 100644 --- a/database/seeders/PetiSeeder.php +++ b/database/seeders/PetiSeeder.php @@ -15,24 +15,106 @@ class PetiSeeder extends Seeder public function run() { // Generate 5 dummy data - for ($i = 0; $i < 5; $i++) { - DB::table('petis')->insert([ + // for ($i = 0; $i < 5; $i++) { + // DB::table('petis')->insert([ + // 'tipe_peti_id' => $this->getRandomId('type_petis'), + // 'warna' => 'Warna', + // 'fix_lot' => 'Dummy Fix Lot ' . ($i + 1), + // 'packing_no' => rand(1, 100), + // 'customer_id' => $this->getRandomId('customers'), + // 'jumlah' => rand(1, 10), + // 'date_pembuatan' => now(), + // 'warehouse_id' => $this->getRandomId('m_warehouses'), + // 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), + // 'status' => 'AKTIF', + // 'created_at' => now(), + // 'updated_at' => now(), + // 'created_by' => 'Seeder', + // 'updated_by' => 'Seeder', + // ]); + // } + DB::table('petis')->insert([ + [ 'tipe_peti_id' => $this->getRandomId('type_petis'), - 'warna' => 'Dummy Warna ' . ($i + 1), - 'fix_lot' => 'Dummy Fix Lot ' . ($i + 1), - 'packing_no' => rand(1, 100), + 'warna' => 'Warna', + 'fix_lot' => 'Dummy Fix Lot 1', + 'packing_no' => 1, 'customer_id' => $this->getRandomId('customers'), - 'jumlah' => rand(1, 10), + 'jumlah' => 1, 'date_pembuatan' => now(), - 'warehouse_id' => $this->getRandomId('m_warehouses'), + 'warehouse_id' => 1, 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), 'status' => 'AKTIF', 'created_at' => now(), 'updated_at' => now(), 'created_by' => 'Seeder', 'updated_by' => 'Seeder', - ]); - } + ], + [ + 'tipe_peti_id' => $this->getRandomId('type_petis'), + 'warna' => 'Warna', + 'fix_lot' => 'Dummy Fix Lot 2', + 'packing_no' => 2, + 'customer_id' => $this->getRandomId('customers'), + 'jumlah' => 2, + 'date_pembuatan' => now(), + 'warehouse_id' => 2, + 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), + 'status' => 'AKTIF', + 'created_at' => now(), + 'updated_at' => now(), + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + ], + [ + 'tipe_peti_id' => $this->getRandomId('type_petis'), + 'warna' => 'Warna', + 'fix_lot' => 'Dummy Fix Lot 3', + 'packing_no' => 3, + 'customer_id' => $this->getRandomId('customers'), + 'jumlah' => 3, + 'date_pembuatan' => now(), + 'warehouse_id' => 3, + 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), + 'status' => 'AKTIF', + 'created_at' => now(), + 'updated_at' => now(), + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + ], + [ + 'tipe_peti_id' => $this->getRandomId('type_petis'), + 'warna' => 'Warna', + 'fix_lot' => 'Dummy Fix Lot 4', + 'packing_no' => 4, + 'customer_id' => $this->getRandomId('customers'), + 'jumlah' => 4, + 'date_pembuatan' => now(), + 'warehouse_id' => 4, + 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), + 'status' => 'AKTIF', + 'created_at' => now(), + 'updated_at' => now(), + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + ], + [ + 'tipe_peti_id' => $this->getRandomId('type_petis'), + 'warna' => 'Warna', + 'fix_lot' => 'Dummy Fix Lot 5', + 'packing_no' => 5, + 'customer_id' => $this->getRandomId('customers'), + 'jumlah' => 5, + 'date_pembuatan' => now(), + 'warehouse_id' => 1, + 'kondisipeti_id' => $this->getRandomId('kondisi_petis'), + 'status' => 'AKTIF', + 'created_at' => now(), + 'updated_at' => now(), + 'created_by' => 'Seeder', + 'updated_by' => 'Seeder', + ], + ]); } /** diff --git a/resources/views/dashboard/Disposal/index.blade.php b/resources/views/dashboard/Disposal/index.blade.php index 29478d4..8cc5f6e 100644 --- a/resources/views/dashboard/Disposal/index.blade.php +++ b/resources/views/dashboard/Disposal/index.blade.php @@ -10,69 +10,72 @@ } @include('layouts.components.alert-prompt') -
-
-
-
-
Data Disposal
-
-
- - Disposal Peti - - + @if (auth()->user()->role_id == 1) +
+
+
+
+
Data Disposal
+
+
-
-
-
- - - - - - - - - - - - - - @php - $nodisposal = 1; - @endphp - @forelse ($disposal as $data_disposal) +
+
+
NoKode PetiNama CustomerTanggal DisposalAlasan DisposalStatus PetiAction
+ - - - - - - - + + + + + + + - @empty -

Data Kosong

- @endforelse - -
{{ $nodisposal++ }}{{ $data_disposal->peti->fix_lot }}{{ $data_disposal->customer->name }}{{ \Carbon\Carbon::parse($data_disposal->date_disposal)->format('d/m/Y') }}{{ $data_disposal->description }}{{ $data_disposal->status_disposal }} - - - -
- @csrf - @method('DELETE') - -
-
NoKode PetiNama CustomerTanggal DisposalAlasan DisposalStatus PetiAction
+ + + @php + $nodisposal = 1; + @endphp + @forelse ($disposal as $data_disposal) + + {{ $nodisposal++ }} + {{ optional($data_disposal->peti)->fix_lot }} + {{ optional($data_disposal->customer)->name }} + {{ \Carbon\Carbon::parse($data_disposal->date_disposal)->format('d/m/Y') }} + {{ $data_disposal->description }} + {{ $data_disposal->status_disposal }} + + + + +
+ @csrf + @method('DELETE') + +
+ + + @empty + @endforelse + + +
-
+ @elseif (auth()->user()->role_id == 2) + @include('pages.user.dashboard.disposal.index') + @endif @endsection diff --git a/resources/views/dashboard/History/Peminjaman/index.blade.php b/resources/views/dashboard/History/Peminjaman/index.blade.php index db78a15..fbd96fe 100644 --- a/resources/views/dashboard/History/Peminjaman/index.blade.php +++ b/resources/views/dashboard/History/Peminjaman/index.blade.php @@ -9,53 +9,48 @@ white-space: nowrap; } - @if (auth()->user()->role_id == 1) -
-
-
-
-
Histori Peminjaman
-
+
+
+
+
+
Histori Peminjaman
-
-
- - + +
+
+
+ + + + + + + + + + + + + @php + $no_peminjaman = 1; + @endphp + @forelse ($peminjaman as $data_peminjaman) - - - - - - - + + + + + + + - - - @php - $no_peminjaman = 1; - @endphp - @forelse ($peminjaman as $data_peminjaman) - - - - - - - - - - @empty -

Data Kosong

- @endforelse - -
NoKode PetiNama CustomerKodeTgl PeminjamanPJ PeminjamanWH Peminjam
NoKode PetiNama CustomerKodeTgl PeminjamanPJ PeminjamanWH Peminjam{{ $no_peminjaman++ }}{{ $data_peminjaman->peti->fix_lot }}{{ $data_peminjaman->peti->customer->name }}{{ $data_peminjaman->peti->customer->code_customer }} - + {{ $data_peminjaman->peti->tipe_peti->type }}{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}{{ $data_peminjaman->exit_pic }}{{ $data_peminjaman->warehouse->name }}
{{ $no_peminjaman++ }}{{ $data_peminjaman->peti->fix_lot }}{{ $data_peminjaman->peti->customer->name }}{{ $data_peminjaman->peti->customer->code_customer }} - - {{ $data_peminjaman->peti->tipe_peti->type }}{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}{{ $data_peminjaman->exit_pic }}{{ $data_peminjaman->warehouse->name }}
-
+ @empty + @endforelse + +
- @else - @include('pages.user.Peminjaman.index') - @endif +
@endsection diff --git a/resources/views/dashboard/History/Pengembalian/index.blade.php b/resources/views/dashboard/History/Pengembalian/index.blade.php index 0f37e5c..7dac629 100644 --- a/resources/views/dashboard/History/Pengembalian/index.blade.php +++ b/resources/views/dashboard/History/Pengembalian/index.blade.php @@ -9,100 +9,95 @@ white-space: nowrap; } - @if (auth()->user()->role_id == 1) -
-
-
-
-
Data Pengembalian
-
+
+
+
+
+
Data Pengembalian
-
-
- - - - - - - - - - - - - - - - - - - @php - $no_peminjaman = 1; - @endphp - @forelse ($peminjaman as $data) - @if ($data->enter_warehouse !== null) - - - - - - - - - - - - - - - @endif - @empty -

Data Kosong

- @endforelse - -
NoKode PetiCustomerTgl PeinjamanEstimasi PengembalianPJ PeminjamanAsal WH PeminjamanTgl PengembalianPJ PengembalianTujuan WH PengembalianKondisi PetiStatus
{{ $no_peminjaman++ }}{{ $data->peti->fix_lot }}{{ $data->peti->customer->name }}{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}{{ $data->exit_pic }} - @if ($data->exit_warehouse) - {{ $data->warehouse->name }} - @else -

-

- @endif -
- @if ($data->enter_at) - {{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }} - @else -

-

- @endif -
- @if ($data->enter_pic) - {{ $data->enter_pic }} - @else -

-

- @endif -
- @if ($data->enter_warehouse) - {{ $data->warehouseEnter->name }} - @else -

-

- @endif -
- @if ($data->kondisi_peti) - {{ $data->kondisi_peti->nama_kondisi }} - @else -

-

- @endif -
- @if ($data->enter_warehouse === null) - Not Return - @else - Return - @endif -
-
+
+
+
+ + + + + + + + + + + + + + + + + + + @php + $no_peminjaman = 1; + @endphp + @forelse ($peminjaman as $data) + @if ($data->enter_warehouse !== null) + + + + + + + + + + + + + + + @endif + @empty + @endforelse + +
NoKode PetiCustomerTgl PeinjamanEstimasi PengembalianPJ PeminjamanAsal WH PeminjamanTgl PengembalianPJ PengembalianTujuan WH PengembalianKondisi PetiStatus
{{ $no_peminjaman++ }}{{ $data->peti->fix_lot }}{{ $data->peti->customer->name }}{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}{{ $data->exit_pic }} + @if ($data->exit_warehouse) + {{ $data->warehouse->name }} + @else +

-

+ @endif +
+ @if ($data->enter_at) + {{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }} + @else +

-

+ @endif +
+ @if ($data->enter_pic) + {{ $data->enter_pic }} + @else +

-

+ @endif +
+ @if ($data->enter_warehouse) + {{ $data->warehouseEnter->name }} + @else +

-

+ @endif +
+ @if ($data->kondisi_peti) + {{ $data->kondisi_peti->nama_kondisi }} + @else +

-

+ @endif +
+ @if ($data->enter_warehouse === null) + Not Return + @else + Return + @endif +
- @else - @include('pages.user.Pengembalian.index') - @endif +
@endsection diff --git a/resources/views/dashboard/Master_Data/Customer/index.blade.php b/resources/views/dashboard/Master_Data/Customer/index.blade.php index 7130eeb..c5da031 100644 --- a/resources/views/dashboard/Master_Data/Customer/index.blade.php +++ b/resources/views/dashboard/Master_Data/Customer/index.blade.php @@ -63,7 +63,6 @@ @empty -

Data Kosong

@endforelse diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Kondisi_Peti/index.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Kondisi_Peti/index.blade.php index ada23b2..c9a2d7c 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Kondisi_Peti/index.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Kondisi_Peti/index.blade.php @@ -1,64 +1,68 @@ @extends('layouts.main') @section('content') @include('layouts.components.alert-prompt') -
-
-
-
-
Data Kondisi Peti
-
-
- - Tambah Kondisi Peti - + @if (auth()->user()->role_id == 1) +
+
+
+
+
Data Kondisi Peti
+
+
-
-
-
- - - - - - - - - - - @php - $nokondisi = 1; - @endphp - @forelse ($kondisiPeti as $data_kondisiPeti) +
+
+
NoKondisi PetiDeskripsiAction
+ - - - - + + + + - @empty -

Data Kosong

- @endforelse - -
{{ $nokondisi++ }}{{ $data_kondisiPeti->nama_kondisi }}{{ $data_kondisiPeti->deskripsi_kondisi }} - - - -
- @csrf - @method('DELETE') - -
-
NoKondisi PetiDeskripsiAction
+ + + @php + $nokondisi = 1; + @endphp + @foreach ($kondisiPeti as $data_kondisiPeti) + + {{ $nokondisi++ }} + {{ $data_kondisiPeti->nama_kondisi }} + {{ $data_kondisiPeti->deskripsi_kondisi }} + + + + +
+ @csrf + @method('DELETE') + +
+ + + @endforeach + + +
-
+ @elseif (auth()->user()->role_id == 2) + @include('pages.user.master_data.manajemen_peti.kondisi_peti.index') + @endif +
- @else + @elseif (auth()->user()->role_id == 2) @include('pages.user.Master_Data.Manajemen_Peti.Peti.index') @endif diff --git a/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php b/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php index f5d9133..3ab7578 100644 --- a/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php +++ b/resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php @@ -57,14 +57,13 @@ @empty -

Data Kosong

@endforelse
- @else - @include('pages.user.Master_Data.Manajemen_Peti.Type_peti.index') + @elseif (auth()->user()->role_id == 2) + @include('pages.user.master_data.manajemen_peti.tipe_peti.index') @endif @endsection 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 index 042750d..26a3c3e 100644 --- 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 @@ -86,7 +86,6 @@ @empty -

Data Kosong

@endforelse 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 index 9c58afc..14bc874 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,6 @@
Report Pettern Lot Peti
- {{-- - Cetak PDF - --}} Cetak Exel @@ -42,6 +39,7 @@ LOT NO PACKING NO FIX LOT + STATUS @@ -63,9 +61,9 @@ {{ $data_peti->fix_lot }} + {{ $data_peti->status }} @empty -

Data Kosong

@endforelse 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 26ce130..f2118f0 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 @@ -9,7 +9,6 @@ white-space: nowrap; } - {{--

Halaman Stop Op Name

--}}
- @else - @include('pages.user.Master_Data.Warehouse.index') + @elseif(auth()->user()->role_id == 2) + @include('pages.user.master_data.warehouse.index') @endif diff --git a/resources/views/dashboard/Peminjaman/index.blade.php b/resources/views/dashboard/Peminjaman/index.blade.php index 37140a7..ded370f 100644 --- a/resources/views/dashboard/Peminjaman/index.blade.php +++ b/resources/views/dashboard/Peminjaman/index.blade.php @@ -11,82 +11,76 @@ @include('layouts.components.alert-prompt') - @if (auth()->user()->role_id == 1) -
-
-
-
-
Data Peminjaman
-
-
+
+
+
+
+
Data Peminjaman
-
-
-
- - - - - - - - - - - - - - - @php - $no_peminjaman = 1; - @endphp - @forelse ($peminjaman as $data_peminjaman) - @if ($data_peminjaman->enter_warehouse == null) - - - - - - - - - - - @endif - @empty -

Data Kosong

- @endforelse - -
NoKode PetiNama CustomerKodeTgl PeminjamanPJ PeminjamanTujuan WH PeminjamAction
{{ $no_peminjaman++ }}{{ $data_peminjaman->peti->fix_lot }}{{ $data_peminjaman->peti->customer->name }}{{ $data_peminjaman->peti->customer->code_customer }} - - {{ $data_peminjaman->peti->tipe_peti->type }}{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}{{ $data_peminjaman->exit_pic }}{{ $data_peminjaman->warehouse->name }} - - - - - - -
- @csrf - @method('DELETE') - -
-
+
- @else - @include('pages.user.Peminjaman.index') - @endif +
+
+ + + + + + + + + + + + + + + @php + $no_peminjaman = 1; + @endphp + @forelse ($peminjaman as $data_peminjaman) + @if ($data_peminjaman->enter_warehouse == null) + + + + + + + + + + + @endif + @empty + @endforelse + +
NoKode PetiNama CustomerKodeTgl PeminjamanPJ PeminjamanTujuan WH PeminjamAction
{{ $no_peminjaman++ }}{{ $data_peminjaman->peti->fix_lot }}{{ $data_peminjaman->peti->customer->name }}{{ $data_peminjaman->peti->customer->code_customer }} - + {{ $data_peminjaman->peti->tipe_peti->type }}{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}{{ $data_peminjaman->exit_pic }}{{ $data_peminjaman->warehouse->name }} + + + + + + +
+ @csrf + @method('DELETE') + +
+
+
+
+
@endsection diff --git a/resources/views/dashboard/Pengembalian/index.blade.php b/resources/views/dashboard/Pengembalian/index.blade.php index 22090fc..8d40ee3 100644 --- a/resources/views/dashboard/Pengembalian/index.blade.php +++ b/resources/views/dashboard/Pengembalian/index.blade.php @@ -10,107 +10,101 @@ white-space: nowrap; } - @if (auth()->user()->role_id == 1) -
-
-
-
-
Data Pengembalian
-
+
+
+
+
+
Data Pengembalian
-
-
- - - - - - - - - - - - - - - - - - - - @php - $no_peminjaman = 1; - @endphp - @forelse ($peminjaman as $data) - @if ($data->enter_warehouse !== null) - - - - - - - - - - - - - - - - @endif - @empty -

Data Kosong

- @endforelse - -
NoKode PetiCustomerTgl PeinjamanEstimasi PengembalianPJ PeminjamanWH PeminjamTgl PengembalianPJ PengembalianWH PengembalianKondisi PetiStatusAction
{{ $no_peminjaman++ }}{{ $data->peti->fix_lot }}{{ $data->peti->customer->name }}{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}{{ $data->exit_pic }} - @if ($data->exit_warehouse) - {{ $data->warehouse->name }} - @else -

-

- @endif -
- @if ($data->enter_at) - {{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }} - @else -

-

- @endif -
- @if ($data->enter_pic) - {{ $data->enter_pic }} - @else -

-

- @endif -
- @if ($data->enter_warehouse) - {{ $data->warehouseEnter->name }} - @else -

-

- @endif -
- @if ($data->kondisi_peti) - {{ $data->kondisi_peti->nama_kondisi }} - @else -

-

- @endif -
- @if ($data->enter_warehouse === null) - Not Return - @else - Return - @endif - - - - -
-
+
+
+
+ + + + + + + + + + + + + + + + + + + + @php + $no_peminjaman = 1; + @endphp + @forelse ($peminjaman as $data) + @if ($data->enter_warehouse !== null) + + + + + + + + + + + + + + + + @endif + @empty + @endforelse + +
NoKode PetiCustomerTgl PeinjamanEstimasi PengembalianPJ PeminjamanWH PeminjamTgl PengembalianPJ PengembalianWH PengembalianKondisi PetiStatusAction
{{ $no_peminjaman++ }}{{ $data->peti->fix_lot }}{{ $data->peti->customer->name }}{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}{{ $data->exit_pic }} + @if ($data->exit_warehouse) + {{ $data->warehouse->name }} + @else +

-

+ @endif +
+ @if ($data->enter_at) + {{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }} + @else +

-

+ @endif +
+ @if ($data->enter_pic) + {{ $data->enter_pic }} + @else +

-

+ @endif +
+ @if ($data->enter_warehouse) + {{ $data->warehouseEnter->name }} + @else +

-

+ @endif +
+ @if ($data->kondisi_peti) + {{ $data->kondisi_peti->nama_kondisi }} + @else +

-

+ @endif +
+ @if ($data->enter_warehouse === null) + Not Return + @else + Return + @endif + + + + +
- @else - @include('pages.user.Pengembalian.index') - @endif +
@endsection diff --git a/resources/views/dashboard/Transaksi/index.blade.php b/resources/views/dashboard/Transaksi/index.blade.php index a1766f7..0552bd7 100644 --- a/resources/views/dashboard/Transaksi/index.blade.php +++ b/resources/views/dashboard/Transaksi/index.blade.php @@ -90,7 +90,6 @@ @empty -

Data Kosong

@endforelse diff --git a/resources/views/dashboard/Transfer/index.blade.php b/resources/views/dashboard/Transfer/index.blade.php index 2c88505..863d3c1 100644 --- a/resources/views/dashboard/Transfer/index.blade.php +++ b/resources/views/dashboard/Transfer/index.blade.php @@ -44,7 +44,8 @@ @foreach ($transfer as $data_transfer) {{ $notransfer++ }} - {{ $data_transfer->peti->fix_lot }} + {{-- {{ $data_transfer->peti->fix_lot }} --}} + {{ optional($data_transfer->peti)->fix_lot }} {{ $data_transfer->customer->name ?? '' }} {{ \Carbon\Carbon::parse($data_transfer->date)->format('d/m/Y') }} {{ $data_transfer->sourceWarehouse->name ?? '' }} diff --git a/resources/views/dashboard/index.blade.php b/resources/views/dashboard/index.blade.php index e948f51..48252ab 100644 --- a/resources/views/dashboard/index.blade.php +++ b/resources/views/dashboard/index.blade.php @@ -1,376 +1,318 @@ @extends('layouts.main') @section('content') -
-

Dashboard

- Generate Report -
-
-
-
-
-
-
-
- Pengadaan + @if (auth()->user()->role_id == 1) +
+

Dashboard

+ Generate Report +
+
+
+
+
+
+
+
+ Pengadaan +
+
+ {{ $jumlahPeti }} +
-
- {{ $jumlahPeti }} +
+
-
- -
-
- -
-
-
-
-
-
- Peminjaman + +
+
+
+
+
+
+ Peminjaman +
+
+ {{ $jumlahPeminjaman }}
+
+
+
-
- {{ $jumlahPeminjaman }}
-
-
-
-
- -
-
-
-
-
-
- Pengembalian + +
+
+
+
+
+
+ Pengembalian +
+
+ {{ $jumlahPengembalian }}
+
+
+
-
- {{ $jumlahPengembalian }}
-
-
-
-
- -
-
-
-
-
-
- Reminder Pengembalian + +
+
+
+
+
+
+ Reminder Pengembalian +
+
+ {{ $reminder }}
+
+
+
-
- {{ $reminder }}
-
-
-
-
- -
-
-
-
Grafik Peminjaman VS Pengembalian
-
- @php - $chartData = app('App\Http\Controllers\HomeController')->generateChartData(); - @endphp -
- - + +
+
+
+
Grafik Peminjaman VS Pengembalian
+
+ @php + $chartData = app('App\Http\Controllers\HomeController')->generateChartData(); + @endphp +
+ + - + +
-
- -
-
- -
-
Grafik Pengadaan Peti
-
- @php - $chartDataPie = app('App\Http\Controllers\HomeController')->generateChartDataPie(); - @endphp + +
+
+ +
+
Grafik Pengadaan Peti
+
+ @php + $chartDataPie = app('App\Http\Controllers\HomeController')->generateChartDataPie(); + @endphp -
- - +
+ + - + +
- {{--
-
- -
-
Grafik Pengadaan Peti
-
- @php - $chartDataPie = app('App\Http\Controllers\HomeController')->generateChartDataPie(); - @endphp - -
- - - - -
-
-
--}} -
- @push('script') - - - + - // Event listener for year filter change - document.getElementById('yearFilterPie').addEventListener('change', function() { - var selectedYear = this.value; - updatePieChart(selectedYear); - }); + + - {{-- - --}} + }); - - - // Mengambil data berdasarkan tahun yang dipilih - var updatedExitData = chartData.exitData[selectedYearIndex]; - var updatedEnterData = chartData.enterData[selectedYearIndex]; + + - @endpush + + @endpush + @elseif(auth()->user()->role_id == 2) + @include('pages.user.dashboard.index') + @endif @endsection diff --git a/resources/views/layouts/navbar.blade.php b/resources/views/layouts/navbar.blade.php index 606a582..029bbe5 100644 --- a/resources/views/layouts/navbar.blade.php +++ b/resources/views/layouts/navbar.blade.php @@ -46,15 +46,15 @@
- {{ \Carbon\Carbon::parse($data_notification->exit_at)->format('F j, Y') }}
+ {{ \Carbon\Carbon::parse($data_notification->est_pengembalian)->format('F j, Y') }} +
Peti dengan kode - {{ $data_notification->peti->fix_lot }} berhasil di pinjam + {{ $data_notification->peti->fix_lot }} Sudah waktunya pengembalian
@endforeach Show All - Alerts + href="{{ route('dashboard.navbarList.notification') }}">Show All Notifikasi
diff --git a/resources/views/layouts/navbar_list.blade.php b/resources/views/layouts/navbar_list.blade.php index b383456..a54b3eb 100644 --- a/resources/views/layouts/navbar_list.blade.php +++ b/resources/views/layouts/navbar_list.blade.php @@ -1,4 +1,21 @@ @extends('layouts.main') @section('content') -

Halaman Notification

+
+ @foreach ($notifikasi as $data_notifikasi) +
+
+ +
+ Kode Peti dengan dengan kode "{{ $data_notifikasi->peti->fix_lot }}" sudah waktunya dikembalikan + pada tanggal {{ \Carbon\Carbon::parse($data_notifikasi->est_pengembalian)->format('F j, Y') }} +
+
+
+ @endforeach +
@endsection diff --git a/resources/views/pages/layouts/sidebar_user.blade.php b/resources/views/pages/layouts/sidebar_user.blade.php index e7d16c5..cf9e418 100644 --- a/resources/views/pages/layouts/sidebar_user.blade.php +++ b/resources/views/pages/layouts/sidebar_user.blade.php @@ -1,34 +1,74 @@ - -
@@ -21,7 +16,6 @@ Kode Customer No. Telepon Alamat - Action @@ -35,24 +29,6 @@ {{ $data_customer->code_customer }} {{ $data_customer->no_tlp }} {{ $data_customer->address }} - - - - - - - -
- @csrf - @method('DELETE') - -
- @empty

Data Kosong

diff --git a/resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php b/resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php index 63f991c..968280b 100644 --- a/resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php +++ b/resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php @@ -1,14 +1,9 @@
-
+
Data Peti
-
@@ -17,6 +12,7 @@ No + Fix Lot User Customer WH @@ -24,10 +20,9 @@ Tipe Peti Ukuran Peti Lot No - Status Peti + Kondisi Peti Packing No - Fix Lot - Action + Status @@ -37,6 +32,7 @@ @forelse ($peti as $data_peti) {{ $nopeti++ }} + {{ $data_peti->fix_lot }} {{ $data_peti->created_by }} {{ $data_peti->customer->name }} {{ $data_peti->warehouse->name }} @@ -44,27 +40,9 @@ {{ $data_peti->tipe_peti->type }} {{ $data_peti->tipe_peti->size_peti }} {{ $data_peti->customer->lot_no }} - {{ $data_peti->status_disposal }} + {{ $data_peti->kondisipeti->nama_kondisi }} {{ $data_peti->packing_no }} - {{ $data_peti->fix_lot }} - - - - - - - -
- @csrf - @method('DELETE') - -
- + {{ $data_peti->status }} @empty

Data Kosong

diff --git a/resources/views/pages/user/Master_Data/Manajemen_Peti/Type_peti/index.blade.php b/resources/views/pages/user/Master_Data/Manajemen_Peti/Type_peti/index.blade.php deleted file mode 100644 index 932082b..0000000 --- a/resources/views/pages/user/Master_Data/Manajemen_Peti/Type_peti/index.blade.php +++ /dev/null @@ -1,62 +0,0 @@ -
-
-
-
-
Data Tipe Peti
-
- -
-
-
-
- - - - - - - - - - - - @php - $notype = 1; - @endphp - @forelse ($typepeti as $data_typepeti) - - - - - - - - @empty -

Data Kosong

- @endforelse - -
NoTipe PetiUkuran PetiDeskripsi PetiAction
{{ $notype++ }}{{ $data_typepeti->type }}{{ $data_typepeti->size_peti }}{{ $data_typepeti->description }} - - - - - - -
- @csrf - @method('DELETE') - -
-
-
-
-
diff --git a/resources/views/pages/user/Master_Data/Role/index.blade.php b/resources/views/pages/user/Master_Data/Manajemen_Peti/kondisi_peti/index.blade.php similarity index 56% rename from resources/views/pages/user/Master_Data/Role/index.blade.php rename to resources/views/pages/user/Master_Data/Manajemen_Peti/kondisi_peti/index.blade.php index 33c9f6c..7ef10b0 100644 --- a/resources/views/pages/user/Master_Data/Role/index.blade.php +++ b/resources/views/pages/user/Master_Data/Manajemen_Peti/kondisi_peti/index.blade.php @@ -2,7 +2,7 @@
-
Data Role
+
Data Kondisi Peti
@@ -11,22 +11,24 @@ - - + + @php - $norole = 1; + $nokondisi = 1; @endphp - @foreach ($role as $data_role) + @forelse ($kondisiPeti as $data_kondisiPeti) - - - + + + - @endforeach + @empty +

Data Kosong

+ @endforelse
NoNama RoleNoKondisi Peti Deskripsi
{{ $norole++ }}{{ $data_role->name }}{{ $data_role->description }}{{ $nokondisi++ }}{{ $data_kondisiPeti->nama_kondisi }}{{ $data_kondisiPeti->deskripsi_kondisi }}
diff --git a/resources/views/pages/user/Master_Data/Manajemen_Peti/tipe_peti/index.blade.php b/resources/views/pages/user/Master_Data/Manajemen_Peti/tipe_peti/index.blade.php new file mode 100644 index 0000000..1725ed0 --- /dev/null +++ b/resources/views/pages/user/Master_Data/Manajemen_Peti/tipe_peti/index.blade.php @@ -0,0 +1,38 @@ +
+
+
+
+
Data Tipe Peti
+
+
+
+
+
+ + + + + + + + + + + @php + $notype = 1; + @endphp + @forelse ($typepeti as $data_typepeti) + + + + + + + @empty +

Data Kosong

+ @endforelse + +
NoTipe PetiUkuran PetiDeskripsi Peti
{{ $notype++ }}{{ $data_typepeti->type }}{{ $data_typepeti->size_peti }}{{ $data_typepeti->description }}
+
+
+
diff --git a/resources/views/pages/user/Master_Data/User/index.blade.php b/resources/views/pages/user/Master_Data/User/index.blade.php deleted file mode 100644 index dad90e3..0000000 --- a/resources/views/pages/user/Master_Data/User/index.blade.php +++ /dev/null @@ -1,59 +0,0 @@ -
-
-
-
-
Data User
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - @php - $noUser = 1; - @endphp - @forelse ($user as $data) - - - - - - - - - - @empty -

Data Kosong

- @endforelse - -
NoNamaEmailNo. HPAlamatDitugaskanAction
NoNamaEmailNo. HPAlamatDitugaskanAction
{{ $noUser++ }}{{ $data->fullname }}{{ $data->email }}{{ isset($data->no_hp) ? $data->no_hp : '-' }}{{ isset($data->address) ? $data->address : '-' }}{{ $data->warehouse->name }} - - - -
-
-
-
diff --git a/resources/views/pages/user/Master_Data/Warehouse/index.blade.php b/resources/views/pages/user/Master_Data/Warehouse/index.blade.php index 5f39722..240c1cc 100644 --- a/resources/views/pages/user/Master_Data/Warehouse/index.blade.php +++ b/resources/views/pages/user/Master_Data/Warehouse/index.blade.php @@ -4,6 +4,8 @@
Data Gudang
+
+
@@ -15,6 +17,7 @@ Nama Gudang Deskripsi Alamat + {{-- Action --}} @@ -32,6 +35,5 @@
-
diff --git a/resources/views/pages/user/Peminjaman/index.blade.php b/resources/views/pages/user/Peminjaman/index.blade.php deleted file mode 100644 index 1c36f46..0000000 --- a/resources/views/pages/user/Peminjaman/index.blade.php +++ /dev/null @@ -1,65 +0,0 @@ -
-
-
-
-
Data Peminjaman
-
- -
-
-
-
- - - - - - - - - - - - - - @php - $no_peminjaman = 1; - @endphp - @forelse ($peminjaman as $data_peminjaman) - - - - - - - - - - @empty -

Data Kosong

- @endforelse - -
NoKode PetiNama CustomerTgl PeminjamanPJ PeminjamanAsal GudangAction
{{ $no_peminjaman++ }}{{ $data_peminjaman->peti->customer->code_customer }} - - {{ $data_peminjaman->peti->tipe_peti->type }}{{ $data_peminjaman->peti->customer->name }}{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}{{ $data_peminjaman->exit_pic }}{{ $data_peminjaman->warehouse->name }} - - - -
- @csrf - @method('DELETE') - -
-
-
-
-
diff --git a/resources/views/pages/user/Pengembalian/index.blade.php b/resources/views/pages/user/Pengembalian/index.blade.php deleted file mode 100644 index 2d615af..0000000 --- a/resources/views/pages/user/Pengembalian/index.blade.php +++ /dev/null @@ -1,88 +0,0 @@ -
-
-
Data Pengembalian
-
-
-
- - - - - - - - - - - - - - - - - - - @php - $no_peminjaman = 1; - @endphp - {{-- @foreach ($peminjaman as $data) - - @endforeach --}} - @forelse ($peminjaman as $data) - - - - - - - - - - - - - - - @empty -

Data Kosong

- @endforelse - -
NoKode PetiTgl PeinjamanEstimasi PengembalianPJ PeminjamanAsal WH PeminjamanTgl PengembalianPJ PengembalianTujuan WH PengembalianKondisi PetiStatusAction
{{ $no_peminjaman++ }}{{ $data->peti->customer->code_customer }} - - {{ $data->peti->tipe_peti->type }}{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}{{ $data->exit_pic }}{{ $data->warehouse->name }} - @if ($data->enter_at) - {{ \Carbon\Carbon::parse($data->enter_at)->format('d-m-Y') }} - @else -

-

- @endif -
- @if ($data->enter_pic) - {{ $data->enter_pic }} - @else -

-

- @endif -
- @if ($data->enter_warehouse) - {{ $data->warehouse->name }} - @else -

-

- @endif -
- @if ($data->kondisi_peti) - {{ $data->kondisi_peti }} - @else -

-

- @endif -
- @if ($data->enter_warehouse === null) - Not Return - @else - Return - @endif - - - - -
-
-
-
diff --git a/resources/views/pages/user/dashboard/disposal/index.blade.php b/resources/views/pages/user/dashboard/disposal/index.blade.php new file mode 100644 index 0000000..bf85ad8 --- /dev/null +++ b/resources/views/pages/user/dashboard/disposal/index.blade.php @@ -0,0 +1,42 @@ +
+
+
+
+
Data Disposal
+
+
+
+
+
+ + + + + + + + + + + + + @php + $nodisposal = 1; + @endphp + @forelse ($disposal as $data_disposal) + + + + + + + + + @empty +

Data Kosong

+ @endforelse + +
NoKode PetiNama CustomerTanggal DisposalAlasan DisposalStatus Peti
{{ $nodisposal++ }}{{ $data_disposal->peti->fix_lot }}{{ $data_disposal->customer->name }}{{ \Carbon\Carbon::parse($data_disposal->date_disposal)->format('d/m/Y') }}{{ $data_disposal->description }}{{ $data_disposal->status_disposal }}
+
+
+
diff --git a/resources/views/pages/user/dashboard/index.blade.php b/resources/views/pages/user/dashboard/index.blade.php new file mode 100644 index 0000000..4aaf3ca --- /dev/null +++ b/resources/views/pages/user/dashboard/index.blade.php @@ -0,0 +1,288 @@ +
+

Dashboard

+ {{-- Generate Report --}} +
+
+
+
+
+
+
+
+ Pengadaan +
+
+ {{ $jumlahPeti }} +
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
+ Peminjaman +
+
+ {{ $jumlahPeminjaman }}
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
+ Pengembalian +
+
+ {{ $jumlahPengembalian }}
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
+ Reminder Pengembalian +
+
+ {{ $reminder }}
+
+
+ +
+
+
+
+
+ + +
+
+
+
Grafik Peminjaman VS Pengembalian
+
+ @php + $chartData = app('App\Http\Controllers\HomeController')->generateChartData(); + @endphp +
+ + + + +
+
+
+ + +
+
+ +
+
Grafik Pengadaan Peti
+
+ @php + $chartDataPie = app('App\Http\Controllers\HomeController')->generateChartDataPie(); + @endphp + +
+ + + + +
+
+
+
+ +@push('script') + + + + + + +@endpush diff --git a/resources/views/pages/user/index.blade.php b/resources/views/pages/user/index.blade.php deleted file mode 100644 index 0f5886f..0000000 --- a/resources/views/pages/user/index.blade.php +++ /dev/null @@ -1,194 +0,0 @@ -@extends('layouts.main') -@section('content') -
-

Dashboard

-
-
-
-
-
-
-
-
- Pengadaan -
-
- {{ $jumlahAsset }} -
-
-
- -
-
-
-
-
- - -
-
-
-
-
-
- Peminjaman -
-
- {{ $jumlahPeminjaman }}
-
-
- -
-
-
-
-
- - -
-
-
-
-
-
- Pengembalian -
-
- {{ $jumlahPengembalian }}
-
-
- -
-
-
-
-
- - -
-
-
-
-
-
- Reminder Pengembalian -
-
- {{ $reminder }}
-
-
- -
-
-
-
-
- -
-
-
-
Grafik Peminjaman VS Pengembalian
- -
- @php - $chartData = app('App\Http\Controllers\HomeController')->generateChartData(); - @endphp - -
- -
-
-
- - - - -
-
- -
-
Grafik Pengadaan Barang
- -
- -
-
- -
-
- - Direct - - - Social - - - Referral - -
-
-
-
-
- - @push('script') - - @endpush -@endsection diff --git a/routes/web.php b/routes/web.php index dc0bce3..d79c075 100644 --- a/routes/web.php +++ b/routes/web.php @@ -205,9 +205,8 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func //halaman Report Stok Route::controller(StokOpNameController::class)->group(function () { - Route::get('StokOpname', 'index')->name('StokOpname.index'); - // Route::get('StokOpname/{id}', 'show')->name('StokOpname.show'); Route::get('StokOpname/export', 'export')->name('StokOpname.export'); + Route::get('StokOpname', 'index')->name('StokOpname.index'); }); });