N'affiche pas les infos de propale sur le module n'est pas actif.
This commit is contained in:
parent
7525d5847e
commit
fdbe141f93
@ -75,36 +75,38 @@ 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="propal.php">';
|
if ($conf->propal->enabled) {
|
||||||
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
|
print '<form method="post" action="propal.php">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">Rechercher une proposition</td></tr>';
|
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
|
||||||
print "<tr $bc[1]><td>";
|
print '<tr class="liste_titre"><td colspan="2">Rechercher une proposition</td></tr>';
|
||||||
print 'Num. : <input type="text" name="sf_ref"><input type="submit" value="Rechercher" class="flat"></td></tr>';
|
print "<tr $bc[1]><td>";
|
||||||
print "</table></form>\n";
|
print 'Num. : <input type="text" name="sf_ref"><input type="submit" value="Rechercher" class="flat"></td></tr>';
|
||||||
|
print "</table></form><br>\n";
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref";
|
$sql = "SELECT p.rowid, p.ref";
|
||||||
$sql .= " FROM llx_propal as p";
|
$sql .= " FROM llx_propal as p";
|
||||||
$sql .= " WHERE p.fk_statut = 0";
|
$sql .= " WHERE p.fk_statut = 0";
|
||||||
|
|
||||||
if ( $db->query($sql) )
|
if ( $db->query($sql) )
|
||||||
{
|
|
||||||
$num = $db->num_rows();
|
|
||||||
$i = 0;
|
|
||||||
if ($num > 0 )
|
|
||||||
{
|
|
||||||
print '<br><table border="0" cellspacing="0" cellpadding="3" width="100%">';
|
|
||||||
print "<TR class=\"liste_titre\">";
|
|
||||||
print "<td colspan=\"2\">Propositions commerciales brouillons</td></tr>";
|
|
||||||
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object( $i);
|
$num = $db->num_rows();
|
||||||
$var=!$var;
|
$i = 0;
|
||||||
print "<tr $bc[$var]><td><a href=\"propal.php?propalid=".$obj->rowid."\">".$obj->ref."</a></td></tr>";
|
if ($num > 0 )
|
||||||
$i++;
|
{
|
||||||
|
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
|
||||||
|
print "<TR class=\"liste_titre\">";
|
||||||
|
print "<td colspan=\"2\">Propositions commerciales brouillons</td></tr>";
|
||||||
|
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object( $i);
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr $bc[$var]><td><a href=\"propal.php?propalid=".$obj->rowid."\">".$obj->ref."</a></td></tr>";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
print "</table><br>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print "</table><br>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -248,64 +250,65 @@ if ( $db->query($sql) )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dernières propales
|
* Dernières propales
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
if ($conf->propal->enabled) {
|
||||||
$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 AND p.fk_statut > 1";
|
|
||||||
if ($socidp)
|
|
||||||
{
|
|
||||||
$sql .= " AND s.idp = $socidp";
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql .= " ORDER BY p.rowid DESC";
|
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
||||||
$sql .= $db->plimit(5, 0);
|
$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 AND p.fk_statut > 1";
|
||||||
|
if ($socidp)
|
||||||
if ( $db->query($sql) )
|
|
||||||
{
|
|
||||||
$num = $db->num_rows();
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
|
||||||
print '<tr class="liste_titre"><td colspan="6">Dernières propositions commerciales</td></tr>';
|
|
||||||
$var=True;
|
|
||||||
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object( $i);
|
$sql .= " AND s.idp = $socidp";
|
||||||
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]>";
|
|
||||||
print '<td width="12%"><a href="propal.php?propalid='.$objp->propalid.'">'.$objp->ref.'</a></td>';
|
|
||||||
print "<td width=\"30%\"><a href=\"fiche.php?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
|
||||||
|
|
||||||
$now = time();
|
|
||||||
$lim = 3600 * 24 * 15 ;
|
|
||||||
|
|
||||||
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 )
|
|
||||||
{
|
|
||||||
print "<td><b> > 15 jours</b></td>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<td> </td>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "<td align=\"right\">";
|
|
||||||
print strftime("%d %B %Y",$objp->dp)."</td>\n";
|
|
||||||
print "<td align=\"right\">".price($objp->price)."</TD>\n";
|
|
||||||
print "<td align=\"center\">$objp->statut</TD>\n";
|
|
||||||
print "</tr>\n";
|
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
$sql .= " ORDER BY p.rowid DESC";
|
||||||
$db->free();
|
$sql .= $db->plimit(5, 0);
|
||||||
}
|
|
||||||
|
|
||||||
|
if ( $db->query($sql) )
|
||||||
|
{
|
||||||
|
$num = $db->num_rows();
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
|
print '<tr class="liste_titre"><td colspan="6">Dernières propositions commerciales</td></tr>';
|
||||||
|
$var=True;
|
||||||
|
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$objp = $db->fetch_object( $i);
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
print '<td width="12%"><a href="propal.php?propalid='.$objp->propalid.'">'.$objp->ref.'</a></td>';
|
||||||
|
print "<td width=\"30%\"><a href=\"fiche.php?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
||||||
|
|
||||||
|
$now = time();
|
||||||
|
$lim = 3600 * 24 * 15 ;
|
||||||
|
|
||||||
|
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 )
|
||||||
|
{
|
||||||
|
print "<td><b> > 15 jours</b></td>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<td> </td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "<td align=\"right\">";
|
||||||
|
print strftime("%d %B %Y",$objp->dp)."</td>\n";
|
||||||
|
print "<td align=\"right\">".price($objp->price)."</TD>\n";
|
||||||
|
print "<td align=\"center\">$objp->statut</TD>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
$db->free();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -314,6 +317,5 @@ print '</table>';
|
|||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user