Files
exchange-2.0/app/Classes/Modules/Transactions/Services/GeneratesTransactionBillNo.php
T
weiken.intex 9ed67e74e2 create Transaction & Transaction Detail
- Supplier (AP)
	- PO
	- DO
	- INV

- Customer (AR)
	- PO
	- DO
	- INV
2020-12-07 14:00:24 +08:00

27 lines
500 B
PHP

<?php
namespace App\Classes\Modules\Transactions\Services;
class GeneratesTransactionBillNo
{
private $transationBillNoExists;
public function __construct(ChecksIfTransactionBillNoExists $transationBillNoExists)
{
$this->transationBillNoExists = $transationBillNoExists;
}
public function execute(): int {
$code = mt_rand(100000001, 999999999);
return !$this->transationBillNoExists->execute($code) ? $code : self::execute();
}
}