dolibarr 23.0.3
companybankaccount.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2010-2023 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
6 * Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
7 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
30require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
31
32
37{
42 public $TRIGGER_PREFIX = 'COMPANY_RIB';
43
47 public $element = 'societe_rib';
48
52 public $table_element = 'societe_rib';
53
93 // BEGIN MODULEBUILDER PROPERTIES
97 public $fields = array(
98 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => -1,),
99 'type' => array('type' => 'varchar(32)', 'label' => 'Type', 'enabled' => 1, 'position' => 15, 'notnull' => 1, 'visible' => -1,),
100 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'picto' => 'company', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150',),
101 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 25, 'notnull' => 0, 'visible' => -1,),
102 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => -1,),
103 'label' => array('type' => 'varchar(200)', 'label' => 'Label', 'enabled' => 1, 'position' => 35, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150',),
104 'bank' => array('type' => 'varchar(255)', 'label' => 'Bank', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
105 'code_banque' => array('type' => 'varchar(128)', 'label' => 'Codebanque', 'enabled' => 1, 'position' => 45, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
106 'code_guichet' => array('type' => 'varchar(6)', 'label' => 'Codeguichet', 'enabled' => 1, 'position' => 50, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
107 'number' => array('type' => 'varchar(255)', 'label' => 'Number', 'enabled' => 1, 'position' => 55, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
108 'cle_rib' => array('type' => 'varchar(5)', 'label' => 'Clerib', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
109 'bic' => array('type' => 'varchar(20)', 'label' => 'Bic', 'enabled' => 1, 'position' => 65, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
110 'iban_prefix' => array('type' => 'varchar(34)', 'label' => 'Ibanprefix', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
111 'domiciliation' => array('type' => 'varchar(255)', 'label' => 'Domiciliation', 'enabled' => 1, 'position' => 75, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
112 'proprio' => array('type' => 'varchar(60)', 'label' => 'Proprio', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
113 'owner_address' => array('type' => 'varchar(255)', 'label' => 'Owneraddress', 'enabled' => 1, 'position' => 85, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
114 'default_rib' => array('type' => 'smallint(6)', 'label' => 'Defaultrib', 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,),
115 'state_id' => array('type' => 'integer', 'label' => 'Stateid', 'enabled' => 1, 'position' => 95, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
116 'fk_country' => array('type' => 'integer', 'label' => 'Fkcountry', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx',),
117 'currency_code' => array('type' => 'varchar(3)', 'label' => 'Currencycode', 'enabled' => 1, 'position' => 105, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
118 'rum' => array('type' => 'varchar(32)', 'label' => 'Rum', 'enabled' => 1, 'position' => 110, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
119 'date_rum' => array('type' => 'date', 'label' => 'Daterum', 'enabled' => 1, 'position' => 115, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
120 'frstrecur' => array('type' => 'varchar(16)', 'label' => 'Frstrecur', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
121 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 900, 'notnull' => 0, 'visible' => -2, 'alwayseditable' => 1,),
122 'last_four' => array('type' => 'varchar(4)', 'label' => 'Lastfour', 'enabled' => 1, 'position' => 130, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
123 'card_type' => array('type' => 'varchar(255)', 'label' => 'Cardtype', 'enabled' => 1, 'position' => 135, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
124 'cvn' => array('type' => 'varchar(255)', 'label' => 'Cvn', 'enabled' => 1, 'position' => 140, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
125 'exp_date_month' => array('type' => 'integer', 'label' => 'Expdatemonth', 'enabled' => 1, 'position' => 145, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
126 'exp_date_year' => array('type' => 'integer', 'label' => 'Expdateyear', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
127 'country_code' => array('type' => 'varchar(10)', 'label' => 'Countrycode', 'enabled' => 1, 'position' => 155, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
128 'approved' => array('type' => 'integer', 'label' => 'Approved', 'enabled' => 1, 'position' => 160, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
129 'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'position' => 165, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
130 'ending_date' => array('type' => 'date', 'label' => 'Endingdate', 'enabled' => 1, 'position' => 170, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
131 'max_total_amount_of_all_payments' => array('type' => 'double(24,8)', 'label' => 'Maxtotalamountofallpayments', 'enabled' => 1, 'position' => 175, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
132 'preapproval_key' => array('type' => 'varchar(255)', 'label' => 'Preapprovalkey', 'enabled' => 1, 'position' => 180, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
133 'starting_date' => array('type' => 'date', 'label' => 'Startingdate', 'enabled' => 1, 'position' => 185, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
134 'total_amount_of_all_payments' => array('type' => 'double(24,8)', 'label' => 'Totalamountofallpayments', 'enabled' => 1, 'position' => 190, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
135 'stripe_card_ref' => array('type' => 'varchar(128)', 'label' => 'Stripecardref', 'enabled' => 1, 'position' => 195, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
136 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,),
137 'comment' => array('type' => 'varchar(255)', 'label' => 'Comment', 'enabled' => 1, 'position' => 205, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
138 'ipaddress' => array('type' => 'varchar(68)', 'label' => 'Ipaddress', 'enabled' => 1, 'position' => 210, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
139 'stripe_account' => array('type' => 'varchar(128)', 'label' => 'Stripeaccount', 'enabled' => 1, 'position' => 215, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
140 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => 0, 'position' => 230),
141 );
142
146 public $id;
147
151 public $type;
152
157 public $fk_soc;
158
162 public $socid;
163
169 public $datec;
170
174 public $label;
178 public $code_banque;
182 public $code_guichet;
186 public $number;
190 public $cle_rib;
194 public $bic;
198 public $iban_prefix;
199
203 public $bank;
204
208 public $state_id;
209
213 public $fk_country;
214
218 public $country_code;
219
223 public $default_rib;
224
228 public $currency_code;
229
233 public $rum;
234
238 public $date_rum;
239
245 public $frstrecur;
249 public $import_key;
253 public $last_four;
257 public $card_type;
261 public $cvn;
265 public $exp_date_month;
269 public $exp_date_year;
273 public $approved;
274
278 public $email;
282 public $ending_date;
286 public $max_total_amount_of_all_payments;
290 public $preapproval_key;
294 public $starting_date;
298 public $total_amount_of_all_payments;
299
300
304 public $ext_payment_site; // Name of the external payment system ('StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ...)
305
309 public $comment;
310
314 public $ipaddress;
315
316
322 public $stripe_account;
323
329 public $stripe_card_ref;
330
336 public $datem;
337
343 public function __construct(DoliDB $db)
344 {
345 $this->db = $db;
346
347 $this->socid = 0;
348 $this->solde = 0;
349 $this->balance = 0;
350 $this->default_rib = 0;
351 $this->type = "ban";
352 }
353
354
362 public function create($user, $notrigger = 0)
363 {
364 $now = dol_now();
365
366 $error = 0;
367
368 // Check parameters
369 if (empty($this->socid)) {
370 $this->error = 'BadValueForParameter';
371 $this->errors[] = $this->error;
372 return -1;
373 }
374
375 if (empty($this->datec)) {
376 $this->datec = $now;
377 }
378
379 // Correct ->default_rib to not set the new account as default, if there is already 1. We want to be sure to have always 1 default for type = 'ban'.
380 // If we really want the new bank account to be the default, we must set it by calling setDefault() after creation.
381 $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib";
382 $sql .= " WHERE fk_soc = ".((int) $this->socid)." AND default_rib = 1 AND type = 'ban'";
383 $result = $this->db->query($sql);
384 if ($result) {
385 $numrows = $this->db->num_rows($result);
386 if ($this->default_rib && $numrows > 0) {
387 $this->default_rib = 0;
388 }
389 if (empty($this->default_rib) && $numrows == 0) {
390 $this->default_rib = 1;
391 }
392 }
393
394
395 $this->db->begin();
396
397 $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_rib (fk_soc, type, datec, model_pdf)";
398 $sql .= " VALUES (".((int) $this->socid).", '".$this->type."', '".$this->db->idate($this->datec)."',";
399 $sql .= " '".$this->db->escape(getDolGlobalString("BANKADDON_PDF"))."'";
400 $sql .= ")";
401 $resql = $this->db->query($sql);
402 if ($resql) {
403 if ($this->db->affected_rows($resql)) {
404 $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."societe_rib");
405
406 if (!$notrigger) {
407 // Call trigger
408 $result = $this->call_trigger('COMPANY_RIB_CREATE', $user);
409 if ($result < 0) {
410 $error++;
411 }
412 // End call triggers
413 }
414 }
415 } else {
416 $error++;
417 $this->error = $this->db->lasterror();
418 $this->errors[] = $this->error;
419 }
420
421 if (!$error) {
422 $this->db->commit();
423 return $this->id;
424 } else {
425 $this->db->rollback();
426 return -1;
427 }
428 }
429
437 public function update($user, $notrigger = 0)
438 {
439 global $langs;
440
441 $error = 0;
442
443 if (!$this->id) {
444 return -1;
445 }
446
447 if (!empty($this->address) && dol_strlen($this->address) > 255) {
448 $this->address = dol_trunc($this->address, 254, 'right', 'UTF-8', 1);
449 }
450 if (dol_strlen($this->owner_address) > 255) {
451 $this->owner_address = dol_trunc($this->owner_address, 254, 'right', 'UTF-8', 1);
452 }
453
454 if (isset($this->model_pdf)) {
455 $this->model_pdf = trim($this->model_pdf);
456 }
457
458 $this->db->begin();
459
460 $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET";
461 $sql .= " bank = '".$this->db->escape($this->bank)."'";
462 $sql .= ",code_banque='".$this->db->escape($this->code_banque)."'";
463 $sql .= ",code_guichet='".$this->db->escape($this->code_guichet)."'";
464 $sql .= ",number='".$this->db->escape($this->number)."'";
465 $sql .= ",cle_rib='".$this->db->escape($this->cle_rib)."'";
466 $sql .= ",bic='".$this->db->escape($this->bic)."'";
467 $sql .= ",iban_prefix = '".$this->db->escape(dolEncrypt($this->iban))."'";
468 $sql .= ",domiciliation = '".$this->db->escape($this->address)."'";
469 $sql .= ",proprio = '".$this->db->escape($this->owner_name)."'";
470 $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'";
471 $sql .= ",default_rib = ".((int) $this->default_rib);
472 if (isModEnabled('prelevement')) {
473 $sql .= ",frstrecur = '".$this->db->escape($this->frstrecur)."'";
474 $sql .= ",rum = '".$this->db->escape($this->rum)."'";
475 $sql .= ",date_rum = ".($this->date_rum ? "'".$this->db->idate($this->date_rum)."'" : "null");
476 }
477 if (trim($this->label) != '') {
478 $sql .= ",label = '".$this->db->escape($this->label)."'";
479 } else {
480 $sql .= ",label = NULL";
481 }
482 $sql .= ",stripe_card_ref = '".$this->db->escape($this->stripe_card_ref)."'";
483 $sql .= ",stripe_account = '".$this->db->escape($this->stripe_account)."'";
484 $sql .= ",model_pdf=".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null");
485 $sql .= " WHERE rowid = ".((int) $this->id);
486
487 $result = $this->db->query($sql);
488 if ($result) {
489 if (!$notrigger) {
490 // Call trigger
491 $result = $this->call_trigger('COMPANY_RIB_MODIFY', $user);
492 if ($result < 0) {
493 $error++;
494 }
495 // End call triggers
496 }
497 } else {
498 $error++;
499 if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
500 $this->error = $langs->trans('ErrorDuplicateField');
501 } else {
502 $this->error = $this->db->lasterror();
503 }
504 $this->errors[] = $this->error;
505 }
506
507 if (!$error) {
508 $this->db->commit();
509 return 1;
510 } else {
511 $this->db->rollback();
512 return -1;
513 }
514 }
515
526 public function fetch($id, $ref = '', $socid = 0, $default = 1, $type = 'ban')
527 {
528 if (empty($id) && empty($ref) && empty($socid)) {
529 return -1;
530 }
531
532 $sql = "SELECT rowid, label, type, fk_soc as socid, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban,";
533 $sql .= " domiciliation as address,";
534 $sql .= " proprio as owner_name, owner_address, default_rib, datec, tms as datem, rum, frstrecur, date_rum,";
535 $sql .= " stripe_card_ref, stripe_account, ext_payment_site,";
536 $sql .= " last_main_doc, model_pdf";
537 $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib";
538
539 if ($id) {
540 $sql .= " WHERE rowid = ".((int) $id);
541 } elseif ($ref) {
542 $sql .= " WHERE rowid = ".((int) $ref);
543 } elseif ($socid > 0) {
544 $sql .= " WHERE fk_soc = ".((int) $socid);
545 if ($default > -1) {
546 $sql .= " AND default_rib = ".((int) $default);
547 }
548 if ($type) {
549 $sql .= " AND type = '".$this->db->escape($type)."'";
550 }
551 }
552
553 $resql = $this->db->query($sql);
554 if ($resql) {
555 if ($this->db->num_rows($resql)) {
556 $obj = $this->db->fetch_object($resql);
557
558 $this->ref = $obj->socid.'-'.$obj->label; // Generate an artificial ref
559
560 $this->id = $obj->rowid;
561 $this->type = $obj->type;
562 $this->socid = $obj->socid;
563 $this->bank = $obj->bank;
564 $this->code_banque = $obj->code_banque;
565 $this->code_guichet = $obj->code_guichet;
566 $this->number = $obj->number;
567 $this->cle_rib = $obj->cle_rib;
568 $this->bic = $obj->bic;
569 $this->iban = dolDecrypt($obj->iban);
570
571 $this->address = $obj->address;
572
573 $this->owner_name = $obj->owner_name;
574 $this->proprio = $obj->owner_name;
575 $this->owner_address = $obj->owner_address;
576 $this->label = $obj->label;
577 $this->default_rib = $obj->default_rib;
578 $this->datec = $this->db->jdate($obj->datec);
579 $this->datem = $this->db->jdate($obj->datem);
580 $this->rum = $obj->rum;
581 $this->frstrecur = $obj->frstrecur;
582 $this->date_rum = $this->db->jdate($obj->date_rum);
583 $this->stripe_card_ref = $obj->stripe_card_ref; // External system payment mode ID
584 $this->stripe_account = $obj->stripe_account; // External system customer ID
585 $this->ext_payment_site = $obj->ext_payment_site; // External system name ('StripeLive', 'StripeTest', 'StancerLive', 'StancerTest', ...)
586 $this->last_main_doc = $obj->last_main_doc;
587 $this->model_pdf = $obj->model_pdf;
588 }
589 $this->db->free($resql);
590
591 return 1;
592 } else {
593 dol_print_error($this->db);
594 return -1;
595 }
596 }
597
605 public function delete($user, $notrigger = 0)
606 {
607 $error = 0;
608
609 dol_syslog(get_class($this)."::delete ".$this->id, LOG_DEBUG);
610
611 $this->db->begin();
612
613 if (!$error && !$notrigger) {
614 // Call trigger
615 $result = $this->call_trigger('COMPANY_RIB_DELETE', $user);
616 if ($result < 0) {
617 $error++;
618 }
619 // End call triggers
620 }
621
622 if (!$error) {
623 $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_rib";
624 $sql .= " WHERE rowid = ".((int) $this->id);
625
626 if (!$this->db->query($sql)) {
627 $error++;
628 $this->errors[] = $this->db->lasterror();
629 }
630 }
631
632 if (!$error) {
633 $this->db->commit();
634 return 1;
635 } else {
636 $this->db->rollback();
637 return -1 * $error;
638 }
639 }
640
647 public function getRibLabel($displayriblabel = true)
648 {
649 $rib = '';
650
651 if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib || $this->iban || $this->bic) {
652 if ($this->label && $displayriblabel) {
653 $rib = $this->label." : ";
654 }
655
656 $rib .= $this->iban;
657 }
658
659 return $rib;
660 }
661
669 public function setAsDefault($rib = 0, $resetolddefaultfor = 'ban')
670 {
671 $sql1 = "SELECT rowid as id, fk_soc as socid FROM ".MAIN_DB_PREFIX."societe_rib";
672 $sql1 .= " WHERE rowid = ".((int) ($rib ? $rib : $this->id));
673
674 dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG);
675 $result1 = $this->db->query($sql1);
676 if ($result1) {
677 if ($this->db->num_rows($result1) == 0) {
678 return 0;
679 } else {
680 $obj = $this->db->fetch_object($result1);
681
682 $this->db->begin();
683
684 $sql2 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 0";
685 $sql2 .= " WHERE fk_soc = ".((int) $obj->socid);
686 if ($resetolddefaultfor) {
687 $sql2 .= " AND type = '".$this->db->escape($resetolddefaultfor)."'";
688 }
689 $result2 = $this->db->query($sql2);
690
691 $sql3 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 1";
692 $sql3 .= " WHERE rowid = ".((int) $obj->id);
693 $result3 = $this->db->query($sql3);
694
695 if (!$result2 || !$result3) {
696 $this->errors[] = $this->db->lasterror();
697 $this->db->rollback();
698 return -1;
699 } else {
700 $this->db->commit();
701 return 1;
702 }
703 }
704 } else {
705 $this->errors[] = $this->db->lasterror();
706 return -1;
707 }
708 }
709
717 public function initAsSpecimen()
718 {
719 $this->id = 0;
720 $this->specimen = 1;
721 $this->ref = 'CBA';
722 $this->label = 'CustomerCorp Bank account';
723 $this->bank = 'CustomerCorp Bank';
724 $this->type = 'ban';
725 $this->status = Account::STATUS_OPEN;
726 $this->code_banque = '123';
727 $this->code_guichet = '456';
728 $this->number = 'CUST12345';
729 $this->cle_rib = '50';
730 $this->bic = 'CC12';
731 $this->iban = 'FR999999999';
732
733 $this->address = 'Rue de Paris';
734 $this->country_id = 1;
735
736 $this->owner_name = 'Owner';
737 $this->owner_address = 'Owner address';
738 $this->owner_country_id = 1;
739
740 $this->rum = 'UMR-CU1212-0007-5-1475405262';
741 $this->date_rum = dol_now() - 10000;
742 $this->frstrecur = 'FRST';
743
744 $this->socid = 1;
745
746 return 1;
747 }
748}
$object ref
Definition info.php:90
Class to manage bank accounts.
solde($option=0, $date_end='', $field='dateo')
Return current balance.
error()
Return error.
Class to manage bank accounts description of third parties.
setAsDefault($rib=0, $resetolddefaultfor='ban')
Set a BAN as Default.
fetch($id, $ref='', $socid=0, $default=1, $type='ban')
Load record from database.
getRibLabel($displayriblabel=true)
Return RIB.
update($user, $notrigger=0)
Update bank account.
create($user, $notrigger=0)
Create bank information record.
initAsSpecimen()
Initialise an instance with random values.
__construct(DoliDB $db)
Constructor.
Class to manage Dolibarr database access.
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...
Definition index.php:171
dol_now($mode='gmt')
Return date for now.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
div refaddress div address
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition repair.php:125
dolEncrypt($chain, $key='', $ciphering='', $forceseed='')
Encode a string with a symmetric encryption.
dolDecrypt($chain, $key='')
Decode a string with a symmetric encryption.