Browse Source

perbaikan hak akses admin dan operator

master
Gunawan19621 1 year ago
parent
commit
8392beea2a
  1. 7
      app/Http/Controllers/DisposalController.php
  2. 6
      app/Http/Controllers/HistoryController.php
  3. 9
      app/Http/Controllers/HomeController.php
  4. 3
      app/Http/Controllers/PetternLotPetiController.php
  5. 16
      app/Http/Controllers/StokOpNameController.php
  6. 2
      app/Http/Controllers/TransaksiKeluarMasukController.php
  7. 12
      app/Http/Requests/Disposal/ValidasiCreateDisposal.php
  8. 12
      app/Http/Requests/Disposal/ValidasiUpdateDisposal.php
  9. 7
      app/Models/Disposal.php
  10. 26
      app/Models/Peti.php
  11. 8
      app/Models/Transfer.php
  12. 5
      app/Models/User.php
  13. 30
      app/Models/asset_status.php
  14. 4
      database/migrations/2023_10_23_075245_create_users_table.php
  15. 8
      database/migrations/2023_11_06_085238_create_petis_table.php
  16. 2
      database/migrations/2023_11_08_132316_create_transfers_table.php
  17. 6
      database/migrations/2023_11_17_075418_create_disposals_table.php
  18. 96
      database/seeders/PetiSeeder.php
  19. 5
      resources/views/dashboard/Disposal/index.blade.php
  20. 1
      resources/views/dashboard/History/Peminjaman/index.blade.php
  21. 1
      resources/views/dashboard/History/Pengembalian/index.blade.php
  22. 1
      resources/views/dashboard/Master_Data/Customer/index.blade.php
  23. 6
      resources/views/dashboard/Master_Data/Manajemen_Peti/Kondisi_Peti/index.blade.php
  24. 1
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php
  25. 1
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php
  26. 1
      resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/detail_peti.blade.php
  27. 1
      resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/index.blade.php
  28. 1
      resources/views/dashboard/Master_Data/Report/Stok_opname/index.blade.php
  29. 1
      resources/views/dashboard/Master_Data/User/index.blade.php
  30. 1
      resources/views/dashboard/Peminjaman/index.blade.php
  31. 1
      resources/views/dashboard/Pengembalian/index.blade.php
  32. 1
      resources/views/dashboard/Transaksi/index.blade.php
  33. 3
      resources/views/dashboard/Transfer/index.blade.php
  34. 21
      resources/views/dashboard/index.blade.php
  35. 8
      resources/views/layouts/navbar.blade.php
  36. 19
      resources/views/layouts/navbar_list.blade.php
  37. 2
      resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php
  38. 4
      resources/views/pages/user/dashboard/index.blade.php
  39. 3
      routes/web.php

7
app/Http/Controllers/DisposalController.php

@ -16,14 +16,17 @@ class DisposalController extends Controller
public function index() public function index()
{ {
$data = [ $data = [
'disposal' => Disposal::where('status_disposal', 'INAKTIF')->orderBy('created_at', 'desc')->get(), 'disposal' => Disposal::where('status_disposal', 'INAKTIF')
// 'disposal' => Disposal::orderBy('created_at', 'desc')->get(), ->orderBy('created_at', 'desc')
->get(),
'active' => 'menu-disposal', 'active' => 'menu-disposal',
]; ];
return view('dashboard.Disposal.index', $data); return view('dashboard.Disposal.index', $data);
} }
/** /**
* Show the form for creating a new resource. * Show the form for creating a new resource.
*/ */

6
app/Http/Controllers/HistoryController.php

