27require_once DOL_DOCUMENT_ROOT.
'/core/modules/expensereport/modules_expensereport.php';
39 public $version =
'dolibarr';
56 public $name =
'Sand';
65 public function info($langs)
69 $langs->load(
"bills");
71 $form =
new Form($db);
73 $texte = $langs->trans(
'GenericNumRefModelDesc').
"<br>\n";
74 $texte .=
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
75 $texte .=
'<input type="hidden" name="token" value="'.newToken().
'">';
76 $texte .=
'<input type="hidden" name="action" value="updateMask">';
77 $texte .=
'<input type="hidden" name="maskconst" value="EXPENSEREPORT_SAND_MASK">';
78 $texte .=
'<table class="nobordernopadding centpercent">';
80 $tooltip = $langs->trans(
"GenericMaskCodes", $langs->transnoentities(
"ExpenseReport"), $langs->transnoentities(
"ExpenseReport"));
82 $tooltip .= $langs->trans(
"GenericMaskCodes3");
83 $tooltip .= $langs->trans(
"GenericMaskCodes4a", $langs->transnoentities(
"ExpenseReport"), $langs->transnoentities(
"ExpenseReport"));
84 $tooltip .= $langs->trans(
"GenericMaskCodes5");
85 $tooltip .=
'<br>'.$langs->trans(
"GenericMaskCodes5b");
88 $texte .=
'<tr><td>'.$langs->trans(
"Mask").
':</td>';
90 $texte .=
'<td class="right">'.$form->textwithpicto(
'<input type="text" class="flat minwidth175" name="maskvalue" value="'.$mask.
'">', $tooltip, 1, 1).
'</td>';
92 $texte .=
'<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button" value="'.$langs->trans(
"Modify").
'"></td>';
109 global $db, $langs, $user;
112 $exp->initAsSpecimen();
113 $exp->fk_user_author = $user->id;
118 $numExample = $langs->trans(
'NotConfigured');
133 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
139 $this->error =
'NotConfigured';
145 $this->error =
'Date valid not defined';
150 if (
$object->fk_user_author > 0) {
151 $fuser =
new User($db);
152 $fuser->fetch(
$object->fk_user_author);
155 $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 a Dolibarr global constant string value.