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;
129 public $fk_user_author;
134 public $fk_user_modif;
149 public $bank_account;
159 public $fields = array(
160 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'index' => 1,
'position' => 1,
'comment' =>
'Id'),
161 'ref' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref',
'enabled' => 1,
'position' => 10,
'visible' => 1,
'index' => 1,
'comment' =>
"Reference of object"),
162 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 20),
163 'datec' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'visible' => 0,
'position' => 30),
164 'datep' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 40,
'comment' =>
'Date'),
165 'datev' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 50,
'comment' =>
'Date'),
166 'fk_user' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'Employee',
'enabled' => 1,
'position' => 60,
'notnull' => 1,
'visible' => 1,
'picto' =>
'user'),
167 'salary' => array(
'type' =>
'double(24,8)',
'label' =>
'salary',
'enabled' => 1,
'visible' => 0,
'position' => 70),
168 'amount' => array(
'type' =>
'double(24,8)',
'label' =>
'Amount',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 80),
169 'fk_projet' => array(
'type' =>
'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)',
'label' =>
'Project',
'enabled' =>
"isModEnabled('project')",
'visible' => 0,
'position' => 90),
170 'fk_typepayment' => array(
'type' =>
'typepayment',
'label' =>
'DefaultPaymentMode',
'enabled' => 1,
'visible' => 1,
'position' => 100,
'comment' =>
'Payment type'),
171 'num_payment' => array(
'type' =>
'string',
'label' =>
'Reference',
'enabled' => 1,
'visible' => 0,
'position' => 110,
'comment' =>
'Reference'),
172 'label' => array(
'type' =>
'varchar(255)',
'label' =>
'Label',
'enabled' => 1,
'position' => 120,
'notnull' => 0,
'visible' => 1),
173 'datesp' => array(
'type' =>
'date',
'label' =>
'DateStart',
'enabled' => 1,
'visible' => 1,
'position' => 130,
'comment' =>
'Date'),
174 'dateep' => array(
'type' =>
'date',
'label' =>
'DateEnd',
'enabled' => 1,
'visible' => 1,
'position' => 140,
'comment' =>
'Date'),
175 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'default' =>
'1',
'enabled' => 1,
'visible' => 0,
'position' => 150,
'index' => 1),
176 'note' => array(
'type' =>
'text',
'label' =>
'Note',
'enabled' => 1,
'position' => 160,
'visible' => 0,),
177 'fk_bank' => array(
'type' =>
'integer',
'label' =>
'BankId',
'enabled' => 1,
'visible' => 0,
'position' => 170),
178 'paye' => array(
'type' =>
'smallint(6)',
'label' =>
'Status',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 180),
179 'fk_user_author' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserAuthor',
'enabled' => 1,
'visible' => 0,
'position' => 190),
180 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 200,
'visible' => 0,),
181 'ref_ext' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref ext',
'enabled' => 1,
'visible' => 0,
'position' => 210),
182 'note_public' => array(
'type' =>
'text',
'label' =>
'NotePublic',
'enabled' => 1,
'visible' => 0,
'position' => 220),
203 public function create($user, $closepaidcontrib = 0)
211 dol_syslog(get_class($this).
"::create", LOG_DEBUG);
214 if (!empty($this->datepaye) && empty($this->datep)) {
215 dol_syslog(__METHOD__.
": using datepaye is deprecated, please use datep instead", LOG_WARNING);
216 $this->datep = $this->datepaye;
220 if (empty($this->datep)) {
221 $this->error =
'ErrorBadValueForParameterCreatePaymentSalary';
226 if (isset($this->fk_salary)) {
227 $this->fk_salary = (int) $this->fk_salary;
229 if (isset($this->amount)) {
230 $this->amount = (float) $this->amount;
232 if (isset($this->fk_typepayment)) {
233 $this->fk_typepayment = (int) $this->fk_typepayment;
235 if (isset($this->num_paiement)) {
236 $this->num_paiement = trim($this->num_paiement);
238 if (isset($this->num_payment)) {
239 $this->num_payment = trim($this->num_payment);
241 if (isset($this->note)) {
242 $this->note = trim($this->note);
244 if (isset($this->fk_bank)) {
245 $this->fk_bank = (int) $this->fk_bank;
247 if (isset($this->fk_user_author)) {
248 $this->fk_user_author = (int) $this->fk_user_author;
250 if (isset($this->fk_user_modif)) {
251 $this->fk_user_modif = (int) $this->fk_user_modif;
255 foreach ($this->amounts as $key => $value) {
256 $newvalue = (float)
price2num($value,
'MT');
257 $this->amounts[$key] = $newvalue;
258 $totalamount += $newvalue;
262 $totalamount = (float)
price2num($totalamount,
'MT');
263 if ($totalamount == 0) {
270 if ($totalamount != 0) {
272 foreach ($this->amounts as $key => $amount) {
274 if (is_numeric($amount) && !empty($amount)) {
276 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"payment_salary (entity, fk_salary, datec, datep, amount,";
277 $sql .=
" fk_typepayment, num_payment, note, fk_user_author, fk_bank)";
278 $sql .=
" VALUES (".((int) $conf->entity).
", ".((int) $salary_id).
", '".$this->db->idate($now).
"',";
279 $sql .=
" '".$this->db->idate($this->datep).
"',";
280 $sql .=
" ".((float) $amount).
",";
281 $sql .=
" ".((int) $this->fk_typepayment).
", '".$this->db->escape($this->num_payment).
"', '".$this->db->escape($this->note).
"', ".((int) $user->id).
",";
284 $resql = $this->db->query($sql);
286 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"payment_salary");
290 if ($closepaidcontrib) {
291 $tmpsalary =
new Salary($this->db);
292 $tmpsalary->fetch($salary_id);
293 $paiement = $tmpsalary->getSommePaiement();
298 $alreadypayed =
price2num($paiement + $creditnotes + $deposits,
'MT');
299 $remaintopay =
price2num((
float) $tmpsalary->amount - $paiement - $creditnotes - $deposits,
'MT');
300 if ($remaintopay == 0) {
301 $result = $tmpsalary->setPaid($user);
303 dol_syslog(
"Remain to pay for salary id=".$salary_id.
" not null. We do nothing.");
310 $result = $this->
call_trigger(
'PAYMENTSALARY_CREATE', $user);
315 if ($totalamount != 0 && !$error) {
316 $this->amount = $totalamount;
317 $this->total = $totalamount;
321 $this->error = $this->db->error();
322 $this->db->rollback();
338 $sql .=
" t.fk_salary,";
342 $sql .=
" t.amount,";
343 $sql .=
" t.fk_typepayment,";
344 $sql .=
" t.num_payment as num_payment,";
346 $sql .=
" t.fk_bank,";
347 $sql .=
" t.fk_user_author,";
348 $sql .=
" t.fk_user_modif,";
349 $sql .=
" pt.code as type_code, pt.libelle as type_label,";
350 $sql .=
' b.fk_account';
351 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pt ON t.fk_typepayment = pt.id";
352 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank as b ON t.fk_bank = b.rowid';
353 $sql .=
" WHERE t.rowid = ".((int) $id);
356 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
357 $resql = $this->db->query($sql);
359 if ($this->db->num_rows($resql)) {
360 $obj = $this->db->fetch_object($resql);
362 $this->
id = $obj->rowid;
363 $this->
ref = $obj->rowid;
365 $this->fk_salary = $obj->fk_salary;
366 $this->datec = $this->db->jdate($obj->datec);
367 $this->tms = $this->db->jdate($obj->tms);
368 $this->datepaye = $this->db->jdate($obj->datep);
369 $this->datep = $this->db->jdate($obj->datep);
370 $this->amount = $obj->amount;
371 $this->fk_typepayment = $obj->fk_typepayment;
372 $this->num_paiement = $obj->num_payment;
373 $this->num_payment = $obj->num_payment;
374 $this->note = $obj->note;
375 $this->note_private = $obj->note;
376 $this->fk_bank = $obj->fk_bank;
377 $this->fk_user_author = $obj->fk_user_author;
378 $this->fk_user_modif = $obj->fk_user_modif;
380 $this->type_code = $obj->type_code;
381 $this->type_label = $obj->type_label;
383 $this->bank_account = $obj->fk_account;
384 $this->bank_line = $obj->fk_bank;
386 $this->db->free($resql);
390 $this->error =
"Error ".$this->db->lasterror();
403 public function update($user =
null, $notrigger = 0)
405 global $conf, $langs;
410 if (isset($this->fk_salary)) {
411 $this->fk_salary = (int) $this->fk_salary;
413 if (isset($this->amount)) {
414 $this->amount = (float) $this->amount;
416 if (isset($this->fk_typepayment)) {
417 $this->fk_typepayment = (int) $this->fk_typepayment;
419 if (isset($this->num_paiement)) {
420 $this->num_paiement = trim($this->num_paiement);
422 if (isset($this->num_payment)) {
423 $this->num_payment = trim($this->num_payment);
425 if (isset($this->note)) {
426 $this->note = trim($this->note);
428 if (isset($this->fk_bank)) {
429 $this->fk_bank = (int) $this->fk_bank;
431 if (isset($this->fk_user_author)) {
432 $this->fk_user_author = (int) $this->fk_user_author;
434 if (isset($this->fk_user_modif)) {
435 $this->fk_user_modif = (int) $this->fk_user_modif;
442 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"payment_salary SET";
443 $sql .=
" fk_salary=".(isset($this->fk_salary) ? $this->fk_salary :
"null").
",";
444 $sql .=
" datec=".(dol_strlen($this->datec) != 0 ?
"'".$this->db->idate($this->datec).
"'" :
'null').
",";
445 $sql .=
" tms=".(dol_strlen((
string) $this->tms) != 0 ?
"'".$this->db->idate($this->tms).
"'" :
'null').
",";
446 $sql .=
" datep=".(dol_strlen($this->datepaye) != 0 ?
"'".$this->db->idate($this->datepaye).
"'" :
'null').
",";
447 $sql .=
" amount=".(isset($this->amount) ? $this->amount :
"null").
",";
448 $sql .=
" fk_typepayment=".(isset($this->fk_typepayment) ? $this->fk_typepayment :
"null").
",";
449 $sql .=
" num_payment=".(isset($this->num_payment) ?
"'".$this->db->escape($this->num_payment).
"'" :
"null").
",";
450 $sql .=
" note=".(isset($this->note) ?
"'".$this->db->escape($this->note).
"'" :
"null").
",";
451 $sql .=
" fk_bank=".(isset($this->fk_bank) ? ((int) $this->fk_bank) :
"null").
",";
452 $sql .=
" fk_user_author=".(isset($this->fk_user_author) ? ((int) $this->fk_user_author) :
"null").
",";
453 $sql .=
" fk_user_modif=".(isset($this->fk_user_modif) ? ((int) $this->fk_user_modif) :
"null");
454 $sql .=
" WHERE rowid=".((int) $this->
id);
458 dol_syslog(get_class($this).
"::update", LOG_DEBUG);
459 $resql = $this->db->query($sql);
462 $this->errors[] =
"Error ".$this->db->lasterror();
467 foreach ($this->errors as $errmsg) {
468 dol_syslog(get_class($this).
"::update ".$errmsg, LOG_ERR);
469 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
471 $this->db->rollback();
487 public function delete($user, $notrigger = 0)
495 if ($this->bank_line > 0) {
497 $accline->fetch($this->bank_line);
498 $result = $accline->delete($user);
500 $this->errors[] = $accline->error;
506 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"payment_salary";
507 $sql .=
" WHERE rowid=".((int) $this->
id);
509 dol_syslog(get_class($this).
"::delete", LOG_DEBUG);
510 $resql = $this->db->query($sql);
513 $this->errors[] =
"Error ".$this->db->lasterror();
519 foreach ($this->errors as $errmsg) {
520 dol_syslog(get_class($this).
"::delete ".$errmsg, LOG_ERR);
521 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
523 $this->db->rollback();
557 $object->context[
'createfromclone'] =
'createfromclone';
558 $result =
$object->create($user);
566 unset(
$object->context[
'createfromclone']);
573 $this->db->rollback();
589 $this->fk_salary = 0;
594 $this->fk_typepayment = 0;
595 $this->num_payment =
'';
596 $this->note_private =
'';
597 $this->note_public =
'';
599 $this->fk_user_author = 0;
600 $this->fk_user_modif = 0;
618 public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
623 $this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement);
627 if (isModEnabled(
"bank")) {
628 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
631 $acc->fetch($accountid);
633 $total = $this->amount;
636 $bank_line_id = $acc->addline(
638 $this->fk_typepayment,
652 if ($bank_line_id > 0) {
661 if ($mode ==
'payment_salary') {
662 $url = DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id=';
666 $result = $acc->add_url_line($bank_line_id, $this->
id, $url,
'(paiement)', $mode);
674 foreach ($this->amounts as $key => $value) {
676 if ($mode ==
'payment_salary') {
677 $salary =
new Salary($this->db);
678 $salary->fetch($key);
679 $salary->fetch_user($salary->fk_user);
681 $fuser = $salary->user;
683 if ($fuser->id > 0) {
684 $result = $acc->add_url_line(
687 DOL_URL_ROOT.
'/user/card.php?id=',
688 $fuser->getFullName($langs),
693 $this->error = $this->db->lasterror();
694 dol_syslog(get_class($this) .
'::addPaymentToBank ' . $this->error);
701 $this->error = $acc->error;
724 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"payment_salary SET fk_bank = ".((int) $id_bank).
" WHERE rowid = ".((int) $this->
id);
726 dol_syslog(get_class($this).
"::update_fk_bank", LOG_DEBUG);
727 $result = $this->db->query($sql);
731 $this->error = $this->db->error();
750 dol_syslog(get_class($this).
"::updatePaymentDate with date = ".$date, LOG_DEBUG);
752 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
753 $sql .=
" SET datep = '".$this->db->idate($date).
"'";
754 $sql .=
" WHERE rowid = ".((int) $this->
id);
756 $result = $this->db->query($sql);
759 $this->error =
'Error -1 '.$this->db->error();
762 $type = $this->element;
764 $sql =
"UPDATE ".MAIN_DB_PREFIX.
'bank';
765 $sql .=
" SET dateo = '".$this->db->idate($date).
"', datev = '".$this->db->idate($date).
"'";
766 $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).
")";
767 $sql .=
" AND rappro = 0";
769 $result = $this->db->query($sql);
772 $this->error =
'Error -1 '.$this->db->error();
779 $this->datepaye = $date;
784 $this->db->rollback();
799 return $this->
LibStatut($this->statut, $mode);
815 $langs->load(
'compta');
864 public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
866 global $conf, $langs, $hookmanager;
870 if (!empty($conf->dol_no_mouse_hover)) {
877 'objecttype' => $this->element.($this->module ?
'@'.$this->module :
''),
880 $classfortooltip =
'classfortooltip';
883 $classfortooltip =
'classforajaxtooltip';
884 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
890 $url = DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id='.$this->id;
892 if ($option !==
'nolink') {
894 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
895 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
896 $add_save_lastsearch_values = 1;
898 if ($url && $add_save_lastsearch_values) {
899 $url .=
'&save_lastsearch_values=1';
904 if (empty($notooltip)) {
906 $label = $langs->trans(
"SalaryPayment");
907 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
909 $linkclose .= ($label ?
' title="'.dol_escape_htmltag($label, 1).
'"' :
' title="tocomplete"');
910 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
912 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
915 if ($option ==
'nolink' || empty($url)) {
916 $linkstart =
'<span';
918 $linkstart =
'<a href="'.$url.
'"';
920 $linkstart .= $linkclose.
'>';
921 if ($option ==
'nolink' || empty($url)) {
922 $linkend =
'</span>';
927 $result .= $linkstart;
929 if (empty($this->showphoto_on_popup)) {
931 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), (($withpicto != 2) ?
'class="paddingright"' :
''), 0, 0, $notooltip ? 0 : 1);
935 if ($withpicto != 2) {
936 $result .= $this->ref;
942 global $action, $hookmanager;
943 $hookmanager->initHooks(array($this->element.
'dao'));
944 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
945 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
947 $result = $hookmanager->resPrint;
949 $result .= $hookmanager->resPrint;
963 global $conf, $langs, $user;
965 $langs->load(
'salaries');
969 return [
'optimize' => $langs->trans(
"SalaryPayment")];
972 if ($user->hasRight(
'salaries',
'read')) {
973 $datas[
'picto'] =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"SalaryPayment").
'</u>';
974 if (isset($this->
status)) {
975 $datas[
'status'] =
' '.$this->getLibStatut(5);
977 $datas[
'Ref'] =
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
978 if (!empty($this->total_ttc)) {
979 $datas[
'AmountTTC'] =
'<br><b>'.$langs->trans(
'AmountTTC').
':</b> '.
price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
981 if (!empty($this->datep)) {
982 $datas[
'Date'] =
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->datep,
'dayhour',
'tzuserrel');
983 } elseif (!empty($this->datepaye)) {
984 $datas[
'Date'] =
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->datepaye,
'dayhour',
'tzuserrel');
1002 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1004 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1005 $return .=
'<div class="info-box info-box-sm">';
1006 $return .=
'<span class="info-box-icon bg-infobox-action">';
1008 $return .=
'</span>';
1009 $return .=
'<div class="info-box-content">';
1010 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
1011 if ($selected >= 0) {
1012 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1014 if (property_exists($this,
'fk_bank') && is_numeric($this->fk_bank)) {
1015 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1017 $account->fetch($this->fk_bank);
1018 $return .=
' | <span class="info-box-label">'.$account->getNomUrl(1).
'</span>';
1020 if (property_exists($this,
'fk_user_author') && is_numeric($this->fk_user_author)) {
1021 $userstatic =
new User($this->db);
1022 $userstatic->fetch($this->fk_user_author);
1023 $return .=
'<br><span class="info-box-status">'.$userstatic->getNomUrl(1).
'</span>';
1026 if (property_exists($this,
'fk_typepayment')) {
1027 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"PaymentMode").
'</span> : <span class="info-box-label">'.$this->fk_typepayment.
'</span>';
1029 if (property_exists($this,
'amount')) {
1030 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Amount").
'</span> : <span class="info-box-label amount">'.
price($this->amount).
'</span>';
1032 $return .=
'</div>';
1033 $return .=
'</div>';
1034 $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.