43 public $version =
'dolibarr';
54 public $nom =
'Universal';
62 public function info($langs)
66 $langs->load(
'cashdesk@cashdesk');
68 $form =
new Form($db);
70 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
71 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
72 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
73 $texte .=
'<input type="hidden" name="action" value="updateMask">';
74 $texte .=
'<input type="hidden" name="maskconst" value="TAKEPOS_REF_UNIVERSAL_MASK">';
75 $texte .=
'<table class="nobordernopadding" width="100%">';
77 $tooltip = $langs->trans(
'GenericMaskCodes', $langs->transnoentities(
'CashDesk'), $langs->transnoentities(
'CashDesk'));
78 $tooltip .= $langs->trans(
'GenericMaskCodes2');
79 $tooltip .= $langs->trans(
'GenericMaskCodes3');
80 $tooltip .= $langs->trans(
'GenericMaskCodes4a', $langs->transnoentities(
'CashDesk'), $langs->transnoentities(
'CashDesk'));
81 $tooltip .= $langs->trans(
'GenericMaskCodes5');
83 $tooltip .= $langs->trans(
'CashDeskGenericMaskCodes6');
86 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
87 $texte .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskvalue" value="'.
getDolGlobalString(
'TAKEPOS_REF_UNIVERSAL_MASK').
'">', $tooltip, 1, 1).
'</td>';
89 $texte .=
'<td class="left" rowspan="2"><input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans(
"Modify").
'"></td>';
106 global $langs, $mysoc;
108 $old_code_client = $mysoc->code_client;
109 $mysoc->code_client =
'CCCCCCCCCC';
111 $mysoc->code_client = $old_code_client;
114 $numExample = $langs->trans(
'NotConfigured');
127 public function getNextValue($objsoc =
null, $invoice =
null, $mode =
'next')
131 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
137 $this->error =
'NotConfigured';
142 $entity =
getEntity(
'invoicenumber', 1, $invoice);
144 $date = (empty($invoice->date) ?
dol_now() : $invoice->date);
145 $pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0;
146 $mask = str_replace(
'{TN}', (
string) $pos_source, $mask);
147 $numFinal =
get_next_value($db, $mask,
'facture',
'ref',
'', $objsoc, $date, $mode,
false,
null, $entity);
Parent Class of the models to number the cash register receipts.
Class to manage ref numbering of takepos cards with rule universal.
getExample()
Return an example of numbering.
getNumRef($objsoc, $objforref)
Return next free value.
getNextValue($objsoc=null, $invoice=null, $mode='next')
Return next free value.
info($langs)
return description of the numbering model
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)
dol_now($mode='auto')
Return date for now.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.