/[dolibarr]/dolibarr/htdocs/compta/bank/account.class.php
ViewVC logotype

Diff of /dolibarr/htdocs/compta/bank/account.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.47 by eldy, Fri Sep 2 21:53:39 2005 UTC revision 1.48 by eldy, Sat Sep 17 00:14:36 2005 UTC
# Line 43  class Account Line 43  class Account
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;
# Line 68  class Account Line 70  class Account
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    
# Line 76  class Account Line 81  class Account
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    
# Line 84  class Account Line 91  class Account
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      /**      /**
# Line 236  class Account Line 245  class Account
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                  }                  }
# Line 288  class Account Line 297  class Account
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    
# Line 310  class Account Line 320  class Account
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    
# Line 326  class Account Line 337  class Account
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;

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26