dolibarr  21.0.0-alpha
paymentexpensereport.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
3  * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
4  * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
5  * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
27 require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
28 
29 
34 {
38  public $element = 'payment_expensereport';
39 
43  public $table_element = 'payment_expensereport';
44 
48  public $picto = 'payment';
49 
53  public $rowid;
54 
58  public $fk_expensereport;
59 
63  public $datec = '';
64 
68  public $datep = '';
72  public $amount; // Total amount of payment
76  public $amounts = array(); // Array of amounts
77 
81  public $fk_typepayment;
82 
87  public $num_payment;
88 
92  public $fk_bank;
93 
97  public $fk_user_creat;
98 
102  public $fk_user_modif;
103 
107  public $type_code;
108 
112  public $type_label;
113 
117  public $bank_account;
118 
122  public $bank_line;
123 
127  public $label;
128 
129 
135  public function __construct($db)
136  {
137  $this->db = $db;
138  }
139 
147  public function create($user)
148  {
149  $error = 0;
150 
151  $now = dol_now();
152  // Validate parameters
153  if (!$this->datep) {
154  $this->error = 'ErrorBadValueForParameterCreatePaymentExpenseReport';
155  return -1;
156  }
157 
158  // Clean parameters
159  if (isset($this->fk_expensereport)) {
160  $this->fk_expensereport = (int) $this->fk_expensereport;
161  }
162  if (isset($this->amount)) {
163  $this->amount = (float) $this->amount;
164  }
165  if (isset($this->fk_typepayment)) {
166  $this->fk_typepayment = (int) $this->fk_typepayment;
167  }
168  if (isset($this->num_payment)) {
169  $this->num_payment = trim($this->num_payment);
170  }
171  if (isset($this->note)) {
172  $this->note = trim($this->note);
173  }
174  if (isset($this->note_public)) {
175  $this->note_public = trim($this->note_public);
176  }
177  if (isset($this->note_private)) {
178  $this->note_private = trim($this->note_private);
179  }
180  if (isset($this->fk_bank)) {
181  $this->fk_bank = ((int) $this->fk_bank);
182  }
183  if (isset($this->fk_user_creat)) {
184  $this->fk_user_creat = ((int) $this->fk_user_creat);
185  }
186  if (isset($this->fk_user_modif)) {
187  $this->fk_user_modif = ((int) $this->fk_user_modif);
188  }
189 
190  $totalamount = 0;
191  foreach ($this->amounts as $key => $value) { // How payment is dispatch
192  $newvalue = (float) price2num($value, 'MT');
193  $this->amounts[$key] = $newvalue;
194  $totalamount += $newvalue;
195  }
196  // $totalamount = (float) price2num($totalamount);
197 
198  // Check parameters
199  if ($totalamount == 0) {
200  return -1; // On accepte les montants negatifs pour les rejets de prelevement mais pas null
201  }
202 
203 
204  $this->db->begin();
205 
206  if ($totalamount != 0) {
207  $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_expensereport (fk_expensereport, datec, datep, amount,";
208  $sql .= " fk_typepayment, num_payment, note, fk_user_creat, fk_bank)";
209  $sql .= " VALUES ($this->fk_expensereport, '".$this->db->idate($now)."',";
210  $sql .= " '".$this->db->idate($this->datep)."',";
211  $sql .= " ".price2num($totalamount).",";
212  $sql .= " ".((int) $this->fk_typepayment).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".((int) $user->id).",";
213  $sql .= " 0)"; // fk_bank is ID of transaction into ll_bank
214 
215  dol_syslog(get_class($this)."::create", LOG_DEBUG);
216  $resql = $this->db->query($sql);
217  if ($resql) {
218  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_expensereport");
219  } else {
220  $error++;
221  }
222  }
223 
224  if ($totalamount != 0 && !$error) {
225  $this->amount = $totalamount;
226  $this->db->commit();
227  return $this->id;
228  } else {
229  $this->error = $this->db->error();
230  $this->db->rollback();
231  return -1;
232  }
233  }
234 
241  public function fetch($id)
242  {
243  $sql = "SELECT";
244  $sql .= " t.rowid,";
245  $sql .= " t.fk_expensereport,";
246  $sql .= " t.datec,";
247  $sql .= " t.tms,";
248  $sql .= " t.datep,";
249  $sql .= " t.amount,";
250  $sql .= " t.fk_typepayment,";
251  $sql .= " t.num_payment,";
252  $sql .= " t.note as note_public,";
253  $sql .= " t.fk_bank,";
254  $sql .= " t.fk_user_creat,";
255  $sql .= " t.fk_user_modif,";
256  $sql .= " pt.code as type_code, pt.libelle as type_label,";
257  $sql .= ' b.fk_account';
258  $sql .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as t";
259  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id";
260  $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid';
261  $sql .= " WHERE t.rowid = ".((int) $id);
262 
263  dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
264  $resql = $this->db->query($sql);
265  if ($resql) {
266  if ($this->db->num_rows($resql)) {
267  $obj = $this->db->fetch_object($resql);
268 
269  $this->id = $obj->rowid;
270  $this->ref = $obj->rowid;
271 
272  $this->fk_expensereport = $obj->fk_expensereport;
273  $this->datec = $this->db->jdate($obj->datec);
274  $this->tms = $this->db->jdate($obj->tms);
275  $this->datep = $this->db->jdate($obj->datep);
276  $this->amount = $obj->amount;
277  $this->fk_typepayment = $obj->fk_typepayment;
278  $this->num_payment = $obj->num_payment;
279  $this->note_public = $obj->note_public;
280  $this->fk_bank = $obj->fk_bank;
281  $this->fk_user_creat = $obj->fk_user_creat;
282  $this->fk_user_modif = $obj->fk_user_modif;
283 
284  $this->type_code = $obj->type_code;
285  $this->type_label = $obj->type_label;
286 
287  $this->bank_account = $obj->fk_account;
288  $this->bank_line = $obj->fk_bank;
289  }
290  $this->db->free($resql);
291 
292  return 1;
293  } else {
294  $this->error = "Error ".$this->db->lasterror();
295  return -1;
296  }
297  }
298 
299  // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter
307  public function update($user = null, $notrigger = 0)
308  {
309  // phpcs:enable
310  $error = 0;
311 
312  // Clean parameters
313 
314  if (isset($this->fk_expensereport)) {
315  $this->fk_expensereport = (int) $this->fk_expensereport;
316  }
317  if (isset($this->amount)) {
318  $this->amount = (float) $this->amount;
319  }
320  if (isset($this->fk_typepayment)) {
321  $this->fk_typepayment = (int) $this->fk_typepayment;
322  }
323  if (isset($this->num_payment)) {
324  $this->num_payment = trim($this->num_payment);
325  }
326  if (isset($this->note)) {
327  $this->note = trim($this->note);
328  }
329  if (isset($this->fk_bank)) {
330  $this->fk_bank = (int) $this->fk_bank;
331  }
332  if (isset($this->fk_user_creat)) {
333  $this->fk_user_creat = (int) $this->fk_user_creat;
334  }
335  if (isset($this->fk_user_modif)) {
336  $this->fk_user_modif = (int) $this->fk_user_modif;
337  }
338 
339  // Update request
340  $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET";
341  $sql .= " fk_expensereport=".(isset($this->fk_expensereport) ? $this->fk_expensereport : "null").",";
342  $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
343  $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
344  $sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
345  $sql .= " amount=".(isset($this->amount) ? $this->amount : "null").",";
346  $sql .= " fk_typepayment=".(isset($this->fk_typepayment) ? $this->fk_typepayment : "null").",";
347  $sql .= " num_payment=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").",";
348  $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").",";
349  $sql .= " fk_bank=".(isset($this->fk_bank) ? $this->fk_bank : "null").",";
350  $sql .= " fk_user_creat=".(isset($this->fk_user_creat) ? $this->fk_user_creat : "null").",";
351  $sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? $this->fk_user_modif : "null");
352  $sql .= " WHERE rowid=".((int) $this->id);
353 
354  $this->db->begin();
355 
356  dol_syslog(get_class($this)."::update", LOG_DEBUG);
357  $resql = $this->db->query($sql);
358  if (!$resql) {
359  $error++;
360  $this->errors[] = "Error ".$this->db->lasterror();
361  }
362 
363  // Commit or rollback
364  if ($error) {
365  foreach ($this->errors as $errmsg) {
366  dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
367  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
368  }
369  $this->db->rollback();
370  return -1 * $error;
371  } else {
372  $this->db->commit();
373  return 1;
374  }
375  }
376 
377  // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter
385  public function delete($user, $notrigger = 0)
386  {
387  // phpcs:enable
388  $error = 0;
389 
390  $this->db->begin();
391 
392  if (!$error) {
393  $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url";
394  $sql .= " WHERE type='payment_expensereport' AND url_id=".((int) $this->id);
395 
396  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
397  $resql = $this->db->query($sql);
398  if (!$resql) {
399  $error++;
400  $this->errors[] = "Error ".$this->db->lasterror();
401  }
402  }
403 
404  if (!$error) {
405  $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_expensereport";
406  $sql .= " WHERE rowid=".((int) $this->id);
407 
408  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
409  $resql = $this->db->query($sql);
410  if (!$resql) {
411  $error++;
412  $this->errors[] = "Error ".$this->db->lasterror();
413  }
414  }
415 
416  // Commit or rollback
417  if ($error) {
418  foreach ($this->errors as $errmsg) {
419  dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
420  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
421  }
422  $this->db->rollback();
423  return -1 * $error;
424  } else {
425  $this->db->commit();
426  return 1;
427  }
428  }
429 
430 
431 
439  public function createFromClone(User $user, $fromid)
440  {
441  $error = 0;
442 
443  $object = new PaymentExpenseReport($this->db);
444 
445  $this->db->begin();
446 
447  // Load source object
448  $object->fetch($fromid);
449  $object->id = 0;
450  $object->statut = 0;
451 
452  // Clear fields
453  // ...
454 
455  // Create clone
456  $object->context['createfromclone'] = 'createfromclone';
457  $result = $object->create($user);
458 
459  // Other options
460  if ($result < 0) {
461  $this->error = $object->error;
462  $error++;
463  }
464 
465  unset($object->context['createfromclone']);
466 
467  // End
468  if (!$error) {
469  $this->db->commit();
470  return $object->id;
471  } else {
472  $this->db->rollback();
473  return -1;
474  }
475  }
476 
477 
484  public function getLibStatut($mode = 0)
485  {
486  return '';
487  }
488 
489  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
497  public function LibStatut($status, $mode = 0)
498  {
499  // phpcs:enable
500  //global $langs;
501 
502  return '';
503  }
504 
505 
513  public function initAsSpecimen()
514  {
515  $this->id = 0;
516 
517  $this->fk_expensereport = 0;
518  $this->datec = dol_now();
519  $this->tms = dol_now();
520  $this->datep = dol_now();
521  $this->amount = 100;
522  $this->fk_typepayment = 0;
523  $this->num_payment = '123456';
524  $this->note_public = 'Public note';
525  $this->note_private = 'Private note';
526  $this->fk_bank = 0;
527  $this->fk_user_creat = 0;
528  $this->fk_user_modif = 0;
529 
530  return 1;
531  }
532 
533 
546  public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
547  {
548  global $langs;
549 
550  $error = 0;
551 
552  if (isModEnabled("bank")) {
553  include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
554 
555  $acc = new Account($this->db);
556  $acc->fetch($accountid);
557 
558  //Fix me field
559  $total = $this->amount;
560 
561  if ($mode == 'payment_expensereport') {
562  $amount = $total;
563  }
564 
565  // Insert payment into llx_bank
566  $bank_line_id = $acc->addline(
567  $this->datep,
568  $this->fk_typepayment, // Payment mode id or code ("CHQ or VIR for example")
569  $label,
570  -$amount,
571  $this->num_payment,
572  '',
573  $user,
574  $emetteur_nom,
575  $emetteur_banque
576  );
577 
578  // Update fk_bank in llx_paiement.
579  // So we will know the payment that has generated the bank transaction
580  if ($bank_line_id > 0) {
581  $result = $this->update_fk_bank($bank_line_id);
582  if ($result <= 0) {
583  $error++;
584  dol_print_error($this->db);
585  }
586 
587  // Add link 'payment', 'payment_supplier', 'payment_expensereport' in bank_url between payment and bank transaction
588  $url = '';
589  if ($mode == 'payment_expensereport') {
590  $url = DOL_URL_ROOT.'/expensereport/payment/card.php?rowid=';
591  }
592  if ($url) {
593  $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
594  if ($result <= 0) {
595  $error++;
596  dol_print_error($this->db);
597  }
598  }
599 
600  // Add link 'user' in bank_url between user and bank transaction
601  if (!$error) {
602  foreach ($this->amounts as $key => $value) { // We should have always same user but we loop in case of.
603  if ($mode == 'payment_expensereport') {
604  $fuser = new User($this->db);
605  $fuser->fetch($key);
606 
607  $result = $acc->add_url_line(
608  $bank_line_id,
609  $fuser->id,
610  DOL_URL_ROOT.'/user/card.php?id=',
611  $fuser->getFullName($langs),
612  'user'
613  );
614  if ($result <= 0) {
615  $this->error = $this->db->lasterror();
616  dol_syslog(get_class($this).'::addPaymentToBank '.$this->error);
617  $error++;
618  }
619  }
620  }
621  }
622  } else {
623  $this->error = $acc->error;
624  $this->errors = $acc->errors;
625  $error++;
626  }
627  }
628 
629  if (!$error) {
630  return 1;
631  } else {
632  return -1;
633  }
634  }
635 
636 
637  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
644  public function update_fk_bank($id_bank)
645  {
646  // phpcs:enable
647  $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET fk_bank = ".((int) $id_bank)." WHERE rowid = ".((int) $this->id);
648 
649  dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
650  $result = $this->db->query($sql);
651  if ($result) {
652  return 1;
653  } else {
654  $this->error = $this->db->error();
655  return 0;
656  }
657  }
658 
666  public function getNomUrl($withpicto = 0, $maxlen = 0)
667  {
668  global $langs, $hookmanager;
669 
670  $result = '';
671 
672  if (empty($this->ref)) {
673  $this->ref = $this->label;
674  }
675  $label = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Payment").'</u>';
676  if (isset($this->status)) {
677  $label .= ' '.$this->getLibStatut(5);
678  }
679  if (!empty($this->ref)) {
680  $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
681  }
682  if (!empty($this->datep)) {
683  $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'dayhour');
684  }
685 
686  if (!empty($this->id)) {
687  $link = '<a href="'.DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
688  $linkend = '</a>';
689 
690  if ($withpicto) {
691  $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
692  }
693  if ($withpicto && $withpicto != 2) {
694  $result .= ' ';
695  }
696  if ($withpicto != 2) {
697  $result .= $link.($maxlen ? dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
698  }
699  }
700  global $action;
701  $hookmanager->initHooks(array($this->element . 'dao'));
702  $parameters = array('id' => $this->id, 'getnomurl' => &$result);
703  $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
704  if ($reshook > 0) {
705  $result = $hookmanager->resPrint;
706  } else {
707  $result .= $hookmanager->resPrint;
708  }
709  return $result;
710  }
711 
718  public function info($id)
719  {
720  $sql = 'SELECT e.rowid, e.datec, e.fk_user_creat, e.fk_user_modif, e.tms';
721  $sql .= ' FROM '.MAIN_DB_PREFIX.'payment_expensereport as e';
722  $sql .= ' WHERE e.rowid = '.((int) $id);
723 
724  dol_syslog(get_class($this).'::info', LOG_DEBUG);
725  $result = $this->db->query($sql);
726 
727  if ($result) {
728  if ($this->db->num_rows($result)) {
729  $obj = $this->db->fetch_object($result);
730 
731  $this->id = $obj->rowid;
732 
733  $this->user_creation_id = $obj->fk_user_creat;
734  $this->user_modification_id = $obj->fk_user_modif;
735  $this->date_creation = $this->db->jdate($obj->datec);
736  $this->date_modification = $this->db->jdate($obj->tms);
737  }
738  $this->db->free($result);
739  } else {
740  dol_print_error($this->db);
741  }
742  }
743 
751  public function getKanbanView($option = '', $arraydata = null)
752  {
753  global $langs;
754 
755  $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
756 
757  $return = '<div class="box-flex-item box-flex-grow-zero">';
758  $return .= '<div class="info-box info-box-sm">';
759  $return .= '<span class="info-box-icon bg-infobox-action">';
760  $return .= img_picto('', $this->picto);
761  $return .= '</span>';
762  $return .= '<div class="info-box-content">';
763  $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>';
764  if ($selected >= 0) {
765  $return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
766  }
767  if (property_exists($this, 'datep')) {
768  $return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->datep), 'dayhour').'</span>';
769  }
770  if (property_exists($this, 'fk_typepayment')) {
771  $return .= '<br><span class="opacitymedium">'.$langs->trans("Type").'</span> : <span class="info-box-label">'.$this->fk_typepayment.'</span>';
772  }
773  if (property_exists($this, 'fk_bank') && !is_null($this->fk_bank)) {
774  $return .= '<br><span class="opacitymedium">'.$langs->trans("BankAccount").'</span> : <span class="info-box-label">'.$this->fk_bank.'</span>';
775  }
776  if (property_exists($this, 'amount')) {
777  $return .= '<br><span class="opacitymedium">'.$langs->trans("Amount").'</span> : <span class="info-box-label amount">'.price($this->amount).'</span>';
778  }
779  if (method_exists($this, 'getLibStatut')) {
780  $return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
781  }
782  $return .= '</div>';
783  $return .= '</div>';
784  $return .= '</div>';
785  return $return;
786  }
787 }
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition: card.php:58
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
Or an array listing all the potential status of the object: array: int of the status => translated la...
Definition: security.php:624
$object ref
Definition: info.php:79
Class to manage bank accounts.
Parent class of all other business classes (invoices, contracts, proposals, orders,...
Class to manage payments of expense report.
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.
fetch($id)
Load object in memory from database.
create($user)
Create payment of expense report into database.
info($id)
Tab information on object.
getLibStatut($mode=0)
Return the label of the status.
initAsSpecimen()
Initialise an instance with random values.
getKanbanView($option='', $arraydata=null)
Return clicable link of object (with eventually picto)
getNomUrl($withpicto=0, $maxlen=0)
Return clicable name (with picto eventually)
LibStatut($status, $mode=0)
Return the label of a given status.
createFromClone(User $user, $fromid)
Load an object from its id and create a new one in database.
update($user=null, $notrigger=0)
Update database.
update_fk_bank($id_bank)
Update link between the expense report payment and the generated line in llx_bank.
Class to manage Dolibarr users.
Definition: user.class.php:50
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
Definition: index.php:751
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.
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...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
td weekend span amount
Definition: global.inc.php:561
div float
Unit price before taxes.
Definition: style.css.php:963