diff --git a/DataTables/BranchDataTable.php b/DataTables/BranchDataTable.php index 8e98b07..2b2c354 100644 --- a/DataTables/BranchDataTable.php +++ b/DataTables/BranchDataTable.php @@ -28,7 +28,10 @@ } })->addIndexColumn()->editColumn('updated_at', function ($row) { return $row->updated_at->locale('id')->translatedFormat('d F Y H:i:s'); - })->rawColumns(['action'])->addColumn('action', function ($branch) { + })->editColumn('status', function ($row) { + $status = $row->status ? 'Aktif' : 'Tidak Aktif'; + return $status; + })->rawColumns(['action','status'])->addColumn('action', function ($branch) { return view('writeoff::parameter.branches._actions', compact('branch')); })->setRowId('id'); } @@ -75,6 +78,7 @@ Column::make('kode')->title('Kode Branch'), Column::make('name')->title('Nama Branch'), Column::make('updated_at')->title('Last Update'), + Column::make('status')->title('Status'), Column::computed('action')->exportable(false)->printable(false)->width(60)->addClass('text-center'), ]; } diff --git a/DataTables/CurrencyDataTable.php b/DataTables/CurrencyDataTable.php index bb5f634..b1beca9 100644 --- a/DataTables/CurrencyDataTable.php +++ b/DataTables/CurrencyDataTable.php @@ -28,7 +28,10 @@ } })->addIndexColumn()->editColumn('updated_at', function ($row) { return $row->updated_at->locale('id')->translatedFormat('d F Y H:i:s'); - })->rawColumns(['action'])->addColumn('action', function ($currency) { + })->editColumn('status', function ($row) { + $status = $row->status ? 'Aktif' : 'Tidak Aktif'; + return $status; + })->rawColumns(['action','status'])->addColumn('action', function ($currency) { return view('writeoff::parameter.currencies._actions', compact('currency')); })->setRowId('id'); } @@ -75,6 +78,7 @@ Column::make('kode')->title('Kode Currency'), Column::make('name')->title('Nama Currency'), Column::make('updated_at')->title('Last Update'), + Column::make('status')->title('Status'), Column::computed('action')->exportable(false)->printable(false)->width(60)->addClass('text-center'), ]; } diff --git a/DataTables/FacilityTypeDataTable.php b/DataTables/FacilityTypeDataTable.php index 5b96979..aafc02d 100644 --- a/DataTables/FacilityTypeDataTable.php +++ b/DataTables/FacilityTypeDataTable.php @@ -28,7 +28,10 @@ } })->addIndexColumn()->editColumn('updated_at', function ($row) { return $row->updated_at->locale('id')->translatedFormat('d F Y H:i:s'); - })->rawColumns(['action'])->addColumn('action', function ($facility_type) { + })->editColumn('status', function ($row) { + $status = $row->status ? 'Aktif' : 'Tidak Aktif'; + return $status; + })->rawColumns(['action','status'])->addColumn('action', function ($facility_type) { return view('writeoff::parameter.facility_types._actions', compact('facility_type')); })->setRowId('id'); } @@ -75,6 +78,7 @@ Column::make('kode')->title('Kode'), Column::make('name')->title('Jenis Fasilitas'), Column::make('updated_at')->title('Last Update'), + Column::make('status')->title('Status'), Column::computed('action')->exportable(false)->printable(false)->width(60)->addClass('text-center'), ]; } diff --git a/DataTables/GuaranteeTypeDataTable.php b/DataTables/GuaranteeTypeDataTable.php index bc486ec..bb78ace 100644 --- a/DataTables/GuaranteeTypeDataTable.php +++ b/DataTables/GuaranteeTypeDataTable.php @@ -31,7 +31,10 @@ return $row->updated_at->locale('id')->translatedFormat('d F Y H:i:s'); return '-'; - })->rawColumns(['action'])->addColumn('action', function ($guarantee_type) { + })->editColumn('status', function ($row) { + $status = $row->status ? 'Aktif' : 'Tidak Aktif'; + return $status; + })->rawColumns(['action','status'])->addColumn('action', function ($guarantee_type) { return view('writeoff::parameter.guarantee_types._actions', compact('guarantee_type')); })->setRowId('id'); } @@ -78,6 +81,7 @@ Column::make('kode')->title('Kode'), Column::make('name')->title('Jenis Jaminan'), Column::make('updated_at')->title('Last Update'), + Column::make('status')->title('Status'), Column::computed('action')->exportable(false)->printable(false)->width(60)->addClass('text-center'), ]; } diff --git a/DataTables/LoanTypeDataTable.php b/DataTables/LoanTypeDataTable.php index 8e45690..7c62790 100644 --- a/DataTables/LoanTypeDataTable.php +++ b/DataTables/LoanTypeDataTable.php @@ -28,7 +28,10 @@ } })->addIndexColumn()->editColumn('updated_at', function ($row) { return $row->updated_at->locale('id')->translatedFormat('d F Y H:i:s'); - })->rawColumns(['action'])->addColumn('action', function ($loan_type) { + })->editColumn('status', function ($row) { + $status = $row->status ? 'Aktif' : 'Tidak Aktif'; + return $status; + })->rawColumns(['action','status'])->addColumn('action', function ($loan_type) { return view('writeoff::parameter.loan_types._actions', compact('loan_type')); })->setRowId('id'); } @@ -75,6 +78,7 @@ Column::make('kode')->title('Kode'), Column::make('name')->title('Jenis Pinjaman'), Column::make('updated_at')->title('Last Update'), + Column::make('status')->title('Status'), Column::computed('action')->exportable(false)->printable(false)->width(60)->addClass('text-center'), ]; } diff --git a/Database/Migrations/2023_10_02_033421_create_branches_table.php b/Database/Migrations/2023_10_02_033421_create_branches_table.php index f49db08..8b2ff37 100644 --- a/Database/Migrations/2023_10_02_033421_create_branches_table.php +++ b/Database/Migrations/2023_10_02_033421_create_branches_table.php @@ -16,7 +16,7 @@ $table->id(); $table->string('kode', 9)->unique(); $table->string('name'); - $table->char('status', 1)->default('A'); + $table->boolean('status')->default(true)->nullable(); $table->timestamps(); $table->timestamp('authorized_at')->nullable(); $table->char('authorized_status', 1)->nullable(); diff --git a/Database/Migrations/2023_10_10_034538_create_currencies_table.php b/Database/Migrations/2023_10_10_034538_create_currencies_table.php index edc5b56..be13b82 100644 --- a/Database/Migrations/2023_10_10_034538_create_currencies_table.php +++ b/Database/Migrations/2023_10_10_034538_create_currencies_table.php @@ -17,7 +17,7 @@ return new class extends Migration $table->id(); $table->string('kode',3)->unique(); $table->string('name'); - $table->char('status', 1)->default('A'); + $table->boolean('status')->default(true)->nullable(); $table->timestamps(); $table->timestamp('authorized_at')->nullable(); $table->char('authorized_status', 1)->nullable(); diff --git a/Database/Migrations/2023_10_10_042307_create_guarantee_types_table.php b/Database/Migrations/2023_10_10_042307_create_guarantee_types_table.php index 555b54e..ffb87f9 100644 --- a/Database/Migrations/2023_10_10_042307_create_guarantee_types_table.php +++ b/Database/Migrations/2023_10_10_042307_create_guarantee_types_table.php @@ -17,7 +17,7 @@ return new class extends Migration $table->id(); $table->string('kode',3)->unique(); $table->string('name'); - $table->char('status', 1)->default('A'); + $table->boolean('status')->default(true)->nullable(); $table->timestamps(); $table->timestamp('authorized_at')->nullable(); $table->char('authorized_status', 1)->nullable(); diff --git a/Database/Migrations/2023_10_11_042437_create_facility_types_table.php b/Database/Migrations/2023_10_11_042437_create_facility_types_table.php index ed36e21..0eab69b 100644 --- a/Database/Migrations/2023_10_11_042437_create_facility_types_table.php +++ b/Database/Migrations/2023_10_11_042437_create_facility_types_table.php @@ -17,7 +17,7 @@ return new class extends Migration $table->id(); $table->string('kode',3)->unique(); $table->string('name'); - $table->char('status', 1)->default('A'); + $table->boolean('status')->default(true)->nullable(); $table->timestamps(); $table->timestamp('authorized_at')->nullable(); $table->char('authorized_status', 1)->nullable(); diff --git a/Database/Migrations/2023_11_06_044321_create_loan_types_table.php b/Database/Migrations/2023_11_06_044321_create_loan_types_table.php index 53374e0..72835c8 100644 --- a/Database/Migrations/2023_11_06_044321_create_loan_types_table.php +++ b/Database/Migrations/2023_11_06_044321_create_loan_types_table.php @@ -15,7 +15,7 @@ return new class extends Migration $table->id(); $table->string('kode',4)->unique(); $table->string('name'); - $table->char('status', 1)->default('A'); + $table->boolean('status')->default(true)->nullable(); $table->timestamps(); $table->timestamp('authorized_at')->nullable(); $table->char('authorized_status', 1)->nullable(); diff --git a/Livewire/Branch/BranchModal.php b/Livewire/Branch/BranchModal.php index f7fb1ef..df14018 100644 --- a/Livewire/Branch/BranchModal.php +++ b/Livewire/Branch/BranchModal.php @@ -14,6 +14,7 @@ public $id; public $kode; public $name; + public $status; public $edit_mode = false; @@ -35,8 +36,9 @@ DB::transaction(function () { // Prepare the data for creating a new user $data = [ - 'kode' => $this->kode, - 'name' => $this->name + 'kode' => $this->kode, + 'name' => $this->name, + 'status' => $this->status ? 1 : 0, ]; if ($this->edit_mode) { @@ -104,16 +106,17 @@ $branch = Branch::find($id); - $this->id = $branch->id; - $this->kode = $branch->kode; - $this->name = $branch->name; + $this->id = $branch->id; + $this->kode = $branch->kode; + $this->name = $branch->name; + $this->status = $branch->status ? true : false; } public function delete($id) { - $branch = Branch::find($id); - $branch->delete_by = auth()->user()->id; + $branch = Branch::find($id); + $branch->delete_by = auth()->user()->id; $branch->deleted_at = now(); $approval = [ @@ -126,11 +129,11 @@ ]; $is_approval = Approval::where('menu', 'Parameter Cabang') - ->where('ref', $branch->kode) - ->where('status', '0') - ->where('method', 'delete') - ->get() - ->first(); + ->where('ref', $branch->kode) + ->where('status', '0') + ->where('method', 'delete') + ->get() + ->first(); if ($is_approval) { $this->dispatch('error', 'Data Sedang Menunggu Approval'); diff --git a/Livewire/Currency/CurrencyModal.php b/Livewire/Currency/CurrencyModal.php index 3836111..d0d1141 100644 --- a/Livewire/Currency/CurrencyModal.php +++ b/Livewire/Currency/CurrencyModal.php @@ -14,6 +14,7 @@ public $id; public $kode; public $name; + public $status; public $edit_mode = false; @@ -35,8 +36,9 @@ DB::transaction(function () { // Prepare the data for creating a new user $data = [ - 'kode' => $this->kode, - 'name' => $this->name + 'kode' => $this->kode, + 'name' => $this->name, + 'status' => $this->status ? 1 : 0, ]; if ($this->edit_mode) { @@ -104,9 +106,10 @@ $currency = Currency::find($id); - $this->id = $currency->id; - $this->kode = $currency->kode; - $this->name = $currency->name; + $this->id = $currency->id; + $this->kode = $currency->kode; + $this->name = $currency->name; + $this->status = $currency->status ? true : false; } public function delete($id) diff --git a/Livewire/FacilityType/FacilityTypeModal.php b/Livewire/FacilityType/FacilityTypeModal.php index 6cbacde..8b60c46 100644 --- a/Livewire/FacilityType/FacilityTypeModal.php +++ b/Livewire/FacilityType/FacilityTypeModal.php @@ -14,6 +14,7 @@ public $id; public $kode; public $name; + public $status; public $edit_mode = false; @@ -35,8 +36,9 @@ DB::transaction(function () { // Prepare the data for creating a new user $data = [ - 'kode' => $this->kode, - 'name' => $this->name + 'kode' => $this->kode, + 'name' => $this->name, + 'status' => $this->status ? 1 : 0, ]; if ($this->edit_mode) { @@ -104,15 +106,16 @@ $facility_type = FacilityType::find($id); - $this->id = $facility_type->id; - $this->kode = $facility_type->kode; - $this->name = $facility_type->name; + $this->id = $facility_type->id; + $this->kode = $facility_type->kode; + $this->name = $facility_type->name; + $this->status = $facility_type->status ? true : false; } public function delete($id) { - $facility = FacilityType::find($id); - $facility->delete_by = auth()->user()->id; + $facility = FacilityType::find($id); + $facility->delete_by = auth()->user()->id; $facility->deleted_at = now(); $approval = [ diff --git a/Livewire/GuaranteeType/GuaranteeTypeModal.php b/Livewire/GuaranteeType/GuaranteeTypeModal.php index e325fc9..69b444f 100644 --- a/Livewire/GuaranteeType/GuaranteeTypeModal.php +++ b/Livewire/GuaranteeType/GuaranteeTypeModal.php @@ -14,6 +14,7 @@ public $id; public $kode; public $name; + public $status; public $edit_mode = false; @@ -36,7 +37,8 @@ // Prepare the data for creating a new user $data = [ 'kode' => $this->kode, - 'name' => $this->name + 'name' => $this->name, + 'status' => $this->status ? 1 : 0, ]; if ($this->edit_mode) { @@ -107,6 +109,7 @@ $this->id = $guarantee_type->id; $this->kode = $guarantee_type->kode; $this->name = $guarantee_type->name; + $this->status = $guarantee_type->status ? true : false; } public function delete($id) diff --git a/Livewire/LoanType/LoanTypeModal.php b/Livewire/LoanType/LoanTypeModal.php index 09673f6..4ba4093 100644 --- a/Livewire/LoanType/LoanTypeModal.php +++ b/Livewire/LoanType/LoanTypeModal.php @@ -14,6 +14,7 @@ public $id; public $kode; public $name; + public $status; public $edit_mode = false; @@ -35,8 +36,9 @@ DB::transaction(function () { // Prepare the data for creating a new user $data = [ - 'kode' => $this->kode, - 'name' => $this->name + 'kode' => $this->kode, + 'name' => $this->name, + 'status' => $this->status ? 1 : 0, ]; if ($this->edit_mode) { @@ -104,15 +106,16 @@ $loan_type = LoanType::find($id); - $this->id = $loan_type->id; - $this->kode = $loan_type->kode; - $this->name = $loan_type->name; + $this->id = $loan_type->id; + $this->kode = $loan_type->kode; + $this->name = $loan_type->name; + $this->status = $loan_type->status; } public function delete($id) { - $loan = LoanType::find($id); - $loan->delete_by = auth()->user()->id; + $loan = LoanType::find($id); + $loan->delete_by = auth()->user()->id; $loan->deleted_at = now(); $approval = [ diff --git a/Resources/views/livewire/branch/branch-modal.blade.php b/Resources/views/livewire/branch/branch-modal.blade.php index 2be5f90..cce9098 100644 --- a/Resources/views/livewire/branch/branch-modal.blade.php +++ b/Resources/views/livewire/branch/branch-modal.blade.php @@ -46,6 +46,16 @@ {{ $message }} @enderror +
+
+ + + @error('status') + {{ $message }} @enderror +
+
diff --git a/Resources/views/livewire/currency/currency-modal.blade.php b/Resources/views/livewire/currency/currency-modal.blade.php index 5a8884c..3bc5151 100644 --- a/Resources/views/livewire/currency/currency-modal.blade.php +++ b/Resources/views/livewire/currency/currency-modal.blade.php @@ -46,6 +46,16 @@ {{ $message }} @enderror +
+
+ + + @error('status') + {{ $message }} @enderror +
+
diff --git a/Resources/views/livewire/facility-type/facility-type-modal.blade.php b/Resources/views/livewire/facility-type/facility-type-modal.blade.php index d3681d8..02ccfa7 100644 --- a/Resources/views/livewire/facility-type/facility-type-modal.blade.php +++ b/Resources/views/livewire/facility-type/facility-type-modal.blade.php @@ -46,6 +46,16 @@ {{ $message }} @enderror +
+
+ + + @error('status') + {{ $message }} @enderror +
+
diff --git a/Resources/views/livewire/guarantee-type/guarantee-type-modal.blade.php b/Resources/views/livewire/guarantee-type/guarantee-type-modal.blade.php index 3eb8ca2..b84fb6a 100644 --- a/Resources/views/livewire/guarantee-type/guarantee-type-modal.blade.php +++ b/Resources/views/livewire/guarantee-type/guarantee-type-modal.blade.php @@ -46,6 +46,16 @@ {{ $message }} @enderror +
+
+ + + @error('status') + {{ $message }} @enderror +
+
diff --git a/Resources/views/livewire/loan-type/loan-type-modal.blade.php b/Resources/views/livewire/loan-type/loan-type-modal.blade.php index 286ebb8..dee4d58 100644 --- a/Resources/views/livewire/loan-type/loan-type-modal.blade.php +++ b/Resources/views/livewire/loan-type/loan-type-modal.blade.php @@ -46,6 +46,16 @@ {{ $message }} @enderror +
+
+ + + @error('status') + {{ $message }} @enderror +
+