update generate bill number to random 10 digits

This commit is contained in:
edmondlang
2023-09-29 11:21:36 +08:00
parent 52851cee09
commit 9529823430
@@ -34,7 +34,8 @@ class GeneratesTransactionBillNumber
$attempt = 0;
while ($attempt < 10) { // Retry up to 10 times
$billNumber = $prefix . $date->format('Y') . $date->format('m') . '-' . intval(microtime(true));
// $billNumber = $prefix . $date->format('Y') . $date->format('m') . '-' . intval(microtime(true));
$billNumber = $prefix . $date->format('Y') . $date->format('m') . '-' . mt_rand(1000000000, 9999999999);
if (!$this->checksIfTransactionBillNumberExists->execute($billNumber)) {
return $billNumber;
}