29require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
41 public $element =
'chequereceipt';
46 public $table_element =
'bordereau_cheque';
51 public $picto =
'payment';
78 public $date_bordereau;
86 public $account_label;
101 const STATUS_DRAFT = 0;
102 const STATUS_VALIDATED = 1;
122 public function fetch($id, $ref =
'')
126 $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,";
127 $sql .=
" bc.date_bordereau as date_bordereau, bc.type,";
128 $sql .=
" ba.label as account_label";
129 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bordereau_cheque as bc";
130 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account as ba ON bc.fk_bank_account = ba.rowid";
131 $sql .=
" WHERE bc.entity = ".$conf->entity;
133 $sql .=
" AND bc.rowid = ".((int) $id);
136 $sql .=
" AND bc.ref = '".$this->db->escape($ref).
"'";
140 $resql = $this->db->query($sql);
142 if ($obj = $this->db->fetch_object($resql)) {
143 $this->
id = $obj->rowid;
144 $this->amount = $obj->amount;
145 $this->date_bordereau = $this->db->jdate($obj->date_bordereau);
146 $this->account_id = $obj->fk_bank_account;
147 $this->account_label = $obj->account_label;
148 $this->author_id = $obj->fk_user_author;
149 $this->nbcheque = $obj->nbcheque;
150 $this->statut = $obj->statut;
151 $this->ref_ext = $obj->ref_ext;
152 $this->
type = $obj->type;
154 if ($this->statut == 0) {
155 $this->
ref =
"(PROV".$this->id.
")";
157 $this->
ref = $obj->ref;
160 $this->db->free($resql);
164 $this->error = $this->db->lasterror();
178 public function create($user, $account_id, $limit, $toRemise)
187 dol_syslog(
"RemiseCheque::Create start", LOG_DEBUG);
190 if (empty($this->
type)) {
196 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"bordereau_cheque (";
198 $sql .=
", date_bordereau";
199 $sql .=
", fk_user_author";
200 $sql .=
", fk_bank_account";
205 $sql .=
", nbcheque";
208 $sql .=
") VALUES (";
209 $sql .=
"'".$this->db->idate($now).
"'";
210 $sql .=
", '".$this->db->idate($now).
"'";
211 $sql .=
", ".((int) $user->id);
212 $sql .=
", ".((int) $account_id);
216 $sql .=
", ".((int)
$conf->entity);
219 $sql .=
", '".$this->db->escape($this->
type).
"'";
222 $resql = $this->db->query($sql);
224 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"bordereau_cheque");
225 if ($this->
id == 0) {
226 $this->errno = -1024;
227 dol_syslog(
"Remisecheque::Create Error read id ".$this->errno, LOG_ERR);
230 if ($this->
id > 0 && $this->errno == 0) {
231 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
232 $sql .=
" SET ref = '(PROV".$this->id.
")'";
233 $sql .=
" WHERE rowid=".((int) $this->
id);
235 $resql = $this->db->query($sql);
237 $this->errno = -1025;
238 dol_syslog(
"RemiseCheque::Create Error update ".$this->errno, LOG_ERR);
244 if ($this->
id > 0 && $this->errno == 0) {
245 $sql =
"SELECT b.rowid";
246 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
247 $sql .=
" WHERE b.fk_type = '".$this->db->escape($this->
type).
"'";
248 $sql .=
" AND b.amount > 0";
249 $sql .=
" AND b.fk_bordereau = 0";
250 $sql .=
" AND b.fk_account = ".((int) $account_id);
252 $sql .= $this->db->plimit($limit);
255 dol_syslog(
"RemiseCheque::Create", LOG_DEBUG);
256 $resql = $this->db->query($sql);
258 while ($row = $this->db->fetch_row($resql)) {
259 array_push($lines, $row[0]);
261 $this->db->free($resql);
263 $this->errno = -1026;
264 dol_syslog(
"RemiseCheque::Create Error ".$this->errno, LOG_ERR);
268 if ($this->
id > 0 && $this->errno == 0) {
269 foreach ($lines as $lineid) {
270 $checkremise =
false;
271 foreach ($toRemise as $linetoremise) {
272 if ($linetoremise == $lineid) {
278 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bank";
279 $sql .=
" SET fk_bordereau = ".((int) $this->
id);
280 $sql .=
" WHERE rowid = ".((int) $lineid);
282 $resql = $this->db->query($sql);
285 dol_syslog(
"RemiseCheque::Create Error update bank ".$this->errno, LOG_ERR);
291 if ($this->
id > 0 && $this->errno == 0) {
293 $this->errno = -1027;
294 dol_syslog(
"RemiseCheque::Create Error update amount ".$this->errno, LOG_ERR);
299 $this->error = $this->db->lasterror();
310 dol_syslog(
"RemiseCheque::Create end", LOG_DEBUG);
313 $this->db->rollback();
314 dol_syslog(
"RemiseCheque::Create end", LOG_DEBUG);
325 public function delete($user)
333 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"bordereau_cheque";
334 $sql .=
" WHERE rowid = ".((int) $this->
id);
335 $sql .=
" AND entity = ".$conf->entity;
337 $resql = $this->db->query($sql);
339 $num = $this->db->affected_rows($resql);
343 dol_syslog(
"Remisecheque::Delete Erreur Lecture ID ($this->errno)");
346 if ($this->errno === 0) {
347 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bank";
348 $sql .=
" SET fk_bordereau = 0";
349 $sql .=
" WHERE fk_bordereau = ".((int) $this->
id);
351 $resql = $this->db->query($sql);
353 $this->errno = -1028;
354 dol_syslog(
"RemiseCheque::Delete ERREUR UPDATE ($this->errno)");
359 if ($this->errno === 0) {
362 $this->db->rollback();
363 dol_syslog(
"RemiseCheque::Delete ROLLBACK ($this->errno)");
385 if ($this->errno == 0 && $numref) {
386 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
387 $sql .=
" SET statut = 1, ref = '".$this->db->escape($numref).
"'";
388 $sql .=
" WHERE rowid = ".((int) $this->
id);
389 $sql .=
" AND entity = ".((int)
$conf->entity);
390 $sql .=
" AND statut = 0";
392 dol_syslog(
"RemiseCheque::Validate", LOG_DEBUG);
393 $resql = $this->db->query($sql);
395 $num = $this->db->affected_rows($resql);
398 $this->
ref = $numref;
402 $this->errno = -1029;
403 dol_syslog(
"Remisecheque::validate Error ".$this->errno, LOG_ERR);
406 $this->errno = -1033;
407 $this->error = $this->db->lasterror();
408 dol_syslog(
"Remisecheque::validate Error ".$this->errno, LOG_ERR);
413 if ($this->errno == 0) {
417 $this->db->rollback();
418 dol_syslog(
"RemiseCheque::Validate ".$this->errno, LOG_ERR);
432 global
$conf, $db, $langs, $mysoc;
433 $langs->load(
"bills");
437 $conf->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
439 $conf->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_thyme';
441 $conf->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
451 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
453 foreach ($dirmodels as $reldir) {
457 if (is_file($dir.$file) && is_readable($dir.$file)) {
458 $mybool = (include_once $dir.$file) || $mybool;
466 $classname = preg_replace(
'/\-.*$/',
'', $classname);
468 foreach (
$conf->file->dol_document_root as $dirroot) {
469 $dir = $dirroot.
"/core/modules/cheque/";
472 if (is_file($dir.$file) && is_readable($dir.$file)) {
473 $mybool = (include_once $dir.$file) || $mybool;
483 $obj =
new $classname();
484 '@phan-var-force ModeleNumRefChequeReceipts $obj';
487 $numref = $obj->getNextValue($mysoc, $this);
493 if ($mode !=
'last' && !$numref) {
500 $langs->load(
"errors");
501 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"Bank"));
518 global
$conf, $langs;
524 $sql =
"SELECT b.rowid, b.datev as datefin";
525 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
526 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
527 $sql .=
" WHERE b.fk_account = ba.rowid";
528 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
529 $sql .=
" AND b.fk_type = '".$this->db->escape($type).
"'";
530 $sql .=
" AND b.fk_bordereau = 0";
531 $sql .=
" AND b.amount > 0";
533 $resql = $this->db->query($sql);
535 $langs->load(
"banks");
539 $response->warning_delay =
$conf->bank->cheque->warning_delay / 60 / 60 / 24;
540 $response->label = $langs->trans(
"BankChecksToReceipt");
541 $response->labelShort = $langs->trans(
"BankChecksToReceiptShort");
542 $response->url = DOL_URL_ROOT.
'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank';
545 while ($obj = $this->db->fetch_object($resql)) {
548 if ($this->db->jdate($obj->datefin) < ($now -
$conf->bank->cheque->warning_delay)) {
549 $response->nbtodolate++;
556 $this->error = $this->db->error();
576 $sql =
"SELECT count(b.rowid) as nb";
577 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
578 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
579 $sql .=
" WHERE b.fk_account = ba.rowid";
580 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
581 $sql .=
" AND b.fk_type = '".$this->db->escape($type).
"'";
582 $sql .=
" AND b.amount > 0";
584 $resql = $this->db->query($sql);
586 while ($obj = $this->db->fetch_object($resql)) {
587 $this->nb[
"cheques"] = $obj->nb;
589 $this->db->free($resql);
593 $this->error = $this->db->error();
608 global $langs,
$conf;
614 dol_syslog(
"RemiseCheque::generatePdf model=".$model.
" id=".$this->id, LOG_DEBUG);
616 $dir = DOL_DOCUMENT_ROOT.
"/core/modules/cheque/doc/";
619 $file =
"pdf_".$model.
".class.php";
620 if (file_exists($dir.$file)) {
621 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
622 include_once $dir.$file;
624 $classname =
'BordereauCheque'.ucfirst($model);
625 $docmodel =
new $classname($this->db);
626 '@phan-var-force ModeleChequeReceipts $docmodel';
628 $sql =
"SELECT b.banque, b.emetteur, b.amount, b.num_chq";
629 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
630 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
631 $sql .=
", ".MAIN_DB_PREFIX.
"bordereau_cheque as bc";
632 $sql .=
" WHERE b.fk_account = ba.rowid";
633 $sql .=
" AND b.fk_bordereau = bc.rowid";
634 $sql .=
" AND bc.rowid = ".((int) $this->
id);
635 $sql .=
" AND bc.entity = ".$conf->entity;
636 $sql .=
" ORDER BY b.dateo ASC, b.rowid ASC";
638 dol_syslog(
"RemiseCheque::generatePdf", LOG_DEBUG);
639 $result = $this->db->query($sql);
642 while ($objp = $this->db->fetch_object($result)) {
643 $docmodel->lines[$i] =
new stdClass();
644 $docmodel->lines[$i]->bank_chq = $objp->banque;
645 $docmodel->lines[$i]->emetteur_chq = $objp->emetteur;
646 $docmodel->lines[$i]->amount_chq = $objp->amount;
647 $docmodel->lines[$i]->num_chq = $objp->num_chq;
651 $docmodel->nbcheque = $this->nbcheque;
652 $docmodel->ref = $this->ref;
653 $docmodel->amount = $this->amount;
654 $docmodel->date = $this->date_bordereau;
656 $account =
new Account($this->db);
657 $account->fetch($this->account_id);
659 $docmodel->account = &$account;
663 $sav_charset_output = $outputlangs->charset_output;
665 $result = $docmodel->write_file($this,
$conf->bank->dir_output.
'/checkdeposits', $this->ref, $outputlangs);
676 $this->error = $langs->trans(
"ErrorFileDoesNotExists", $dir.$file);
695 $sql =
"SELECT amount ";
696 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank";
697 $sql .=
" WHERE fk_bordereau = ".((int) $this->
id);
699 $resql = $this->db->query($sql);
701 while ($row = $this->db->fetch_row($resql)) {
706 $this->db->free($resql);
708 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
709 $sql .=
" SET amount = ".price2num($total);
710 $sql .=
", nbcheque = ".((int) $nb);
711 $sql .=
" WHERE rowid = ".((int) $this->
id);
712 $sql .=
" AND entity = ".((int)
$conf->entity);
714 $resql = $this->db->query($sql);
716 $this->errno = -1030;
717 dol_syslog(
"RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)");
720 $this->errno = -1031;
721 dol_syslog(
"RemiseCheque::updateAmount ERREUR SELECT ($this->errno)");
724 if ($this->errno === 0) {
727 $this->db->rollback();
728 dol_syslog(
"RemiseCheque::updateAmount ROLLBACK ($this->errno)");
745 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bank";
746 $sql .=
" SET fk_bordereau = 0";
747 $sql .=
" WHERE rowid = ".((int) $account_id);
748 $sql .=
" AND fk_bordereau = ".((int) $this->
id);
750 $resql = $this->db->query($sql);
754 $this->errno = -1032;
755 dol_syslog(
"RemiseCheque::removeCheck ERREUR UPDATE ($this->errno)");
774 $payment->fetch(0, 0, $bank_id);
777 $bankline->fetch($bank_id);
791 $bankaccount = $payment->fk_account;
794 $sql =
'SELECT pf.fk_facture, pf.amount';
795 $sql .=
' FROM '.MAIN_DB_PREFIX.
'paiement_facture as pf';
796 $sql .=
' WHERE pf.fk_paiement = '.((int) $payment->id);
798 $resql = $this->db->query($sql);
800 $rejectedPayment =
new Paiement($this->db);
801 $rejectedPayment->amounts = array();
802 $rejectedPayment->datepaye = $rejection_date;
803 $rejectedPayment->paiementid =
dol_getIdFromCode($this->db,
'CHQ',
'c_paiement',
'code',
'id', 1);
804 $rejectedPayment->num_payment = $payment->num_payment;
806 while ($obj = $this->db->fetch_object($resql)) {
807 $invoice =
new Facture($this->db);
808 $invoice->fetch($obj->fk_facture);
809 $invoice->setUnpaid($user);
811 $rejectedPayment->amounts[$obj->fk_facture] = (float)
price2num($obj->amount) * -1;
814 $result = $rejectedPayment->create($user);
817 $result = $rejectedPayment->addPaymentToBank($user,
'payment',
'(CheckRejected)', $bankaccount,
'',
'');
819 $result = $payment->reject();
822 return $rejectedPayment->id;
824 $this->db->rollback();
828 $this->error = $rejectedPayment->error;
829 $this->errors = $rejectedPayment->errors;
830 $this->db->rollback();
834 $this->error = $rejectedPayment->error;
835 $this->errors = $rejectedPayment->errors;
836 $this->db->rollback();
840 $this->error = $this->db->lasterror();
841 $this->db->rollback();
857 if ($user->hasRight(
'banque',
'cheque')) {
858 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
859 $sql .=
" SET date_bordereau = ".($date ?
"'".$this->db->idate($date).
"'" :
'null');
860 $sql .=
" WHERE rowid = ".((int) $this->
id);
862 dol_syslog(
"RemiseCheque::set_date", LOG_DEBUG);
863 $resql = $this->db->query($sql);
865 $this->date_bordereau = $date;
868 $this->error = $this->db->error();
887 if ($user->hasRight(
'banque',
'cheque')) {
888 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
889 $sql .=
" SET ref = '".$this->db->escape($ref).
"'";
890 $sql .=
" WHERE rowid = ".((int) $this->
id);
892 dol_syslog(
"RemiseCheque::set_number", LOG_DEBUG);
893 $resql = $this->db->query($sql);
897 $this->error = $this->db->error();
915 global $user, $langs,
$conf;
919 $nownotime =
dol_mktime(0, 0, 0, $arraynow[
'mon'], $arraynow[
'mday'], $arraynow[
'year']);
923 $this->
ref =
'SPECIMEN';
925 $this->date_bordereau = $nownotime;
940 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
942 global
$conf, $langs;
946 $label =
'<u>'.$langs->trans(
"ShowCheckReceipt").
'</u>';
948 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
950 $url = DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?id='.$this->id;
952 if ($option !=
'nolink') {
954 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
955 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
956 $add_save_lastsearch_values = 1;
958 if ($add_save_lastsearch_values) {
959 $url .=
'&save_lastsearch_values=1';
964 if (empty($notooltip)) {
966 $label = $langs->trans(
"ShowCheckReceipt");
967 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
969 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
970 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
972 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
975 $linkstart =
'<a href="'.$url.
'"';
976 $linkstart .= $linkclose.
'>';
979 $result .= $linkstart;
981 $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);
983 if ($withpicto != 2) {
984 $result .= $this->ref;
999 return $this->
LibStatut($this->statut, $mode);
1013 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
1015 $langs->load(
'compta');
1016 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'ToValidate');
1017 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
1018 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'ToValidate');
1019 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
1022 $statusType =
'status'.$status;
1023 if ($status == self::STATUS_VALIDATED) {
1024 $statusType =
'status4';
1027 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
1041 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1043 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1044 $return .=
'<div class="info-box info-box-sm">';
1045 $return .=
'<span class="info-box-icon bg-infobox-action">';
1047 $return .=
'</span>';
1048 $return .=
'<div class="info-box-content">';
1049 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl() : $this->ref).
'</span>';
1050 if ($selected >= 0) {
1051 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1053 if (property_exists($this,
'date_bordereau')) {
1054 $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>';
1056 if (property_exists($this,
'nbcheque')) {
1057 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Cheque",
'',
'',
'',
'', 5).
'</span> : <span class="info-box-label">'.$this->nbcheque.
'</span>';
1059 if (property_exists($this,
'account_id')) {
1060 $return .=
' | <span class="info-box-label">'.$this->account_id.
'</span>';
1062 if (method_exists($this,
'LibStatut')) {
1063 $return .=
'<br><div style="display:inline-block" class="info-box-status margintoponly">'.$this->getLibStatut(3).
'</div>';
1065 if (property_exists($this,
'amount')) {
1066 $return .=
' | <div style="display:inline-block"><span class="opacitymedium">'.$langs->trans(
"Amount").
'</span> : <span class="amount">'.
price($this->amount).
'</div>';
1068 $return .=
'</div>';
1069 $return .=
'</div>';
1070 $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 clickable name (with picto eventually)
getKanbanView($option='', $arraydata=null)
Return clickable 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.
loadStateBoard($type='CHQ')
Load indicators this->nb for the state board.
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.
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_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
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.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
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).
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type