27require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
39 public $element =
'chequereceipt';
44 public $table_element =
'bordereau_cheque';
49 public $picto =
'payment';
59 public $date_bordereau;
61 public $account_label;
70 const STATUS_DRAFT = 0;
71 const STATUS_VALIDATED = 1;
91 public function fetch($id, $ref =
'')
95 $sql =
"SELECT bc.rowid, bc.datec, bc.fk_user_author, bc.fk_bank_account, bc.amount, bc.ref, bc.statut, bc.nbcheque, bc.ref_ext,";
96 $sql .=
" bc.date_bordereau as date_bordereau, bc.type,";
97 $sql .=
" ba.label as account_label";
98 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bordereau_cheque as bc";
99 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON bc.fk_bank_account = ba.rowid";
100 $sql .=
" WHERE bc.entity = ".$conf->entity;
102 $sql .=
" AND bc.rowid = ".((int) $id);
105 $sql .=
" AND bc.ref = '".$this->db->escape($ref).
"'";
109 $resql = $this->db->query($sql);
111 if ($obj = $this->db->fetch_object($resql)) {
112 $this->
id = $obj->rowid;
113 $this->amount = $obj->amount;
114 $this->date_bordereau = $this->db->jdate($obj->date_bordereau);
115 $this->account_id = $obj->fk_bank_account;
116 $this->account_label = $obj->account_label;
117 $this->author_id = $obj->fk_user_author;
118 $this->nbcheque = $obj->nbcheque;
119 $this->
statut = $obj->statut;
120 $this->ref_ext = $obj->ref_ext;
121 $this->
type = $obj->type;
124 $this->
ref =
"(PROV".$this->id.
")";
126 $this->
ref = $obj->ref;
129 $this->db->free($resql);
133 $this->error = $this->db->lasterror();
147 public function create($user, $account_id, $limit, $toRemise)
156 dol_syslog(
"RemiseCheque::Create start", LOG_DEBUG);
159 if (empty($this->
type)) {
165 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"bordereau_cheque (";
167 $sql .=
", date_bordereau";
168 $sql .=
", fk_user_author";
169 $sql .=
", fk_bank_account";
174 $sql .=
", nbcheque";
177 $sql .=
") VALUES (";
178 $sql .=
"'".$this->db->idate($now).
"'";
179 $sql .=
", '".$this->db->idate($now).
"'";
180 $sql .=
", ".((int) $user->id);
181 $sql .=
", ".((int) $account_id);
185 $sql .=
", ".((int) $conf->entity);
188 $sql .=
", '".$this->db->escape($this->
type).
"'";
191 $resql = $this->db->query($sql);
193 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"bordereau_cheque");
194 if ($this->
id == 0) {
195 $this->errno = -1024;
196 dol_syslog(
"Remisecheque::Create Error read id ".$this->errno, LOG_ERR);
199 if ($this->
id > 0 && $this->errno == 0) {
200 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
201 $sql .=
" SET ref = '(PROV".$this->id.
")'";
202 $sql .=
" WHERE rowid=".((int) $this->
id);
204 $resql = $this->db->query($sql);
206 $this->errno = -1025;
207 dol_syslog(
"RemiseCheque::Create Error update ".$this->errno, LOG_ERR);
213 if ($this->
id > 0 && $this->errno == 0) {
214 $sql =
"SELECT b.rowid";
215 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
216 $sql .=
" WHERE b.fk_type = '".$this->db->escape($this->
type).
"'";
217 $sql .=
" AND b.amount > 0";
218 $sql .=
" AND b.fk_bordereau = 0";
219 $sql .=
" AND b.fk_account = ".((int) $account_id);
221 $sql .= $this->db->plimit($limit);
224 dol_syslog(
"RemiseCheque::Create", LOG_DEBUG);
225 $resql = $this->db->query($sql);
227 while ($row = $this->db->fetch_row($resql)) {
228 array_push($lines, $row[0]);
230 $this->db->free($resql);
232 $this->errno = -1026;
233 dol_syslog(
"RemiseCheque::Create Error ".$this->errno, LOG_ERR);
237 if ($this->
id > 0 && $this->errno == 0) {
238 foreach ($lines as $lineid) {
239 $checkremise =
false;
240 foreach ($toRemise as $linetoremise) {
241 if ($linetoremise == $lineid) {
247 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bank";
248 $sql .=
" SET fk_bordereau = ".((int) $this->
id);
249 $sql .=
" WHERE rowid = ".((int) $lineid);
251 $resql = $this->db->query($sql);
254 dol_syslog(
"RemiseCheque::Create Error update bank ".$this->errno, LOG_ERR);
260 if ($this->
id > 0 && $this->errno == 0) {
262 $this->errno = -1027;
263 dol_syslog(
"RemiseCheque::Create Error update amount ".$this->errno, LOG_ERR);
268 $this->error = $this->db->lasterror();
269 $this->errno = $this->db->lasterrno();
279 dol_syslog(
"RemiseCheque::Create end", LOG_DEBUG);
282 $this->db->rollback();
283 dol_syslog(
"RemiseCheque::Create end", LOG_DEBUG);
294 public function delete($user =
null)
302 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"bordereau_cheque";
303 $sql .=
" WHERE rowid = ".((int) $this->
id);
304 $sql .=
" AND entity = ".$conf->entity;
306 $resql = $this->db->query($sql);
308 $num = $this->db->affected_rows($resql);
312 dol_syslog(
"Remisecheque::Delete Erreur Lecture ID ($this->errno)");
315 if ($this->errno === 0) {
316 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bank";
317 $sql .=
" SET fk_bordereau = 0";
318 $sql .=
" WHERE fk_bordereau = ".((int) $this->
id);
320 $resql = $this->db->query($sql);
322 $this->errno = -1028;
323 dol_syslog(
"RemiseCheque::Delete ERREUR UPDATE ($this->errno)");
328 if ($this->errno === 0) {
331 $this->db->rollback();
332 dol_syslog(
"RemiseCheque::Delete ROLLBACK ($this->errno)");
346 global $langs, $conf;
354 if ($this->errno == 0 && $numref) {
355 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
356 $sql .=
" SET statut = 1, ref = '".$this->db->escape($numref).
"'";
357 $sql .=
" WHERE rowid = ".((int) $this->
id);
358 $sql .=
" AND entity = ".$conf->entity;
359 $sql .=
" AND statut = 0";
361 dol_syslog(
"RemiseCheque::Validate", LOG_DEBUG);
362 $resql = $this->db->query($sql);
364 $num = $this->db->affected_rows($resql);
367 $this->
ref = $numref;
370 $this->errno = -1029;
371 dol_syslog(
"Remisecheque::Validate Error ".$this->errno, LOG_ERR);
374 $this->errno = -1033;
375 dol_syslog(
"Remisecheque::Validate Error ".$this->errno, LOG_ERR);
380 if ($this->errno == 0) {
384 $this->db->rollback();
385 dol_syslog(
"RemiseCheque::Validate ".$this->errno, LOG_ERR);
399 global $conf, $db, $langs, $mysoc;
400 $langs->load(
"bills");
404 $conf->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
406 $conf->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_thyme';
408 $conf->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
415 $classname = $conf->global->CHEQUERECEIPTS_ADDON;
418 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
420 foreach ($dirmodels as $reldir) {
424 if (is_file($dir.$file) && is_readable($dir.$file)) {
425 $mybool |= include_once $dir.$file;
433 $classname = preg_replace(
'/\-.*$/',
'', $classname);
435 foreach ($conf->file->dol_document_root as $dirroot) {
436 $dir = $dirroot.
"/core/modules/cheque/";
439 if (is_file($dir.$file) && is_readable($dir.$file)) {
440 $mybool |= include_once $dir.$file;
450 $obj =
new $classname();
452 $numref = $obj->getNextValue($mysoc, $this);
458 if ($mode !=
'last' && !$numref) {
465 $langs->load(
"errors");
466 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"Bank"));
483 global $conf, $langs;
489 $sql =
"SELECT b.rowid, b.datev as datefin";
490 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
491 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
492 $sql .=
" WHERE b.fk_account = ba.rowid";
493 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
494 $sql .=
" AND b.fk_type = '".$this->db->escape($type).
"'";
495 $sql .=
" AND b.fk_bordereau = 0";
496 $sql .=
" AND b.amount > 0";
498 $resql = $this->db->query($sql);
500 $langs->load(
"banks");
504 $response->warning_delay = $conf->bank->cheque->warning_delay / 60 / 60 / 24;
505 $response->label = $langs->trans(
"BankChecksToReceipt");
506 $response->labelShort = $langs->trans(
"BankChecksToReceiptShort");
507 $response->url = DOL_URL_ROOT.
'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank';
510 while ($obj = $this->db->fetch_object($resql)) {
513 if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->cheque->warning_delay)) {
514 $response->nbtodolate++;
521 $this->error = $this->db->error();
543 $sql =
"SELECT count(b.rowid) as nb";
544 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
545 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
546 $sql .=
" WHERE b.fk_account = ba.rowid";
547 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
548 $sql .=
" AND b.fk_type = '".$this->db->escape($type).
"'";
549 $sql .=
" AND b.amount > 0";
551 $resql = $this->db->query($sql);
553 while ($obj = $this->db->fetch_object($resql)) {
554 $this->nb[
"cheques"] = $obj->nb;
556 $this->db->free($resql);
560 $this->error = $this->db->error();
575 global $langs, $conf;
581 dol_syslog(
"RemiseCheque::generatePdf model=".$model.
" id=".$this->id, LOG_DEBUG);
583 $dir = DOL_DOCUMENT_ROOT.
"/core/modules/cheque/doc/";
586 $file =
"pdf_".$model.
".class.php";
587 if (file_exists($dir.$file)) {
588 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
589 include_once $dir.$file;
591 $classname =
'BordereauCheque'.ucfirst($model);
592 $docmodel =
new $classname($this->db);
594 $sql =
"SELECT b.banque, b.emetteur, b.amount, b.num_chq";
595 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
596 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
597 $sql .=
", ".MAIN_DB_PREFIX.
"bordereau_cheque as bc";
598 $sql .=
" WHERE b.fk_account = ba.rowid";
599 $sql .=
" AND b.fk_bordereau = bc.rowid";
600 $sql .=
" AND bc.rowid = ".((int) $this->
id);
601 $sql .=
" AND bc.entity = ".$conf->entity;
602 $sql .=
" ORDER BY b.dateo ASC, b.rowid ASC";
604 dol_syslog(
"RemiseCheque::generatePdf", LOG_DEBUG);
605 $result = $this->db->query($sql);
608 while ($objp = $this->db->fetch_object($result)) {
609 $docmodel->lines[$i] =
new stdClass();
610 $docmodel->lines[$i]->bank_chq = $objp->banque;
611 $docmodel->lines[$i]->emetteur_chq = $objp->emetteur;
612 $docmodel->lines[$i]->amount_chq = $objp->amount;
613 $docmodel->lines[$i]->num_chq = $objp->num_chq;
617 $docmodel->nbcheque = $this->nbcheque;
618 $docmodel->ref = $this->ref;
619 $docmodel->amount = $this->amount;
620 $docmodel->date = $this->date_bordereau;
622 $account =
new Account($this->db);
623 $account->fetch($this->account_id);
625 $docmodel->account = &$account;
629 $sav_charset_output = $outputlangs->charset_output;
631 $result = $docmodel->write_file($this, $conf->bank->dir_output.
'/checkdeposits', $this->ref, $outputlangs);
642 $this->error = $langs->trans(
"ErrorFileDoesNotExists", $dir.$file);
661 $sql =
"SELECT amount ";
662 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank";
663 $sql .=
" WHERE fk_bordereau = ".((int) $this->
id);
665 $resql = $this->db->query($sql);
667 while ($row = $this->db->fetch_row($resql)) {
672 $this->db->free($resql);
674 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
675 $sql .=
" SET amount = ".price2num($total);
676 $sql .=
", nbcheque = ".((int) $nb);
677 $sql .=
" WHERE rowid = ".((int) $this->
id);
678 $sql .=
" AND entity = ".((int) $conf->entity);
680 $resql = $this->db->query($sql);
682 $this->errno = -1030;
683 dol_syslog(
"RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)");
686 $this->errno = -1031;
687 dol_syslog(
"RemiseCheque::updateAmount ERREUR SELECT ($this->errno)");
690 if ($this->errno === 0) {
693 $this->db->rollback();
694 dol_syslog(
"RemiseCheque::updateAmount ROLLBACK ($this->errno)");
711 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bank";
712 $sql .=
" SET fk_bordereau = 0";
713 $sql .=
" WHERE rowid = ".((int) $account_id);
714 $sql .=
" AND fk_bordereau = ".((int) $this->
id);
716 $resql = $this->db->query($sql);
720 $this->errno = -1032;
721 dol_syslog(
"RemiseCheque::removeCheck ERREUR UPDATE ($this->errno)");
740 $payment->fetch(0, 0, $bank_id);
743 $bankline->fetch($bank_id);
757 $bankaccount = $payment->fk_account;
760 $sql =
'SELECT pf.fk_facture, pf.amount';
761 $sql .=
' FROM '.MAIN_DB_PREFIX.
'paiement_facture as pf';
762 $sql .=
' WHERE pf.fk_paiement = '.((int) $payment->id);
764 $resql = $this->db->query($sql);
766 $rejectedPayment =
new Paiement($this->db);
767 $rejectedPayment->amounts = array();
768 $rejectedPayment->datepaye = $rejection_date;
769 $rejectedPayment->paiementid =
dol_getIdFromCode($this->db,
'CHQ',
'c_paiement',
'code',
'id', 1);
770 $rejectedPayment->num_payment = $payment->num_payment;
772 while ($obj = $this->db->fetch_object($resql)) {
773 $invoice =
new Facture($this->db);
774 $invoice->fetch($obj->fk_facture);
775 $invoice->setUnpaid($user);
777 $rejectedPayment->amounts[$obj->fk_facture] =
price2num($obj->amount) * -1;
780 $result = $rejectedPayment->create($user);
783 $result = $rejectedPayment->addPaymentToBank($user,
'payment',
'(CheckRejected)', $bankaccount,
'',
'');
785 $result = $payment->reject();
788 return $rejectedPayment->id;
790 $this->db->rollback();
794 $this->error = $rejectedPayment->error;
795 $this->errors = $rejectedPayment->errors;
796 $this->db->rollback();
800 $this->error = $rejectedPayment->error;
801 $this->errors = $rejectedPayment->errors;
802 $this->db->rollback();
806 $this->error = $this->db->lasterror();
807 $this->db->rollback();
823 if ($user->hasRight(
'banque',
'cheque')) {
824 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
825 $sql .=
" SET date_bordereau = ".($date ?
"'".$this->db->idate($date).
"'" :
'null');
826 $sql .=
" WHERE rowid = ".((int) $this->
id);
828 dol_syslog(
"RemiseCheque::set_date", LOG_DEBUG);
829 $resql = $this->db->query($sql);
831 $this->date_bordereau = $date;
834 $this->error = $this->db->error();
853 if ($user->hasRight(
'banque',
'cheque')) {
854 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
855 $sql .=
" SET ref = '".$this->db->escape($ref).
"'";
856 $sql .=
" WHERE rowid = ".((int) $this->
id);
858 dol_syslog(
"RemiseCheque::set_number", LOG_DEBUG);
859 $resql = $this->db->query($sql);
863 $this->error = $this->db->error();
881 global $user, $langs, $conf;
885 $nownotime =
dol_mktime(0, 0, 0, $arraynow[
'mon'], $arraynow[
'mday'], $arraynow[
'year']);
889 $this->
ref =
'SPECIMEN';
891 $this->date_bordereau = $nownotime;
904 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
906 global $conf, $langs;
910 $label =
'<u>'.$langs->trans(
"ShowCheckReceipt").
'</u>';
912 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
914 $url = DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?id='.$this->id;
916 if ($option !=
'nolink') {
918 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
919 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
920 $add_save_lastsearch_values = 1;
922 if ($add_save_lastsearch_values) {
923 $url .=
'&save_lastsearch_values=1';
928 if (empty($notooltip)) {
930 $label = $langs->trans(
"ShowCheckReceipt");
931 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
933 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
934 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
936 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
939 $linkstart =
'<a href="'.$url.
'"';
940 $linkstart .= $linkclose.
'>';
943 $result .= $linkstart;
945 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
947 if ($withpicto != 2) {
948 $result .= $this->ref;
977 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
979 $langs->load(
'compta');
980 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'ToValidate');
981 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
982 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'ToValidate');
983 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
986 $statusType =
'status'.$status;
987 if ($status == self::STATUS_VALIDATED) {
988 $statusType =
'status4';
991 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
1005 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1007 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1008 $return .=
'<div class="info-box info-box-sm">';
1009 $return .=
'<span class="info-box-icon bg-infobox-action">';
1011 $return .=
'</span>';
1012 $return .=
'<div class="info-box-content">';
1013 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl() : $this->ref).
'</span>';
1014 if ($selected >= 0) {
1015 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1017 if (property_exists($this,
'date_bordereau')) {
1018 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"DateCreation").
'</span> : <span class="info-box-label">'.
dol_print_date($this->db->jdate($this->date_bordereau),
'day').
'</span>';
1020 if (property_exists($this,
'nbcheque')) {
1021 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Cheque",
'',
'',
'',
'', 5).
'</span> : <span class="info-box-label">'.$this->nbcheque.
'</span>';
1023 if (property_exists($this,
'account_id')) {
1024 $return .=
' | <span class="info-box-label">'.$this->account_id.
'</span>';
1026 if (method_exists($this,
'LibStatut')) {
1027 $return .=
'<br><div style="display:inline-block" class="info-box-status margintoponly">'.$this->getLibStatut(3).
'</div>';
1029 if (property_exists($this,
'amount')) {
1030 $return .=
' | <div style="display:inline-block"><span class="opacitymedium">'.$langs->trans(
"Amount").
'</span> : <span class="amount">'.
price($this->amount).
'</div>';
1032 $return .=
'</div>';
1033 $return .=
'</div>';
1034 $return .=
'</div>';
Class to manage bank accounts.
Class to manage bank transaction lines.
Parent class of all other business classes (invoices, contracts, proposals, orders,...
Class to manage invoices.
Class to manage payments of customer invoices.
Class to manage cheque delivery receipts.
removeCheck($account_id)
Insere la remise en base.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return clicable name (with picto eventually)
$errno
Numero d'erreur Plage 1024-1279.
load_state_board($type='CHQ')
Charge indicateurs this->nb de tableau de bord.
getKanbanView($option='', $arraydata=null)
Return clicable link of object (with eventually picto)
generatePdf($model, $outputlangs)
Build document.
LibStatut($status, $mode=0)
Return the label of a given status.
__construct($db)
Constructor.
getLibStatut($mode=0)
Return the label of the status.
set_date($user, $date)
Set the creation date.
rejectCheck($bank_id, $rejection_date)
Check return management Reopen linked invoices and create a new negative payment.
validate($user)
Validate a receipt.
set_number($user, $ref)
Set the ref of bordereau.
load_board($user, $type='CHQ')
Load indicators for dashboard (this->nbtodo and this->nbtodolate)
getNextNumRef($mode='next')
Return next reference of cheque receipts not already used (or last reference) according to numbering ...
fetch($id, $ref='')
Load record.
create($user, $account_id, $limit, $toRemise)
Create a receipt to send cheques.
updateAmount()
Mets a jour le montant total.
initAsSpecimen($option='')
Initialise an instance with random values.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
publicphonebutton2 phonegreen basiclayout basiclayout TotalHT VATCode TotalVAT TotalLT1 TotalLT2 TotalTTC TotalHT clearboth nowraponall right right takeposterminal SELECT e e e e e statut
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type