chore: update document approval workflow and bug fixes

This commit is contained in:
2026-05-25 13:05:20 +08:00
parent d573c02893
commit 39a8e1d4cd
910 changed files with 49994 additions and 1010 deletions

42
storage/clear_data.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\DB;
try {
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
// 1. Approvals
DB::table('approval_steps')->truncate();
DB::table('approval_chains')->truncate();
// 2. Inventory Movements
DB::table('inventory_movements')->truncate();
// 3. Purchase Orders and MRs
DB::table('purchase_order_items')->truncate();
DB::table('purchase_order_requisitions')->truncate();
DB::table('purchase_orders')->truncate();
DB::table('material_requisition_items')->truncate();
DB::table('material_requisitions')->truncate();
// 4. Inventory
DB::table('warehouse_stock')->truncate();
DB::table('project_inventories')->truncate();
DB::table('inventory_batches')->truncate();
DB::table('task_materials')->truncate();
// 5. Warehouses
DB::table('warehouses')->truncate();
// 6. Projects and Tasks
DB::table('task_user')->truncate();
DB::table('tasks')->truncate();
DB::table('projects')->truncate();
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
echo "Data cleared successfully!\n";
} catch (\Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}