29 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
40 public $element =
'user_bank_account';
45 public $table_element =
'user_rib';
81 $this->error_number = 0;
92 public function create(
User $user = null, $notrigger = 0)
96 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"user_rib (fk_user, datec)";
97 $sql .=
" VALUES (".$this->userid.
", '".$this->
db->idate($now).
"')";
101 if ($this->
db->affected_rows(
$resql))
103 $this->
id = $this->
db->last_insert_id(MAIN_DB_PREFIX.
"user_rib");
105 return $this->
update($user);
129 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"user_rib SET";
130 $sql .=
" bank = '".$this->db->escape($this->bank).
"'";
131 $sql .=
",code_banque='".$this->db->escape($this->code_banque).
"'";
132 $sql .=
",code_guichet='".$this->db->escape($this->code_guichet).
"'";
133 $sql .=
",number='".$this->db->escape($this->number).
"'";
134 $sql .=
",cle_rib='".$this->db->escape($this->cle_rib).
"'";
135 $sql .=
",bic='".$this->db->escape($this->bic).
"'";
136 $sql .=
",iban_prefix = '".$this->db->escape($this->iban).
"'";
137 $sql .=
",domiciliation='".$this->db->escape($this->domiciliation).
"'";
138 $sql .=
",proprio = '".$this->db->escape($this->proprio).
"'";
139 $sql .=
",owner_address = '".$this->db->escape($this->owner_address).
"'";
141 if (trim($this->label) !=
'')
142 $sql .=
",label = '".$this->db->escape($this->label).
"'";
143 else $sql .=
",label = NULL";
144 $sql .=
" WHERE rowid = ".$this->id;
146 $result = $this->
db->query($sql);
164 public function fetch($id, $ref =
'', $userid = 0)
166 if (empty($id) && empty($ref) && empty($userid))
return -1;
168 $sql =
"SELECT rowid, fk_user, entity, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,";
169 $sql .=
" owner_address, label, datec, tms as datem";
170 $sql .=
" FROM ".MAIN_DB_PREFIX.
"user_rib";
171 if ($id) $sql .=
" WHERE rowid = ".$id;
172 if ($ref) $sql .=
" WHERE label = '".$this->db->escape($ref).
"'";
173 if ($userid) $sql .=
" WHERE fk_user = ".((int) $userid);
180 $obj = $this->
db->fetch_object(
$resql);
182 $this->
id = $obj->rowid;
183 $this->userid = $obj->fk_soc;
184 $this->bank = $obj->bank;
185 $this->code_banque = $obj->code_banque;
186 $this->code_guichet = $obj->code_guichet;
187 $this->number = $obj->number;
188 $this->cle_rib = $obj->cle_rib;
189 $this->bic = $obj->bic;
190 $this->iban = $obj->iban;
191 $this->domiciliation = $obj->domiciliation;
192 $this->proprio = $obj->proprio;
193 $this->owner_address = $obj->owner_address;
194 $this->label = $obj->label;
195 $this->datec = $this->
db->jdate($obj->datec);
196 $this->datem = $this->
db->jdate($obj->datem);
217 if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib) {
218 if ($this->label && $displayriblabel) {
219 $rib = $this->label.
" : ";
222 $rib .= (string) $this;
Class to manage bank accounts description of users.
dol_now($mode= 'auto')
Return date for now.
Class to manage Dolibarr users.
Class to manage Dolibarr database access.
fetch($id, $ref= '', $userid=0)
Load record from database.
$conf db
API class for accounts.
Class to manage bank accounts.
__construct(DoliDB $db)
Constructor.
create(User $user=null, $notrigger=0)
Create bank information record.
getRibLabel($displayriblabel=true)
Return RIB.
update(User $user=null, $notrigger=0)
Update bank account.
print
Draft customers invoices.
solde($option=0)
Return current sold.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...