mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 02:34:35 -04:00
Generates number
This commit is contained in:
parent
defbae832b
commit
21edcdf919
@ -20,6 +20,8 @@ trait GeneratesNumberCounter
|
|||||||
{
|
{
|
||||||
|
|
||||||
$counter = $this->getCounter($entity);
|
$counter = $this->getCounter($entity);
|
||||||
|
$prefix = $this->getNumberPrefix($entityType);
|
||||||
|
|
||||||
$check = false;
|
$check = false;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -87,6 +89,20 @@ trait GeneratesNumberCounter
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $entity
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getNumberPrefix($entity)
|
||||||
|
{
|
||||||
|
|
||||||
|
$field = $this->entityName($entity) . "_number_prefix";
|
||||||
|
|
||||||
|
return $this->getSettingsByKey( $field )->{$field};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private function incrementCounter($entity)
|
private function incrementCounter($entity)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user