Mises aux normes, debut d'implementation des commandes, travail dans le train retour JDLL2003 :)
This commit is contained in:
parent
9942b17e3a
commit
50c13e2594
@ -40,10 +40,6 @@ require("../propal.class.php");
|
||||
require("../actioncomm.class.php");
|
||||
require("../lib/CMailFile.class.php");
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
|
||||
@ -62,15 +62,15 @@ if ($action == 'del_bookmark')
|
||||
*/
|
||||
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 '<form method="post" action="facture.php">';
|
||||
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<td colspan="2">Rechercher une facture</td></tr>';
|
||||
print "<tr $bc[1]><td>";
|
||||
print 'Num. : <input type="text" name="sf_ref"> <input type="submit" value="Rechercher" class="flat"></td></tr>';
|
||||
@ -198,7 +198,6 @@ if ( $db->query($sql) )
|
||||
print '</table>';
|
||||
}
|
||||
/*
|
||||
* Actions a faire
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ -222,16 +221,15 @@ if ($user->comm > 0 && $conf->commercial )
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print '<td colspan="2">'.translate("Propositions comm. à facturer").'</td>';
|
||||
print "</TR>\n";
|
||||
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<td colspan="2">'.translate("Propositions commerciales à facturer").'</td></tr>';
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$var=!$var;
|
||||
$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>';
|
||||
$i++;
|
||||
}
|
||||
@ -266,7 +264,7 @@ if ( $db->query($sql) )
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
$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 align="right">'.price($obj->total_ttc).'</td></tr>';
|
||||
$i++;
|
||||
|
||||
@ -58,15 +58,12 @@ function llxHeader($head = "", $title="") {
|
||||
$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("ligne.php","Compta");
|
||||
* $menu->add_submenu("ligne.php","Lignes");
|
||||
* $menu->add_submenu("config.php","Configuration");
|
||||
*/
|
||||
$menu->add(DOL_URL_ROOT."/fourn/index.php", "Fournisseurs");
|
||||
}
|
||||
|
||||
if ($user->compta > 0)
|
||||
{
|
||||
@ -78,7 +75,10 @@ function llxHeader($head = "", $title="") {
|
||||
$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);
|
||||
|
||||
|
||||
@ -34,9 +34,15 @@ require("../lib/CMailFile.class.php");
|
||||
require("../project.class.php");
|
||||
require("../propal.class.php");
|
||||
require("../actioncomm.class.php");
|
||||
|
||||
/*
|
||||
*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socidp = $user->societe_id;
|
||||
}
|
||||
|
||||
llxHeader();
|
||||
|
||||
@ -127,7 +133,7 @@ if ($propalid)
|
||||
$projet = new Project($db);
|
||||
$projet->fetch($obj->fk_projet);
|
||||
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 "<tr><td>Destinataire</td><td colspan=\"2\">$obj->firstname $obj->name <$obj->email></td></tr>";
|
||||
|
||||
@ -167,7 +167,7 @@ function pt ($db, $sql, $year) {
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
$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 "<TD>Mois</TD>";
|
||||
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 "<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 "<TD>Mois</TD>";
|
||||
print "<TD align=\"right\">Montant</TD>";
|
||||
|
||||
@ -37,7 +37,7 @@ function propals ($db, $year, $month) {
|
||||
$result = $db->query($sql);
|
||||
$num = $db->num_rows();
|
||||
$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>";
|
||||
|
||||
$oldstatut = -1;
|
||||
@ -87,7 +87,7 @@ function propals ($db, $year, $month) {
|
||||
print "<tr>";
|
||||
print "<td colspan=\"2\" align=\"right\"><b>Total : ".price($total)."</b></td>";
|
||||
print "<td align=\"left\"><b>Euros HT</b></td></tr>";
|
||||
print "</TABLE>";
|
||||
print "</table>";
|
||||
$db->free();
|
||||
|
||||
}
|
||||
@ -157,7 +157,7 @@ function pt ($db, $sql, $year) {
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
$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 "<TD>Mois</TD>";
|
||||
print "<td align=\"right\">Montant</td></tr>\n";
|
||||
@ -229,7 +229,7 @@ function ppt ($db, $year, $socidp)
|
||||
print "CA ".($year - 1);
|
||||
|
||||
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%\">";
|
||||
|
||||
$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 "<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 "<TD>Mois</TD>";
|
||||
print "<TD align=\"right\">Montant</TD>";
|
||||
|
||||
@ -28,6 +28,16 @@ llxHeader();
|
||||
|
||||
$mesg = '';
|
||||
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'add')
|
||||
{
|
||||
$contrat = new Contrat($db);
|
||||
@ -97,7 +107,7 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="type" value="'.$type.'">'."\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 '<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>';
|
||||
@ -133,7 +143,7 @@ else
|
||||
{
|
||||
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 '<td width="20%">Service</td><td width="40%">'.$contrat->product->label_url.'</td>';
|
||||
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>';
|
||||
|
||||
if ($contrat->enservice)
|
||||
|
||||
@ -21,12 +21,19 @@
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
if ($page == -1) {
|
||||
$page = 0 ;
|
||||
}
|
||||
/*
|
||||
* Sécurité accés client
|
||||
*/
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
$limit = $conf->liste_limit;
|
||||
$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 .= " 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";
|
||||
if ($socid > 0)
|
||||
{
|
||||
$sql .= " AND s.idp = $socid";
|
||||
}
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $db->plimit($limit + 1 ,$offset);
|
||||
|
||||
|
||||
@ -27,9 +27,12 @@ $info_box_contents = array();
|
||||
|
||||
$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";
|
||||
if($user->societe_id)
|
||||
{
|
||||
$sql .= " AND s.idp = $user->societe_id";
|
||||
}
|
||||
$sql .= " ORDER BY c.tms DESC ";
|
||||
/*
|
||||
* Il faudrait ajouter un datec à cette table
|
||||
*
|
||||
*/
|
||||
$sql .= $db->plimit(5, 0);
|
||||
|
||||
@ -87,8 +87,7 @@ class Propal
|
||||
$sql .= " (".$this->id.",". $idproduct.",". $qty.",". $price.",".$prod->tva_tx.",'".addslashes($prod->label)."',$remise_percent, $subprice)";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
|
||||
{
|
||||
$this->update_price();
|
||||
|
||||
return 1;
|
||||
@ -159,7 +158,6 @@ class Propal
|
||||
$client = new Societe($this->db);
|
||||
$client->fetch($this->socidp);
|
||||
$this->client = $client;
|
||||
|
||||
}
|
||||
/*
|
||||
*
|
||||
@ -173,7 +171,6 @@ class Propal
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
|
||||
$this->update_price();
|
||||
|
||||
return 1;
|
||||
@ -219,9 +216,6 @@ class Propal
|
||||
$prod = new Product($this->db, $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->products_qty[$i],
|
||||
$this->products_remise_percent[$i]);
|
||||
@ -422,8 +416,6 @@ class Propal
|
||||
{
|
||||
print $this->db->error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -440,7 +432,6 @@ class Propal
|
||||
*/
|
||||
Function valid($user)
|
||||
{
|
||||
|
||||
if ($user->rights->propale->valider)
|
||||
{
|
||||
|
||||
|
||||
@ -49,6 +49,14 @@ table.noborder td {
|
||||
border-collapse: collapse;
|
||||
border: 0px }
|
||||
|
||||
table.liste {
|
||||
border-collapse: collapse;
|
||||
border: 0px }
|
||||
|
||||
table.liste td {
|
||||
border-collapse: collapse;
|
||||
border: 0px }
|
||||
|
||||
table#actions {
|
||||
border: 0px;
|
||||
cell-spacing: 1em;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user