Correction nom de table societe en llx_societe

This commit is contained in:
Rodolphe Quiedeville 2003-06-18 13:01:15 +00:00
parent 821f65361b
commit 85611356bf
7 changed files with 46 additions and 49 deletions

View File

@ -1,8 +1,5 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
/* Copyright (C) 2001-2003 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
@ -18,6 +15,9 @@
* 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");
@ -60,7 +60,7 @@ function get_ca ($db, $year, $socidp) {
function propals ($db, $year, $month) {
global $bc;
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price - p.remise as price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
$sql .= " FROM societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
$sql .= " AND c.id in (1,2)";
$sql .= " AND date_format(p.datep, '%Y') = $year ";
$sql .= " AND round(date_format(p.datep, '%m')) = $month ";
@ -131,7 +131,7 @@ function factures ($db, $year, $month, $paye) {
global $bc;
$sql = "SELECT s.nom, s.idp, f.facnumber, f.amount,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.paye = $paye";
$sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.paye = $paye";
$sql .= " AND date_format(f.datef, '%Y') = $year ";
$sql .= " AND round(date_format(f.datef, '%m')) = $month ";
$sql .= " ORDER BY f.datef DESC ";

View File

@ -44,7 +44,7 @@ print "<TD align=\"center\">Montant</TD><td align=\"right\">Solde</td>";
print "</TR>\n";
$sql = "SELECT s.nom,sum(f.amount) as amount";
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp";
$sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp";
if ($year > 0) {
$sql .= " AND date_format(f.datef, '%Y') = $year";
}
@ -87,7 +87,7 @@ print '<tr><td colspan="3" align="right">'.price($total).'</td></tr>';
*
*/
$sql = "SELECT s.nom,sum(f.amount) as amount";
$sql .= " FROM societe as s,llx_facture_fourn as f WHERE f.fk_soc = s.idp";
$sql .= " FROM llx_societe as s,llx_facture_fourn as f WHERE f.fk_soc = s.idp";
if ($year > 0) {
$sql .= " AND date_format(f.datef, '%Y') = $year";
}

View File

