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();
631 global $langs,
$conf;
637 dol_syslog(
"RemiseCheque::generatePdf model=".$model.
" id=".$this->id, LOG_DEBUG);
639 $dir = DOL_DOCUMENT_ROOT.
"/core/modules/cheque/doc/";
642 $file =
"pdf_".$model.
".class.php";
643 if (file_exists($dir.$file)) {
644 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
645 include_once $dir.$file;
647 $classname =
'BordereauCheque'.ucfirst($model);
648 $docmodel =
new $classname($this->db);
649 '@phan-var-force ModeleChequeReceipts $docmodel';
651 $sql =
"SELECT b.banque, b.emetteur, b.amount, b.num_chq";
652 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank as b";
653 $sql .=
", ".MAIN_DB_PREFIX.
"bank_account as ba";
654 $sql .=
", ".MAIN_DB_PREFIX.
"bordereau_cheque as bc";
655 $sql .=
" WHERE b.fk_account = ba.rowid";
656 $sql .=
" AND b.fk_bordereau = bc.rowid";
657 $sql .=
" AND bc.rowid = ".((int) $this->
id);
658 $sql .=
" AND bc.entity = ".((int)
$conf->entity);
659 $sql .=
" ORDER BY b.dateo ASC, b.rowid ASC";
661 dol_syslog(
"RemiseCheque::generatePdf", LOG_DEBUG);
662 $result = $this->db->query($sql);
665 while ($objp = $this->db->fetch_object($result)) {
666 $docmodel->lines[$i] =
new stdClass();
667 $docmodel->lines[$i]->bank_chq = $objp->banque;
668 $docmodel->lines[$i]->emetteur_chq = $objp->emetteur;
669 $docmodel->lines[$i]->amount_chq = $objp->amount;
670 $docmodel->lines[$i]->num_chq = $objp->num_chq;
674 $docmodel->nbcheque = $this->nbcheque;
675 $docmodel->ref = $this->ref;
676 $docmodel->amount = $this->amount;
677 $docmodel->date = $this->date_bordereau;
679 $account =
new Account($this->db);
680 $account->fetch($this->account_id);
682 $docmodel->account = &$account;
686 $sav_charset_output = $outputlangs->charset_output;
688 $result = $docmodel->write_file($this, $outputlangs,
$conf->bank->dir_output.
'/checkdeposits', $this->ref);
695 dol_print_error($this->db, $docmodel->error);
699 $this->error = $langs->trans(
"ErrorFileDoesNotExists", $dir.$file);
718 $sql =
"SELECT amount ";
719 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank";
720 $sql .=
" WHERE fk_bordereau = ".((int) $this->
id);
722 $resql = $this->db->query($sql);
724 while ($row = $this->db->fetch_row($resql)) {
729 $this->db->free($resql);
731 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
732 $sql .=
" SET amount = ".price2num($total);
733 $sql .=
", nbcheque = ".((int) $nb);
734 $sql .=
" WHERE rowid = ".((int) $this->
id);
735 $sql .=
" AND entity = ".((int)
$conf->entity);
737 $resql = $this->db->query($sql);
739 $this->errno = -1030;
740 dol_syslog(
"RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)");
743 $this->errno = -1031;
744 dol_syslog(
"RemiseCheque::updateAmount ERREUR SELECT ($this->errno)");
747 if ($this->errno === 0) {
750 $this->db->rollback();
751 dol_syslog(
"RemiseCheque::updateAmount ROLLBACK ($this->errno)");
768 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bank";
769 $sql .=
" SET fk_bordereau = 0";
770 $sql .=
" WHERE rowid = ".((int) $account_id);
771 $sql .=
" AND fk_bordereau = ".((int) $this->
id);
773 $resql = $this->db->query($sql);
777 $this->errno = -1032;
778 dol_syslog(
"RemiseCheque::removeCheck ERREUR UPDATE ($this->errno)");
797 $payment->fetch(0,
'0', $bank_id);
800 $bankline->fetch($bank_id);
814 $bankaccount = $payment->fk_account;
817 $sql =
'SELECT pf.fk_facture, pf.amount';
818 $sql .=
' FROM '.MAIN_DB_PREFIX.
'paiement_facture as pf';
819 $sql .=
' WHERE pf.fk_paiement = '.((int) $payment->id);
821 $resql = $this->db->query($sql);
823 $rejectedPayment =
new Paiement($this->db);
824 $rejectedPayment->amounts = array();
825 $rejectedPayment->datepaye = $rejection_date;
826 $rejectedPayment->paiementid =
dol_getIdFromCode($this->db,
'CHQ',
'c_paiement',
'code',
'id', 1);
827 $rejectedPayment->num_payment = $payment->num_payment;
829 while ($obj = $this->db->fetch_object($resql)) {
830 $invoice =
new Facture($this->db);
831 $invoice->fetch($obj->fk_facture);
832 $invoice->setUnpaid($user);
834 $rejectedPayment->amounts[$obj->fk_facture] = (float)
price2num($obj->amount) * -1;
837 $result = $rejectedPayment->create($user);
840 $result = $rejectedPayment->addPaymentToBank($user,
'payment',
'(CheckRejected)', (
int) $bankaccount,
'',
'');
842 $result = $payment->reject();
845 return $rejectedPayment->id;
847 $this->db->rollback();
851 $this->error = $rejectedPayment->error;
852 $this->errors = $rejectedPayment->errors;
853 $this->db->rollback();
857 $this->error = $rejectedPayment->error;
858 $this->errors = $rejectedPayment->errors;
859 $this->db->rollback();
863 $this->error = $this->db->lasterror();
864 $this->db->rollback();
880 if ($user->hasRight(
'banque',
'cheque')) {
881 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
882 $sql .=
" SET date_bordereau = ".($date ?
"'".$this->db->idate($date).
"'" :
'null');
883 $sql .=
" WHERE rowid = ".((int) $this->
id);
885 dol_syslog(
"RemiseCheque::set_date", LOG_DEBUG);
886 $resql = $this->db->query($sql);
888 $this->date_bordereau = $date;
891 $this->error = $this->db->error();
910 if ($user->hasRight(
'banque',
'cheque')) {
911 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"bordereau_cheque";
912 $sql .=
" SET ref = '".$this->db->escape((
string) $ref).
"'";
913 $sql .=
" WHERE rowid = ".((int) $this->
id);
915 dol_syslog(
"RemiseCheque::set_number", LOG_DEBUG);
916 $resql = $this->db->query($sql);
920 $this->error = $this->db->error();
938 global $user, $langs,
$conf;
942 $nownotime =
dol_mktime(0, 0, 0, $arraynow[
'mon'], $arraynow[
'mday'], $arraynow[
'year']);
946 $this->
ref =
'SPECIMEN';
948 $this->date_bordereau = $nownotime;
963 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
965 global
$conf, $langs;
969 $label =
'<u>'.$langs->trans(
"ShowCheckReceipt").
'</u>';
971 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
973 $url = DOL_URL_ROOT.
'/compta/paiement/cheque/card.php?id='.$this->id;
975 if ($option !=
'nolink') {
977 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
978 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
979 $add_save_lastsearch_values = 1;
981 if ($add_save_lastsearch_values) {
982 $url .=
'&save_lastsearch_values=1';
987 if (empty($notooltip)) {
989 $label = $langs->trans(
"ShowCheckReceipt");
990 $linkclose .=
' alt="'.dolPrintHTMLForAttribute($label).
'"';
992 $linkclose .=
' title="'.dolPrintHTMLForAttribute($label).
'"';
993 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
995 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
998 $linkstart =
'<a href="'.$url.
'"';
999 $linkstart .= $linkclose.
'>';
1002 $result .= $linkstart;
1004 $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);
1006 if ($withpicto != 2) {
1007 $result .= $this->ref;
1009 $result .= $linkend;
1011 global $action, $hookmanager;
1012 $hookmanager->initHooks(array($this->element .
'dao'));
1013 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
1014 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
1016 $result = $hookmanager->resPrint;
1018 $result .= $hookmanager->resPrint;
1032 return $this->
LibStatut($this->statut, $mode);
1046 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
1048 $langs->load(
'compta');
1049 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'ToValidate');
1050 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
1051 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'ToValidate');
1052 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Validated');
1055 $statusType =
'status'.$status;
1056 if ($status == self::STATUS_VALIDATED) {
1057 $statusType =
'status4';
1060 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
1074 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1076 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1077 $return .=
'<div class="info-box info-box-sm">';
1078 $return .=
'<span class="info-box-icon bg-infobox-action">';
1079 $return .= img_picto(
'', $this->picto);
1080 $return .=
'</span>';
1081 $return .=
'<div class="info-box-content">';
1082 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl() : $this->ref).
'</span>';
1083 if ($selected >= 0) {
1084 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1086 if (property_exists($this,
'date_bordereau')) {
1087 $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>';
1089 if (property_exists($this,
'nbcheque')) {
1090 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Cheque",
'',
'',
'',
'', 5).
'</span> : <span class="info-box-label">'.$this->nbcheque.
'</span>';
1092 if (property_exists($this,
'account_id')) {
1093 $return .=
' | <span class="info-box-label">'.$this->account_id.
'</span>';
1095 if (method_exists($this,
'LibStatut')) {
1096 $return .=
'<br><div style="display:inline-block" class="info-box-status margintoponly">'.$this->getLibStatut(3).
'</div>';
1098 if (property_exists($this,
'amount')) {
1099 $return .=
' | <div style="display:inline-block"><span class="opacitymedium">'.$langs->trans(
"Amount").
'</span> : <span class="amount">'.
price($this->
amount).
'</div>';
1101 $return .=
'</div>';
1102 $return .=
'</div>';
1103 $return .=
'</div>';
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Class to manage bank accounts.
Class to manage bank transaction lines.
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 ...
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)
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_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