29require_once DOL_DOCUMENT_ROOT.
'/core/modules/commande/modules_commande.php';
41 public $version =
'dolibarr';
51 public $name =
'Saphir';
60 public function info($langs)
64 $langs->load(
"bills");
66 $form =
new Form($db);
68 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
69 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
70 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
71 $texte .=
'<input type="hidden" name="action" value="updateMask">';
72 $texte .=
'<input type="hidden" name="maskconstorder" value="COMMANDE_SAPHIR_MASK">';
73 $texte .=
'<table class="nobordernopadding" width="100%">';
75 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"Order"), $langs->transnoentities(
"Order"));
76 $tooltip .= $langs->trans(
"GenericMaskCodes2");
77 $tooltip .= $langs->trans(
"GenericMaskCodes3");
78 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"Order"), $langs->transnoentities(
"Order"));
79 $tooltip .= $langs->trans(
"GenericMaskCodes5");
82 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
83 $texte .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskorder" value="'.
getDolGlobalString(
"COMMANDE_SAPHIR_MASK").
'">', $tooltip, 1, 1).
'</td>';
85 $texte .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans(
"Modify").
'"></td>';
102 global $conf, $langs, $mysoc;
104 $old_code_client = $mysoc->code_client;
105 $old_code_type = $mysoc->typent_code;
106 $mysoc->code_client =
'CCCCCCCCCC';
107 $mysoc->typent_code =
'TTTTTTTTTT';
109 $mysoc->code_client = $old_code_client;
110 $mysoc->typent_code = $old_code_type;
113 $numExample = $langs->trans(
'NotConfigured');
129 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
135 $this->error =
'NotConfigured';
140 $entity =
getEntity(
'ordernumber', 1, $object);
142 if (is_object($object)) {
143 $date = ($object->date_commande ? $object->date_commande : $object->date);
148 $numFinal =
get_next_value($db, $mask,
'commande',
'ref',
'', $objsoc, $date,
'next',
false,
null, $entity);
Parent class to manage numbering of Sale Orders.
Class to manage Sales Order numbering rules Saphir.
commande_get_num($objsoc, $objforref)
Return next free value.
getExample()
Return an example of numbering.
info($langs)
Returns the description of the numbering model.
getNextValue($objsoc, $object)
Return next free value.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.