mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-18 14:27:54 -05:00
- Added missing PHPdocs - Corrected Syntax - Added noinspection parameters to PHPdoc for AJAX called functions - Added missing function return types - Added missing parameter types - Added public keyword to functions without visibility modifier - Corrected incorrectly formatted PHPdocs - Added public to constants and functions missing a visibility keyword
40 lines
536 B
PHP
40 lines
536 B
PHP
<?php
|
|
|
|
namespace App\Models\Tokens;
|
|
|
|
use App\Models\Sale;
|
|
|
|
/**
|
|
* Token_invoice_count class
|
|
*
|
|
* @property sale sale
|
|
*
|
|
*/
|
|
class Token_invoice_count extends Token
|
|
{
|
|
/**
|
|
* @param string $value
|
|
*/
|
|
public function __construct(string $value = '')
|
|
{
|
|
parent::__construct($value);
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function token_id(): string
|
|
{
|
|
return 'CO';
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function get_value(): int
|
|
{
|
|
$sale = model(Sale::class);
|
|
return empty($value) ? $sale->get_invoice_count() : $value;
|
|
}
|
|
}
|