@ -14,7 +14,7 @@ class HistoryController extends Controller
$data = [ $data = [
// 'peminjaman' => asset_status::get(), // '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(), 'warehouse' => m_warehouse::get(),
'active' => 'history-peminjaman', 'active' => 'history-peminjaman',
]; ];
@ -25,7 +25,7 @@ class HistoryController extends Controller
public function historyPengembalian() public function historyPengembalian()
{ {
$data = [ $data = [
'peminjaman' => asset_status::orderBy('created_at', 'desc')->get(), 'peminjaman' => asset_status::withTrashed()->orderBy('created_at', 'desc')->get(),
'active' => 'history-pengembalian', 'active' => 'history-pengembalian',
]; ];
return view('dashboard.History.Pengembalian.index', $data); return view('dashboard.History.Pengembalian.index', $data);
@ -34,7 +34,7 @@ class HistoryController extends Controller
public function historyTransfer() public function historyTransfer()
{ {
$data = [ $data = [
'transfer' => Transfer::orderBy('created_at', 'desc')->get(), 'transfer' => Transfer::withTrashed()->orderBy('created_at', 'desc')->get(),
'active' => 'history-transfer', 'active' => 'history-transfer',
]; ];
return view('dashboard.History.Transfer.index', $data); return view('dashboard.History.Transfer.index', $data);

9
app/Http/Controllers/HomeController.php

@ -37,11 +37,12 @@ class HomeController extends Controller
public function notification() public function notification()
{ {
$notification = \App\Models\asset_status::whereNull('enter_at')
->whereDate('est_pengembalian', \Carbon\Carbon::today())
->get();
$data = [ $data = [
'reminder' => \App\Models\asset_status::whereNull('enter_at')->count(), 'notifikasi' => $notification,
'jumlahPeti' => \App\Models\Peti::count(),
'jumlahPeminjaman' => \App\Models\asset_status::count(),
'jumlahPengembalian' => \App\Models\asset_status::whereNotNull('enter_at')->count(),
'active' => 'menu-admin', 'active' => 'menu-admin',
]; ];

3
app/Http/Controllers/PetternLotPetiController.php

@ -13,8 +13,7 @@ class PetternLotPetiController extends Controller
public function index() public function index()
{ {
$data = [ $data = [
// 'warehouses' => m_warehouse::orderBy('created_at', 'desc')->get(), 'peti' => Peti::withTrashed()->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);

16
app/Http/Controllers/StokOpNameController.php

@ -14,27 +14,27 @@ class StokOpNameController extends Controller
public function index() public function index()
{ {
// Total Peti Berdasarkan Gudang // 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')) ->select('customer_id', 'tipe_peti_id', 'warehouse_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id', 'warehouse_id') ->groupBy('customer_id', 'tipe_peti_id', 'warehouse_id')
->get(); ->get();
// Total Peti Berdasarkan Tanggal Sekarang // 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')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', today()) ->whereDate('created_at', today())
->groupBy('customer_id', 'tipe_peti_id') ->groupBy('customer_id', 'tipe_peti_id')
->get(); ->get();
// Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang // 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')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini ->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 // 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')) ->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();
@ -52,27 +52,27 @@ class StokOpNameController extends Controller
public function export() public function export()
{ {
//total peti //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')) ->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();
// Total Peti Berdasarkan Tanggal Sekarang // 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')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', today()) ->whereDate('created_at', today())
->groupBy('customer_id', 'tipe_peti_id') ->groupBy('customer_id', 'tipe_peti_id')
->get(); ->get();
// Total Peti Berdasarkan Tanggal Sebelum Tanggal Sekarang // 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')) ->select('customer_id', 'tipe_peti_id', DB::raw('COUNT(*) as total_petis'))
->whereDate('created_at', '<', today()) // Mendapatkan data sebelum tanggal hari ini ->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 Gudang // 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')) ->select('customer_id', 'tipe_peti_id', 'warehouse_id', DB::raw('COUNT(*) as total_petis'))
->groupBy('customer_id', 'tipe_peti_id', 'warehouse_id') ->groupBy('customer_id', 'tipe_peti_id', 'warehouse_id')
->get(); ->get();

2
app/Http/Controllers/TransaksiKeluarMasukController.php

@ -14,7 +14,7 @@ class TransaksiKeluarMasukController extends Controller
public function index() public function index()
{ {
$data = [ $data = [
'peminjaman' => asset_status::all(), 'peminjaman' => asset_status::withTrashed()->all(),
'active' => 'menu-transaksi', 'active' => 'menu-transaksi',
]; ];
return view('dashboard.transaksi.index', $data); return view('dashboard.transaksi.index', $data);

12
app/Http/Requests/Disposal/ValidasiCreateDisposal.php

@ -22,9 +22,9 @@ class ValidasiCreateDisposal extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'peti_id' => 'required', 'peti_id' => 'required|integer',
'customer_id' => 'nullable', 'customer_id' => 'required|integer',
'warehouse_id' => 'nullable', 'warehouse_id' => 'required|integer',
'date_disposal' => 'nullable|date', 'date_disposal' => 'nullable|date',
'description' => 'nullable|string', 'description' => 'nullable|string',
'status_disposal' => 'nullable', 'status_disposal' => 'nullable',
@ -34,6 +34,12 @@ class ValidasiCreateDisposal extends FormRequest
public function messages(): array public function messages(): array
{ {
return [ 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.', 'date_disposal.date' => 'Format tanggal disposal tidak valid.',
'description.string' => 'Deskripsi harus berupa teks.', 'description.string' => 'Deskripsi harus berupa teks.',
]; ];

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

@ -22,9 +22,9 @@ class ValidasiUpdateDisposal extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'peti_id' => 'required', 'peti_id' => 'required|integer',
'customer_id' => 'nullable', 'customer_id' => 'required|integer',
'warehouse_id' => 'nullable', 'warehouse_id' => 'required|integer',
'date_disposal' => 'nullable|date', 'date_disposal' => 'nullable|date',
'description' => 'nullable|string', 'description' => 'nullable|string',
'status_disposal' => 'nullable', 'status_disposal' => 'nullable',
@ -34,6 +34,12 @@ class ValidasiUpdateDisposal extends FormRequest
public function messages(): array public function messages(): array
{ {
return [ 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.', 'date_disposal.date' => 'Format tanggal disposal tidak valid.',
'description.string' => 'Deskripsi harus berupa teks.', 'description.string' => 'Deskripsi harus berupa teks.',
]; ];

7
app/Models/Disposal.php

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
class Disposal extends Model class Disposal extends Model
{ {
use HasFactory, SoftDeletes, UUID; use HasFactory, SoftDeletes;
protected $table = 'disposals'; protected $table = 'disposals';
protected $fillable = [ protected $fillable = [
@ -35,13 +35,14 @@ class Disposal extends Model
'kondisipeti_id', 'kondisipeti_id',
'fix_lot', 'fix_lot',
'updated_by', 'updated_by',
); )->withTrashed();
} }
public function customer() public function customer()
{ {
return $this->belongsTo(Customer::class, 'customer_id')->select( return $this->belongsTo(Customer::class, 'customer_id')->select(
'name', 'name',
'code_customer', 'code_customer',
); )->withTrashed();
} }
} }

26
app/Models/Peti.php

@ -31,29 +31,43 @@ class Peti extends Model
public function customer() 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() 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() 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() 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() public function transfer()
{ {
return $this->hasOne(Transfer::class, 'peti_id'); return $this->hasOne(Transfer::class, 'peti_id')->withTrashed();
} }
// proses pengambilan data // proses pengambilan data
public function assetStatuses() public function assetStatuses()
{ {
return $this->hasMany(asset_status::class, 'peti_id'); return $this->hasMany(asset_status::class, 'peti_id')->withTrashed();
} }
} }

8
app/Models/Transfer.php

@ -35,27 +35,27 @@ class Transfer extends Model
'kondisipeti_id', 'kondisipeti_id',
'fix_lot', 'fix_lot',
'updated_by', 'updated_by',
); )->withTrashed();
} }
public function customer() public function customer()
{ {
return $this->belongsTo(Customer::class, 'name_customer')->select( return $this->belongsTo(Customer::class, 'name_customer')->select(
'name', 'name',
'code_customer', 'code_customer',
); )->withTrashed();
} }
public function sourceWarehouse() public function sourceWarehouse()
{ {
return $this->belongsTo(m_warehouse::class, 'source_warehouse')->select( return $this->belongsTo(m_warehouse::class, 'source_warehouse')->select(
'name', 'name',
'address', 'address',
); )->withTrashed();
} }
public function destinationWarehouse() public function destinationWarehouse()
{ {
return $this->belongsTo(m_warehouse::class, 'destination_warehouse')->select( return $this->belongsTo(m_warehouse::class, 'destination_warehouse')->select(
'name', 'name',
'address', 'address',
); )->withTrashed();
} }
} }

5
app/Models/User.php

@ -8,11 +8,12 @@ use Laravel\Sanctum\HasApiTokens;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use PHPOpenSourceSaver\JWTAuth\Contracts\JWTSubject; use PHPOpenSourceSaver\JWTAuth\Contracts\JWTSubject;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable implements JWTSubject class User extends Authenticatable implements JWTSubject
{ {
use HasApiTokens, HasFactory, Notifiable; use HasApiTokens, HasFactory, Notifiable, SoftDeletes;
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
@ -40,7 +41,7 @@ class User extends Authenticatable implements JWTSubject
public function warehouse() public function warehouse()
{ {
return $this->belongsTo(m_warehouse::class, 'warehouse_id'); return $this->belongsTo(m_warehouse::class, 'warehouse_id')->withTrashed();
} }
/** /**

30
app/Models/asset_status.php

@ -7,11 +7,12 @@ use App\Traits\UUID;
use App\Models\Customer; use App\Models\Customer;
use App\Models\Type_peti; use App\Models\Type_peti;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
class asset_status extends Model class asset_status extends Model
{ {
use HasFactory; use HasFactory, SoftDeletes;
protected $table = 'asset_statuses'; protected $table = 'asset_statuses';
protected $fillable = [ protected $fillable = [
@ -34,41 +35,52 @@ class asset_status extends Model
public function asset() public function asset()
{ {
return $this->belongsTo(m_asset::class, 'asset_id'); return $this->belongsTo(m_asset::class, 'asset_id')->withTrashed();
} }
public function warehouseId() 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() 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() 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() 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() 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() public function customer()
{ {
return $this->belongsTo(Customer::class, 'customer_id'); return $this->belongsTo(Customer::class, 'customer_id')->withTrashed();
} }
public function kondisi_peti() public function kondisi_peti()
{ {
return $this->belongsTo(kondisi_peti::class, 'kondisi_peti_id'); return $this->belongsTo(kondisi_peti::class, 'kondisi_peti_id')->withTrashed();
} }
} }

4
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('foto', 255)->nullable();
$table->string('jenis_kelamin', 20)->nullable(); $table->string('jenis_kelamin', 20)->nullable();
$table->string('agama', 15)->nullable(); $table->string('agama', 15)->nullable();
$table->foreignId('role_id')->nullable()->constrained('m_roles')->onDelete('set null'); $table->foreignId('role_id')->nullable()->constrained('m_roles');
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null'); $table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses');
$table->text('address')->nullable(); $table->text('address')->nullable();
$table->timestamp('email_verified_at')->nullable(); $table->timestamp('email_verified_at')->nullable();
$table->string('password', 255)->nullable(); $table->string('password', 255)->nullable();

8
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) { Schema::create('petis', function (Blueprint $table) {
$table->id(); $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('warna', 50);
$table->string('fix_lot', 100); $table->string('fix_lot', 100);
$table->integer('packing_no'); $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->integer('jumlah')->nullable();
$table->date('date_pembuatan', 100)->nullable(); $table->date('date_pembuatan', 100)->nullable();
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null'); $table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses');
$table->foreignId('kondisipeti_id')->nullable()->constrained('kondisi_petis')->onDelete('set null'); $table->foreignId('kondisipeti_id')->nullable()->constrained('kondisi_petis');
$table->string('status', 50)->default('AKTIF'); $table->string('status', 50)->default('AKTIF');
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();

2
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('peti_id')->nullable()->constrained('petis');
$table->foreignId('name_customer')->nullable()->constrained('customers'); $table->foreignId('name_customer')->nullable()->constrained('customers');
$table->foreignId('source_warehouse')->nullable()->constrained('m_warehouses'); $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->date('date');
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();

6
database/migrations/2023_11_17_075418_create_disposals_table.php

@ -12,11 +12,11 @@ return new class extends Migration
public function up(): void public function up(): void
{ {
Schema::create('disposals', function (Blueprint $table) { Schema::create('disposals', function (Blueprint $table) {
$table->uuid('id')->primary(); $table->id();
$table->uuid('mobile_id')->nullable(); $table->uuid('mobile_id')->nullable();
$table->foreignId('peti_id')->constrained('petis'); $table->foreignId('peti_id')->constrained('petis');
$table->foreignId('customer_id')->nullable()->constrained('customers')->onDelete('set null'); $table->foreignId('customer_id')->constrained('customers');
$table->foreignId('warehouse_id')->nullable()->constrained('m_warehouses')->onDelete('set null'); $table->foreignId('warehouse_id')->constrained('m_warehouses');
$table->date('date_disposal'); $table->date('date_disposal');
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->string('status_disposal', 50); $table->string('status_disposal', 50);

96
database/seeders/PetiSeeder.php

@ -15,25 +15,107 @@ class PetiSeeder extends Seeder
public function run() public function run()
{ {
// Generate 5 dummy data // Generate 5 dummy data
for ($i = 0; $i < 5; $i++) { // 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([ DB::table('petis')->insert([
[
'tipe_peti_id' => $this->getRandomId('type_petis'), 'tipe_peti_id' => $this->getRandomId('type_petis'),
'warna' => 'Dummy Warna ' . ($i + 1), 'warna' => 'Warna',
'fix_lot' => 'Dummy Fix Lot ' . ($i + 1), 'fix_lot' => 'Dummy Fix Lot 1',
'packing_no' => rand(1, 100), 'packing_no' => 1,
'customer_id' => $this->getRandomId('customers'), 'customer_id' => $this->getRandomId('customers'),
'jumlah' => rand(1, 10), 'jumlah' => 1,
'date_pembuatan' => now(), 'date_pembuatan' => now(),
'warehouse_id' => $this->getRandomId('m_warehouses'), 'warehouse_id' => 1,
'kondisipeti_id' => $this->getRandomId('kondisi_petis'), 'kondisipeti_id' => $this->getRandomId('kondisi_petis'),
'status' => 'AKTIF', 'status' => 'AKTIF',
'created_at' => now(), 'created_at' => now(),
'updated_at' => now(), 'updated_at' => now(),
'created_by' => 'Seeder', 'created_by' => 'Seeder',
'updated_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',
],
]); ]);
} }
}
/** /**
* Get a random ID from a specific table * Get a random ID from a specific table

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

@ -46,8 +46,8 @@
@forelse ($disposal as $data_disposal) @forelse ($disposal as $data_disposal)
<tr> <tr>
<td>{{ $nodisposal++ }}</td> <td>{{ $nodisposal++ }}</td>
<td>{{ $data_disposal->peti->fix_lot }}</td> <td>{{ optional($data_disposal->peti)->fix_lot }}</td>
<td>{{ $data_disposal->customer->name }}</td> <td>{{ optional($data_disposal->customer)->name }}</td>
<td>{{ \Carbon\Carbon::parse($data_disposal->date_disposal)->format('d/m/Y') }}</td> <td>{{ \Carbon\Carbon::parse($data_disposal->date_disposal)->format('d/m/Y') }}</td>
<td>{{ $data_disposal->description }}</td> <td>{{ $data_disposal->description }}</td>
<td>{{ $data_disposal->status_disposal }}</td> <td>{{ $data_disposal->status_disposal }}</td>
@ -68,7 +68,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

1
resources/views/dashboard/History/Peminjaman/index.blade.php

@ -47,7 +47,6 @@
<td>{{ $data_peminjaman->warehouse->name }}</td> <td>{{ $data_peminjaman->warehouse->name }}</td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

1
resources/views/dashboard/History/Pengembalian/index.blade.php

@ -94,7 +94,6 @@
</tr> </tr>
@endif @endif
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

1
resources/views/dashboard/Master_Data/Customer/index.blade.php

@ -63,7 +63,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

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

@ -31,7 +31,7 @@
@php @php
$nokondisi = 1; $nokondisi = 1;
@endphp @endphp
@forelse ($kondisiPeti as $data_kondisiPeti) @foreach ($kondisiPeti as $data_kondisiPeti)
<tr> <tr>
<td class="text-center">{{ $nokondisi++ }}</td> <td class="text-center">{{ $nokondisi++ }}</td>
<td>{{ $data_kondisiPeti->nama_kondisi }}</td> <td>{{ $data_kondisiPeti->nama_kondisi }}</td>
@ -53,9 +53,7 @@
</form> </form>
</td> </td>
</tr> </tr>
@empty @endforeach
<p>Data Kosong</p>
@endforelse
</tbody> </tbody>
</table> </table>
</div> </div>

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

@ -92,7 +92,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

1
resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/index.blade.php

@ -57,7 +57,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

1
resources/views/dashboard/Master_Data/Report/Pattern_lot_peti/detail_peti.blade.php

@ -86,7 +86,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

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

@ -64,7 +64,6 @@
<td>{{ $data_peti->status }}</td> <td>{{ $data_peti->status }}</td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

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

@ -165,7 +165,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

1
resources/views/dashboard/Master_Data/User/index.blade.php

@ -72,7 +72,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

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

@ -77,7 +77,6 @@
</tr> </tr>
@endif @endif
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

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

@ -101,7 +101,6 @@
</tr> </tr>
@endif @endif
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

1
resources/views/dashboard/Transaksi/index.blade.php

@ -90,7 +90,6 @@
</td> </td>
</tr> </tr>
@empty @empty
<p>Data Kosong</p>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>

3
resources/views/dashboard/Transfer/index.blade.php

@ -44,7 +44,8 @@
@foreach ($transfer as $data_transfer) @foreach ($transfer as $data_transfer)
<tr> <tr>
<td>{{ $notransfer++ }}</td> <td>{{ $notransfer++ }}</td>
<td>{{ $data_transfer->peti->fix_lot }}</td> {{-- <td>{{ $data_transfer->peti->fix_lot }}</td> --}}
<td>{{ optional($data_transfer->peti)->fix_lot }}</td>
<td>{{ $data_transfer->customer->name ?? '' }}</td> <td>{{ $data_transfer->customer->name ?? '' }}</td>
<td>{{ \Carbon\Carbon::parse($data_transfer->date)->format('d/m/Y') }}</td> <td>{{ \Carbon\Carbon::parse($data_transfer->date)->format('d/m/Y') }}</td>
<td>{{ $data_transfer->sourceWarehouse->name ?? '' }}</td> <td>{{ $data_transfer->sourceWarehouse->name ?? '' }}</td>

21
resources/views/dashboard/index.blade.php

@ -3,7 +3,7 @@
@if (auth()->user()->role_id == 1) @if (auth()->user()->role_id == 1)
<div class="d-sm-flex align-items-center justify-content-between mb-4"> <div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1> <h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
<a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i <a href="#" id="generateReportBtn" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
class="fas fa-download fa-sm text-white-50"></i> Generate Report</a> class="fas fa-download fa-sm text-white-50"></i> Generate Report</a>
</div> </div>
<div class="row"> <div class="row">
@ -292,6 +292,25 @@
} }
}); });
</script> </script>
<!-- script generate report -->
<script>
function downloadReport(routeName) {
var exportUrl = '{{ url('dashboard') }}/' + routeName;
var link = document.createElement('a');
link.href = exportUrl;
link.download = 'nama_file_report.xlsx'; // Ganti dengan nama file yang diinginkan
link.target = '_blank';
link.click();
}
document.getElementById('generateReportBtn').addEventListener('click', function() {
downloadReport('Pettern_Lot_Peti/export');
downloadReport('StokOpname/export');
});
</script>
@endpush @endpush
@elseif(auth()->user()->role_id == 2) @elseif(auth()->user()->role_id == 2)
@include('pages.user.dashboard.index') @include('pages.user.dashboard.index')

8
resources/views/layouts/navbar.blade.php

@ -46,15 +46,15 @@
</div> </div>
<div> <div>
<div class="small text-gray-500"> <div class="small text-gray-500">
{{ \Carbon\Carbon::parse($data_notification->exit_at)->format('F j, Y') }}</div> {{ \Carbon\Carbon::parse($data_notification->est_pengembalian)->format('F j, Y') }}
</div>
<span class="font-weight-bold">Peti dengan kode <span class="font-weight-bold">Peti dengan kode
{{ $data_notification->peti->fix_lot }} berhasil di pinjam</span> {{ $data_notification->peti->fix_lot }} Sudah waktunya pengembalian</span>
</div> </div>
</a> </a>
@endforeach @endforeach
<a class="dropdown-item text-center small text-gray-500" <a class="dropdown-item text-center small text-gray-500"
href="{{ route('dashboard.navbarList.notification') }}">Show All href="{{ route('dashboard.navbarList.notification') }}">Show All Notifikasi</a>
Alerts</a>
</div> </div>
</li> </li>

19
resources/views/layouts/navbar_list.blade.php

@ -1,4 +1,21 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
<p>Halaman Notification</p> <div class="row">
@foreach ($notifikasi as $data_notifikasi)
<div class="col-lg-6">
<div class="card shadow mb-4">
<div class="card-header py-3">
<a href="{{ route('dashboard.pengembalian.edit', $data_notifikasi->id) }}">
<h6 class="m-0 font-weight-bold text-primary">Kode Peti {{ $data_notifikasi->peti->fix_lot }}
</h6>
</a>
</div>
<div class="card-body">
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') }}
</div>
</div>
</div>
@endforeach
</div>
@endsection @endsection

2
resources/views/pages/user/Master_Data/Manajemen_Peti/Peti/index.blade.php

@ -12,7 +12,6 @@
<thead> <thead>
<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>Fix Lot</th> <th>Fix Lot</th>
<th>User</th> <th>User</th>
<th>Customer</th> <th>Customer</th>
@ -33,7 +32,6 @@
@forelse ($peti as $data_peti) @forelse ($peti as $data_peti)
<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>{{ $data_peti->fix_lot }}</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>

4
resources/views/pages/user/dashboard/index.blade.php

@ -1,7 +1,7 @@
<div class="d-sm-flex align-items-center justify-content-between mb-4"> <div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1> <h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
<a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i {{-- <a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
class="fas fa-download fa-sm text-white-50"></i> Generate Report</a> class="fas fa-download fa-sm text-white-50"></i> Generate Report</a> --}}
</div> </div>
<div class="row"> <div class="row">
<div class="col-xl-3 col-md-6 mb-4"> <div class="col-xl-3 col-md-6 mb-4">

3
routes/web.php

@ -205,9 +205,8 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func
//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/{id}', 'show')->name('StokOpname.show');
Route::get('StokOpname/export', 'export')->name('StokOpname.export'); Route::get('StokOpname/export', 'export')->name('StokOpname.export');
Route::get('StokOpname', 'index')->name('StokOpname.index');
}); });
}); });

Loading…
Cancel
Save