diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 7af6a2934fb..248c5437186 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -21,7 +21,7 @@
* \file htdocs/comm/index.php
* \ingroup commercial
* \brief Home page of commercial area
- * \version $Id: index.php,v 1.172 2011/08/08 12:22:52 eldy Exp $
+ * \version $Id: index.php,v 1.173 2011/08/08 14:25:44 eldy Exp $
*/
require("../main.inc.php");
@@ -272,6 +272,87 @@ $NBMAX=3;
$max=3;
+/*
+ * Last modified proposals
+ */
+/*
+if ($conf->propal->enabled && $user->rights->propale->lire)
+{
+ $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, p.datep as dp";
+ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
+ $sql.= ", ".MAIN_DB_PREFIX."propal as p";
+ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql.= " WHERE p.fk_soc = s.rowid";
+ $sql.= " AND p.entity = ".$conf->entity;
+ //$sql.= " AND p.fk_statut > 1";
+ if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+ if ($socid) $sql.= " AND s.rowid = ".$socid;
+ $sql.= " ORDER BY p.datep DESC";
+ $sql.= $db->plimit($NBMAX, 0);
+
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $num = $db->num_rows($resql);
+
+ $i = 0;
+ print '
";
print '';
- $propal_static->id=$obj->rowid;
- $propal_static->ref=$obj->ref;
+ $propalstatic->id=$obj->rowid;
+ $propalstatic->ref=$obj->ref;
print '';
print '| ';
- print $propal_static->getNomUrl(1);
+ print $propalstatic->getNomUrl(1);
print ' | ';
print '';
@@ -257,7 +257,7 @@ if ($resql)
print ' | '.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.' | ';
print ''.dol_print_date($db->jdate($obj->datec),'day').' | ';
- print ''.$propal_static->LibStatut($obj->fk_statut,5).' | ';
+ print ''.$propalstatic->LibStatut($obj->fk_statut,5).' | ';
print ' ';
$i++;
}
@@ -267,6 +267,85 @@ if ($resql)
else dol_print_error($db);
+/*
+ * Opened proposals
+ */
+if ($conf->propal->enabled && $user->rights->propale->lire)
+{
+ $langs->load("propal");
+
+ $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp";
+ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
+ $sql.= ", ".MAIN_DB_PREFIX."propal as p";
+ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql.= " WHERE p.fk_soc = s.rowid";
+ $sql.= " AND p.entity = ".$conf->entity;
+ $sql.= " AND p.fk_statut = 1";
+ if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+ if ($socid) $sql.= " AND s.rowid = ".$socid;
+ $sql.= " ORDER BY p.rowid DESC";
+
+ $result=$db->query($sql);
+ if ($result)
+ {
+ $total = 0;
+ $num = $db->num_rows($result);
+ $i = 0;
+ if ($num > 0)
+ {
+ $var=true;
+
+ print '';
+ print '| '.$langs->trans("ProposalsOpened").' ('.$num.') | ';
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($result);
+ $var=!$var;
+ print '';
+
+ // Ref
+ print '';
+
+ $propalstatic->id=$obj->propalid;
+ $propalstatic->ref=$obj->ref;
+
+ print '';
+ print '| ';
+ print $propalstatic->getNomUrl(1);
+ print ' | ';
+ print '';
+ if ($db->jdate($obj->dp) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
+ print ' | ';
+ print '';
+ $filename=dol_sanitizeFileName($obj->ref);
+ $filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($obj->ref);
+ $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
+ $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
+ print ' | ';
+
+ print " | ";
+
+ print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,44).' | '."\n";
+ print '';
+ print dol_print_date($db->jdate($obj->dp),'day').' | '."\n";
+ print ''.price($obj->total_ttc).' | ';
+ print ''.$propalstatic->LibStatut($obj->fk_statut,3).' | '."\n";
+ print ' '."\n";
+ $i++;
+ $total += $obj->total_ttc;
+ }
+ if ($total>0) {
+ print '| '.$langs->trans("Total")." | ".price($total)." | | ";
+ }
+ print " ";
+ }
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+}
+
/*
* Proposals to process
*/
@@ -304,12 +383,12 @@ if ($conf->propal->enabled)
print "";
print '';
- $propal_static->id=$obj->rowid;
- $propal_static->ref=$obj->ref;
+ $propalstatic->id=$obj->rowid;
+ $propalstatic->ref=$obj->ref;
print '';
print '| ';
- print $propal_static->getNomUrl(1);
+ print $propalstatic->getNomUrl(1);
print ' | ';
print '';
@@ -327,7 +406,7 @@ if ($conf->propal->enabled)
print ' | '.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).' | ';
- print ''.$propal_static->LibStatut($obj->fk_statut,$obj->facture,5).' | ';
+ print ''.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).' | ';
print ' ';
$i++;
@@ -376,12 +455,12 @@ if ($conf->propal->enabled)
print "";
print '';
- $propal_static->id=$obj->rowid;
- $propal_static->ref=$obj->ref;
+ $propalstatic->id=$obj->rowid;
+ $propalstatic->ref=$obj->ref;
print '';
print '| ';
- print $propal_static->getNomUrl(1);
+ print $propalstatic->getNomUrl(1);
print ' | ';
print '';
@@ -399,7 +478,7 @@ if ($conf->propal->enabled)
print ' | '.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.' | ';
- print ''.$propal_static->LibStatut($obj->fk_statut,$obj->facture,5).' | ';
+ print ''.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).' | ';
print ' ';
$i++;
@@ -415,6 +494,6 @@ print ' ';
$db->close();
-llxFooter('$Date: 2011/08/03 00:46:34 $ - $Revision: 1.7 $');
+llxFooter('$Date: 2011/08/08 14:25:44 $ - $Revision: 1.8 $');
?>
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 0efb704828f..2002f743795 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -21,7 +21,7 @@
* \file htdocs/compta/index.php
* \ingroup compta
* \brief Main page of accountancy area
- * \version $Id: index.php,v 1.184 2011/08/03 00:46:24 eldy Exp $
+ * \version $Id: index.php,v 1.185 2011/08/08 14:25:45 eldy Exp $
*/
require('../main.inc.php');
@@ -347,7 +347,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$i = 0;
print '';
- print '| '.$langs->trans("BoxTitleLastCustomerBills",min($max,$num)).' | ';
+ print ' | '.$langs->trans("BoxTitleLastCustomerBills",$max).' | ';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.$langs->trans("AmountHT").' | ';
print ''.$langs->trans("AmountTTC").' | ';
print ''.$langs->trans("DateModificationShort").' | ';
@@ -444,7 +444,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
$num = $db->num_rows($resql);
print '';
- print '| '.$langs->trans("BoxTitleLastSupplierBills",min($max,$num)).' | ';
+ print ' | '.$langs->trans("BoxTitleLastSupplierBills",$max).' | ';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.$langs->trans("AmountHT").' | ';
print ''.$langs->trans("AmountTTC").' | ';
print ''.$langs->trans("DateModificationShort").' | ';
@@ -519,7 +519,7 @@ if ($conf->don->enabled && $user->rights->societe->lire)
$i = 0;
print '';
- print '| '.$langs->trans("BoxTitleLastModifiedDonations",min($max,$num)).' | ';
+ print ' | '.$langs->trans("BoxTitleLastModifiedDonations",$max).' | ';
print ''.$langs->trans("AmountTTC").' | ';
print ''.$langs->trans("DateModificationShort").' | ';
print ' | ';
@@ -588,7 +588,7 @@ if ($conf->deplacement->enabled && $user->rights->deplacement->lire)
print '';
print '';
- print '| '.$langs->trans("BoxTitleLastModifiedExpenses",min($max,$num)).' | ';
+ print ''.$langs->trans("BoxTitleLastModifiedExpenses",$max).' | ';
print ''.$langs->trans("FeesKilometersOrAmout").' | ';
print ''.$langs->trans("DateModificationShort").' | ';
print ' | ';
@@ -838,7 +838,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$i = 0;
print '';
- print '| '.$langs->trans("BillsCustomersUnpaid",min($conf->liste_limit,$num)).' ('.$num.') | ';
+ print ' | '.$langs->trans("BillsCustomersUnpaid",$num).' ('.$num.') | ';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.$langs->trans("AmountHT").' | ';
print ''.$langs->trans("AmountTTC").' | ';
print ''.$langs->trans("Received").' | ';
@@ -943,7 +943,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
$num = $db->num_rows($resql);
print '';
- print '| '.$langs->trans("BillsSuppliersUnpaid",min($conf->liste_limit,$num)).' ('.$num.') | ';
+ print ' | '.$langs->trans("BillsSuppliersUnpaid",$num).' ('.$num.') | ';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.$langs->trans("AmountHT").' | ';
print ''.$langs->trans("AmountTTC").' | ';
print ''.$langs->trans("Paid").' | ';
@@ -1031,5 +1031,5 @@ print ' ';
$db->close();
-llxFooter('$Date: 2011/08/03 00:46:24 $ - $Revision: 1.184 $');
+llxFooter('$Date: 2011/08/08 14:25:45 $ - $Revision: 1.185 $');
?>
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 2c127cb9efc..593ef6ef347 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -24,7 +24,7 @@
* \file htdocs/contrat/class/contrat.class.php
* \ingroup contrat
* \brief Fichier de la classe des contrats
- * \version $Id: contrat.class.php,v 1.23 2011/07/31 23:50:01 eldy Exp $
+ * \version $Id: contrat.class.php,v 1.24 2011/08/08 14:25:44 eldy Exp $
*/
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
@@ -1542,8 +1542,8 @@ class ContratLigne
/**
- * \brief Constructeur d'objets ligne de contrat
- * \param DB Database access handler
+ * Constructeur d'objets ligne de contrat
+ * @param DB Database access handler
*/
function ContratLigne($DB)
{
@@ -1552,9 +1552,9 @@ class ContratLigne
/**
- * \brief Return label of this contract line status
- * \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
- * \return string Libelle
+ * Return label of this contract line status
+ * @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @return string Libelle
*/
function getLibStatut($mode)
{
@@ -1562,11 +1562,11 @@ class ContratLigne
}
/**
- * \brief Return label of a contract line status
- * \param statut id statut
- * \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
- * \param expired 0=Not expired, 1=Expired, -1=Both or unknown
- * \return string Libelle
+ * Return label of a contract line status
+ * @param statut id statut
+ * @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @param expired 0=Not expired, 1=Expired, -1=Both or unknown
+ * @return string Libelle
*/
function LibStatut($statut,$mode,$expired=-1)
{
@@ -1623,10 +1623,10 @@ class ContratLigne
}
/**
- \brief Renvoie nom clicable (avec eventuellement le picto)
- \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
- \return string Chaine avec URL
- */
+ * Renvoie nom clicable (avec eventuellement le picto)
+ * @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
+ * @return string Chaine avec URL
+ */
function getNomUrl($withpicto=0,$maxlength=0)
{
global $langs;
@@ -1647,10 +1647,10 @@ class ContratLigne
}
/**
- * \brief Load object in memory from database
- * \param id id object
- * \param ref Ref of contract
- * \return int <0 if KO, >0 if OK
+ * Load object in memory from database
+ * @param id id object
+ * @param ref Ref of contract
+ * @return int <0 if KO, >0 if OK
*/
function fetch($id, $ref='')
{
@@ -1752,11 +1752,11 @@ class ContratLigne
}
- /*
- * \brief Update database for contract line
- * \param user User that modify
- * \param notrigger 0=no, 1=yes (no update trigger)
- * \return int <0 if KO, >0 if OK
+ /**
+ * Update database for contract line
+ * @param user User that modify
+ * @param notrigger 0=no, 1=yes (no update trigger)
+ * @return int <0 if KO, >0 if OK
*/
function update($user, $notrigger=0)
{
@@ -1854,9 +1854,9 @@ class ContratLigne
/**
- * \brief Mise a jour en base des champs total_xxx de ligne
- * \remarks Utilise par migration
- * \return int <0 si ko, >0 si ok
+ * Mise a jour en base des champs total_xxx de ligne
+ * Used by migration process
+ * @return int <0 if KO, >0 if OK
*/
function update_total()
{
diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php
index 49fbaddc963..1684c49b97f 100644
--- a/htdocs/contrat/index.php
+++ b/htdocs/contrat/index.php
@@ -20,8 +20,8 @@
/**
* \file htdocs/contrat/index.php
* \ingroup contrat
- * \brief Page liste des contrats
- * \version $Revision: 1.84 $
+ * \brief Home page of contract area
+ * \version $Revision: 1.85 $
*/
require ("../main.inc.php");
@@ -45,6 +45,14 @@ $result = restrictedArea($user, 'contrat',$contratid,'');
$staticcompany=new Societe($db);
$staticcontrat=new Contrat($db);
$staticcontratligne=new ContratLigne($db);
+$productstatic=new Product($db);
+
+
+/*
+ * Action
+ */
+
+// None
/*
@@ -355,13 +363,94 @@ else
print ' ';
-
-// Not activated services
-$sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.description as note, cd.fk_contrat, s.nom";
-$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
+// Last modified services
+$sql = "SELECT c.ref, c.fk_soc, ";
+$sql.= " cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat, cd.date_fin_validite,";
+$sql.= " s.nom,";
+$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
+$sql.= " FROM (".MAIN_DB_PREFIX."contratdet as cd";
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+$sql.= " ) LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
+$sql.= " WHERE cd.fk_contrat = c.rowid";
+$sql.= " AND c.fk_soc = s.rowid";
+$sql.= " AND s.entity = ".$conf->entity;
+if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+if ($socid) $sql.= " AND s.rowid = ".$socid;
+$sql.= " ORDER BY cd.tms DESC";
+
+$resql=$db->query($sql);
+if ($resql)
+{
+ $num = $db->num_rows($resql);
+ $i = 0;
+
+ print '';
+
+ print '| '.$langs->trans("LastModifiedServices",$max).' | ';
+ print " \n";
+
+ $var=True;
+ while ($i < min($num,$max))
+ {
+ $obj = $db->fetch_object($resql);
+ $var=!$var;
+ print '';
+ print '| ';
+ $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
+ $staticcontrat->id=$obj->fk_contrat;
+ print $staticcontrat->getNomUrl(1,16);
+ //if (1 == 1) print img_warning($langs->trans("Late"));
+ print ' | ';
+ print '';
+ if ($obj->fk_product > 0)
+ {
+ $productstatic->id=$obj->fk_product;
+ $productstatic->type=$obj->ptype;
+ $productstatic->ref=$obj->pref;
+ print $productstatic->getNomUrl(1,'',20);
+ }
+ else
+ {
+ print ''.img_object($langs->trans("ShowService"),"service");
+ if ($obj->label) print ' '.dol_trunc($obj->label,20).'';
+ else print ' '.dol_trunc($obj->note,20);
+ }
+ print ' | ';
+ print '';
+ $staticcompany->id=$obj->fk_soc;
+ $staticcompany->nom=$obj->nom;
+ print $staticcompany->getNomUrl(1,'',20);
+ print ' | ';
+ print '';
+ $dateend=$db->jdate($obj->date_fin_validite);
+ print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now)?1:0);
+ print ' | ';
+ print " \n";
+ $i++;
+ }
+ $db->free();
+
+ print " ";
+
+}
+else
+{
+ dol_print_error($db);
+}
+
+print ' ';
+
+// Not activated services
+$sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
+$sql.= " s.nom,";
+$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
+$sql.= " FROM (".MAIN_DB_PREFIX."contratdet as cd";
+$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
+$sql.= ", ".MAIN_DB_PREFIX."societe as s";
+if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+$sql.= " ) LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
$sql.= " WHERE c.statut=1";
$sql.= " AND cd.statut = 0";
$sql.= " AND cd.fk_contrat = c.rowid";
@@ -379,7 +468,7 @@ if ($resql)
print '';
- print '| '.$langs->trans("NotActivatedServices").' | ';
+ print ' | '.$langs->trans("NotActivatedServices").' ('.$num.') | ';
print " \n";
$var=True;
@@ -394,10 +483,21 @@ if ($resql)
$staticcontrat->id=$obj->fk_contrat;
print $staticcontrat->getNomUrl(1,16);
print '';
- print '';
- print ''.img_object($langs->trans("ShowService"),"service");
- if ($obj->label) print ' '.dol_trunc($obj->label,20).' | ';
- else print ' '.dol_trunc($obj->note,20).'';
+ print '';
+ if ($obj->fk_product > 0)
+ {
+ $productstatic->id=$obj->fk_product;
+ $productstatic->type=$obj->ptype;
+ $productstatic->ref=$obj->pref;
+ print $productstatic->getNomUrl(1,'',20);
+ }
+ else
+ {
+ print ''.img_object($langs->trans("ShowService"),"service");
+ if ($obj->label) print ' '.dol_trunc($obj->label,20).'';
+ else print ' '.dol_trunc($obj->note,20);
+ }
+ print ' | ';
print '';
$staticcompany->id=$obj->fk_soc;
$staticcompany->nom=$obj->nom;
@@ -421,17 +521,19 @@ else
print ' ';
-// Last modified services
-$max=5;
-
-$sql = "SELECT c.ref, c.fk_soc, ";
-$sql.= " cd.rowid as cid, cd.statut, cd.label, cd.description as note, cd.fk_contrat, cd.date_fin_validite,";
-$sql.= " s.nom";
-$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
+// Expired services
+$sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
+$sql.= " s.nom,";
+$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
+$sql.= " FROM (".MAIN_DB_PREFIX."contratdet as cd";
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
-$sql.= " WHERE cd.fk_contrat = c.rowid";
+$sql.= " ) LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
+$sql.= " WHERE c.statut=1";
+$sql.= " AND cd.statut = 4";
+$sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'";
+$sql.= " AND cd.fk_contrat = c.rowid";
$sql.= " AND c.fk_soc = s.rowid";
$sql.= " AND s.entity = ".$conf->entity;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
@@ -446,32 +548,43 @@ if ($resql)
print '';
- print '| '.$langs->trans("LastModifiedServices",min($num,$max)).' | ';
+ print ' | '.$langs->trans("ListOfExpiredServices").' ('.$num.') | ';
print " \n";
$var=True;
- while ($i < min($num,$max))
+ while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print '';
+
print '| ';
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
$staticcontrat->id=$obj->fk_contrat;
print $staticcontrat->getNomUrl(1,16);
- //if (1 == 1) print img_warning($langs->trans("Late"));
print ' | ';
- print ''.img_object($langs->trans("ShowService"),"service");
- if ($obj->label) print ' '.dol_trunc($obj->label,20).' | ';
- else print ' '.dol_trunc($obj->note,20).'';
+ print '';
+ if ($obj->fk_product > 0)
+ {
+ $productstatic->id=$obj->fk_product;
+ $productstatic->type=$obj->ptype;
+ $productstatic->ref=$obj->pref;
+ print $productstatic->getNomUrl(1,'',20);
+ }
+ else
+ {
+ print ''.img_object($langs->trans("ShowService"),"service");
+ if ($obj->label) print ' '.dol_trunc($obj->label,20).'';
+ else print ' '.dol_trunc($obj->note,20);
+ }
+ print ' | ';
print '';
$staticcompany->id=$obj->fk_soc;
$staticcompany->nom=$obj->nom;
print $staticcompany->getNomUrl(1,'',20);
print ' | ';
- print '';
- $dateend=$db->jdate($obj->date_fin_validite);
- print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now)?1:0);
+ print ' | ';
+ print $staticcontratligne->LibStatut($obj->statut,3,1);
print ' | ';
print " \n";
$i++;
@@ -492,5 +605,5 @@ print ' ';
$db->close();
-llxFooter('$Date: 2011/07/31 23:46:55 $ - $Revision: 1.84 $');
+llxFooter('$Date: 2011/08/08 14:25:44 $ - $Revision: 1.85 $');
?>
\ No newline at end of file
diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php
index de125e85f65..3c828e438a6 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -21,7 +21,7 @@
* \file htdocs/contrat/services.php
* \ingroup contrat
* \brief Page to list services in contracts
- * \version $Id: services.php,v 1.57 2011/07/31 23:46:55 eldy Exp $
+ * \version $Id: services.php,v 1.58 2011/08/08 14:25:44 eldy Exp $
*/
require ("../main.inc.php");
@@ -93,7 +93,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc
if ($mode == "0") $sql.= " AND cd.statut = 0";
if ($mode == "4") $sql.= " AND cd.statut = 4";
if ($mode == "5") $sql.= " AND cd.statut = 5";
-if ($filter == "expired") $sql.= " AND date_fin_validite < ".$db->idate($now);
+if ($filter == "expired") $sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'";
if ($search_nom) $sql.= " AND s.nom like '%".$db->escape($search_nom)."%'";
if ($search_contract) $sql.= " AND c.rowid = '".$db->escape($search_contract)."'";
if ($search_service) $sql.= " AND (p.ref like '%".$db->escape($search_service)."%' OR p.description like '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')";
@@ -266,5 +266,5 @@ else
$db->close();
-llxFooter('$Date: 2011/07/31 23:46:55 $ - $Revision: 1.57 $');
+llxFooter('$Date: 2011/08/08 14:25:44 $ - $Revision: 1.58 $');
?>
| |
|
|