diff --git a/app/Console/Commands/SetStockOpnameToProcess.php b/app/Console/Commands/SetStockOpnameToProcess.php deleted file mode 100644 index 2e3a530..0000000 --- a/app/Console/Commands/SetStockOpnameToProcess.php +++ /dev/null @@ -1,37 +0,0 @@ -format('Y-m'); - - $stockOpnames = StockOpname::where('period_month', $periodMonth)->get(); - - if ($stockOpnames->isEmpty()) { - $this->info("Tidak ada stock opname untuk bulan {$periodMonth}."); - - return; - } - - DB::transaction(function () use ($stockOpnames) { - foreach ($stockOpnames as $stockOpname) { - $stockOpname->status = StockOpnameStatus::PROCESS; - $stockOpname->save(); - } - }); - - $this->info("Status stock opname untuk bulan {$periodMonth} berhasil diubah menjadi Proses."); - } -} diff --git a/database/migrations/2025_11_23_193832_create_stock_opname_table.php b/database/migrations/2025_11_23_193832_create_stock_opname_table.php index 5cb92ac..cc6bd5e 100644 --- a/database/migrations/2025_11_23_193832_create_stock_opname_table.php +++ b/database/migrations/2025_11_23_193832_create_stock_opname_table.php @@ -16,7 +16,7 @@ public function up(): void $table->id(); $table->foreignId('outlet_id')->constrained()->cascadeOnDelete(); $table->string('period_month', 7); - $table->enum('status', StockOpnameStatus::values())->default(StockOpnameStatus::DRAFT)->comment(StockOpnameStatus::comment()); + $table->enum('status', StockOpnameStatus::values())->default(StockOpnameStatus::PROCESS)->comment(StockOpnameStatus::comment()); $table->text('note')->nullable(); $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); diff --git a/routes/console.php b/routes/console.php index 4a2239c..444f2d4 100644 --- a/routes/console.php +++ b/routes/console.php @@ -3,5 +3,4 @@ use Illuminate\Support\Facades\Schedule; Schedule::command('payroll:generate --current')->monthly(); -Schedule::command('stock-opname:generate')->monthly(); -Schedule::command('stock-opname:set-to-process')->monthlyOn(25, '00:00'); +Schedule::command('stock-opname:generate')->monthlyOn(25, '00:00');