feat: standardize invoice number field, refine invoice creation logic, and update module foreign key constraints

This commit is contained in:
pbao9
2026-03-12 10:10:20 +07:00
parent 1e09ccf17b
commit 1934be9a19
10 changed files with 24 additions and 30 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ class OrderHelper
$number = $prefix . '-' . strtoupper(Str::random(8));
$exists = match ($prefix) {
'INV' => Invoice::where('invoice_num', $number)->exists(),
'INV' => Invoice::where('invoice_number', $number)->exists(),
default => Order::where('order_num', $number)->exists(),
};
} while ($exists);