40 public $version =
'dolibarr';
51 public $nom =
'Universal';
62 $langs->load(
'cashdesk@cashdesk');
64 $form =
new Form($this->
db);
66 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
67 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
68 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
69 $texte .=
'<input type="hidden" name="action" value="updateMask">';
70 $texte .=
'<input type="hidden" name="maskconst" value="TAKEPOS_REF_UNIVERSAL_MASK">';
71 $texte .=
'<table class="nobordernopadding" width="100%">';
73 $tooltip = $langs->trans(
'GenericMaskCodes', $langs->transnoentities(
'CashDesk'), $langs->transnoentities(
'CashDesk'));
74 $tooltip .= $langs->trans(
'GenericMaskCodes2');
75 $tooltip .= $langs->trans(
'GenericMaskCodes3');
76 $tooltip .= $langs->trans(
'GenericMaskCodes4a', $langs->transnoentities(
'CashDesk'), $langs->transnoentities(
'CashDesk'));
77 $tooltip .= $langs->trans(
'GenericMaskCodes5');
78 $tooltip .= $langs->trans(
'CashDeskGenericMaskCodes6');
81 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
82 $texte .=
'<td align="right">'.$form->textwithpicto(
'<input type="text" class="flat" size="24" name="maskvalue" value="'.$conf->global->TAKEPOS_REF_UNIVERSAL_MASK.
'">', $tooltip, 1, 1).
'</td>';
84 $texte .=
'<td align="left" rowspan="2"> <input type="submit" class="button" value="'.$langs->trans(
"Modify").
'" name="Button"></td>';
101 global $conf, $langs, $mysoc;
103 $old_code_client = $mysoc->code_client;
104 $mysoc->code_client =
'CCCCCCCCCC';
106 $mysoc->code_client = $old_code_client;
109 $numExample = $langs->trans(
'NotConfigured');
122 public function getNextValue($objsoc = 0, $invoice = null, $mode =
'next')
126 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
129 $mask = $conf->global->TAKEPOS_REF_UNIVERSAL_MASK;
132 $this->error =
'NotConfigured';
137 $entity =
getEntity(
'invoicenumber', 1, $invoice);
139 $pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0;
140 $mask = str_replace(
'{TN}', $pos_source, $mask);
141 $numFinal =
get_next_value($db, $mask,
'facture',
'ref',
'', $objsoc, $invoice->date, $mode,
false, null, $entity);
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname= '')
Make an include_once using default root and alternate root if it fails.
get_next_value($db, $mask, $table, $field, $where= '', $objsoc= '', $date= '', $mode= 'next', $bentityon=true, $objuser=null, $forceentity=null)
Return last or next value for a mask (according to area we should not reset)
getNumRef($objsoc, $objforref)
Return next free value.
$conf db
API class for accounts.
Classe mere des modeles de numerotation des tickets de caisse.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
getExample()
Renvoi un exemple de numerotation.
info()
Renvoi la description du modele de numerotation.
getNextValue($objsoc=0, $invoice=null, $mode= 'next')
Return next free value.
getNextValue()
Renvoi prochaine valeur attribuee.
Class to manage ref numbering of takepos cards with rule universal.