27require_once DOL_DOCUMENT_ROOT.
'/core/modules/contract/modules_contract.php';
35 public $name =
'Magre';
36 public $version =
'dolibarr';
42 public $position = 30;
59 public function info($langs)
63 $langs->load(
"bills");
65 $form =
new Form($db);
67 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
68 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
69 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
70 $texte .=
'<input type="hidden" name="action" value="updateMask">';
71 $texte .=
'<input type="hidden" name="maskconstcontract" value="CONTRACT_MAGRE_MASK">';
72 $texte .=
'<input type="hidden" name="page_y" value="">';
74 $texte .=
'<table class="nobordernopadding centpercent">';
76 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"Contract"), $langs->transnoentities(
"Contract"));
77 $tooltip .= $langs->trans(
"GenericMaskCodes1");
79 $tooltip .= $langs->trans(
"GenericMaskCodes2");
81 $tooltip .= $langs->trans(
"GenericMaskCodes3");
82 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"Contract"), $langs->transnoentities(
"Contract"));
83 $tooltip .= $langs->trans(
"GenericMaskCodes5");
84 $tooltip .=
'<br>'.$langs->trans(
"GenericMaskCodes5b");
86 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
87 $texte .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskcontract" value="'.
getDolGlobalString(
"CONTRACT_MAGRE_MASK").
'">', $tooltip, 1,
'help',
'valignmiddle', 0, 3, $this->
name).
'</td>';
88 $texte .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button" value="'.$langs->trans(
"Save").
'"></td>';
105 require_once DOL_DOCUMENT_ROOT .
'/contrat/class/contrat.class.php';
106 require_once DOL_DOCUMENT_ROOT .
'/societe/class/societe.class.php';
109 $contract->initAsSpecimen();
110 $thirdparty =
new Societe($db);
111 $thirdparty->initAsSpecimen();
113 $numExample = $this->
getNextValue($thirdparty, $contract);
117 $numExample = $langs->trans(
'NotConfigured');
133 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
138 $this->error =
'NotConfigured';
142 $numFinal =
get_next_value($db, $mask,
'contrat',
'ref',
'', $objsoc, $contract->date_contrat);
Parent class for all contract numbering modules.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage contract numbering rules Magre.
getNextValue($objsoc, $contract)
Return next value.
getExample()
Return numbering example.
info($langs)
Return default description of numbering model.
__construct()
Constructor.
get_next_value($db, $mask, $table, $field, $where='', $objsoc='', $date='', $mode='next', $bentityon=true, $objuser=null, $forceentity=null, $objbookkeeping=null)
Return last or next value for a mask (according to area we should not reset)
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
$conf db name
Only used if Module[ID]Name translation string is not found.