30require_once DOL_DOCUMENT_ROOT.
'/core/modules/propale/modules_propale.php';
42 public $version =
'dolibarr';
54 public $nom =
'Saphir';
59 public $name =
'Saphir';
68 public function info($langs)
70 global
$conf, $langs, $db;
72 $langs->load(
"bills");
74 $form =
new Form($db);
76 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
77 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
78 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
79 $texte .=
'<input type="hidden" name="action" value="updateMask">';
80 $texte .=
'<input type="hidden" name="maskconstpropal" value="PROPALE_SAPHIR_MASK">';
81 $texte .=
'<table class="nobordernopadding" width="100%">';
83 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"Proposal"), $langs->transnoentities(
"Proposal"));
84 $tooltip .= $langs->trans(
"GenericMaskCodes2");
85 $tooltip .= $langs->trans(
"GenericMaskCodes3");
86 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"Proposal"), $langs->transnoentities(
"Proposal"));
87 $tooltip .= $langs->trans(
"GenericMaskCodes5");
88 $tooltip .=
'<br>'.$langs->trans(
"GenericMaskCodes5b");
91 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
93 $texte .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskpropal" value="'.$mask.
'">', $tooltip, 1, 1).
'</td>';
95 $texte .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans(
"Modify").
'"></td>';
114 require_once DOL_DOCUMENT_ROOT .
'/comm/propal/class/propal.class.php';
115 require_once DOL_DOCUMENT_ROOT .
'/societe/class/societe.class.php';
117 $propal =
new Propal($db);
118 $propal->initAsSpecimen();
119 $thirdparty =
new Societe($db);
120 $thirdparty->initAsSpecimen();
121 $numExample = $this->
getNextValue($thirdparty, $propal);
124 $numExample = $langs->trans(
'NotConfigured');
141 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
147 $this->error =
'NotConfigured';
152 $entity =
getEntity(
'proposalnumber', 1, $propal);
154 $date = empty($propal->date) ?
dol_now() : $propal->date;
156 $numFinal =
get_next_value($db, $mask,
'propal',
'ref',
'', $objsoc, $date,
'next',
false,
null, $entity);
Parent class for numbering rules of proposals.
Class to manage proposals.
Class to manage third parties objects (customers, suppliers, prospects...)
Class of file that contains the numbering module rules Saphir.
info($langs)
Return description of module.
getExample()
Return an example of numbering.
getNextValue($objsoc, $propal)
Return next 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 a Dolibarr global constant string value.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...