Files
opensourcepos/app/Models/Tokens/Token_invoice_sequence.php
jekkos 30da69a382 Fix attachment cid (#4314)
* Add attachment cid when sending emails (#4308)

Also check if an encryption key is set before decrypting the SMTP
password.

* Upgrade to CI 4.6.3 (#4308)

* Fix for changing invoice id in email (#4308)
2025-11-23 21:37:32 +01:00

45 lines
815 B
PHP

<?php
namespace App\Models\Tokens;
use App\Models\Appconfig;
use ReflectionException;
/**
* Token_invoice_sequence class
**/
class Token_invoice_sequence extends Token
{
private Appconfig $appconfig;
/**
* @param string $value
*/
public function __construct(string $value = '')
{
parent::__construct($value);
$this->appconfig = model(Appconfig::class);
}
/**
* @return string
*/
public function token_id(): string
{
return 'ISEQ';
}
/**
* @throws ReflectionException
*/
public function get_value(bool $save = true): string
{
if (empty($this->value)) {
return $this->appconfig->acquire_next_invoice_sequence($save);
} else {
return $this->value;
}
}
}