Mises aux normes, debut d'implementation des commandes, travail dans le train retour JDLL2003 :)

This commit is contained in:
Rodolphe Quiedeville 2003-11-03 08:44:04 +00:00
parent 9942b17e3a
commit 50c13e2594
11 changed files with 70 additions and 47 deletions

View File

@ -40,10 +40,6 @@ require("../propal.class.php");
require("../actioncomm.class.php"); require("../actioncomm.class.php");
require("../lib/CMailFile.class.php"); require("../lib/CMailFile.class.php");
/*
*
*/
/* /*
* Sécurité accés client * Sécurité accés client
*/ */

View File

@ -62,15 +62,15 @@ if ($action == 'del_bookmark')
*/ */
print_titre(translate("Espace comptabilité")); print_titre(translate("Espace comptabilité"));
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">'; print '<table border="0" width="100%" cellspacing="0" cellpadding="4">';
print '<tr><td valign="top" width="30%">'; print '<tr><td valign="top" width="30%">';
/* /*
* *
*/ */
print '<form method="post" action="facture.php">'; print '<form method="post" action="facture.php">';
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">'; print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print "<TR class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td colspan="2">Rechercher une facture</td></tr>'; print '<td colspan="2">Rechercher une facture</td></tr>';
print "<tr $bc[1]><td>"; print "<tr $bc[1]><td>";
print 'Num. : <input type="text" name="sf_ref">&nbsp;<input type="submit" value="Rechercher" class="flat"></td></tr>'; print 'Num. : <input type="text" name="sf_ref">&nbsp;<input type="submit" value="Rechercher" class="flat"></td></tr>';
@ -198,7 +198,6 @@ if ( $db->query($sql) )
print '</table>'; print '</table>';
} }
/* /*
* Actions a faire
* *
* *
*/ */
@ -222,16 +221,15 @@ if ($user->comm > 0 && $conf->commercial )
if ($num) if ($num)
{ {
$i = 0; $i = 0;
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">'; print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print "<TR class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td colspan="2">'.translate("Propositions comm. à facturer").'</td>'; print '<td colspan="2">'.translate("Propositions commerciales à facturer").'</td></tr>';
print "</TR>\n";
while ($i < $num) while ($i < $num)
{ {
$var=!$var; $var=!$var;
$obj = $db->fetch_object($i); $obj = $db->fetch_object($i);
print "<tr $bc[$var]><td><a href=\"propal.php?propalid=$obj->rowid\">$obj->ref</a></td>"; print "<tr $bc[$var]><td width=\"20%\"><a href=\"propal.php?propalid=$obj->rowid\">$obj->ref</a></td>";
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td></tr>'; print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td></tr>';
$i++; $i++;
} }
@ -266,7 +264,7 @@ if ( $db->query($sql) )
{ {
$obj = $db->fetch_object( $i); $obj = $db->fetch_object( $i);
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td><a href="facture.php?facid='.$obj->rowid.'">'.$obj->facnumber.'</a></td>'; print '<tr '.$bc[$var].'><td width="20%"><a href="facture.php?facid='.$obj->rowid.'">'.$obj->facnumber.'</a></td>';
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td>'; print '<td><a href="fiche.php?socid='.$obj->idp.'">'.$obj->nom.'</a></td>';
print '<td align="right">'.price($obj->total_ttc).'</td></tr>'; print '<td align="right">'.price($obj->total_ttc).'</td></tr>';
$i++; $i++;

View File

@ -58,15 +58,12 @@ function llxHeader($head = "", $title="") {
$menu->add("tva/index.php","TVA"); $menu->add("tva/index.php","TVA");
} }
$menu->add(DOL_URL_ROOT."/compta/caisse/index.php","Caisse"); if ($user->societe_id == 0)
{
$menu->add(DOL_URL_ROOT."/compta/caisse/index.php","Caisse");
$menu->add(DOL_URL_ROOT."/fourn/index.php", "Fournisseurs"); $menu->add(DOL_URL_ROOT."/fourn/index.php", "Fournisseurs");
}
/*
* $menu->add("ligne.php","Compta");
* $menu->add_submenu("ligne.php","Lignes");
* $menu->add_submenu("config.php","Configuration");
*/
if ($user->compta > 0) if ($user->compta > 0)
{ {
@ -78,7 +75,10 @@ function llxHeader($head = "", $title="") {
$menu->add(DOL_URL_ROOT."/","Accueil"); $menu->add(DOL_URL_ROOT."/","Accueil");
} }
$menu->add(DOL_URL_ROOT."/compta/deplacement/", "Déplacement"); if ($user->societe_id == 0)
{
$menu->add(DOL_URL_ROOT."/compta/deplacement/", "Déplacement");
}
left_menu($menu->liste); left_menu($menu->liste);

View File

@ -34,9 +34,15 @@ require("../lib/CMailFile.class.php");
require("../project.class.php"); require("../project.class.php");
require("../propal.class.php"); require("../propal.class.php");
require("../actioncomm.class.php"); require("../actioncomm.class.php");
/* /*
* * Sécurité accés client
*/ */
if ($user->societe_id > 0)
{
$action = '';
$socidp = $user->societe_id;
}
llxHeader(); llxHeader();
@ -127,7 +133,7 @@ if ($propalid)
$projet = new Project($db); $projet = new Project($db);
$projet->fetch($obj->fk_projet); $projet->fetch($obj->fk_projet);
print '<tr><td>Projet</td><td colspan="1">'; print '<tr><td>Projet</td><td colspan="1">';
print '<a href="projet/fiche.php?id='.$projet->id.'">'; print '<a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id.'">';
print $projet->title.'</a></td></tr>'; print $projet->title.'</a></td></tr>';
} }
print "<tr><td>Destinataire</td><td colspan=\"2\">$obj->firstname $obj->name &lt;$obj->email&gt;</td></tr>"; print "<tr><td>Destinataire</td><td colspan=\"2\">$obj->firstname $obj->name &lt;$obj->email&gt;</td></tr>";

View File

@ -167,7 +167,7 @@ function pt ($db, $sql, $year) {
if ($result) { if ($result) {
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $total = 0 ; $i = 0; $total = 0 ;
print "<TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">"; print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
print "<TR class=\"liste_titre\">"; print "<TR class=\"liste_titre\">";
print "<TD>Mois</TD>"; print "<TD>Mois</TD>";
print "<td align=\"right\">Montant</td></tr>\n"; print "<td align=\"right\">Montant</td></tr>\n";
@ -269,7 +269,7 @@ function ppt ($db, $year, $socidp)
print "</td><td valign=\"top\" width=\"30%\">"; print "</td><td valign=\"top\" width=\"30%\">";
print "<TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">"; print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
print "<TR class=\"liste_titre\">"; print "<TR class=\"liste_titre\">";
print "<TD>Mois</TD>"; print "<TD>Mois</TD>";
print "<TD align=\"right\">Montant</TD>"; print "<TD align=\"right\">Montant</TD>";

View File

@ -37,7 +37,7 @@ function propals ($db, $year, $month) {
$result = $db->query($sql); $result = $db->query($sql);
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print '<p><table class="border" width="100%" cellspacing="0" cellpadding="4">';
print "<TR bgcolor=\"#e0e0e0\"><td colspan=\"3\"><b>Propal</b></td></tr>"; print "<TR bgcolor=\"#e0e0e0\"><td colspan=\"3\"><b>Propal</b></td></tr>";
$oldstatut = -1; $oldstatut = -1;
@ -87,7 +87,7 @@ function propals ($db, $year, $month) {
print "<tr>"; print "<tr>";
print "<td colspan=\"2\" align=\"right\"><b>Total : ".price($total)."</b></td>"; print "<td colspan=\"2\" align=\"right\"><b>Total : ".price($total)."</b></td>";
print "<td align=\"left\"><b>Euros HT</b></td></tr>"; print "<td align=\"left\"><b>Euros HT</b></td></tr>";
print "</TABLE>"; print "</table>";
$db->free(); $db->free();
} }
@ -157,7 +157,7 @@ function pt ($db, $sql, $year) {
if ($result) { if ($result) {
$num = $db->num_rows(); $num = $db->num_rows();
$i = 0; $total = 0 ; $i = 0; $total = 0 ;
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">"; print '<p><table class="border" width="100%" cellspacing="0" cellpadding="3">';
print "<TR class=\"liste_titre\">"; print "<TR class=\"liste_titre\">";
print "<TD>Mois</TD>"; print "<TD>Mois</TD>";
print "<td align=\"right\">Montant</td></tr>\n"; print "<td align=\"right\">Montant</td></tr>\n";
@ -229,7 +229,7 @@ function ppt ($db, $year, $socidp)
print "CA ".($year - 1); print "CA ".($year - 1);
print "</td><td align=\"center\">CA $year</td>"; print "</td><td align=\"center\">CA $year</td>";
print "<td valign=\"top\">Delta</td></tr>"; print '<td align="center">Delta</td></tr>';
print "<tr><td valign=\"top\" width=\"30%\">"; print "<tr><td valign=\"top\" width=\"30%\">";
$sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm"; $sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm";
@ -259,7 +259,7 @@ function ppt ($db, $year, $socidp)
print "</td><td valign=\"top\" width=\"30%\">"; print "</td><td valign=\"top\" width=\"30%\">";
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">"; print '<p><table class="border" width="100%" cellspacing="0" cellpadding="3">';
print "<TR class=\"liste_titre\">"; print "<TR class=\"liste_titre\">";
print "<TD>Mois</TD>"; print "<TD>Mois</TD>";
print "<TD align=\"right\">Montant</TD>"; print "<TD align=\"right\">Montant</TD>";

View File

@ -28,6 +28,16 @@ llxHeader();
$mesg = ''; $mesg = '';
/*
* Sécurité accés client
*/
if ($user->societe_id > 0)
{
$action = '';
$socid = $user->societe_id;
}
if ($action == 'add') if ($action == 'add')
{ {
$contrat = new Contrat($db); $contrat = new Contrat($db);
@ -97,7 +107,7 @@ if ($action == 'create')
print '<input type="hidden" name="type" value="'.$type.'">'."\n"; print '<input type="hidden" name="type" value="'.$type.'">'."\n";
print '<div class="titre">Nouveau '.$types[$type].'</div><br>'."\n"; print '<div class="titre">Nouveau '.$types[$type].'</div><br>'."\n";
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">'; print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
print "<tr>"; print "<tr>";
print '<td>Référence</td><td><input name="ref" size="20" value=""></td></tr>'; print '<td>Référence</td><td><input name="ref" size="20" value=""></td></tr>';
print '<td>Libellé</td><td><input name="libelle" size="40" value=""></td></tr>'; print '<td>Libellé</td><td><input name="libelle" size="40" value=""></td></tr>';
@ -133,7 +143,7 @@ else
{ {
print_fiche_titre('Fiche contrat : '.$contrat->id, $mesg); print_fiche_titre('Fiche contrat : '.$contrat->id, $mesg);
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">'; print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
print "<tr>"; print "<tr>";
print '<td width="20%">Service</td><td width="40%">'.$contrat->product->label_url.'</td>'; print '<td width="20%">Service</td><td width="40%">'.$contrat->product->label_url.'</td>';
print '<td colspan="2">'; print '<td colspan="2">';
@ -202,7 +212,7 @@ else
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
print '<br><table width="100%" border="1" cellspacing="0" cellpadding="3">'; print '<br><table width="100%" id="actions" cellspacing="0" cellpadding="3">';
print '<td width="20%" align="center">-</td>'; print '<td width="20%" align="center">-</td>';
if ($contrat->enservice) if ($contrat->enservice)

View File

@ -21,12 +21,19 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
llxHeader(); llxHeader();
if ($page == -1) { if ($page == -1) {
$page = 0 ; $page = 0 ;
} }
/*
* Sécurité accés client
*/
if ($user->societe_id > 0)
{
$action = '';
$socid = $user->societe_id;
}
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
@ -44,6 +51,10 @@ if ($sortorder == "")
$sql = "SELECT s.nom, c.rowid as cid, c.enservice, p.label, p.rowid, s.idp as sidp"; $sql = "SELECT s.nom, c.rowid as cid, c.enservice, p.label, p.rowid, s.idp as sidp";
$sql .= " FROM llx_contrat as c, llx_societe as s, llx_product as p"; $sql .= " FROM llx_contrat as c, llx_societe as s, llx_product as p";
$sql .= " WHERE c.fk_soc = s.idp AND c.fk_product = p.rowid"; $sql .= " WHERE c.fk_soc = s.idp AND c.fk_product = p.rowid";
if ($socid > 0)
{
$sql .= " AND s.idp = $socid";
}
$sql .= " ORDER BY $sortfield $sortorder "; $sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit($limit + 1 ,$offset); $sql .= $db->plimit($limit + 1 ,$offset);

View File

@ -27,9 +27,12 @@ $info_box_contents = array();
$sql = "SELECT s.nom,s.idp, p.label, c.rowid"; $sql = "SELECT s.nom,s.idp, p.label, c.rowid";
$sql .= " FROM llx_societe as s, llx_contrat as c, llx_product as p WHERE s.idp = c.fk_soc AND c.fk_product = p.rowid"; $sql .= " FROM llx_societe as s, llx_contrat as c, llx_product as p WHERE s.idp = c.fk_soc AND c.fk_product = p.rowid";
if($user->societe_id)
{
$sql .= " AND s.idp = $user->societe_id";
}
$sql .= " ORDER BY c.tms DESC "; $sql .= " ORDER BY c.tms DESC ";
/* /*
* Il faudrait ajouter un datec à cette table
* *
*/ */
$sql .= $db->plimit(5, 0); $sql .= $db->plimit(5, 0);

View File

@ -87,8 +87,7 @@ class Propal
$sql .= " (".$this->id.",". $idproduct.",". $qty.",". $price.",".$prod->tva_tx.",'".addslashes($prod->label)."',$remise_percent, $subprice)"; $sql .= " (".$this->id.",". $idproduct.",". $qty.",". $price.",".$prod->tva_tx.",'".addslashes($prod->label)."',$remise_percent, $subprice)";
if ($this->db->query($sql) ) if ($this->db->query($sql) )
{ {
$this->update_price(); $this->update_price();
return 1; return 1;
@ -159,7 +158,6 @@ class Propal
$client = new Societe($this->db); $client = new Societe($this->db);
$client->fetch($this->socidp); $client->fetch($this->socidp);
$this->client = $client; $this->client = $client;
} }
/* /*
* *
@ -173,7 +171,6 @@ class Propal
if ($this->db->query($sql) ) if ($this->db->query($sql) )
{ {
$this->update_price(); $this->update_price();
return 1; return 1;
@ -219,9 +216,6 @@ class Propal
$prod = new Product($this->db, $this->products[$i]); $prod = new Product($this->db, $this->products[$i]);
$prod->fetch($this->products[$i]); $prod->fetch($this->products[$i]);
//$sql = "INSERT INTO llx_propaldet (fk_propal, fk_product, qty, price, tva_tx) VALUES ";
//$sql .= " ($propalid,".$this->products[$i].",".$this->products_qty[$i].",$prod->price,$prod->tva_tx);";
$this->insert_product($this->products[$i], $this->insert_product($this->products[$i],
$this->products_qty[$i], $this->products_qty[$i],
$this->products_remise_percent[$i]); $this->products_remise_percent[$i]);
@ -422,8 +416,6 @@ class Propal
{ {
print $this->db->error(); print $this->db->error();
} }
} }
return 1; return 1;
} }
@ -440,7 +432,6 @@ class Propal
*/ */
Function valid($user) Function valid($user)
{ {
if ($user->rights->propale->valider) if ($user->rights->propale->valider)
{ {

View File

@ -49,6 +49,14 @@ table.noborder td {
border-collapse: collapse; border-collapse: collapse;
border: 0px } border: 0px }
table.liste {
border-collapse: collapse;
border: 0px }
table.liste td {
border-collapse: collapse;
border: 0px }
table#actions { table#actions {
border: 0px; border: 0px;
cell-spacing: 1em; cell-spacing: 1em;