mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-14 10:43:56 -04:00
63 lines
1.4 KiB
PHP
63 lines
1.4 KiB
PHP
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
require_once(APPPATH . 'libraries/tokens/Token.php');
|
|
require_once(APPPATH . 'libraries/tokens/Token_customer.php');
|
|
require_once(APPPATH . 'libraries/tokens/Token_invoice_count.php');
|
|
require_once(APPPATH . 'libraries/tokens/Token_invoice_sequence.php');
|
|
require_once(APPPATH . 'libraries/tokens/Token_quote_sequence.php');
|
|
require_once(APPPATH . 'libraries/tokens/Token_suspended_invoice_count.php');
|
|
require_once(APPPATH . 'libraries/tokens/Token_year_invoice_count.php');
|
|
|
|
/**
|
|
* Token class
|
|
*/
|
|
|
|
class Token
|
|
{
|
|
protected $CI;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->CI =& get_instance();
|
|
}
|
|
|
|
public function replace($token_id)
|
|
{
|
|
if($token_id == 'CU')
|
|
{
|
|
return (new Token_customer())->get_value();
|
|
}
|
|
elseif($token_id == 'CO')
|
|
{
|
|
return (new Token_invoice_count())->get_value();
|
|
}
|
|
elseif($token_id == 'ISEQ')
|
|
{
|
|
return (new Token_invoice_sequence())->get_value();
|
|
}
|
|
elseif($token_id == 'ISEQ')
|
|
{
|
|
return (new Token_invoice_sequence())->get_value();
|
|
}
|
|
elseif($token_id == 'QSEQ')
|
|
{
|
|
return (new Token_quote_sequence())->get_value();
|
|
}
|
|
elseif($token_id == 'SCO')
|
|
{
|
|
return (new Token_suspended_invoice_count())->get_value();
|
|
}
|
|
elseif($token_id == 'YCO')
|
|
{
|
|
return (new Token_year_invoice_count())->get_value();
|
|
}
|
|
return '';
|
|
}
|
|
|
|
public function get_value()
|
|
{
|
|
return '';
|
|
}
|
|
}
|
|
?>
|