Fix: Add ref and label on service list
This commit is contained in:
parent
cc84d3e0ac
commit
2367562f0b
@ -543,77 +543,6 @@ if ($_GET["action"] == 'create')
|
|||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
// TODO A quoi ca sert ?
|
|
||||||
/*
|
|
||||||
if ($propalid)
|
|
||||||
{
|
|
||||||
print '<br>';
|
|
||||||
print_titre($langs->trans("Products"));
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("Product").'</td>';
|
|
||||||
print '<td align="right">'.$langs->trans("Price").'</td>';
|
|
||||||
print '<td align="center">'.$langs->trans("Qty").'</td>';
|
|
||||||
print '<td align="center">'.$langs->trans("ReductionShort").'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
$sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, pt.qty, p.rowid as prodid, pt.remise_percent";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pt";
|
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."product as p";
|
|
||||||
$sql.= " WHERE pt.fk_product = p.rowid";
|
|
||||||
$sql.= " AND pt.fk_propal = ".$propalid;
|
|
||||||
$sql .= " ORDER BY pt.rowid ASC";
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$i = 0;
|
|
||||||
$var=True;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($result);
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]><td>[$objp->ref]</td>\n";
|
|
||||||
print '<td>'.$objp->product.'</td>';
|
|
||||||
print "<td align=\"right\">".price($objp->price).'</td>';
|
|
||||||
print '<td align="center">'.$objp->qty.'</td>';
|
|
||||||
print '<td align="center">'.$objp->remise_percent.'%</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$sql = "SELECT pt.rowid, pt.description as product, pt.price, pt.qty, pt.remise_percent";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pt";
|
|
||||||
$sql.= " WHERE pt.fk_propal = ".$propalid;
|
|
||||||
$sql.= " AND pt.fk_product = 0";
|
|
||||||
$sql.= " ORDER BY pt.rowid ASC";
|
|
||||||
$result=$db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object($result);
|
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]><td> </td>\n";
|
|
||||||
print '<td>'.$objp->product.'</td>';
|
|
||||||
print '<td align="right">'.price($objp->price).'</td>';
|
|
||||||
print '<td align="center">'.$objp->remise_percent.'%</td>';
|
|
||||||
print '<td align="center">'.$objp->qty.'</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -770,6 +699,7 @@ else
|
|||||||
/*
|
/*
|
||||||
* Lines of contracts
|
* Lines of contracts
|
||||||
*/
|
*/
|
||||||
|
$productstatic=new Product($db);
|
||||||
|
|
||||||
// Title line for service
|
// Title line for service
|
||||||
print '<table class="notopnoleft" width="100%">'; // Array with (n*2)+1 lines
|
print '<table class="notopnoleft" width="100%">'; // Array with (n*2)+1 lines
|
||||||
@ -790,7 +720,7 @@ else
|
|||||||
$sql.= " cd.date_ouverture_prevue as date_debut, cd.date_ouverture as date_debut_reelle,";
|
$sql.= " cd.date_ouverture_prevue as date_debut, cd.date_ouverture as date_debut_reelle,";
|
||||||
$sql.= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,";
|
$sql.= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,";
|
||||||
$sql.= " cd.commentaire as comment,";
|
$sql.= " cd.commentaire as comment,";
|
||||||
$sql.= " p.ref, p.label";
|
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
|
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||||
$sql.= " WHERE cd.rowid = ".$object->lines[$cursorline-1]->id;
|
$sql.= " WHERE cd.rowid = ".$object->lines[$cursorline-1]->id;
|
||||||
@ -822,9 +752,11 @@ else
|
|||||||
if ($objp->fk_product > 0)
|
if ($objp->fk_product > 0)
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
$productstatic->id=$objp->fk_product;
|
||||||
print img_object($langs->trans("ShowService"),"service").' '.$objp->ref.'</a>';
|
$productstatic->type=$objp->ptype;
|
||||||
print $objp->label?' - '.$objp->label:'';
|
$productstatic->ref=$objp->pref;
|
||||||
|
print $productstatic->getNomUrl(1,'',20);
|
||||||
|
print $objp->label?' - '.dol_trunc($objp->label,16):'';
|
||||||
if ($objp->description) print '<br>'.nl2br($objp->description);
|
if ($objp->description) print '<br>'.nl2br($objp->description);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -918,9 +850,11 @@ else
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
if ($objp->fk_product)
|
if ($objp->fk_product)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
$productstatic->id=$objp->fk_product;
|
||||||
print img_object($langs->trans("ShowService"),"service").' '.$objp->ref.'</a>';
|
$productstatic->type=$objp->ptype;
|
||||||
print $objp->label?' - '.$objp->label:'';
|
$productstatic->ref=$objp->pref;
|
||||||
|
print $productstatic->getNomUrl(1,'',20);
|
||||||
|
print $objp->label?' - '.dol_trunc($objp->label,16):'';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -102,8 +102,8 @@ if ($resql)
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
$param='&search_contract='.$search_contract;
|
$param='&search_contract='.$search_contract;
|
||||||
$param.='&search_nom='.$search_nom;
|
$param.='&search_nom='.$search_nom;
|
||||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'width="50"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder);
|
||||||
//print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder);
|
//print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder);
|
||||||
//print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "c.statut","","$param",'align="center"',$sortfield,$sortorder);
|
//print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "c.statut","","$param",'align="center"',$sortfield,$sortorder);
|
||||||
@ -134,8 +134,8 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print '<tr '.$bc[$var].'>';
|
||||||
print "<td nowrap><a href=\"fiche.php?id=$obj->cid\">";
|
print '<td nowrap="nowrap"><a href="fiche.php?id='.$obj->cid.'">';
|
||||||
print img_object($langs->trans("ShowContract"),"contract").' '.(isset($obj->ref) ? $obj->ref : $obj->cid) .'</a>';
|
print img_object($langs->trans("ShowContract"),"contract").' '.(isset($obj->ref) ? $obj->ref : $obj->cid) .'</a>';
|
||||||
if ($obj->nb_late) print img_warning($langs->trans("Late"));
|
if ($obj->nb_late) print img_warning($langs->trans("Late"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -74,7 +74,7 @@ llxHeader();
|
|||||||
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
|
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
|
||||||
$sql.= " s.rowid as socid, s.nom,";
|
$sql.= " s.rowid as socid, s.nom,";
|
||||||
$sql.= " cd.rowid, cd.description, cd.statut,";
|
$sql.= " cd.rowid, cd.description, cd.statut,";
|
||||||
$sql.= " p.rowid as pid, p.label as label, p.fk_product_type as ptype,";
|
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype,";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
|
||||||
$sql.= " cd.date_ouverture_prevue,";
|
$sql.= " cd.date_ouverture_prevue,";
|
||||||
$sql.= " cd.date_ouverture,";
|
$sql.= " cd.date_ouverture,";
|
||||||
@ -188,7 +188,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$contractstatic->id=$obj->cid;
|
$contractstatic->id=$obj->cid;
|
||||||
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
|
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
|
||||||
@ -201,8 +201,9 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$productstatic->id=$obj->pid;
|
$productstatic->id=$obj->pid;
|
||||||
$productstatic->type=$obj->ptype;
|
$productstatic->type=$obj->ptype;
|
||||||
$productstatic->ref=$obj-label?$obj->label:$obj->pid;
|
$productstatic->ref=$obj->pref;
|
||||||
print $productstatic->getNomUrl(1,'',20);
|
print $productstatic->getNomUrl(1,'',20);
|
||||||
|
print $obj->label?' - '.dol_trunc($obj->label,16):'';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user