diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 753b9f30f67..092d14074d3 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Éric Seigne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,12 +37,15 @@ if ($user->societe_id > 0) if ($action == 'add') { $paiementfourn = new PaiementFourn($db); - $paiementfourn->facid = $facid; - $paiementfourn->datepaye = $db->idate(mktime(12, 0 , 0, + $paiementfourn->facid = $facid; + $paiementfourn->facnumber = $facnumber; + $paiementfourn->datepaye = $db->idate(mktime(12, 0 , 0, $HTTP_POST_VARS["remonth"], $HTTP_POST_VARS["reday"], $HTTP_POST_VARS["reyear"])); $paiementfourn->amount = $amount; + $paiementfourn->accountid = $accountid; + $paiementfourn->societe = $societe; $paiementfourn->author = $author; $paiementfourn->paiementid = $paiementid; $paiementfourn->num_paiement = $num_paiement; @@ -53,7 +57,6 @@ if ($action == 'add') { } $action = ''; - } /* @@ -139,6 +142,28 @@ if ($action == 'create') print ""; print ''; + print "Compte à débiter :"; + print "\n"; + print "Numéro :
Num du cheque ou virement\n"; print "Reste à payer :".price($total - $sumpayed)." euros TTC\n"; print "Montant :\n"; diff --git a/htdocs/fourn/facture/paiementfourn.class.php b/htdocs/fourn/facture/paiementfourn.class.php index 68aa6f49732..b8859fc308e 100644 --- a/htdocs/fourn/facture/paiementfourn.class.php +++ b/htdocs/fourn/facture/paiementfourn.class.php @@ -25,12 +25,15 @@ class PaiementFourn var $id; var $db; var $facid; + var $facnumber; var $datepaye; var $amount; + var $accountid; var $author; var $paiementid; // numero du paiement dans le cas ou une facture paye +ieur fois var $num_paiement; var $note; + var $societe; /* * * @@ -54,16 +57,16 @@ class PaiementFourn $this->amount = ereg_replace(",",".",$this->amount); $sql = "INSERT INTO llx_paiementfourn (fk_facture_fourn, datec, datep, amount, fk_user_author, fk_paiement, num_paiement, note)"; - $sql .= " VALUES ($this->facid, now(), $this->datepaye,$this->amount, $user->id, $this->paiementid, '$this->num_paiement', '$this->note')"; + $sql .= " VALUES ('$this->facid', now(), '$this->datepaye', '$this->amount', '$user->id', '$this->paiementid', '$this->num_paiement', '$this->note')"; $result = $this->db->query($sql); - - if ($result) + + if (isset($result)) { $label = "Facture $this->facnumber - $this->societe"; - $sql = "INSERT INTO llx_bank (datec, dateo, amount, author, label)"; - $sql .= " VALUES (now(), $this->datepaye, $this->amount,'$this->author', '$this->label')"; - //$result = $this->db->query($sql); + $sql = "INSERT INTO llx_bank (datec, dateo, amount, author, label, fk_account)"; + $sql .= " VALUES (now(), '$this->datepaye', '$this->amount', '$this->author', '$label', '$this->accountid')"; + $result = $this->db->query($sql); } else {