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 as status, 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 = ".((int)
$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->status;
151 $this->
status = $obj->status;
152 $this->ref_ext = $obj->ref_ext;
153 $this->
type = $obj->type;
156 $this->
ref =
"(PROV".$this->id.
")";
158 $this->
ref = $obj->ref;
161 $this->db->free($resql);
165 $this->error = $this->db->lasterror();
180 public function create($user, $account_id, $limit, $toRemise, $notrigger = 0)
189 dol_syslog(
"RemiseCheque::Create start", LOG_DEBUG);
192 if (empty($this->
type)) {
198 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"bordereau_cheque (";
200 $sql .=
", date_bordereau";
201 $sql .=
", fk_user_author";
202 $sql .=
", fk_bank_account";
207 $sql .=
", nbcheque";
210 $sql .=
") VALUES (";
211 $sql .=
"'".$this->db->idate($now).
"'";
212 $sql .=
", '".$this->db->idate($now).
"'";
213 $sql .=
", ".((int) $user->id);
214 $sql .=
", ".((int) $account_id);
218 $sql .=
", ".((int)
$conf->entity);
221 $sql .=
", '".$this->db->escape($this->
type).
"'";
224 $resql = $this->db->query($sql);
226 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"bordereau_cheque");
227 if ($this->
id == 0) {
228 $this->errno = -1024;
229 dol_syslog(
"Remisecheque::Create Error read id ".$this->errno, LOG_ERR);
232 if ($this->
id > 0 && $this->errno == 0) {
233 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
234 $sql .=
" SET ref = '(PROV".((int) $this->
id).
")'";
235 $sql .=
" WHERE rowid=".((int) $this->
id);
237 $resql = $this->db->query($sql);
239 $this->errno = -1025;
240 dol_syslog(
"RemiseCheque::Create Error update ".$this->errno, LOG_ERR);
246 if ($this->
id > 0 && $this->errno == 0) {
247 $sql =
"SELECT b.rowid";
248 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
249 $sql .=
" WHERE b.fk_type = '".$this->db->escape($this->
type).
"'";
250 $sql .=
" AND b.amount > 0";
251 $sql .=
" AND b.fk_bordereau = 0";
252 $sql .=
" AND b.fk_account = ".((int) $account_id);
254 $sql .= $this->db->plimit($limit);
257 dol_syslog(
"RemiseCheque::Create", LOG_DEBUG);
258 $resql = $this->db->query($sql);
260 while ($row = $this->db->fetch_row($resql)) {
261 array_push($lines, $row[0]);
263 $this->db->free($resql);
265 $this->errno = -1026;
266 dol_syslog(
"RemiseCheque::Create Error ".$this->errno, LOG_ERR);
270 if ($this->
id > 0 && $this->errno == 0) {
271 foreach ($lines as $lineid) {
272 $checkremise =
false;
273 foreach ($toRemise as $linetoremise) {
274 if ($linetoremise == $lineid) {
280 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bank";
281 $sql .=
" SET fk_bordereau = ".((int) $this->
id);
282 $sql .=
" WHERE rowid = ".((int) $lineid);
284 $resql = $this->db->query($sql);
287 dol_syslog(
"RemiseCheque::Create Error update bank ".$this->errno, LOG_ERR);
293 if ($this->
id > 0 && $this->errno == 0) {
295 $this->errno = -1027;
296 dol_syslog(
"RemiseCheque::Create Error update amount ".$this->errno, LOG_ERR);
301 $this->error = $this->db->lasterror();
310 if (!$this->errno && !$notrigger) {
312 $result = $this->call_trigger(
'REMISECHEQUE_CREATE', $user);
314 $this->errno = -1029;
321 dol_syslog(
"RemiseCheque::Create end", LOG_DEBUG);
324 $this->db->rollback();
325 dol_syslog(
"RemiseCheque::Create end", LOG_DEBUG);
337 public function delete($user, $notrigger = 0)
345 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"bordereau_cheque";
346 $sql .=
" WHERE rowid = ".((int) $this->
id);
347 $sql .=
" AND entity = ".((int)
$conf->entity);
349 $resql = $this->db->query($sql);
351 $num = $this->db->affected_rows($resql);
355 dol_syslog(
"Remisecheque::Delete Erreur Lecture ID ($this->errno)");
358 if ($this->errno === 0) {
359 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bank";
360 $sql .=
" SET fk_bordereau = 0";
361 $sql .=
" WHERE fk_bordereau = ".((int) $this->
id);
363 $resql = $this->db->query($sql);
365 $this->errno = -1028;
366 dol_syslog(
"RemiseCheque::Delete ERREUR UPDATE ($this->errno)");
371 if ($this->errno === 0 && !$notrigger) {
373 $result = $this->call_trigger(
'REMISECHEQUE_DELETE', $user);
375 $this->errno = -1029;
380 if ($this->errno === 0) {
383 $this->db->rollback();
384 dol_syslog(
"RemiseCheque::Delete ROLLBACK ($this->errno)");
406 if ($this->errno == 0 && $numref) {
407 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
408 $sql .=
" SET statut = 1, ref = '".$this->db->escape($numref).
"'";
409 $sql .=
" WHERE rowid = ".((int) $this->
id);
410 $sql .=
" AND entity = ".((int)
$conf->entity);
411 $sql .=
" AND statut = 0";
413 dol_syslog(
"RemiseCheque::Validate", LOG_DEBUG);
414 $resql = $this->db->query($sql);
416 $num = $this->db->affected_rows($resql);
419 $this->
ref = $numref;
423 $this->errno = -1029;
424 dol_syslog(
"Remisecheque::validate Error ".$this->errno, LOG_ERR);
427 $this->errno = -1033;
428 $this->error = $this->db->lasterror();
429 dol_syslog(
"Remisecheque::validate Error ".$this->errno, LOG_ERR);
434 if ($this->errno == 0) {
438 $this->db->rollback();
439 dol_syslog(
"RemiseCheque::Validate ".$this->errno, LOG_ERR);
454 $langs->load(
"bills");
458 $conf->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
460 $conf->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_thyme';
462 $conf->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
472 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
474 foreach ($dirmodels as $reldir) {
478 if (is_file($dir.$file) && is_readable($dir.$file)) {
479 $mybool = (include_once $dir.$file) || $mybool;
487 $classname = preg_replace(
'/\-.*$/',
'', $classname);
489 foreach (
$conf->file->dol_document_root as $dirroot) {
490 $dir = $dirroot.
"/core/modules/cheque/";
493 if (is_file($dir.$file) && is_readable($dir.$file)) {
494 $mybool = (include_once $dir.$file) || $mybool;
500 dol_print_error(
null,
"Failed to include file ".$file);
504 $obj =
new $classname();
505 '@phan-var-force ModeleNumRefChequeReceipts $obj';
508 $numref = $obj->getNextValue(
$mysoc, $this);
514 if ($mode !=
'last' && !$numref) {
515 dol_print_error($db,
"ChequeReceipts::getNextValue ".$obj->error);
521 $langs->load(
"errors");
522 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"Bank"));
539 global
$conf, $langs;
549 $sql =
"SELECT COUNT(b.rowid) as nb,";
550 $sql .=
" SUM(CASE WHEN b.datev IS NULL OR b.datev < '".$this->db->idate($now -
$conf->bank->cheque->warning_delay).
"' THEN 1 ELSE 0 END) as nblate";
551 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
552 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
553 $sql .=
" WHERE b.fk_account = ba.rowid";
554 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
555 $sql .=
" AND b.fk_type = '".$this->db->escape($type).
"'";
556 $sql .=
" AND b.fk_bordereau = 0";
557 $sql .=
" AND b.amount > 0";
559 $resql = $this->db->query($sql);
561 $langs->load(
"banks");
564 $response->warning_delay =
$conf->bank->cheque->warning_delay / 60 / 60 / 24;
565 $response->label = $langs->trans(
"BankChecksToReceipt");
566 $response->labelShort = $langs->trans(
"BankChecksToReceiptShort");
567 $response->url = DOL_URL_ROOT.
'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank';
568 $response->img = img_object(
'',
"payment");
570 $obj = $this->db->fetch_object($resql);
572 $response->nbtodo = (int) $obj->nb;
573 $response->nbtodolate = (int) $obj->nblate;
578 dol_print_error($this->db);
579 $this->error = $this->db->error();
599 $sql =
"SELECT count(b.rowid) as nb";
600 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
601 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
602 $sql .=
" WHERE b.fk_account = ba.rowid";
603 $sql .=
" AND ba.entity IN (".getEntity(
'bank_account').
")";
604 $sql .=
" AND b.fk_type = '".$this->db->escape($type).
"'";
605 $sql .=
" AND b.amount > 0";
607 $resql = $this->db->query($sql);
609 while ($obj = $this->db->fetch_object($resql)) {
610 $this->nb[
"cheques"] = $obj->nb;
612 $this->db->free($resql);
615 dol_print_error($this->db);
616 $this->error = $this->db->error();
633 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
639 dol_syslog(
"RemiseCheque::generateDocument modele=".$modele.
" id=".$this->id, LOG_DEBUG);
641 $modelpath =
"core/modules/cheque/doc/";
643 return $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
656 dol_syslog(
"RemiseCheque::generatePdf is deprecated, use RemiseCheque::generateDocument() instead", LOG_NOTICE);
675 $sql =
"SELECT amount ";
676 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank";
677 $sql .=
" WHERE fk_bordereau = ".((int) $this->
id);
679 $resql = $this->db->query($sql);
681 while ($row = $this->db->fetch_row($resql)) {
686 $this->db->free($resql);
688 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
689 $sql .=
" SET amount = ".price2num($total);
690 $sql .=
", nbcheque = ".((int) $nb);
691 $sql .=
" WHERE rowid = ".((int) $this->
id);
692 $sql .=
" AND entity = ".((int)
$conf->entity);
694 $resql = $this->db->query($sql);
696 $this->errno = -1030;
697 dol_syslog(
"RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)");
700 $this->errno = -1031;
701 dol_syslog(
"RemiseCheque::updateAmount ERREUR SELECT ($this->errno)");
704 if ($this->errno === 0) {
707 $this->db->rollback();
708 dol_syslog(
"RemiseCheque::updateAmount ROLLBACK ($this->errno)");
725 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bank";
726 $sql .=
" SET fk_bordereau = 0";
727 $sql .=
" WHERE rowid = ".((int) $account_id);
728 $sql .=
" AND fk_bordereau = ".((int) $this->
id);
730 $resql = $this->db->query($sql);
734 $this->errno = -1032;
735 dol_syslog(
"RemiseCheque::removeCheck ERREUR UPDATE ($this->errno)");
754 $payment->fetch(0,
'0', $bank_id);
757 $bankline->fetch($bank_id);
771 $bankaccount = $payment->fk_account;
774 $sql =
'SELECT pf.fk_facture, pf.amount';
775 $sql .=
' FROM '.MAIN_DB_PREFIX.
'paiement_facture as pf';
776 $sql .=
' WHERE pf.fk_paiement = '.((int) $payment->id);
778 $resql = $this->db->query($sql);
780 $rejectedPayment =
new Paiement($this->db);
781 $rejectedPayment->amounts = array();
782 $rejectedPayment->datepaye = $rejection_date;
783 $rejectedPayment->paiementid =
dol_getIdFromCode($this->db,
'CHQ',
'c_paiement',
'code',
'id', 1);
784 $rejectedPayment->num_payment = $payment->num_payment;
786 while ($obj = $this->db->fetch_object($resql)) {
787 $invoice =
new Facture($this->db);
788 $invoice->fetch($obj->fk_facture);
789 $invoice->setUnpaid($user);
791 $rejectedPayment->amounts[$obj->fk_facture] = (float)
price2num($obj->amount) * -1;
794 $result = $rejectedPayment->create($user);
797 $result = $rejectedPayment->addPaymentToBank($user,
'payment',
'(CheckRejected)', (
int) $bankaccount,
'',
'');
799 $result = $payment->reject();
802 return $rejectedPayment->id;
804 $this->db->rollback();
808 $this->error = $rejectedPayment->error;
809 $this->errors = $rejectedPayment->errors;
810 $this->db->rollback();
814 $this->error = $rejectedPayment->error;
815 $this->errors = $rejectedPayment->errors;
816 $this->db->rollback();
820 $this->error = $this->db->lasterror();
821 $this->db->rollback();
837 if ($user->hasRight(
'banque',
'cheque')) {
838 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
839 $sql .=
" SET date_bordereau = ".($date ?
"'".$this->db->idate($date).
"'" :
'null');
840 $sql .=
" WHERE rowid = ".((int) $this->
id);
842 dol_syslog(
"RemiseCheque::set_date", LOG_DEBUG);
843 $resql = $this->db->query($sql);
845 $this->date_bordereau = $date;
848 $this->error = $this->db->error();
867 if ($user->hasRight(
'banque',
'cheque')) {
868 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
869 $sql .=
" SET ref = '".$this->db->escape((
string) $ref).
"'";
870 $sql .=
" WHERE rowid = ".((int) $this->
id);
872 dol_syslog(
"RemiseCheque::set_number", LOG_DEBUG);
873 $resql = $this->db->query($sql);
877 $this->error = $this->db->error();
895 global $user, $langs,
$conf;
899 $nownotime =
dol_mktime(0, 0, 0, $arraynow[
'mon'], $arraynow[
'mday'], $arraynow[
'year']);
903 $this->
ref =
'SPECIMEN';
905 $this->date_bordereau = $nownotime;
920 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
922 global
$conf, $langs;
926 $label =
'<u>'.$langs->trans(
"ShowCheckReceipt").
'</u>';
928 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
930 $url = DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?id='.$this->id;
932 if ($option !=
'nolink') {
934 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
935 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
936 $add_save_lastsearch_values = 1;
938 if ($add_save_lastsearch_values) {
939 $url .=
'&save_lastsearch_values=1';
944 if (empty($notooltip)) {
946 $label = $langs->trans(
"ShowCheckReceipt");
947 $linkclose .=
' alt="'.dolPrintHTMLForAttribute($label).
'"';
949 $linkclose .=
' title="'.dolPrintHTMLForAttribute($label).
'"';
950 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
952 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
955 $linkstart =
'<a href="'.$url.
'"';
956 $linkstart .= $linkclose.
'>';
959 $result .= $linkstart;
961 $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);
963 if ($withpicto != 2) {
964 $result .= $this->ref;
968 global $action, $hookmanager;
969 $hookmanager->initHooks(array($this->element .
'dao'));
970 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
971 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
973 $result = $hookmanager->resPrint;
975 $result .= $hookmanager->resPrint;
989 return $this->
LibStatut($this->statut, $mode);
1003 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
1005 $langs->load(
'compta');
1006 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'ToValidate');
1007 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
1008 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'ToValidate');
1009 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
1012 $statusType =
'status'.$status;
1013 if ($status == self::STATUS_VALIDATED) {
1014 $statusType =
'status4';
1017 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
1031 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1033 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1034 $return .=
'<div class="info-box info-box-sm">';
1035 $return .=
'<span class="info-box-icon bg-infobox-action">';
1036 $return .= img_picto(
'', $this->picto);
1037 $return .=
'</span>';
1038 $return .=
'<div class="info-box-content">';
1039 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl() : $this->ref).
'</span>';
1040 if ($selected >= 0) {
1041 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1043 if (property_exists($this,
'date_bordereau')) {
1044 $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>';
1046 if (property_exists($this,
'nbcheque')) {
1047 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Cheque",
'',
'',
'',
'', 5).
'</span> : <span class="info-box-label">'.$this->nbcheque.
'</span>';
1049 if (property_exists($this,
'account_id')) {
1050 $return .=
' | <span class="info-box-label">'.$this->account_id.
'</span>';
1052 if (method_exists($this,
'LibStatut')) {
1053 $return .=
'<br><div style="display:inline-block" class="info-box-status margintoponly">'.$this->getLibStatut(3).
'</div>';
1055 if (property_exists($this,
'amount')) {
1056 $return .=
' | <div style="display:inline-block"><span class="opacitymedium">'.$langs->trans(
"Amount").
'</span> : <span class="amount">'.
price($this->
amount).
'</div>';
1058 $return .=
'</div>';
1059 $return .=
'</div>';
1060 $return .=
'</div>';
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage bank transaction lines.
commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null)
Common function for all objects extending CommonObject for generating documents.
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 (kept for backward compatibility)
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.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Build document.
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 ...
create($user, $account_id, $limit, $toRemise, $notrigger=0)
Create a receipt to send cheques.
fetch($id, $ref='')
Load record.
loadStateBoard($type='CHQ')
Load indicators this->nb for the state board.
updateAmount()
Update the total amount.
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_now($mode='gmt')
Return date for now.
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...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
price2num($amount, $rounding='', $option=0, $currencycode='')
Function that return a number with universal decimal format (decimal separator is '.
dol_strlen($string, $stringencoding='UTF-8', $binarycount=0)
Make a strlen call.
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_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
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.
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