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) ? $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) ? $this->
amount :
"null").
",";
440 $sql .=
" fk_typepayment=".(isset($this->fk_typepayment) ? $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();
459 foreach ($this->errors as $errmsg) {
460 dol_syslog(get_class($this).
"::update ".$errmsg, LOG_ERR);
461 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
463 $this->db->rollback();
479 public function delete($user, $notrigger = 0)
487 if ($this->bank_line > 0) {
489 $accline->fetch((
int) $this->bank_line);
490 $result = $accline->delete($user);
498 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"payment_salary";
499 $sql .=
" WHERE rowid=".((int) $this->
id);
501 dol_syslog(get_class($this).
"::delete", LOG_DEBUG);
502 $resql = $this->db->query($sql);
505 $this->errors[] =
"Error ".$this->db->lasterror();
511 foreach ($this->errors as $errmsg) {
512 dol_syslog(get_class($this).
"::delete ".$errmsg, LOG_ERR);
513 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
515 $this->db->rollback();
549 $object->context[
'createfromclone'] =
'createfromclone';
550 $result =
$object->create($user);
558 unset(
$object->context[
'createfromclone']);
565 $this->db->rollback();
581 $this->fk_salary = 0;
586 $this->fk_typepayment = 0;
587 $this->num_payment =
'';
588 $this->note_private =
'';
589 $this->note_public =
'';
591 $this->fk_user_author = 0;
592 $this->fk_user_modif = 0;
610 public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
615 $this->num_payment = trim((
string) $this->num_payment);
620 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
623 $acc->fetch($accountid);
625 $total = $this->amount;
628 $bank_line_id = $acc->addline(
630 (
string) $this->fk_typepayment,
644 if ($bank_line_id > 0) {
653 if ($mode ==
'payment_salary') {
654 $url = DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id=';
658 $result = $acc->add_url_line($bank_line_id, $this->
id, $url,
'(paiement)', $mode);
666 foreach ($this->amounts as $key => $value) {
668 if ($mode ==
'payment_salary') {
669 $salary =
new Salary($this->db);
670 $salary->fetch($key);
671 $salary->fetch_user($salary->fk_user);
673 $fuser = $salary->user;
675 if ($fuser->id > 0) {
676 $result = $acc->add_url_line(
679 DOL_URL_ROOT.
'/user/card.php?id=',
680 $fuser->getFullName($langs),
685 $this->error = $this->db->lasterror();
686 dol_syslog(get_class($this) .
'::addPaymentToBank ' . $this->error);
693 $this->error = $acc->error;
716 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"payment_salary SET fk_bank = ".((int) $id_bank).
" WHERE rowid = ".((int) $this->
id);
718 dol_syslog(get_class($this).
"::update_fk_bank", LOG_DEBUG);
719 $result = $this->db->query($sql);
723 $this->error = $this->db->error();
742 dol_syslog(get_class($this).
"::updatePaymentDate with date = ".$date, LOG_DEBUG);
744 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
745 $sql .=
" SET datep = '".$this->db->idate($date).
"'";
746 $sql .=
" WHERE rowid = ".((int) $this->
id);
748 $result = $this->db->query($sql);
751 $this->error =
'Error -1 '.$this->db->error();
754 $type = $this->element;
756 $sql =
"UPDATE ".MAIN_DB_PREFIX.
'bank';
757 $sql .=
" SET dateo = '".$this->db->idate($date).
"', datev = '".$this->db->idate($date).
"'";
758 $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).
")";
759 $sql .=
" AND rappro = 0";
761 $result = $this->db->query($sql);
764 $this->error =
'Error -1 '.$this->db->error();
768 $this->datepaye = $date;
773 $this->db->rollback();
788 return $this->
LibStatut($this->statut, $mode);
804 $langs->load(
'compta');
854 public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1, $option =
'')
856 global $conf, $langs, $hookmanager;
858 if (!empty($conf->dol_no_mouse_hover)) {
865 'objecttype' => $this->element.($this->module ?
'@'.$this->module :
''),
868 $classfortooltip =
'classfortooltip';
871 $classfortooltip =
'classforajaxtooltip';
872 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
878 $url = DOL_URL_ROOT.
'/salaries/payment_salary/card.php?id='.$this->id;
892 if (empty($notooltip)) {
894 $label = $langs->trans(
"SalaryPayment");
895 $linkclose .=
' alt="'.dolPrintHTMLForAttribute($label).
'"';
897 $linkclose .= ($label ?
' title="'.dolPrintHTMLForAttribute($label).
'"' :
' title="tocomplete"');
898 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
900 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
903 if ($option ==
'nolink') {
904 $linkstart =
'<span';
906 $linkstart =
'<a href="'.$url.
'"';
908 $linkstart .= $linkclose.
'>';
909 if ($option ==
'nolink') {
910 $linkend =
'</span>';
915 $result .= $linkstart;
917 if (empty($this->showphoto_on_popup)) {
919 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), (($withpicto != 2) ?
'class="paddingright"' :
''), 0, 0, $notooltip ? 0 : 1);
923 if ($withpicto != 2) {
924 $result .= $this->ref;
930 global $action, $hookmanager;
931 $hookmanager->initHooks(array($this->element.
'dao'));
932 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
933 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
935 $result = $hookmanager->resPrint;
937 $result .= $hookmanager->resPrint;
951 global $conf, $langs, $user;
953 $langs->load(
'salaries');
957 return [
'optimize' => $langs->trans(
"SalaryPayment")];
960 if ($user->hasRight(
'salaries',
'read')) {
961 $datas[
'picto'] =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"SalaryPayment").
'</u>';
962 if (isset($this->
status)) {
963 $datas[
'status'] =
' '.$this->getLibStatut(5);
965 $datas[
'Ref'] =
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
966 if (!empty($this->total_ttc)) {
967 $datas[
'AmountTTC'] =
'<br><b>'.$langs->trans(
'AmountTTC').
':</b> '.
price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
969 if (!empty($this->datep)) {
970 $datas[
'Date'] =
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->datep,
'dayhour',
'tzuserrel');
971 } elseif (!empty($this->datepaye)) {
972 $datas[
'Date'] =
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->datepaye,
'dayhour',
'tzuserrel');
990 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
992 $return =
'<div class="box-flex-item box-flex-grow-zero">';
993 $return .=
'<div class="info-box info-box-sm">';
994 $return .=
'<span class="info-box-icon bg-infobox-action">';
996 $return .=
'</span>';
997 $return .=
'<div class="info-box-content">';
998 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->
getNomUrl(1) .
'</span>';
999 if ($selected >= 0) {
1000 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1002 if (!empty($this->fk_bank) && is_numeric($this->fk_bank)) {
1003 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1005 $account->fetch($this->fk_bank);
1006 $return .=
' | <span class="info-box-label">'.$account->getNomUrl(1).
'</span>';
1008 if (!empty($this->fk_user_author) && is_numeric($this->fk_user_author)) {
1009 $userstatic =
new User($this->db);
1010 $userstatic->fetch($this->fk_user_author);
1011 $return .=
'<br><span class="info-box-status">'.$userstatic->getNomUrl(1).
'</span>';
1014 if (!empty($this->fk_typepayment)) {
1015 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"PaymentMode").
'</span> : <span class="info-box-label">'.$this->fk_typepayment.
'</span>';
1017 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Amount").
'</span> : <span class="info-box-label amount">'.
price($this->
amount).
'</span>';
1018 $return .=
'</div>';
1019 $return .=
'</div>';
1020 $return .=
'</div>';
if(! $sortfield) if(! $sortorder) $object
Class to manage bank accounts.
Class to manage bank transaction lines.
Parent class of all other business classes (invoices, contracts, proposals, orders,...
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
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 '.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
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).
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.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
if(getDolGlobalString( 'TAKEPOS_SHOW_CUSTOMER')) print $langs trans('Date')." left 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 PaymentTypeShortLIQ right SELECT p pos_change as p datep as p p num_paiement as f pf amount as amount