@ -157,7 +157,7 @@ if ($action == 'create')
print '<td><select name="socidp">';
$sql = "SELECT s.nom, s.prefix_comm, s.idp";
$sql .= " FROM societe as s WHERE s.fournisseur = 1 ORDER BY s.nom ASC";
$sql .= " FROM llx_societe as s WHERE s.fournisseur = 1 ORDER BY s.nom ASC";
if ( $db->query($sql) )
{
@ -239,7 +239,7 @@ else
$fac->fetch($facid);
$sql = "SELECT s.nom as socnom, s.idp as socidp, f.facnumber, f.amount, f.tva, f.total, ".$db->pdate("f.datef")." as df, f.paye, f.fk_statut as statut, f.note, f.libelle, f.rowid";
$sql .= " FROM societe as s,llx_facture_fourn as f WHERE f.fk_soc = s.idp AND f.rowid = $facid";
$sql .= " FROM llx_societe as s,llx_facture_fourn as f WHERE f.fk_soc = s.idp AND f.rowid = $facid";
$result = $db->query( $sql);

View File

@ -66,7 +66,7 @@ if ($mode == 'search')
{
if ($mode-search == 'soc')
{
$sql = "SELECT s.idp FROM societe as s ";
$sql = "SELECT s.idp FROM llx_societe as s ";
$sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'";
}
@ -98,7 +98,7 @@ if ($sortfield == "")
$sql = "SELECT s.idp as socid, s.nom, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, s.prefix_comm, fac.total_ht, fac.paye, fac.libelle, ".$db->pdate("fac.datef")." as datef, fac.rowid as facid, fac.facnumber";
$sql .= " FROM societe as s, llx_facture_fourn as fac ";
$sql .= " FROM llx_societe as s, llx_facture_fourn as fac ";
$sql .= " WHERE fac.fk_soc = s.idp";
if ($socid)

View File

@ -69,7 +69,7 @@ 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 .= " FROM llx_societe as s, llx_facture_fourn as f WHERE f.fk_soc = s.idp";
$sql .= " AND f.rowid = $facid";
$result = $db->query($sql);

View File

@ -1,8 +1,5 @@
<?PHP
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
*
* 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
@ -18,6 +15,9 @@
* 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("../contact.class.php3");
@ -58,7 +58,7 @@ if ($action == 'recontact')
}
if ($action == 'note') {
$sql = "UPDATE societe SET note='$note' WHERE idp=$socid";
$sql = "UPDATE llx_societe SET note='$note' WHERE idp=$socid";
$result = $db->query($sql);
}
@ -69,7 +69,7 @@ if ($action == 'stcomm') {
$result = @$db->query($sql);
if ($result) {
$sql = "UPDATE societe SET fk_stcomm=$stcommid WHERE idp=$socid";
$sql = "UPDATE llx_societe SET fk_stcomm=$stcommid WHERE idp=$socid";
$result = $db->query($sql);
} else {
$errmesg = "ERREUR DE DATE !";
@ -93,7 +93,7 @@ if ($action == 'stcomm') {
*/
if ($mode == 'search') {
if ($mode-search == 'soc') {
$sql = "SELECT s.idp FROM societe as s ";
$sql = "SELECT s.idp FROM llx_societe as s ";
$sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'";
}
@ -114,7 +114,7 @@ if ($mode == 'search') {
if ($socid > 0) {
$societe = new Societe($db, $socid);
$sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.address,s.cp,s.ville, s.note, t.libelle as typent, e.libelle as effectif, s.siren, s.prefix_comm, s.services,s.parent, s.description FROM societe as s, c_stcomm as st, c_typent as t, c_effectif as e ";
$sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.address,s.cp,s.ville, s.note, t.libelle as typent, e.libelle as effectif, s.siren, s.prefix_comm, s.services,s.parent, s.description FROM llx_societe as s, c_stcomm as st, c_typent as t, c_effectif as e ";
$sql .= " WHERE s.fk_stcomm=st.id AND s.fk_typent = t.id AND s.fk_effectif = e.id";
if ($to == 'next') {

View File

@ -1,8 +1,5 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
/* Copyright (C) 2001-2003 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
@ -18,11 +15,15 @@
* 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");
$db = new Db();
if ($sortorder == "") {
if ($sortorder == "")
{
$sortfield="lower(s.nom)";
$sortorder="ASC";
}
@ -75,7 +76,7 @@ $pagenext = $page + 1;
if ($socid > 0) {
$sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.cp,s.ville, s.note FROM societe as s, c_stcomm as st ";
$sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.cp,s.ville, s.note FROM llx_societe as s, c_stcomm as st ";
$sql .= " WHERE s.fk_stcomm=st.id";
if ($to == 'next') {
@ -95,7 +96,7 @@ if ($socid > 0) {
*/
print "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n";
print "<tr><td><div class=\"titre\">Contacts pour la société : <a href=\"fiche.php3?socid=$objsoc->idp\">$objsoc->nom</a></div></td>";
print "<td bgcolor=\"#e0E0E0\" align=\"center\">[<a href=\"people.php3?socid=$socid&action=addcontact\">Ajouter un contact</a>]</td>";
print "<td align=\"center\">[<a href=\"people.php3?socid=$socid&action=addcontact\">Ajouter un contact</a>]</td>";
print '</td></tr></table>';
print "<hr>";
@ -109,8 +110,7 @@ if ($socid > 0) {
}
print "</td>\n";
print "<td valign=\"top\"><table border=0 width=\"100%\" cellspacing=0 bgcolor=#e0e0e0>";
print "<tr><td>Créée le</td><td align=center><b>" . strftime("%d %b %Y %H:%M", $objsoc->dc) . "</b></td></tr>";
print "<td valign=\"top\"><table border=0 width=\"100%\" cellspacing=0>";
print "</table></td></tr>\n";
print "</table>";
@ -120,13 +120,10 @@ if ($socid > 0) {
*/
print "<table border=0 width=\"100%\" cellspacing=0 bgcolor=#e0e0e0>";
print "<table border=0 width=\"100%\" cellspacing=0>";
print "<tr><td>".nl2br($objsoc->note)."</td></tr>";
print "</table>";
$bc1="bgcolor=\"#c0f0c0\"";
$bc3="bgcolor=\"#90c090\"";
$bc2="bgcolor=\"#b0e0b0\"";
} else {
print $db->error();
}
@ -145,23 +142,23 @@ if ($socid > 0) {
}
$sql .= " ORDER by p.datec";
$result = $db->query($sql);
$i = 0 ; $num = $db->num_rows(); $tag = True;
while ($i < $num) {
$obj = $db->fetch_object( $i);
if ($tag) {
print "<tr bgcolor=\"e0e0e0\">";
} else {
print "<tr>";
$i = 0 ; $num = $db->num_rows(); $var = True;
while ($i < $num)
{
$obj = $db->fetch_object( $i);
$var != $var;
print "<tr $bc[$var]>";
print "<td>$obj->firstname $obj->name</td>";
print "<td>$obj->poste&nbsp;</td>";
print "<td>$obj->phone&nbsp;</td>";
print "<td>$obj->fax&nbsp;</td>";
print "<td><a href=\"mailto:$obj->email\">$obj->email</a>&nbsp;</td>";
print "</tr>\n";
$i++;
$tag = !$tag;
}
print "<td>$obj->firstname $obj->name</td>";
print "<td>$obj->poste&nbsp;</td>";
print "<td>$obj->phone&nbsp;</td>";
print "<td>$obj->fax&nbsp;</td>";
print "<td><a href=\"mailto:$obj->email\">$obj->email</a>&nbsp;</td>";
print "</tr>\n";
$i++;
$tag = !$tag;
}
print "</table>";