*** empty log message ***
This commit is contained in:
parent
079c250a07
commit
7d41814d70
@ -29,12 +29,12 @@ $yn[1] = "oui";
|
||||
$yn[0] = "<b>non</b>";
|
||||
|
||||
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 "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\">";
|
||||
print "<tr><td>Société</td><td colspan=\"2\"><b><a href=\"fiche.php3?socid=$obj->socidp\">$obj->socnom</a></b></td></tr>";
|
||||
print "<tr><td>Société</td><td colspan=\"3\"><b><a href=\"fiche.php3?socid=$obj->socidp\">$obj->socnom</a></b></td></tr>";
|
||||
|
||||
print "<tr><td>date</td><td colspan=\"2\">".strftime("%A %d %B %Y",$obj->df)."</td></tr>\n";
|
||||
print "<tr><td>Auteur</td><td colspan=\"2\">$obj->author</td>";
|
||||
print "<tr><td>Statut</td><td align=\"center\" colspan=\"2\">$obj->statut</td>";
|
||||
print "<tr><td>Paye</td><td align=\"center\" colspan=\"2\" bgcolor=\"#f0f0f0\"><b>".$yn[$obj->paye]."</b></td>";
|
||||
print "<tr><td>Date</td><td colspan=\"3\">".strftime("%A %d %B %Y",$obj->df)."</td></tr>\n";
|
||||
print "<tr><td>Libelle</td><td colspan=\"3\">$obj->libelle</td>";
|
||||
print "<tr><td>Auteur</td><td colspan=\"3\">$obj->author </td>";
|
||||
|
||||
print "<tr><td>Montant</td><td align=\"right\"><b>".price($obj->amount)."</b></td><td>euros HT</td></tr>";
|
||||
print "<tr><td>TVA</td><td align=\"right\">".tva($obj->amount)."</td><td>euros</td></tr>";
|
||||
print "<tr><td>Total</td><td align=\"right\">".price($obj->total)."</td><td>euros TTC</td></tr>";
|
||||
|
||||
print "<tr><td>Statut</td><td align=\"center\">$obj->statut</td>";
|
||||
print "<td>Paye</td><td align=\"center\" bgcolor=\"#f0f0f0\"><b>".$yn[$obj->paye]."</b></td>";
|
||||
|
||||
print "</tr>";
|
||||
print "</table>";
|
||||
|
||||
@ -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 "</table>";
|
||||
$db->free();
|
||||
} else {
|
||||
print $db->error();
|
||||
// print $db->error();
|
||||
}
|
||||
|
||||
print "</td></tr>";
|
||||
@ -295,7 +298,7 @@ if ($action == 'create') {
|
||||
if ($obj->statut == 0) {
|
||||
print "<td align=\"center\" bgcolor=\"#e0e0e0\" width=\"25%\">[<a href=\"$PHP_SELF?facid=$facid&action=valid\">Valider</a>]</td>";
|
||||
} else {
|
||||
print "<td align=\"center\" width=\"25%\"><a href=\"facture.php3?facid=$facid&action=pdf\">Générer la facture</a></td>";
|
||||
print "<td align=\"center\" width=\"25%\">-</td>";
|
||||
}
|
||||
print "</tr></table><p>";
|
||||
|
||||
@ -305,7 +308,7 @@ if ($action == 'create') {
|
||||
*/
|
||||
print "<hr>";
|
||||
print "<table width=\"100%\" cellspacing=2><tr><td width=\"50%\" valign=\"top\">";
|
||||
print "<b>Documents générés</b><br>";
|
||||
print "<b>Documents associés</b><br>";
|
||||
print "<table width=\"100%\" cellspacing=0 border=1 cellpadding=3>";
|
||||
|
||||
$file = $GLOBALS["GLJ_ROOT"] . "/www-sys/doc/facture/$obj->facnumber/$obj->facnumber.pdf";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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 "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||
print '<TR class="liste_titre"><td>';
|
||||
print '<TR class="liste_titre">';
|
||||
print "<TD>Libelle</TD><td>";
|
||||
print_liste_field_titre("Société",$PHP_SELF,"s.nom");
|
||||
print "</td><TD>Ville</TD>";
|
||||
print "</td><TD>Montant</TD>";
|
||||
print "<td colspan=\"2\"> </td>";
|
||||
print "</TR>\n";
|
||||
$var=True;
|
||||
@ -144,8 +134,9 @@ if ($socid > 0) {
|
||||
$var=!$var;
|
||||
|
||||
print "<TR $bc[$var]>";
|
||||
print "<TD><a href=\"fiche.php3?socid=$obj->idp\">$obj->nom</A></td>\n";
|
||||
print "<TD>".$obj->ville."</TD>\n";
|
||||
print "<TD><a href=\"fiche.php3?facid=$obj->facid\">$obj->libelle</A></td>\n";
|
||||
print "<TD><a href=\"fiche.php3?socid=$obj->facid\">$obj->nom</A></td>\n";
|
||||
print '<TD align="right">'.price($obj->amount).'</TD>';
|
||||
|
||||
print "<TD align=\"center\">$obj->prefix_comm </TD>\n";
|
||||
|
||||
|
||||
51
htdocs/fourn/facture/pre.inc.php3
Normal file
51
htdocs/fourn/facture/pre.inc.php3
Normal file
@ -0,0 +1,51 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@ -148,7 +148,8 @@ if ($socid > 0) {
|
||||
print "<TD>".$obj->ville."</TD>\n";
|
||||
|
||||
print "<TD align=\"center\">$obj->prefix_comm </TD>\n";
|
||||
|
||||
|
||||
print '<td><a href="facture/fiche.php3?action=create&socid='.$obj->idp.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Nouvelle facture"></a></td>';
|
||||
|
||||
print "</TR>\n";
|
||||
$i++;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user