diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3
index 8b0c9581577..7eb2aa608a5 100644
--- a/htdocs/compta/facture.php3
+++ b/htdocs/compta/facture.php3
@@ -194,7 +194,7 @@ if ($action == 'send')
$sendto = htmlentities($sendto);
- $sql = "INSERT INTO actioncomm (datea,fk_action,fk_soc,note,fk_facture, fk_contact,fk_user_author, label) VALUES (now(), 9 ,$fac->socidp ,'Envoyée à $sendto',$fac->id, $sendtoid, $user->id, 'Envoi Facture par mail');";
+ $sql = "INSERT INTO llx_actioncomm (datea,fk_action,fk_soc,note,fk_facture, fk_contact,fk_user_author, label) VALUES (now(), 9 ,$fac->socidp ,'Envoyée à $sendto',$fac->id, $sendtoid, $user->id, 'Envoi Facture par mail');";
if (! $db->query($sql) )
{
@@ -644,7 +644,7 @@ else
*
*/
$sql = "SELECT ".$db->pdate("a.datea")." as da, a.note";
- $sql .= " FROM actioncomm as a WHERE a.fk_soc = $obj->socidp AND a.fk_action = 9 AND a.fk_facture = $facid";
+ $sql .= " FROM llx_actioncomm as a WHERE a.fk_soc = $obj->socidp AND a.fk_action = 9 AND a.fk_facture = $facid";
$result = $db->query($sql);
if ($result)
@@ -781,23 +781,35 @@ else
$limit = $conf->liste_limit;
$offset = $limit * $page ;
+ if ($sortorder == "")
+ {
+ $sortorder="DESC";
+ }
+ if ($sortfield == "")
+ {
+ $sortfield="f.datef";
+ }
+
print_barre_liste("Factures",$page,$PHP_SELF);
$sql = "SELECT s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid";
$sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp";
- if ($socidp) {
- $sql .= " AND s.idp = $socidp";
- }
+ if ($socidp)
+ {
+ $sql .= " AND s.idp = $socidp";
+ }
- if ($month > 0) {
- $sql .= " AND date_format(f.datef, '%m') = $month";
- }
- if ($year > 0) {
- $sql .= " AND date_format(f.datef, '%Y') = $year";
- }
+ if ($month > 0)
+ {
+ $sql .= " AND date_format(f.datef, '%m') = $month";
+ }
+ if ($year > 0)
+ {
+ $sql .= " AND date_format(f.datef, '%Y') = $year";
+ }
- $sql .= " ORDER BY f.datef DESC, f.facnumber DESC ";
+ $sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit( $limit ,$offset);
$result = $db->query($sql);
@@ -807,9 +819,11 @@ else
$i = 0;
print "
";
print '';
- print "| Numéro | ";
+ print ' | Numéro | ';
+ print '';
print_liste_field_titre("Société",$PHP_SELF,"s.nom");
- print " | Date | Montant | ";
+ print 'Date | ';
+ print 'Montant | ';
print ' | ';
print "
\n";
diff --git a/htdocs/compta/fiche.php3 b/htdocs/compta/fiche.php3
index b90eeeda2e6..5c2df661c93 100644
--- a/htdocs/compta/fiche.php3
+++ b/htdocs/compta/fiche.php3
@@ -75,7 +75,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);
}
@@ -89,7 +89,7 @@ if ($action == 'stcomm')
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
@@ -100,7 +100,7 @@ if ($action == 'stcomm')
if ($actioncommid)
{
- $sql = "INSERT INTO actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')";
+ $sql = "INSERT INTO llx_actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')";
$result = @$db->query($sql);
if (!$result)
@@ -120,7 +120,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)."%'";
}
@@ -154,7 +154,7 @@ 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')
@@ -233,7 +233,7 @@ if ($socid > 0)
print "";
$var=!$var;
$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 s.idp = $objsoc->idp ORDER BY f.datef DESC";
+ $sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND s.idp = $objsoc->idp ORDER BY f.datef DESC";
if ( $db->query($sql) ) {
$num = $db->num_rows(); $i = 0;
if ($num > 0) {
@@ -378,7 +378,7 @@ if ($socid > 0)
*
*/
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
- $sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u ";
+ $sql .= " FROM llx_actioncomm as a, c_actioncomm as c, llx_user as u ";
$sql .= " WHERE a.fk_soc = $objsoc->idp ";
$sql .= " AND u.rowid = a.fk_user_author";
$sql .= " AND c.id=a.fk_action ";
diff --git a/htdocs/fourn/index.php3 b/htdocs/fourn/index.php3
index 85f00e1b9f2..a420a2c8b32 100644
--- a/htdocs/fourn/index.php3
+++ b/htdocs/fourn/index.php3
@@ -35,8 +35,9 @@ llxHeader();
$db = new Db();
-if ($action == 'note') {
- $sql = "UPDATE societe SET note='$note' WHERE idp=$socid";
+if ($action == 'note')
+{
+ $sql = "UPDATE llx_societe SET note='$note' WHERE idp=$socid";
$result = $db->query($sql);
}
@@ -47,7 +48,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 !";
@@ -77,7 +78,7 @@ $pagenext = $page + 1;
*/
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)."%'";
}
@@ -109,7 +110,7 @@ if ($mode == 'search') {
print_barre_liste("Liste des fournisseurs",$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, s.ville,".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm FROM llx_societe as s, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.fournisseur=1";
if (strlen($stcomm)) {
$sql .= " AND s.fk_stcomm=$stcomm";