From f736c3bff0f1236192d524e951bd8beeae86df7e Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 4 Aug 2003 18:06:12 +0000 Subject: [PATCH] =?UTF-8?q?Correction=20erreur=20lorsque=20pas=20de=20comp?= =?UTF-8?q?te=20bancaires=20d=E9finit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/bank/account.class.php | 72 ++++++++++++++-------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php index 23cf23ee21a..e91d8e3ccf8 100644 --- a/htdocs/compta/bank/account.class.php +++ b/htdocs/compta/bank/account.class.php @@ -51,43 +51,45 @@ class Account Function addline($date, $oper, $label, $amount, $num_chq="") { - switch ($oper) + if ($this->rowid) { - case 1: - $oper = 'TIP'; - break; - case 2: - $oper = 'VIR'; - break; - case 3: - $oper = 'PRE'; - break; - case 4: - $oper = 'LIQ'; - break; - case 5: - $oper = 'WWW'; - break; - case 6: - $oper = 'CB'; - break; - case 7: - $oper = 'CHQ'; - break; - } + switch ($oper) + { + case 1: + $oper = 'TIP'; + break; + case 2: + $oper = 'VIR'; + break; + case 3: + $oper = 'PRE'; + break; + case 4: + $oper = 'LIQ'; + break; + case 5: + $oper = 'WWW'; + break; + case 6: + $oper = 'CB'; + break; + case 7: + $oper = 'CHQ'; + break; + } + + $sql = "INSERT INTO llx_bank (datec, dateo, label, amount, author, num_chq,fk_account, fk_type)"; + $sql .= " VALUES (now(), $date, '$label', $amount,'$author','$num_chq', $this->rowid, '$oper')"; - - $sql = "INSERT INTO llx_bank (datec, dateo, label, amount, author, num_chq,fk_account, fk_type)"; - $sql .= " VALUES (now(), $date, '$label', $amount,'$author','$num_chq', $this->rowid, '$oper')"; - - if ($this->db->query($sql)) - { - return 1; - } - else - { - print $this->db->error(); - print "
$sql"; + if ($this->db->query($sql)) + { + return 1; + } + else + { + print $this->db->error(); + print "
$sql"; + } } }