From f6de7c5d3b2be1e78770978dd13623bf5624b8ba Mon Sep 17 00:00:00 2001 From: erics Date: Mon, 26 Jan 2004 23:53:04 +0000 Subject: [PATCH] =?UTF-8?q?quand=20on=20paye=20une=20facture=20fournisseur?= =?UTF-8?q?=20on=20peut=20maintenant=20dire=20quel=20est=20le=20compte=20?= =?UTF-8?q?=E0=20d=E9biter=20et=20si=20c'est=20le=20cas=20on=20le=20retrou?= =?UTF-8?q?vera=20=E0=20rapprocher=20dans=20les=20extraits=20de=20compte?= =?UTF-8?q?=20en=20module=20compta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/fourn/facture/paiement.php | 31 ++++++++++++++++++-- htdocs/fourn/facture/paiementfourn.class.php | 15 ++++++---- 2 files changed, 37 insertions(+), 9 deletions(-) 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 {