From 7d41814d709932de88cef9b031cd12bac2c3027e Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 25 Jun 2002 17:08:58 +0000 Subject: [PATCH] *** empty log message *** --- htdocs/fourn/facture/fiche.php3 | 29 ++++++++++-------- htdocs/fourn/facture/index.php3 | 37 +++++++++------------- htdocs/fourn/facture/pre.inc.php3 | 51 +++++++++++++++++++++++++++++++ htdocs/fourn/index.php3 | 3 +- htdocs/fourn/pre.inc.php3 | 3 ++ 5 files changed, 86 insertions(+), 37 deletions(-) create mode 100644 htdocs/fourn/facture/pre.inc.php3 diff --git a/htdocs/fourn/facture/fiche.php3 b/htdocs/fourn/facture/fiche.php3 index e007ce471d1..997868d70eb 100644 --- a/htdocs/fourn/facture/fiche.php3 +++ b/htdocs/fourn/facture/fiche.php3 @@ -29,12 +29,12 @@ $yn[1] = "oui"; $yn[0] = "non"; if ($action == 'valid') { - $sql = "UPDATE llx_facture set fk_statut = 1 WHERE rowid = $facid ;"; + $sql = "UPDATE llx_facture_fourn set fk_statut = 1 WHERE rowid = $facid ;"; $result = $db->query( $sql); } if ($action == 'payed') { - $sql = "UPDATE llx_facture set paye = 1 WHERE rowid = $facid ;"; + $sql = "UPDATE llx_facture_fourn set paye = 1 WHERE rowid = $facid ;"; $result = $db->query( $sql); } @@ -184,8 +184,8 @@ if ($action == 'create') { if ($facid > 0) { - $sql = "SELECT s.nom as socnom, s.idp as socidp, f.facnumber, f.amount, f.total, ".$db->pdate("f.datef")." as df, f.paye, f.fk_statut as statut, f.author, f.note"; - $sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.rowid = $facid"; + $sql = "SELECT s.nom as socnom, s.idp as socidp, f.facnumber, f.amount, f.total, ".$db->pdate("f.datef")." as df, f.paye, f.fk_statut as statut, f.note, f.libelle"; + $sql .= " FROM societe as s,llx_facture_fourn as f WHERE f.fk_soc = s.idp AND f.rowid = $facid"; $result = $db->query( $sql); @@ -209,17 +209,19 @@ if ($action == 'create') { * Facture */ print ""; - print ""; + print ""; - print "\n"; - print ""; - print ""; - print ""; + print "\n"; + print ""; + print ""; print ""; print ""; print ""; + print ""; + print ""; + print ""; print "
Sociétésocidp\">$obj->socnom
Sociétésocidp\">$obj->socnom
date".strftime("%A %d %B %Y",$obj->df)."
Auteur$obj->author
Statut$obj->statut
Paye".$yn[$obj->paye]."
Date".strftime("%A %d %B %Y",$obj->df)."
Libelle$obj->libelle
Auteur$obj->author 
Montant".price($obj->amount)."euros HT
TVA".tva($obj->amount)."euros
Total".price($obj->total)."euros TTC
Statut$obj->statutPaye".$yn[$obj->paye]."
"; @@ -233,7 +235,8 @@ if ($action == 'create') { $sql = "SELECT ".$db->pdate("datep")." as dp, p.amount, c.libelle as paiement_type, p.num_paiement, p.rowid"; $sql .= " FROM llx_paiement as p, c_paiement as c WHERE p.fk_facture = $facid AND p.fk_paiement = c.id"; - $result = $db->query($sql); + //$result = $db->query($sql); + $result = 0; if ($result) { $num = $db->num_rows(); $i = 0; $total = 0; @@ -268,7 +271,7 @@ if ($action == 'create') { print ""; $db->free(); } else { - print $db->error(); + // print $db->error(); } print ""; @@ -295,7 +298,7 @@ if ($action == 'create') { if ($obj->statut == 0) { print "[Valider]"; } else { - print "Générer la facture"; + print "-"; } print "

"; @@ -305,7 +308,7 @@ if ($action == 'create') { */ print "


"; print "
"; - print "Documents générés
"; + print "Documents associés
"; print ""; $file = $GLOBALS["GLJ_ROOT"] . "/www-sys/doc/facture/$obj->facnumber/$obj->facnumber.pdf"; diff --git a/htdocs/fourn/facture/index.php3 b/htdocs/fourn/facture/index.php3 index 14c78777901..ee63ffc90e5 100644 --- a/htdocs/fourn/facture/index.php3 +++ b/htdocs/fourn/facture/index.php3 @@ -1,5 +1,5 @@ +/* Copyright (C) 2002 Rodolphe Quiedeville * * 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 @@ -20,7 +20,7 @@ * */ require("./pre.inc.php3"); -require("../contact.class.php3"); +require("../../contact.class.php3"); llxHeader(); @@ -101,27 +101,16 @@ if ($socid > 0) { * * */ - print_barre_liste("Liste des fournisseurs",$page, $PHP_SELF); + print_barre_liste("Liste des factures", $page, $PHP_SELF); - $sql = "SELECT s.idp, s.nom, s.ville,".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm FROM societe as s, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.fournisseur=1"; + $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, s.prefix_comm, fac.amount, fac.paye, fac.libelle, ".$db->pdate("fac.datef")." as datef, fac.rowid as facid"; + $sql .= " FROM societe as s, llx_facture_fourn as fac "; + $sql .= " WHERE fac.fk_soc = s.idp"; - if (strlen($stcomm)) { - $sql .= " AND s.fk_stcomm=$stcomm"; - } - - if (strlen($begin)) { - $sql .= " AND upper(s.nom) like '$begin%'"; - } - - if ($socname) { - $sql .= " AND lower(s.nom) like '%".strtolower($socname)."%'"; - $sortfield = "lower(s.nom)"; - $sortorder = "ASC"; - } - - $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset); + // $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset); $result = $db->query($sql); + if ($result) { $num = $db->num_rows(); $i = 0; @@ -132,9 +121,10 @@ if ($socid > 0) { $sortorder="DESC"; } print "

"; - print ''; + print ""; + print ""; print ""; print "\n"; $var=True; @@ -144,8 +134,9 @@ if ($socid > 0) { $var=!$var; print ""; - print "\n"; - print "\n"; + print "\n"; + print "\n"; + print ''; print "\n"; diff --git a/htdocs/fourn/facture/pre.inc.php3 b/htdocs/fourn/facture/pre.inc.php3 new file mode 100644 index 00000000000..8c819571b30 --- /dev/null +++ b/htdocs/fourn/facture/pre.inc.php3 @@ -0,0 +1,51 @@ + + * + * 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("../../main.inc.php3"); + +function llxHeader($head = "", $urlp = "") { + global $user, $conf; + + + /* + * + * + */ + top_menu($head); + + $menu = new Menu(); + + $menu->add("/comm/clients.php3", "Clients"); + + $menu->add("/fourn/index.php3", "Fournisseurs"); + + + $menu->add_submenu("/soc.php3?&action=create","Nouvelle sociétée"); + $menu->add_submenu("contact.php3","Contacts"); + + $menu->add("/fourn/facture/index.php3", "Factures"); + $menu->add_submenu("fiche.php3?action=create","Nouvelle"); + + left_menu($menu->liste); +} + + +?> diff --git a/htdocs/fourn/index.php3 b/htdocs/fourn/index.php3 index 14c78777901..c3dadd8fe56 100644 --- a/htdocs/fourn/index.php3 +++ b/htdocs/fourn/index.php3 @@ -148,7 +148,8 @@ if ($socid > 0) { print "\n"; print "\n"; - + + print ''; print "\n"; $i++; diff --git a/htdocs/fourn/pre.inc.php3 b/htdocs/fourn/pre.inc.php3 index 1a9691ff5d8..eecaa85d83e 100644 --- a/htdocs/fourn/pre.inc.php3 +++ b/htdocs/fourn/pre.inc.php3 @@ -42,6 +42,9 @@ function llxHeader($head = "", $urlp = "") { $menu->add_submenu("contact.php3","Contacts"); + $menu->add("/fourn/facture/index.php3", "Factures"); + + left_menu($menu->liste); }
'; + print '
Libelle"; print_liste_field_titre("Société",$PHP_SELF,"s.nom"); - print "VilleMontant 
idp\">$obj->nom".$obj->ville."facid\">$obj->libellefacid\">$obj->nom'.price($obj->amount).'$obj->prefix_comm ".$obj->ville."$obj->prefix_comm Nouvelle facture