diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php new file mode 100644 index 00000000000..91719994f67 --- /dev/null +++ b/htdocs/fourn/facture/paiement.php @@ -0,0 +1,219 @@ + + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ +require("./pre.inc.php3"); +require("./paiementfourn.class.php"); + +$db = new Db(); + +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socidp = $user->societe_id; +} +/* + * + */ +if ($action == 'add') { + $paiementfourn = new PaiementFourn($db); + + $paiementfourn->facid = $facid; + $paiementfourn->datepaye = $db->idate(mktime(12, 0 , 0, + $HTTP_POST_VARS["remonth"], + $HTTP_POST_VARS["reday"], + $HTTP_POST_VARS["reyear"])); + $paiementfourn->amount = $amount; + $paiementfourn->author = $author; + $paiementfourn->paiementid = $paiementid; + $paiementfourn->num_paiement = $num_paiement; + $paiementfourn->note = $note; + + if ( $paiementfourn->create($user) ) + { + Header("Location: fiche.php3?facid=$facid"); + } + + $action = ''; + +} + +/* + * + * + */ + +llxHeader(); + +if ($action == 'create') +{ + + $sql = "SELECT s.nom,s.idp, f.amount, f.total_ttc, f.facnumber"; + $sql .= " FROM societe as s, llx_facture_fourn as f WHERE f.fk_soc = s.idp"; + $sql .= " AND f.rowid = $facid"; + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows(); + if ($num) + { + $obj = $db->fetch_object( 0); + + $total = $obj->total_ttc; + + print_titre("Emettre un paiement"); + print '