From 06925984da6f744602ee86e2d45bc250e7c3eaa8 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 4 Sep 2003 13:09:13 +0000 Subject: [PATCH] Ajout automatique du Solde --- htdocs/compta/bank/account.class.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php index 02bd4b1a194..009ed922a78 100644 --- a/htdocs/compta/bank/account.class.php +++ b/htdocs/compta/bank/account.class.php @@ -42,7 +42,7 @@ class Account $this->clos = 0; $this->db = $DB; $this->rowid = $rowid; - + $this->solde = 0; return 1; } @@ -118,7 +118,10 @@ class Account } } } - + /* + * + * + */ Function create() { $sql = "INSERT INTO llx_bank_account (datec, label) values (now(),'$this->label');"; @@ -127,7 +130,13 @@ class Account if ($this->db->affected_rows()) { $this->id = $this->db->last_insert_id(); - $this->update(); + if ( $this->update() ) + { + $sql = "INSERT INTO llx_bank (datec, label, amount, fk_account,datev,dateo) "; + $sql .= " VALUES (now(),'Solde',$this->solde,$this->id,'1970-01-01','1970-01-01');"; + + $this->db->query($sql); + } return $this->id; } } @@ -176,6 +185,7 @@ class Account { print $this->db->error(); print "

$sql

"; + return 0; } } /*