From 751a45f1b54846172fca6664f4c8ebde63d3563e Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 15 Jul 2003 11:30:58 +0000 Subject: [PATCH] bugfix --- htdocs/compta/bank/account.class.php | 7 ++++++- htdocs/compta/facture.php3 | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php index 0482f9f51c3..492a2ea830b 100644 --- a/htdocs/compta/bank/account.class.php +++ b/htdocs/compta/bank/account.class.php @@ -52,12 +52,17 @@ class Account Function addline($date, $oper, $label, $amount, $num_chq="") { $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,'$operation')"; + $sql .= " VALUES (now(), $date, '$label', $amount,'$author','$num_chq', $this->rowid, '$operation')"; if ($this->db->query($sql)) { return 1; } + else + { + print $this->db->error(); + print "
$sql"; + } } Function create() diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index 630c4ef11fa..3d14c41883a 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -45,23 +45,26 @@ if ($user->societe_id > 0) if ($action == 'add_paiement') { - $datepaye = $db->idate(mktime(12, 0 , 0, $remonth, $reday, $reyear)); + $datepaye = $db->idate(mktime(12, 0 , 0, $HTTP_POST_VARS["remonth"], $HTTP_POST_VARS["reday"], $HTTP_POST_VARS["reyear"])); $paiement = new Paiement($db); - $paiement->facid = $facid; + $paiement->facid = $HTTP_POST_VARS["facid"]; $paiement->datepaye = $datepaye; - $paiement->amount = $amount; - $paiement->author = $author; - $paiement->paiementid = $paiementid; - $paiement->num_paiement = $num_paiement; - $paiement->note = $note; + $paiement->amount = $HTTP_POST_VARS["amount"]; + $paiement->author = $HTTP_POST_VARS["author"]; + $paiement->paiementid = $HTTP_POST_VARS["paiementid"]; + $paiement->num_paiement = $HTTP_POST_VARS["num_paiement"]; + $paiement->note = $HTTP_POST_VARS["note"]; $paiement->create(); $action = ''; - $label = "Réglement facture N°"; + $fac = new Facture($db); + $fac->fetch($HTTP_POST_VARS["facid"]); + + $label = "Réglement facture ".$fac->ref; $acc = new Account($db, $HTTP_POST_VARS["accountid"]); $acc->addline($datepaye, $paiementid, $label, $amount, $num_paiement);