26require_once DOL_DOCUMENT_ROOT.
'/core/modules/expensereport/modules_expensereport.php';
38 public $version =
'dolibarr';
55 public $name =
'Sand';
64 public function info($langs)
68 $langs->load(
"bills");
70 $form =
new Form($db);
72 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
73 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
74 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
75 $texte .=
'<input type="hidden" name="action" value="updateMask">';
76 $texte .=
'<input type="hidden" name="maskconst" value="EXPENSEREPORT_SAND_MASK">';
77 $texte .=
'<table class="nobordernopadding centpercent">';
79 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"ExpenseReport"), $langs->transnoentities(
"ExpenseReport"));
81 $tooltip .= $langs->trans(
"GenericMaskCodes3");
82 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"ExpenseReport"), $langs->transnoentities(
"ExpenseReport"));
83 $tooltip .= $langs->trans(
"GenericMaskCodes5");
84 $tooltip .=
'<br>'.$langs->trans(
"GenericMaskCodes5b");
87 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
89 $texte .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskvalue" value="'.$mask.
'">', $tooltip, 1, 1).
'</td>';
91 $texte .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button" value="'.$langs->trans(
"Modify").
'"></td>';
108 global $db, $langs, $user;
111 $exp->initAsSpecimen();
112 $exp->fk_user_author = $user->id;
117 $numExample = $langs->trans(
'NotConfigured');
132 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
138 $this->error =
'NotConfigured';
144 $this->error =
'Date valid not defined';
149 if (
$object->fk_user_author > 0) {
150 $fuser =
new User($db);
151 $fuser->fetch(
$object->fk_user_author);
154 $numFinal =
get_next_value($db, $mask,
'expensereport',
'ref',
'',
null, $date,
'next',
true, $fuser);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage Trips and Expenses.
Parent class for numbering masks of expense reports.
Class to manage Dolibarr users.
Class to manage expense report numbering rules Sand.
info($langs)
Returns the description of the numbering model.
getExample()
Return an example of numbering.
getNextValue($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)
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.