43 |
var $type; |
var $type; |
44 |
var $bank; |
var $bank; |
45 |
var $clos; |
var $clos; |
46 |
|
var $rappro; |
47 |
|
|
48 |
var $code_banque; |
var $code_banque; |
49 |
var $code_guichet; |
var $code_guichet; |
50 |
var $number; |
var $number; |
70 |
$this->type_lib[1]=$langs->trans("BankType1"); |
$this->type_lib[1]=$langs->trans("BankType1"); |
71 |
$this->type_lib[2]=$langs->trans("BankType2"); |
$this->type_lib[2]=$langs->trans("BankType2"); |
72 |
|
|
73 |
|
$this->status[0]=$langs->trans("StatusAccountOpened"); |
74 |
|
$this->status[1]=$langs->trans("StatusAccountClosed"); |
75 |
|
|
76 |
return 1; |
return 1; |
77 |
} |
} |
78 |
|
|
81 |
*/ |
*/ |
82 |
function deleteline($rowid) |
function deleteline($rowid) |
83 |
{ |
{ |
84 |
|
$this->db->begin(); |
85 |
|
|
86 |
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=$rowid"; |
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=$rowid"; |
87 |
$result = $this->db->query($sql); |
$result = $this->db->query($sql); |
88 |
|
|
91 |
|
|
92 |
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=$rowid"; |
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=$rowid"; |
93 |
$result = $this->db->query($sql); |
$result = $this->db->query($sql); |
94 |
|
|
95 |
|
$this->db->commit(); |
96 |
} |
} |
97 |
|
|
98 |
/** |
/** |
245 |
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_account"); |
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_account"); |
246 |
if ( $this->update() ) |
if ( $this->update() ) |
247 |
{ |
{ |
248 |
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank (datec, label, amount, fk_account,datev,dateo,fk_type,rappro) "; |
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank (datec, label, amount, fk_account, datev, dateo, fk_type, rappro) "; |
249 |
$sql .= " VALUES (now(),'".$langs->trans("Balance")."','" . ereg_replace(',','.',$this->solde) . "','$this->id','".$this->db->idate($this->date_solde)."','".$this->db->idate($this->date_solde)."','SOLD',1);"; |
$sql .= " VALUES (now(),'".$langs->trans("Balance")."','" . ereg_replace(',','.',$this->solde) . "','$this->id','".$this->db->idate($this->date_solde)."','".$this->db->idate($this->date_solde)."','SOLD',1);"; |
250 |
$this->db->query($sql); |
$this->db->query($sql); |
251 |
} |
} |
297 |
$sql .= ",adresse_proprio = '".$this->adresse_proprio."'"; |
$sql .= ",adresse_proprio = '".$this->adresse_proprio."'"; |
298 |
$sql .= ",courant = ".$this->courant; |
$sql .= ",courant = ".$this->courant; |
299 |
$sql .= ",clos = ".$this->clos; |
$sql .= ",clos = ".$this->clos; |
300 |
|
$sql .= ",rappro = ".$this->rappro; |
301 |
|
|
302 |
$sql .= " WHERE rowid = ".$this->id; |
$sql .= " WHERE rowid = ".$this->id; |
303 |
|
|
320 |
function fetch($id) |
function fetch($id) |
321 |
{ |
{ |
322 |
$this->id = $id; |
$this->id = $id; |
323 |
$sql = "SELECT rowid, label, bank, number, courant, clos, code_banque, code_guichet, cle_rib, bic, iban_prefix, domiciliation, proprio, adresse_proprio FROM ".MAIN_DB_PREFIX."bank_account"; |
$sql = "SELECT rowid, label, bank, number, courant, clos, rappro,"; |
324 |
$sql .= " WHERE rowid = ".$id; |
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix, domiciliation, proprio, adresse_proprio FROM ".MAIN_DB_PREFIX."bank_account"; |
325 |
|
$sql.= " WHERE rowid = ".$id; |
326 |
|
|
327 |
$result = $this->db->query($sql); |
$result = $this->db->query($sql); |
328 |
|
|
337 |
$this->courant = $obj->courant; |
$this->courant = $obj->courant; |
338 |
$this->bank = $obj->bank; |
$this->bank = $obj->bank; |
339 |
$this->clos = $obj->clos; |
$this->clos = $obj->clos; |
340 |
|
$this->rappro = $obj->rappro; |
341 |
|
|
342 |
$this->code_banque = $obj->code_banque; |
$this->code_banque = $obj->code_banque; |
343 |
$this->code_guichet = $obj->code_guichet; |
$this->code_guichet = $obj->code_guichet; |
344 |
$this->number = $obj->number; |
$this->number = $obj->number; |