feat: standardize invoice number field, refine invoice creation logic, and update module foreign key constraints
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user