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;
125 public $fk_user_author;
130 public $fk_user_modif;
145 public $bank_account;
155 public $fields = array(
156 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'index' => 1,
'position' => 1,
'comment' =>
'Id'),
157 'ref' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref',
'enabled' => 1,
'position' => 10,
'visible' => 1,
'index' => 1,
'comment' =>
"Reference of object"),
158 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 20),
159 'datec' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'visible' => 0,
'position' => 30),
160 'datep' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 40,
'comment' =>
'Date'),
161 'datev' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 50,
'comment' =>
'Date'),
162 'fk_user' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'Employee',
'enabled' => 1,
'position' => 60,
'notnull' => 1,
'visible' => 1,
'picto' =>
'user'),
163 'salary' => array(
'type' =>
'double(24,8)',
'label' =>
'salary',
'enabled' => 1,
'visible' => 0,
'position' => 70),
164 'amount' => array(
'type' =>
'double(24,8)',
'label' =>
'Amount',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 80),
165 'fk_projet' => array(
'type' =>
'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)',
'label' =>
'Project',
'enabled' =>
"isModEnabled('project')",
'visible' => 0,
'position' => 90),
166 'fk_typepayment' => array(
'type' =>
'typepayment',
'label' =>
'DefaultPaymentMode',
'enabled' => 1,
'visible' => 1,
'position' => 100,
'comment' =>
'Payment type'),
167 'num_payment' => array(
'type' =>
'string',
'label' =>
'Reference',
'enabled' => 1,
'visible' => 0,
'position' => 110,
'comment' =>
'Reference'),
168 'label' => array(
'type' =>
'varchar(255)',
'label' =>
'Label',
'enabled' => 1,
'position' => 120,
'notnull' => 0,
'visible' => 1),
169 'datesp' => array(
'type' =>
'date',
'label' =>
'DateStart',
'enabled' => 1,
'visible' => 1,
'position' => 130,
'comment' =>
'Date'),
170 'dateep' => array(
'type' =>
'date',
'label' =>
'DateEnd',
'enabled' => 1,
'visible' => 1,
'position' => 140,
'comment' =>
'Date'),
171 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'default' =>
'1',
'enabled' => 1,
'visible' => 0,
'position' => 150,
'index' => 1),
172 'note' => array(
'type' =>
'text',
'label' =>
'Note',
'enabled' => 1,
'position' => 160,
'visible' => 0,),
173 'fk_bank' => array(
'type' =>
'integer',
'label' =>
'BankId',
'enabled' => 1,
'visible' => 0,
'position' => 170),
174 'paye' => array(
'type' =>
'smallint(6)',
'label' =>
'Status',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 180),
175 'fk_user_author' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserAuthor',
'enabled' => 1,
'visible' => 0,
'position' => 190),
176 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 200,
'visible' => 0,),
177 'ref_ext' => array(
'type' =>
'varchar(128)',
'label' =>
'RefExt',
'enabled' => 1,
'visible' => 0,
'position' => 210),
178 'note_public' => array(
'type' =>
'text',
'label' =>
'NotePublic',
'enabled' => 1,
'visible' => 0,
'position' => 220),
199 public function create($user, $closepaidcontrib = 0)
207 dol_syslog(get_class($this).
"::create", LOG_DEBUG);
210 if (!empty($this->datepaye) && empty($this->datep)) {
211 dol_syslog(__METHOD__.
": using datepaye is deprecated, please use datep instead", LOG_WARNING);
212 $this->datep = $this->datepaye;
216 if (empty($this->datep)) {
217 $this->error =
'ErrorBadValueForParameterCreatePaymentSalary';
222 if (isset($this->fk_salary)) {
223 $this->fk_salary = (int) $this->fk_salary;
225 if (isset($this->
amount)) {
228 if (isset($this->fk_typepayment)) {
229 $this->fk_typepayment = (int) $this->fk_typepayment;
231 if (isset($this->num_payment)) {
232 $this->num_payment = trim($this->num_payment);
234 if (isset($this->note)) {
235 $this->note = trim($this->note);
237 if (isset($this->fk_bank)) {
238 $this->fk_bank = (int) $this->fk_bank;
240 if (isset($this->fk_user_author)) {
241 $this->fk_user_author = (int) $this->fk_user_author;
243 if (isset($this->fk_user_modif)) {
244 $this->fk_user_modif = (int) $this->fk_user_modif;
248 foreach ($this->amounts as $key => $value) {
249 $newvalue = (float)
price2num($value,
'MT');
250 $this->amounts[$key] = $newvalue;
251 $totalamount += $newvalue;
255 $totalamount = (float)
price2num($totalamount,
'MT');
256 if ($totalamount == 0) {
263 if ($totalamount != 0) {
265 foreach ($this->amounts as $key => $amount) {
267 if (is_numeric($amount) && !empty($amount)) {
269 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"payment_salary (entity, fk_salary, datec, datep, amount,";
270 $sql .=
" fk_typepayment, num_payment, note, fk_user_author, fk_bank)";
271 $sql .=
" VALUES (".((int)
$conf->entity).
", ".((int) $salary_id).
", '".$this->db->idate($now).
"',";
272 $sql .=
" '".$this->db->idate($this->datep).
"',";
273 $sql .=
" ".((float) $amount).
",";
274 $sql .=
" ".((int) $this->fk_typepayment).
", '".$this->db->escape($this->num_payment).
"', '".$this->db->escape($this->note).
"', ".((int) $user->id).
",";
277 $resql = $this->db->query($sql);
279 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"payment_salary");
283 if ($closepaidcontrib) {
284 $tmpsalary =
new Salary($this->db);
285 $tmpsalary->fetch($salary_id);
286 $paiement = $tmpsalary->getSommePaiement();
291 $alreadypayed =
price2num($paiement + $creditnotes + $deposits,
'MT');
292 $remaintopay =
price2num((
float) $tmpsalary->amount - $paiement - $creditnotes - $deposits,
'MT');
293 if ($remaintopay == 0) {
294 $result = $tmpsalary->setPaid($user);
296 dol_syslog(
"Remain to pay for salary id=".$salary_id.
" not null. We do nothing.");
303 $result = $this->call_trigger(
'PAYMENTSALARY_CREATE', $user);
308 if ($totalamount != 0 && !$error) {
309 $this->
amount = $totalamount;
310 $this->total = $totalamount;
314 $this->error = $this->db->error();
315 $this->db->rollback();
331 $sql .=
" t.fk_salary,";
335 $sql .=
" t.amount,";
336 $sql .=
" t.fk_typepayment,";
337 $sql .=
" t.num_payment as num_payment,";
339 $sql .=
" t.fk_bank as bank_line,";
340 $sql .=
" t.fk_user_author,";
341 $sql .=
" t.fk_user_modif,";
342 $sql .=
" pt.code as type_code, pt.libelle as type_label,";
343 $sql .=
' b.fk_account';
344 $sql .=
" FROM ".MAIN_DB_PREFIX.
"payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pt ON t.fk_typepayment = pt.id";
345 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank as b ON t.fk_bank = b.rowid';
346 $sql .=
" WHERE t.rowid = ".((int) $id);
349 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
350 $resql = $this->db->query($sql);
352 if ($this->db->num_rows($resql)) {
353 $obj = $this->db->fetch_object($resql);
355 $this->
id = $obj->rowid;
356 $this->
ref = $obj->rowid;
358 $this->fk_salary = $obj->fk_salary;
359 $this->datec = $this->db->jdate($obj->datec);
360 $this->tms = $this->db->jdate($obj->tms);
361 $this->datepaye = $this->db->jdate($obj->datep);
362 $this->datep = $this->db->jdate($obj->datep);
363 $this->
amount = $obj->amount;
364 $this->fk_typepayment = $obj->fk_typepayment;
365 $this->num_payment = $obj->num_payment;
366 $this->note = $obj->note;
367 $this->note_private = $obj->note;
368 $this->fk_user_author = $obj->fk_user_author;
369 $this->fk_user_modif = $obj->fk_user_modif;
370 $this->user_modification_id = $obj->fk_user_modif;
372 $this->type_code = $obj->type_code;
373 $this->type_label = $obj->type_label;
375 $this->bank_account = $obj->fk_account;
376 $this->fk_account = $obj->fk_account;
378 $this->fk_bank = $obj->bank_line;
379 $this->bank_line = $obj->bank_line;
381 $this->db->free($resql);
385 $this->error =
"Error ".$this->db->lasterror();
398 public function update($user =
null, $notrigger = 0)
400 global
$conf, $langs;
405 if (isset($this->fk_salary)) {
406 $this->fk_salary = (int) $this->fk_salary;
408 if (isset($this->
amount)) {
411 if (isset($this->fk_typepayment)) {
412 $this->fk_typepayment = (int) $this->fk_typepayment;
414 if (isset($this->num_payment)) {
415 $this->num_payment = trim($this->num_payment);
417 if (isset($this->note)) {
418 $this->note = trim($this->note);
420 if (isset($this->fk_bank)) {
421 $this->fk_bank = (int) $this->fk_bank;
423 if (isset($this->fk_user_author)) {
424 $this->fk_user_author = (int) $this->fk_user_author;
426 if (isset($this->fk_user_modif)) {
427 $this->fk_user_modif = (int) $this->fk_user_modif;
434 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"payment_salary SET";
435 $sql .=
" fk_salary=".(isset($this->fk_salary) ? ((int) $this->fk_salary) :
"null").
",";
436 $sql .=
" datec=".(dol_strlen($this->datec) != 0 ?
"'".$this->db->idate($this->datec).
"'" :
'null').
",";
437 $sql .=
" tms=".(dol_strlen((
string) $this->tms) != 0 ?
"'".$this->db->idate($this->tms).
"'" :
'null').
",";
438 $sql .=
" datep=".(dol_strlen($this->datepaye) != 0 ?
"'".$this->db->idate($this->datepaye).
"'" :
'null').
",";
439 $sql .=
" amount=".(isset($this->
amount) ? ((float) $this->
amount) :
"null").
",";
440 $sql .=
" fk_typepayment=".(isset($this->fk_typepayment) ? ((int) $this->fk_typepayment) :
"null").
",";
441 $sql .=
" num_payment=".(isset($this->num_payment) ?
"'".$this->db->escape($this->num_payment).
"'" :
"null").
",";
442 $sql .=
" note=".(isset($this->note) ?
"'".$this->db->escape($this->note).
"'" :
"null").
",";
443 $sql .=
" fk_bank=".(isset($this->fk_bank) ? ((int) $this->fk_bank) :
"null").
",";
444 $sql .=
" fk_user_author=".(isset($this->fk_user_author) ? ((int) $this->fk_user_author) :
"null").
",";
445 $sql .=
" fk_user_modif=".(isset($this->fk_user_modif) ? ((int) $this->fk_user_modif) :
"null");
446 $sql .=
" WHERE rowid=".((int) $this->
id);
450 dol_syslog(get_class($this).
"::update", LOG_DEBUG);
451 $resql = $this->db->query($sql);
454 $this->errors[] =
"Error ".$this->db->lasterror();
457 if (!$error && $user && !$notrigger) {
459 $result = $this->call_trigger(
'PAYMENTSALARY_MODIFY', $user);
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((
int) $this->bank_line);
499 $result = $accline->delete($user);
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();
518 if (!$error && !$notrigger) {
520 $result = $this->call_trigger(
'PAYMENTSALARY_DELETE', $user);
529 foreach ($this->errors as $errmsg) {
530 dol_syslog(get_class($this).
"::delete ".$errmsg, LOG_ERR);
531 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
533 $this->db->rollback();
567 $object->context[
'createfromclone'] =
'createfromclone';
568 $result =
$object->create($user);
576 unset(
$object->context[
'createfromclone']);
583 $this->db->rollback();
599 $this->fk_salary = 0;
604 $this->fk_typepayment = 0;
605 $this->num_payment =
'';
606 $this->note_private =
'';
607 $this->note_public =
'';
609 $this->fk_user_author = 0;
610 $this->fk_user_modif = 0;
628 public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
633 $this->num_payment = trim((
string) $this->num_payment);
638 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
641 $acc->fetch($accountid);
643 $total = $this->amount;
646 $bank_line_id = $acc->addline(
648 (
string) $this->fk_typepayment,
662 if ($bank_line_id > 0) {
666 dol_print_error($this->db);
671 if ($mode ==
'payment_salary') {
672 $url = DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id=';
676 $result = $acc->add_url_line($bank_line_id, $this->
id, $url,
'(paiement)', $mode);
679 dol_print_error($this->db);
684 foreach ($this->amounts as $key => $value) {
686 if ($mode ==
'payment_salary') {
687 $salary =
new Salary($this->db);
688 $salary->fetch($key);
689 $salary->fetch_user($salary->fk_user);
691 $fuser = $salary->user;
693 if ($fuser->id > 0) {
694 $result = $acc->add_url_line(
697 DOL_URL_ROOT.
'/user/card.php?id=',
698 $fuser->getFullName($langs),
703 $this->error = $this->db->lasterror();
704 dol_syslog(get_class($this) .
'::addPaymentToBank ' . $this->error);
711 $this->error = $acc->error;
734 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"payment_salary SET fk_bank = ".((int) $id_bank).
" WHERE rowid = ".((int) $this->
id);
736 dol_syslog(get_class($this).
"::update_fk_bank", LOG_DEBUG);
737 $result = $this->db->query($sql);
741 $this->error = $this->db->error();
760 dol_syslog(get_class($this).
"::updatePaymentDate with date = ".$date, LOG_DEBUG);
762 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
763 $sql .=
" SET datep = '".$this->db->idate($date).
"'";
764 $sql .=
" WHERE rowid = ".((int) $this->
id);
766 $result = $this->db->query($sql);
769 $this->error =
'Error -1 '.$this->db->error();
772 $type = $this->element;
774 $sql =
"UPDATE ".MAIN_DB_PREFIX.
'bank';
775 $sql .=
" SET dateo = '".$this->db->idate($date).
"', datev = '".$this->db->idate($date).
"'";
776 $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).
")";
777 $sql .=
" AND rappro = 0";
779 $result = $this->db->query($sql);
782 $this->error =
'Error -1 '.$this->db->error();
786 $this->datepaye = $date;
791 $this->db->rollback();
806 return $this->
LibStatut($this->statut, $mode);
822 $langs->load(
'compta');
872 public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1, $option =
'')
874 global
$conf, $langs, $hookmanager;
876 if (!empty(
$conf->dol_no_mouse_hover)) {
883 'objecttype' => $this->element.($this->module ?
'@'.$this->module :
''),
886 $classfortooltip =
'classfortooltip';
889 $classfortooltip =
'classforajaxtooltip';
890 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
896 $url = DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id='.$this->id;
910 if (empty($notooltip)) {
912 $label = $langs->trans(
"SalaryPayment");
913 $linkclose .=
' alt="'.dolPrintHTMLForAttribute($label).
'"';
915 $linkclose .= ($label ?
' title="'.dolPrintHTMLForAttribute($label).
'"' :
' title="tocomplete"');
916 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
918 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
921 if ($option ==
'nolink') {
922 $linkstart =
'<span';
924 $linkstart =
'<a href="'.$url.
'"';
926 $linkstart .= $linkclose.
'>';
927 if ($option ==
'nolink') {
928 $linkend =
'</span>';
933 $result .= $linkstart;
935 if (empty($this->showphoto_on_popup)) {
937 $result .= img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), (($withpicto != 2) ?
'class="paddingright"' :
''), 0, 0, $notooltip ? 0 : 1);
941 if ($withpicto != 2) {
942 $result .= $this->ref;
948 global $action, $hookmanager;
949 $hookmanager->initHooks(array($this->element.
'dao'));
950 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
951 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
953 $result = $hookmanager->resPrint;
955 $result .= $hookmanager->resPrint;
969 global
$conf, $langs, $user;
971 $langs->load(
'salaries');
975 return [
'optimize' => $langs->trans(
"SalaryPayment")];
978 if ($user->hasRight(
'salaries',
'read')) {
979 $datas[
'picto'] = img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"SalaryPayment").
'</u>';
980 if (isset($this->
status)) {
981 $datas[
'status'] =
' '.$this->getLibStatut(5);
983 $datas[
'Ref'] =
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
984 if (!empty($this->total_ttc)) {
985 $datas[
'AmountTTC'] =
'<br><b>'.$langs->trans(
'AmountTTC').
':</b> '.
price($this->total_ttc, 0, $langs, 0, -1, -1,
$conf->currency);
987 if (!empty($this->datep)) {
988 $datas[
'Date'] =
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->datep,
'dayhour',
'tzuserrel');
989 } elseif (!empty($this->datepaye)) {
990 $datas[
'Date'] =
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->datepaye,
'dayhour',
'tzuserrel');
1008 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1010 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1011 $return .=
'<div class="info-box info-box-sm">';
1012 $return .=
'<span class="info-box-icon bg-infobox-action">';
1013 $return .= img_picto(
'', $this->picto);
1014 $return .=
'</span>';
1015 $return .=
'<div class="info-box-content">';
1016 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->
getNomUrl(1) .
'</span>';
1017 if ($selected >= 0) {
1018 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1020 if (!empty($this->fk_bank) && is_numeric($this->fk_bank)) {
1021 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1023 $account->fetch($this->fk_bank);
1024 $return .=
' | <span class="info-box-label">'.$account->getNomUrl(1).
'</span>';
1026 if (!empty($this->fk_user_author) && is_numeric($this->fk_user_author)) {
1027 $userstatic =
new User($this->db);
1028 $userstatic->fetch($this->fk_user_author);
1029 $return .=
'<br><span class="info-box-status">'.$userstatic->getNomUrl(1).
'</span>';
1032 if (!empty($this->fk_typepayment)) {
1033 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"PaymentMode").
'</span> : <span class="info-box-label">'.$this->fk_typepayment.
'</span>';
1035 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Amount").
'</span> : <span class="info-box-label amount">'.
price($this->
amount).
'</span>';
1036 $return .=
'</div>';
1037 $return .=
'</div>';
1038 $return .=
'</div>';
if(! $sortfield) if(! $sortorder) $object
Class to manage bank accounts.
Class to manage bank transaction lines.
setErrorsFromObject($object)
setErrorsFromObject
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.
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.
getNomUrl($withpicto=0, $maxlen=0, $notooltip=0, $morecss='', $save_lastsearch_value=-1, $option='')
Return clickable name (with picto eventually)
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...
dol_now($mode='gmt')
Return date for now.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
print $langs trans('Date')." left Ref Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right Paid right PaymentTypeShortLIQ right SELECT p pos_change as p datep as p p num_paiement as f pf amount as amount