Mise à jour des noms de tables

This commit is contained in:
Rodolphe Quiedeville 2003-05-25 16:44:11 +00:00
parent d29346aac2
commit cb8025f4ae
3 changed files with 19 additions and 12 deletions

View File

@ -56,7 +56,7 @@ if ($catotal == 0) { $catotal = 1; };
$sql = "SELECT s.nom, s.idp, sum(f.amount) as ca"; $sql = "SELECT s.nom, s.idp, sum(f.amount) as ca";
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp GROUP BY s.nom, s.idp ORDER BY ca DESC"; $sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp GROUP BY s.nom, s.idp ORDER BY ca DESC";
$result = $db->query($sql); $result = $db->query($sql);
if ($result) { if ($result) {

View File

@ -98,7 +98,7 @@ if ($action == 'recontact')
if ($action == 'note') 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); $result = $db->query($sql);
} }
@ -112,7 +112,7 @@ if ($action == 'stcomm')
if ($result) 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); $result = $db->query($sql);
} }
else else
@ -123,7 +123,7 @@ if ($action == 'stcomm')
if ($actioncommid) 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); $result = @$db->query($sql);
if (!$result) if (!$result)
@ -140,7 +140,7 @@ if ($action == 'stcomm')
*/ */
if ($mode == 'search') { if ($mode == 'search') {
if ($mode-search == 'soc') { 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)."%'"; $sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'";
} }
@ -169,7 +169,7 @@ $pagenext = $page + 1;
*/ */
print_barre_liste("Liste des clients", $page, $PHP_SELF,"",$sortfield,$sortorder); print_barre_liste("Liste des clients", $page, $PHP_SELF,"",$sortfield,$sortorder);
$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.client=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.client=1";
if (strlen($stcomm)) if (strlen($stcomm))
{ {

View File

@ -45,8 +45,9 @@ if ($user->societe_id > 0)
* *
*/ */
if ($action == 'add_paiement') { if ($action == 'add_paiement')
$datepaye = $db->idate(mktime(12, 0 , 0, $pmonth, $pday, $pyear)); {
$datepaye = $db->idate(mktime(12, 0 , 0, $remonth, $reday, $reyear));
$paiement = new Paiement($db); $paiement = new Paiement($db);
@ -61,6 +62,12 @@ if ($action == 'add_paiement') {
$paiement->create(); $paiement->create();
$action = ''; $action = '';
$label = "Réglement facture N°";
$acc = new Account($db, $HTTP_POST_VARS["accountid"]);
$acc->addline($datepaye, $paiementid, $label, $amount, $num_paiement);
} }
/* /*
* *
@ -233,14 +240,14 @@ if ($action == 'create')
if ($propalid) if ($propalid)
{ {
$sql = "SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.tva, p.total, p.ref, ".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst"; $sql = "SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.tva, p.total, p.ref, ".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst";
$sql .= " FROM societe as s, llx_propal as p, c_propalst as c"; $sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c";
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id"; $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
$sql .= " AND p.rowid = $propalid"; $sql .= " AND p.rowid = $propalid";
} }
else else
{ {
$sql = "SELECT s.nom, s.prefix_comm, s.idp "; $sql = "SELECT s.nom, s.prefix_comm, s.idp ";
$sql .= "FROM societe as s "; $sql .= "FROM llx_societe as s ";
$sql .= "WHERE s.idp = $socidp"; $sql .= "WHERE s.idp = $socidp";
} }
@ -319,7 +326,7 @@ else
if ($facid > 0) { 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.fk_user_author, f.note"; $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.fk_user_author, f.note";
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.rowid = $facid"; $sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.rowid = $facid";
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
@ -777,7 +784,7 @@ else
print_barre_liste("Factures",$page,$PHP_SELF); 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 = "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"; $sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp";
if ($socidp) { if ($socidp) {
$sql .= " AND s.idp = $socidp"; $sql .= " AND s.idp = $socidp";