29require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/salaries/class/salary.class.php';
41 public $element =
'payment_salary';
46 public $table_element =
'payment_salary';
51 public $picto =
'payment';
75 public $datepaye =
'';
97 public $amounts = array();
102 public $fk_typepayment;
108 public $num_paiement;
130 public $fk_user_author;
135 public $fk_user_modif;
150 public $bank_account;
160 public $fields = array(
161 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'index' => 1,
'position' => 1,
'comment' =>
'Id'),
162 'ref' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref',
'enabled' => 1,
'position' => 10,
'visible' => 1,
'index' => 1,
'comment' =>
"Reference of object"),
163 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 20),
164 'datec' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'visible' => 0,
'position' => 30),
165 'datep' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 40,
'comment' =>
'Date'),
166 'datev' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 50,
'comment' =>
'Date'),
167 'fk_user' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'Employee',
'enabled' => 1,
'position' => 60,
'notnull' => 1,
'visible' => 1,
'picto' =>
'user'),
168 'salary' => array(
'type' =>
'double(24,8)',
'label' =>
'salary',
'enabled' => 1,
'visible' => 0,
'position' => 70),
169 'amount' => array(
'type' =>
'double(24,8)',
'label' =>
'Amount',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 80),
170 'fk_projet' => array(
'type' =>
'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)',
'label' =>
'Project',
'enabled' =>
"isModEnabled('project')",
'visible' => 0,
'position' => 90),
171 'fk_typepayment' => array(
'type' =>
'typepayment',
'label' =>
'DefaultPaymentMode',
'enabled' => 1,
'visible' => 1,
'position' => 100,
'comment' =>
'Payment type'),
172 'num_payment' => array(
'type' =>
'string',
'label' =>
'Reference',
'enabled' => 1,
'visible' => 0,
'position' => 110,
'comment' =>
'Reference'),
173 'label' => array(
'type' =>
'varchar(255)',
'label' =>
'Label',
'enabled' => 1,
'position' => 120,
'notnull' => 0,
'visible' => 1),
174 'datesp' => array(
'type' =>
'date',
'label' =>
'DateStart',
'enabled' => 1,
'visible' => 1,
'position' => 130,
'comment' =>
'Date'),
175 'dateep' => array(
'type' =>
'date',
'label' =>
'DateEnd',
'enabled' => 1,
'visible' => 1,
'position' => 140,
'comment' =>
'Date'),
176 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'default' =>
'1',
'enabled' => 1,
'visible' => 0,
'position' => 150,
'index' => 1),
177 'note' => array(
'type' =>
'text',
'label' =>
'Note',
'enabled' => 1,
'position' => 160,
'visible' => 0,),
178 'fk_bank' => array(
'type' =>
'integer',
'label' =>
'BankId',
'enabled' => 1,
'visible' => 0,
'position' => 170),
179 'paye' => array(
'type' =>
'smallint(6)',
'label' =>
'Status',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 180),
180 'fk_user_author' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserAuthor',
'enabled' => 1,
'visible' => 0,
'position' => 190),
181 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 200,
'visible' => 0,),
182 'ref_ext' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref ext',
'enabled' => 1,
'visible' => 0,
'position' => 210),
183 'note_public' => array(
'type' =>
'text',
'label' =>
'NotePublic',
'enabled' => 1,
'visible' => 0,
'position' => 220),
204 public function create($user, $closepaidcontrib = 0)
212 dol_syslog(get_class($this).
"::create", LOG_DEBUG);
215 if (!empty($this->datepaye) && empty($this->datep)) {
216 dol_syslog(__METHOD__.
": using datepaye is deprecated, please use datep instead", LOG_WARNING);
217 $this->datep = $this->datepaye;
221 if (empty($this->datep)) {
222 $this->error =
'ErrorBadValueForParameterCreatePaymentSalary';
227 if (isset($this->fk_salary)) {
228 $this->fk_salary = (int) $this->fk_salary;
230 if (isset($this->amount)) {
231 $this->amount = (float) $this->amount;
233 if (isset($this->fk_typepayment)) {
234 $this->fk_typepayment = (int) $this->fk_typepayment;
236 if (isset($this->num_paiement)) {
237 $this->num_paiement = trim($this->num_paiement);
239 if (isset($this->num_payment)) {
240 $this->num_payment = trim($this->num_payment);
242 if (isset($this->note)) {
243 $this->note = trim($this->note);
245 if (isset($this->fk_bank)) {
246 $this->fk_bank = (int) $this->fk_bank;
248 if (isset($this->fk_user_author)) {
249 $this->fk_user_author = (int) $this->fk_user_author;
251 if (isset($this->fk_user_modif)) {
252 $this->fk_user_modif = (int) $this->fk_user_modif;
256 foreach ($this->amounts as $key => $value) {
257 $newvalue = (float)
price2num($value,
'MT');
258 $this->amounts[$key] = $newvalue;
259 $totalamount += $newvalue;
263 $totalamount = (float)
price2num($totalamount,
'MT');
264 if ($totalamount == 0) {
271 if ($totalamount != 0) {
273 foreach ($this->amounts as $key => $amount) {
275 if (is_numeric($amount) && !empty($amount)) {
277 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"payment_salary (entity, fk_salary, datec, datep, amount,";
278 $sql .=
" fk_typepayment, num_payment, note, fk_user_author, fk_bank)";
279 $sql .=
" VALUES (".((int)
$conf->entity).
", ".((int) $salary_id).
", '".$this->db->idate($now).
"',";
280 $sql .=
" '".$this->db->idate($this->datep).
"',";
281 $sql .=
" ".((float) $amount).
",";
282 $sql .=
" ".((int) $this->fk_typepayment).
", '".$this->db->escape($this->num_payment).
"', '".$this->db->escape($this->note).
"', ".((int) $user->id).
",";
285 $resql = $this->db->query($sql);
287 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"payment_salary");
291 if ($closepaidcontrib) {
292 $tmpsalary =
new Salary($this->db);
293 $tmpsalary->fetch($salary_id);
294 $paiement = $tmpsalary->getSommePaiement();
299 $alreadypayed =
price2num($paiement + $creditnotes + $deposits,
'MT');
300 $remaintopay =
price2num((
float) $tmpsalary->amount - $paiement - $creditnotes - $deposits,
'MT');
301 if ($remaintopay == 0) {
302 $result = $tmpsalary->setPaid($user);
304 dol_syslog(
"Remain to pay for salary id=".$salary_id.
" not null. We do nothing.");
311 $result = $this->
call_trigger(
'PAYMENTSALARY_CREATE', $user);
316 if ($totalamount != 0 && !$error) {
317 $this->amount = $totalamount;
318 $this->total = $totalamount;
322 $this->error = $this->db->error();
323 $this->db->rollback();
339 $sql .=
" t.fk_salary,";
343 $sql .=
" t.amount,";
344 $sql .=
" t.fk_typepayment,";
345 $sql .=
" t.num_payment as num_payment,";
347 $sql .=
" t.fk_bank,";
348 $sql .=
" t.fk_user_author,";
349 $sql .=
" t.fk_user_modif,";
350 $sql .=
" pt.code as type_code, pt.libelle as type_label,";
351 $sql .=
' b.fk_account';
352 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pt ON t.fk_typepayment = pt.id";
353 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank as b ON t.fk_bank = b.rowid';
354 $sql .=
" WHERE t.rowid = ".((int) $id);
357 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
358 $resql = $this->db->query($sql);
360 if ($this->db->num_rows($resql)) {
361 $obj = $this->db->fetch_object($resql);
363 $this->
id = $obj->rowid;
364 $this->
ref = $obj->rowid;
366 $this->fk_salary = $obj->fk_salary;
367 $this->datec = $this->db->jdate($obj->datec);
368 $this->tms = $this->db->jdate($obj->tms);
369 $this->datepaye = $this->db->jdate($obj->datep);
370 $this->datep = $this->db->jdate($obj->datep);
371 $this->amount = $obj->amount;
372 $this->fk_typepayment = $obj->fk_typepayment;
373 $this->num_paiement = $obj->num_payment;
374 $this->num_payment = $obj->num_payment;
375 $this->note = $obj->note;
376 $this->note_private = $obj->note;
377 $this->fk_bank = $obj->fk_bank;
378 $this->fk_user_author = $obj->fk_user_author;
379 $this->fk_user_modif = $obj->fk_user_modif;
381 $this->type_code = $obj->type_code;
382 $this->type_label = $obj->type_label;
384 $this->bank_account = $obj->fk_account;
385 $this->bank_line = $obj->fk_bank;
387 $this->db->free($resql);
391 $this->error =
"Error ".$this->db->lasterror();
404 public function update($user =
null, $notrigger = 0)
406 global
$conf, $langs;
411 if (isset($this->fk_salary)) {
412 $this->fk_salary = (int) $this->fk_salary;
414 if (isset($this->amount)) {
415 $this->amount = (float) $this->amount;
417 if (isset($this->fk_typepayment)) {
418 $this->fk_typepayment = (int) $this->fk_typepayment;
420 if (isset($this->num_paiement)) {
421 $this->num_paiement = trim($this->num_paiement);
423 if (isset($this->num_payment)) {
424 $this->num_payment = trim($this->num_payment);
426 if (isset($this->note)) {
427 $this->note = trim($this->note);
429 if (isset($this->fk_bank)) {
430 $this->fk_bank = (int) $this->fk_bank;
432 if (isset($this->fk_user_author)) {
433 $this->fk_user_author = (int) $this->fk_user_author;
435 if (isset($this->fk_user_modif)) {
436 $this->fk_user_modif = (int) $this->fk_user_modif;
443 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"payment_salary SET";
444 $sql .=
" fk_salary=".(isset($this->fk_salary) ? $this->fk_salary :
"null").
",";
445 $sql .=
" datec=".(dol_strlen($this->datec) != 0 ?
"'".$this->db->idate($this->datec).
"'" :
'null').
",";
446 $sql .=
" tms=".(dol_strlen((
string) $this->tms) != 0 ?
"'".$this->db->idate($this->tms).
"'" :
'null').
",";
447 $sql .=
" datep=".(dol_strlen($this->datepaye) != 0 ?
"'".$this->db->idate($this->datepaye).
"'" :
'null').
",";
448 $sql .=
" amount=".(isset($this->amount) ? $this->amount :
"null").
",";
449 $sql .=
" fk_typepayment=".(isset($this->fk_typepayment) ? $this->fk_typepayment :
"null").
",";
450 $sql .=
" num_payment=".(isset($this->num_payment) ?
"'".$this->db->escape($this->num_payment).
"'" :
"null").
",";
451 $sql .=
" note=".(isset($this->note) ?
"'".$this->db->escape($this->note).
"'" :
"null").
",";
452 $sql .=
" fk_bank=".(isset($this->fk_bank) ? ((int) $this->fk_bank) :
"null").
",";
453 $sql .=
" fk_user_author=".(isset($this->fk_user_author) ? ((int) $this->fk_user_author) :
"null").
",";
454 $sql .=
" fk_user_modif=".(isset($this->fk_user_modif) ? ((int) $this->fk_user_modif) :
"null");
455 $sql .=
" WHERE rowid=".((int) $this->
id);
459 dol_syslog(get_class($this).
"::update", LOG_DEBUG);
460 $resql = $this->db->query($sql);
463 $this->errors[] =
"Error ".$this->db->lasterror();
468 foreach ($this->errors as $errmsg) {
469 dol_syslog(get_class($this).
"::update ".$errmsg, LOG_ERR);
470 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
472 $this->db->rollback();
488 public function delete($user, $notrigger = 0)
496 if ($this->bank_line > 0) {
498 $accline->fetch($this->bank_line);
499 $result = $accline->delete($user);
501 $this->errors[] = $accline->error;
507 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"payment_salary";
508 $sql .=
" WHERE rowid=".((int) $this->
id);
510 dol_syslog(get_class($this).
"::delete", LOG_DEBUG);
511 $resql = $this->db->query($sql);
514 $this->errors[] =
"Error ".$this->db->lasterror();
520 foreach ($this->errors as $errmsg) {
521 dol_syslog(get_class($this).
"::delete ".$errmsg, LOG_ERR);
522 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
524 $this->db->rollback();
558 $object->context[
'createfromclone'] =
'createfromclone';
559 $result =
$object->create($user);
567 unset(
$object->context[
'createfromclone']);
574 $this->db->rollback();
590 $this->fk_salary = 0;
595 $this->fk_typepayment = 0;
596 $this->num_payment =
'';
597 $this->note_private =
'';
598 $this->note_public =
'';
600 $this->fk_user_author = 0;
601 $this->fk_user_modif = 0;
619 public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
624 $this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement);
628 if (isModEnabled(
"bank")) {
629 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
632 $acc->fetch($accountid);
634 $total = $this->amount;
637 $bank_line_id = $acc->addline(
639 $this->fk_typepayment,
653 if ($bank_line_id > 0) {
662 if ($mode ==
'payment_salary') {
663 $url = DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id=';
667 $result = $acc->add_url_line($bank_line_id, $this->
id, $url,
'(paiement)', $mode);
675 foreach ($this->amounts as $key => $value) {
677 if ($mode ==
'payment_salary') {
678 $salary =
new Salary($this->db);
679 $salary->fetch($key);
680 $salary->fetch_user($salary->fk_user);
682 $fuser = $salary->user;
684 if ($fuser->id > 0) {
685 $result = $acc->add_url_line(
688 DOL_URL_ROOT.
'/user/card.php?id=',
689 $fuser->getFullName($langs),
694 $this->error = $this->db->lasterror();
695 dol_syslog(get_class($this) .
'::addPaymentToBank ' . $this->error);
702 $this->error = $acc->error;
725 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"payment_salary SET fk_bank = ".((int) $id_bank).
" WHERE rowid = ".((int) $this->
id);
727 dol_syslog(get_class($this).
"::update_fk_bank", LOG_DEBUG);
728 $result = $this->db->query($sql);
732 $this->error = $this->db->error();
751 dol_syslog(get_class($this).
"::updatePaymentDate with date = ".$date, LOG_DEBUG);
753 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
754 $sql .=
" SET datep = '".$this->db->idate($date).
"'";
755 $sql .=
" WHERE rowid = ".((int) $this->
id);
757 $result = $this->db->query($sql);
760 $this->error =
'Error -1 '.$this->db->error();
763 $type = $this->element;
765 $sql =
"UPDATE ".MAIN_DB_PREFIX.
'bank';
766 $sql .=
" SET dateo = '".$this->db->idate($date).
"', datev = '".$this->db->idate($date).
"'";
767 $sql .=
" WHERE rowid IN (SELECT fk_bank FROM ".MAIN_DB_PREFIX.
"bank_url WHERE type = '".$this->db->escape($type).
"' AND url_id = ".((int) $this->
id).
")";
768 $sql .=
" AND rappro = 0";
770 $result = $this->db->query($sql);
773 $this->error =
'Error -1 '.$this->db->error();
777 $this->datepaye = $date;
782 $this->db->rollback();
797 return $this->
LibStatut($this->statut, $mode);
813 $langs->load(
'compta');
862 public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
864 global
$conf, $langs, $hookmanager;
868 if (!empty(
$conf->dol_no_mouse_hover)) {
875 'objecttype' => $this->element.($this->module ?
'@'.$this->module :
''),
878 $classfortooltip =
'classfortooltip';
881 $classfortooltip =
'classforajaxtooltip';
882 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
888 $url = DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id='.$this->id;
890 if ($option !==
'nolink') {
892 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
893 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
894 $add_save_lastsearch_values = 1;
896 if ($url && $add_save_lastsearch_values) {
897 $url .=
'&save_lastsearch_values=1';
902 if (empty($notooltip)) {
904 $label = $langs->trans(
"SalaryPayment");
905 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
907 $linkclose .= ($label ?
' title="'.dol_escape_htmltag($label, 1).
'"' :
' title="tocomplete"');
908 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
910 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
913 if ($option ==
'nolink' || empty($url)) {
914 $linkstart =
'<span';
916 $linkstart =
'<a href="'.$url.
'"';
918 $linkstart .= $linkclose.
'>';
919 if ($option ==
'nolink' || empty($url)) {
920 $linkend =
'</span>';
925 $result .= $linkstart;
927 if (empty($this->showphoto_on_popup)) {
929 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), (($withpicto != 2) ?
'class="paddingright"' :
''), 0, 0, $notooltip ? 0 : 1);
933 if ($withpicto != 2) {
934 $result .= $this->ref;
940 global $action, $hookmanager;
941 $hookmanager->initHooks(array($this->element.
'dao'));
942 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
943 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
945 $result = $hookmanager->resPrint;
947 $result .= $hookmanager->resPrint;
961 global
$conf, $langs, $user;
963 $langs->load(
'salaries');
967 return [
'optimize' => $langs->trans(
"SalaryPayment")];
970 if ($user->hasRight(
'salaries',
'read')) {
971 $datas[
'picto'] =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"SalaryPayment").
'</u>';
972 if (isset($this->
status)) {
973 $datas[
'status'] =
' '.$this->getLibStatut(5);
975 $datas[
'Ref'] =
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
976 if (!empty($this->total_ttc)) {
977 $datas[
'AmountTTC'] =
'<br><b>'.$langs->trans(
'AmountTTC').
':</b> '.
price($this->total_ttc, 0, $langs, 0, -1, -1,
$conf->currency);
979 if (!empty($this->datep)) {
980 $datas[
'Date'] =
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->datep,
'dayhour',
'tzuserrel');
981 } elseif (!empty($this->datepaye)) {
982 $datas[
'Date'] =
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->datepaye,
'dayhour',
'tzuserrel');
1000 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1002 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1003 $return .=
'<div class="info-box info-box-sm">';
1004 $return .=
'<span class="info-box-icon bg-infobox-action">';
1006 $return .=
'</span>';
1007 $return .=
'<div class="info-box-content">';
1008 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
1009 if ($selected >= 0) {
1010 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1012 if (property_exists($this,
'fk_bank') && is_numeric($this->fk_bank)) {
1013 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1015 $account->fetch($this->fk_bank);
1016 $return .=
' | <span class="info-box-label">'.$account->getNomUrl(1).
'</span>';
1018 if (property_exists($this,
'fk_user_author') && is_numeric($this->fk_user_author)) {
1019 $userstatic =
new User($this->db);
1020 $userstatic->fetch($this->fk_user_author);
1021 $return .=
'<br><span class="info-box-status">'.$userstatic->getNomUrl(1).
'</span>';
1024 if (property_exists($this,
'fk_typepayment')) {
1025 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"PaymentMode").
'</span> : <span class="info-box-label">'.$this->fk_typepayment.
'</span>';
1027 if (property_exists($this,
'amount')) {
1028 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Amount").
'</span> : <span class="info-box-label amount">'.
price($this->amount).
'</span>';
1030 $return .=
'</div>';
1031 $return .=
'</div>';
1032 $return .=
'</div>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage bank accounts.
Class to manage bank transaction lines.
Parent class of all other business classes (invoices, contracts, proposals, orders,...
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage payments of salaries.
LibStatut($status, $mode=0)
Return the status.
update_fk_bank($id_bank)
Update the relation between the salary paiment and the line generated in llx_bank.
updatePaymentDate($date)
Updates the payment date.
getLibStatut($mode=0)
Return the label of the status.
initAsSpecimen()
Initialise an instance with random values.
getNomUrl($withpicto=0, $maxlen=0, $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return clickable name (with picto eventually)
create($user, $closepaidcontrib=0)
Create payment of salary into database.
__construct($db)
Constructor.
update($user=null, $notrigger=0)
Update database.
getTooltipContentArray($params)
getTooltipContentArray
addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
Add record into bank for payment with links between this bank record and invoices of payment.
getKanbanView($option='', $arraydata=null)
Return clickable link of object (with eventually picto)
fetch($id)
Load object in memory from database.
createFromClone(User $user, $fromid)
Load an object from its id and create a new one in database.
Class to manage salary payments.
Class to manage Dolibarr users.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...