Les dates prévues et effectives des lignes de contrats sont modifiables (Avant c'était l'un ou l'autre).
This commit is contained in:
parent
9ca30b4cd4
commit
7dce03bf7d
@ -81,18 +81,13 @@ if ($_POST["action"] == 'add')
|
|||||||
|
|
||||||
$contrat->soc_id = $_POST["soc_id"];
|
$contrat->soc_id = $_POST["soc_id"];
|
||||||
$contrat->date_contrat = $datecontrat;
|
$contrat->date_contrat = $datecontrat;
|
||||||
$contrat->commercial_suivi_id = $_POST["commercial_suivi_id"];
|
// Remplacé par la fonction des contacts non limités d'un contrat
|
||||||
$contrat->commercial_signature_id = $_POST["commercial_signature_id"];
|
// $contrat->commercial_suivi_id = $_POST["commercial_suivi_id"];
|
||||||
|
// $contrat->commercial_signature_id = $_POST["commercial_signature_id"];
|
||||||
$contrat->note = $_POST["note"];
|
$contrat->note = $_POST["note"];
|
||||||
$contrat->projetid = $_POST["projetid"];
|
$contrat->projetid = $_POST["projetid"];
|
||||||
$contrat->remise_percent = $_POST["remise_percent"];
|
$contrat->remise_percent = $_POST["remise_percent"];
|
||||||
|
|
||||||
/*
|
|
||||||
$contrat->add_product($_POST["idprod1"],$_POST["qty1"],$_POST["remise_percent1"]);
|
|
||||||
$contrat->add_product($_POST["idprod2"],$_POST["qty2"],$_POST["remise_percent2"]);
|
|
||||||
$contrat->add_product($_POST["idprod3"],$_POST["qty3"],$_POST["remise_percent3"]);
|
|
||||||
$contrat->add_product($_POST["idprod4"],$_POST["qty4"],$_POST["remise_percent4"]);
|
|
||||||
*/
|
|
||||||
$result = $contrat->create($user,$langs,$conf);
|
$result = $contrat->create($user,$langs,$conf);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@ -270,6 +265,7 @@ if ($_GET["action"] == 'create')
|
|||||||
print '<tr><td>'.$langs->trans("Customer").':</td><td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id.'">'.$obj->nom.'</a></td></tr>';
|
print '<tr><td>'.$langs->trans("Customer").':</td><td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id.'">'.$obj->nom.'</a></td></tr>';
|
||||||
|
|
||||||
// Commercial suivi
|
// Commercial suivi
|
||||||
|
/* Remplacé par fonction des contacts d'un contrat
|
||||||
print '<tr><td width="20%" nowrap>'.$langs->trans("SalesRepresentativeFollowUp").'</td><td>';
|
print '<tr><td width="20%" nowrap>'.$langs->trans("SalesRepresentativeFollowUp").'</td><td>';
|
||||||
print '<select name="commercial_suivi_id">';
|
print '<select name="commercial_suivi_id">';
|
||||||
print '<option value="-1"> </option>';
|
print '<option value="-1"> </option>';
|
||||||
@ -319,7 +315,7 @@ if ($_GET["action"] == 'create')
|
|||||||
|
|
||||||
}
|
}
|
||||||
print '</select></td></tr>';
|
print '</select></td></tr>';
|
||||||
|
*/
|
||||||
print '<tr><td>'.$langs->trans("Date").' :</td><td>';
|
print '<tr><td>'.$langs->trans("Date").' :</td><td>';
|
||||||
$html->select_date();
|
$html->select_date();
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
@ -332,49 +328,6 @@ if ($_GET["action"] == 'create')
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Liste des elements
|
|
||||||
*
|
|
||||||
*
|
|
||||||
print '<tr><td colspan="3">'.$langs->trans("Services").'/'.$langs->trans("Products").'</td></tr>';
|
|
||||||
print '<tr><td colspan="3">';
|
|
||||||
|
|
||||||
$sql = "SELECT p.rowid,p.label,p.ref,p.price FROM ".MAIN_DB_PREFIX."product as p ";
|
|
||||||
$sql .= " WHERE envente = 1";
|
|
||||||
$sql .= " ORDER BY p.nbvente DESC LIMIT 20";
|
|
||||||
if ( $db->query($sql) )
|
|
||||||
{
|
|
||||||
$opt = "<option value=\"0\" selected=\"true\"></option>";
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows(); $i = 0;
|
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$objp = $db->fetch_object();
|
|
||||||
$opt .= "<option value=\"$objp->rowid\">[$objp->ref] $objp->label : $objp->price</option>\n";
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$db->free();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $db->error();
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<table class="noborder" cellspacing="0">';
|
|
||||||
print '<tr><td>20 Produits les plus vendus</td><td>Quan.</td><td>Remise</td></tr>';
|
|
||||||
for ($i = 1 ; $i < 5 ; $i++)
|
|
||||||
{
|
|
||||||
print '<tr><td><select name="idprod'.$i.'">'.$opt.'</select></td>';
|
|
||||||
print '<td><input type="text" size="3" name="qty'.$i.'" value="1"></td>';
|
|
||||||
print '<td><input type="text" size="4" name="remise_percent'.$i.'" value="0">%</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
print '</td></tr>';
|
|
||||||
*/
|
|
||||||
print '<tr><td>'.$langs->trans("Comment").'</td><td valign="top">';
|
print '<tr><td>'.$langs->trans("Comment").'</td><td valign="top">';
|
||||||
print '<textarea name="note" wrap="soft" cols="60" rows="3"></textarea></td></tr>';
|
print '<textarea name="note" wrap="soft" cols="60" rows="3"></textarea></td></tr>';
|
||||||
|
|
||||||
@ -586,8 +539,11 @@ else
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Remplacer par fonction des contacts de contrat
|
||||||
|
// Commerciaux
|
||||||
print '<tr><td width="25%">'.$langs->trans("SalesRepresentativeFollowUp").'</td><td>'.$commercial_suivi->fullname.'</td>';
|
print '<tr><td width="25%">'.$langs->trans("SalesRepresentativeFollowUp").'</td><td>'.$commercial_suivi->fullname.'</td>';
|
||||||
print '<td width="25%">'.$langs->trans("SalesRepresentativeSignature").'</td><td>'.$commercial_signature->fullname.'</td></tr>';
|
print '<td width="25%">'.$langs->trans("SalesRepresentativeSignature").'</td><td>'.$commercial_signature->fullname.'</td></tr>';
|
||||||
|
*/
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
if ($contrat->brouillon == 1 && $user->rights->contrat->creer)
|
if ($contrat->brouillon == 1 && $user->rights->contrat->creer)
|
||||||
@ -638,6 +594,7 @@ else
|
|||||||
{
|
{
|
||||||
|
|
||||||
print '<tr '.$bc[$var].' valign="top">';
|
print '<tr '.$bc[$var].' valign="top">';
|
||||||
|
// Libelle
|
||||||
if ($objp->fk_product > 0)
|
if ($objp->fk_product > 0)
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -695,43 +652,45 @@ else
|
|||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Dates mise en service
|
// Dates de en service prévues et effectives
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td colspan="7">';
|
print '<td colspan="7">';
|
||||||
|
|
||||||
|
// Date prévues
|
||||||
|
print $langs->trans("DateStartPlanned").': ';
|
||||||
|
if ($objp->date_debut) {
|
||||||
|
print dolibarr_print_date($objp->date_debut);
|
||||||
|
// Warning si date prevu passée et pas en service
|
||||||
|
if ($objp->statut == 0 && $objp->date_debut < time() - $conf->contrat->warning_delay) { print " ".img_warning($langs->trans("Late")); }
|
||||||
|
}
|
||||||
|
else print $langs->trans("Unknown");
|
||||||
|
print ' - ';
|
||||||
|
print $langs->trans("DateEndPlanned").': ';
|
||||||
|
if ($objp->date_fin) {
|
||||||
|
print dolibarr_print_date($objp->date_fin);
|
||||||
|
if ($objp->statut == 4 && $objp->date_fin < time() - $conf->contrat->warning_delay) { print " ".img_warning($langs->trans("Late")); }
|
||||||
|
}
|
||||||
|
else print $langs->trans("Unknown");
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
// Si pas encore activé
|
// Si pas encore activé
|
||||||
if (! $objp->date_debut_reelle) {
|
if (! $objp->date_debut_reelle) {
|
||||||
print $langs->trans("DateStartPlanned").': ';
|
|
||||||
if ($objp->date_debut) print dolibarr_print_date($objp->date_debut);
|
|
||||||
else print $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
// Si activé
|
|
||||||
if ($objp->date_debut_reelle) {
|
|
||||||
print $langs->trans("DateStartReal").': ';
|
print $langs->trans("DateStartReal").': ';
|
||||||
if ($objp->date_debut_reelle) print dolibarr_print_date($objp->date_debut_reelle);
|
if ($objp->date_debut_reelle) print dolibarr_print_date($objp->date_debut_reelle);
|
||||||
else print $langs->trans("ContractStatusNotRunning");
|
else print $langs->trans("ContractStatusNotRunning");
|
||||||
}
|
}
|
||||||
|
// Si activé et en cours
|
||||||
print ' - ';
|
|
||||||
|
|
||||||
// Si pas encore activé
|
|
||||||
if (! $objp->date_debut_reelle) {
|
|
||||||
print $langs->trans("DateEndPlanned").': ';
|
|
||||||
if ($objp->date_fin) {
|
|
||||||
print dolibarr_print_date($objp->date_fin);
|
|
||||||
}
|
|
||||||
else print $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
// Si activé
|
|
||||||
if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) {
|
if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) {
|
||||||
print $langs->trans("DateEndPlanned").': ';
|
print $langs->trans("DateStartReal").': ';
|
||||||
if ($objp->date_fin) {
|
print dolibarr_print_date($objp->date_debut_reelle);
|
||||||
print dolibarr_print_date($objp->date_fin);
|
|
||||||
if ($objp->date_fin < time()) { print " ".img_warning($langs->trans("Late")); }
|
|
||||||
}
|
|
||||||
else print $langs->trans("Unknown");
|
|
||||||
}
|
}
|
||||||
// Si désactivé
|
// Si désactivé
|
||||||
if ($objp->date_debut_reelle && $objp->date_fin_reelle) {
|
if ($objp->date_debut_reelle && $objp->date_fin_reelle) {
|
||||||
|
print $langs->trans("DateStartReal").': ';
|
||||||
|
print dolibarr_print_date($objp->date_debut_reelle);
|
||||||
|
print ' - ';
|
||||||
print $langs->trans("DateEndReal").': ';
|
print $langs->trans("DateEndReal").': ';
|
||||||
print dolibarr_print_date($objp->date_fin_reelle);
|
print dolibarr_print_date($objp->date_fin_reelle);
|
||||||
}
|
}
|
||||||
@ -776,6 +735,18 @@ else
|
|||||||
$html->select_date($objp->date_debut,"date_start_update",0,0,($objp->date_debut>0?0:1));
|
$html->select_date($objp->date_debut,"date_start_update",0,0,($objp->date_debut>0?0:1));
|
||||||
print ' '.$langs->trans("DateEndPlanned").' ';
|
print ' '.$langs->trans("DateEndPlanned").' ';
|
||||||
$html->select_date($objp->date_fin,"date_end_update",0,0,($objp->date_fin>0?0:1));
|
$html->select_date($objp->date_fin,"date_end_update",0,0,($objp->date_fin>0?0:1));
|
||||||
|
if ($objp->statut >= 4)
|
||||||
|
{
|
||||||
|
print '<br>';
|
||||||
|
print $langs->trans("DateStartReal").' ';
|
||||||
|
$html->select_date($objp->date_debut_reelle,"date_start_real_update",0,0,($objp->date_debut_reelle>0?0:1));
|
||||||
|
print ' ';
|
||||||
|
if ($objp->statut == 5)
|
||||||
|
{
|
||||||
|
print $langs->trans("DateEndReal").' ';
|
||||||
|
$html->select_date($objp->date_fin_reelle,"date_end_real_update",0,0,($objp->date_fin_reelle>0?0:1));
|
||||||
|
}
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -115,6 +115,7 @@ if ($id > 0)
|
|||||||
$author->id = $contrat->user_author_id;
|
$author->id = $contrat->user_author_id;
|
||||||
$author->fetch();
|
$author->fetch();
|
||||||
|
|
||||||
|
/* Remplacé par fonctions des contacts de contrat
|
||||||
$commercial_signature = new User($db);
|
$commercial_signature = new User($db);
|
||||||
$commercial_signature->id = $contrat->commercial_signature_id;
|
$commercial_signature->id = $contrat->commercial_signature_id;
|
||||||
$commercial_signature->fetch();
|
$commercial_signature->fetch();
|
||||||
@ -122,7 +123,7 @@ if ($id > 0)
|
|||||||
$commercial_suivi = new User($db);
|
$commercial_suivi = new User($db);
|
||||||
$commercial_suivi->id = $contrat->commercial_suivi_id;
|
$commercial_suivi->id = $contrat->commercial_suivi_id;
|
||||||
$commercial_suivi->fetch();
|
$commercial_suivi->fetch();
|
||||||
|
*/
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/fiche.php?id='.$contrat->id;
|
$head[$h][0] = DOL_URL_ROOT.'/contrat/fiche.php?id='.$contrat->id;
|
||||||
$head[$h][1] = $langs->trans("ContractCard");
|
$head[$h][1] = $langs->trans("ContractCard");
|
||||||
@ -144,15 +145,36 @@ if ($id > 0)
|
|||||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Contract").': '.$contrat->id);
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Contract").': '.$contrat->id);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Confirmation de la validation activation
|
||||||
|
*/
|
||||||
|
if ($_GET["action"] == 'active' && $user->rights->contrat->activer)
|
||||||
|
{
|
||||||
|
$dateactstart = mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||||
|
$dateactend = mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
|
||||||
|
$html->form_confirm("ligne.php?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend,$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",strftime("%A %d %B %Y", $dateactstart)),"confirm_active");
|
||||||
|
print '<br />';
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Confirmation de la validation fermeture
|
||||||
|
*/
|
||||||
|
if ($_GET["action"] == 'close' && $user->rights->contrat->activer)
|
||||||
|
{
|
||||||
|
$dateactstart = mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||||
|
$dateactend = mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
|
||||||
|
$html->form_confirm("ligne.php?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend,$langs->trans("CloseService"),$langs->trans("ConfirmCloseService",strftime("%A %d %B %Y", $dateactstart)),"confirm_close");
|
||||||
|
print '<br />';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Contrat
|
* Contrat
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Reference du contrat
|
// Reference du contrat
|
||||||
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $contrat->ref;
|
print $contrat->ref;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
@ -197,34 +219,14 @@ if ($id > 0)
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fonction remplacé par les contacts de contrat
|
||||||
|
// Commerciaux
|
||||||
print '<tr><td width="25%">'.$langs->trans("SalesRepresentativeFollowUp").'</td><td>'.$commercial_suivi->fullname.'</td>';
|
print '<tr><td width="25%">'.$langs->trans("SalesRepresentativeFollowUp").'</td><td>'.$commercial_suivi->fullname.'</td>';
|
||||||
print '<td width="25%">'.$langs->trans("SalesRepresentativeSignature").'</td><td>'.$commercial_signature->fullname.'</td></tr>';
|
print '<td width="25%">'.$langs->trans("SalesRepresentativeSignature").'</td><td>'.$commercial_signature->fullname.'</td></tr>';
|
||||||
|
*/
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Confirmation de la validation activation
|
|
||||||
*/
|
|
||||||
if ($_GET["action"] == 'active' && $user->rights->contrat->activer)
|
|
||||||
{
|
|
||||||
print '<br />';
|
|
||||||
$dateactstart = mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
|
||||||
$dateactend = mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
|
|
||||||
$html->form_confirm("ligne.php?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend,$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",strftime("%A %d %B %Y", $dateactstart)),"confirm_active");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Confirmation de la validation fermeture
|
|
||||||
*/
|
|
||||||
if ($_GET["action"] == 'close' && $user->rights->contrat->activer)
|
|
||||||
{
|
|
||||||
print '<br />';
|
|
||||||
$dateactstart = mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
|
||||||
$dateactend = mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
|
|
||||||
$html->form_confirm("ligne.php?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend,$langs->trans("CloseService"),$langs->trans("ConfirmCloseService",strftime("%A %d %B %Y", $dateactstart)),"confirm_close");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lignes de contrats
|
* Lignes de contrats
|
||||||
*/
|
*/
|
||||||
@ -232,10 +234,12 @@ if ($id > 0)
|
|||||||
|
|
||||||
$sql = "SELECT cd.statut, cd.label, cd.fk_product, cd.description, cd.price_ht, cd.qty, cd.rowid, cd.tva_tx, cd.remise_percent, cd.subprice,";
|
$sql = "SELECT cd.statut, cd.label, cd.fk_product, cd.description, cd.price_ht, cd.qty, cd.rowid, cd.tva_tx, cd.remise_percent, cd.subprice,";
|
||||||
$sql.= " ".$db->pdate("cd.date_ouverture_prevue")." as date_debut, ".$db->pdate("cd.date_ouverture")." as date_debut_reelle,";
|
$sql.= " ".$db->pdate("cd.date_ouverture_prevue")." as date_debut, ".$db->pdate("cd.date_ouverture")." as date_debut_reelle,";
|
||||||
$sql.= " ".$db->pdate("cd.date_fin_validite")." as date_fin, ".$db->pdate("cd.date_cloture")." as date_fin_reelle";
|
$sql.= " ".$db->pdate("cd.date_fin_validite")." as date_fin, ".$db->pdate("cd.date_cloture")." as date_fin_reelle,";
|
||||||
|
$sql.= " p.ref, p.label";
|
||||||
$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.= " WHERE cd.fk_contrat = ".$id;
|
$sql.= " WHERE cd.fk_contrat = ".$id;
|
||||||
$sql.= " AND rowid = ".$_GET["ligne"];
|
$sql.= " AND cd.rowid = ".$_GET["ligne"];
|
||||||
$sql.= " ORDER BY cd.rowid";
|
$sql.= " ORDER BY cd.rowid";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -253,7 +257,6 @@ if ($id > 0)
|
|||||||
print '<td width="30" align="center">'.$langs->trans("Qty").'</td>';
|
print '<td width="30" align="center">'.$langs->trans("Qty").'</td>';
|
||||||
print '<td width="50" align="right">'.$langs->trans("Discount").'</td>';
|
print '<td width="50" align="right">'.$langs->trans("Discount").'</td>';
|
||||||
print '<td width="16"> </td>';
|
print '<td width="16"> </td>';
|
||||||
print '<td width="16"> </td>';
|
|
||||||
print '<td width="30" align="center">'.$langs->trans("Status").'</td>';
|
print '<td width="30" align="center">'.$langs->trans("Status").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
@ -265,22 +268,22 @@ if ($id > 0)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var] valign=\"top\">\n";
|
print "<tr $bc[$var] valign=\"top\">\n";
|
||||||
|
|
||||||
// Libell
|
// Libelle
|
||||||
if ($objp->fk_product > 0)
|
if ($objp->fk_product > 0)
|
||||||
{
|
{
|
||||||
print '<td><a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowService"),"service").' '.$objp->label.'</a>';
|
print '<td>';
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
||||||
if ($objp->description)
|
print img_object($langs->trans("ShowService"),"service").' '.$objp->ref.'</a>';
|
||||||
{
|
print $objp->label?' - '.$objp->label:'';
|
||||||
print '<br />'.stripslashes(nl2br($objp->description));
|
if ($objp->description) print '<br />'.stripslashes(nl2br($objp->description));
|
||||||
}
|
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td>'.stripslashes(nl2br($objp->description))."</td>\n";
|
print "<td>".stripslashes(nl2br($objp->description))."</td>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TVA
|
||||||
print '<td align="center">'.$objp->tva_tx.'%</td>';
|
print '<td align="center">'.$objp->tva_tx.'%</td>';
|
||||||
|
|
||||||
print '<td align="right">'.price($objp->subprice)."</td>\n";
|
print '<td align="right">'.price($objp->subprice)."</td>\n";
|
||||||
@ -296,7 +299,7 @@ if ($id > 0)
|
|||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td> </td><td> </td>';
|
print '<td> </td>';
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
print '<td align="center">'.img_statut($objp->statut,$langs->trans("ServiceStatusInitial")).'</td>';
|
print '<td align="center">'.img_statut($objp->statut,$langs->trans("ServiceStatusInitial")).'</td>';
|
||||||
@ -306,48 +309,49 @@ if ($id > 0)
|
|||||||
if ($objp->date_debut) $dateactstart=$objp->date_debut;
|
if ($objp->date_debut) $dateactstart=$objp->date_debut;
|
||||||
if ($objp->date_fin) $dateactend=$objp->date_fin;
|
if ($objp->date_fin) $dateactend=$objp->date_fin;
|
||||||
|
|
||||||
// Dates mise en service
|
// Dates de en service prévues et effectives
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td colspan="7">';
|
print '<td colspan="7">';
|
||||||
|
|
||||||
|
// Date prévues
|
||||||
|
print $langs->trans("DateStartPlanned").': ';
|
||||||
|
if ($objp->date_debut) {
|
||||||
|
print dolibarr_print_date($objp->date_debut);
|
||||||
|
// Warning si date prevu passée et pas en service
|
||||||
|
if ($objp->statut == 0 && $objp->date_debut < time() - $conf->contrat->warning_delay) { print " ".img_warning($langs->trans("Late")); }
|
||||||
|
}
|
||||||
|
else print $langs->trans("Unknown");
|
||||||
|
print ' - ';
|
||||||
|
print $langs->trans("DateEndPlanned").': ';
|
||||||
|
if ($objp->date_fin) {
|
||||||
|
print dolibarr_print_date($objp->date_fin);
|
||||||
|
if ($objp->statut == 4 && $objp->date_fin < time() - $conf->contrat->warning_delay) { print " ".img_warning($langs->trans("Late")); }
|
||||||
|
}
|
||||||
|
else print $langs->trans("Unknown");
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
// Si pas encore activé
|
// Si pas encore activé
|
||||||
if (! $objp->date_debut_reelle) {
|
if (! $objp->date_debut_reelle) {
|
||||||
print $langs->trans("DateStartPlanned").': ';
|
|
||||||
if ($objp->date_debut) print dolibarr_print_date($objp->date_debut);
|
|
||||||
else print $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
// Si activé
|
|
||||||
if ($objp->date_debut_reelle) {
|
|
||||||
print $langs->trans("DateStartReal").': ';
|
print $langs->trans("DateStartReal").': ';
|
||||||
if ($objp->date_debut_reelle) print dolibarr_print_date($objp->date_debut_reelle);
|
if ($objp->date_debut_reelle) print dolibarr_print_date($objp->date_debut_reelle);
|
||||||
else print $langs->trans("ContractStatusNotRunning");
|
else print $langs->trans("ContractStatusNotRunning");
|
||||||
}
|
}
|
||||||
|
// Si activé et en cours
|
||||||
print ' - ';
|
|
||||||
|
|
||||||
// Si pas encore activé
|
|
||||||
if (! $objp->date_debut_reelle) {
|
|
||||||
print $langs->trans("DateEndPlanned").': ';
|
|
||||||
if ($objp->date_fin) {
|
|
||||||
print dolibarr_print_date($objp->date_fin);
|
|
||||||
}
|
|
||||||
else print $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
// Si activé
|
|
||||||
if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) {
|
if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) {
|
||||||
print $langs->trans("DateEndPlanned").': ';
|
print $langs->trans("DateStartReal").': ';
|
||||||
if ($objp->date_fin) {
|
print dolibarr_print_date($objp->date_debut_reelle);
|
||||||
print dolibarr_print_date($objp->date_fin);
|
|
||||||
if ($objp->date_fin < time()) { print " ".img_warning($langs->trans("Late")); }
|
|
||||||
}
|
|
||||||
else print $langs->trans("Unknown");
|
|
||||||
}
|
}
|
||||||
// Si désactivé
|
// Si désactivé
|
||||||
if ($objp->date_debut_reelle && $objp->date_fin_reelle) {
|
if ($objp->date_debut_reelle && $objp->date_fin_reelle) {
|
||||||
|
print $langs->trans("DateStartReal").': ';
|
||||||
|
print dolibarr_print_date($objp->date_debut_reelle);
|
||||||
|
print ' - ';
|
||||||
print $langs->trans("DateEndReal").': ';
|
print $langs->trans("DateEndReal").': ';
|
||||||
print dolibarr_print_date($objp->date_fin_reelle);
|
print dolibarr_print_date($objp->date_fin_reelle);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td> </td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
@ -402,7 +406,7 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Comment").'</td><td colspan="3"><input size="70" type="text" name="commentaire" value="'.$_POST["commentaire"].'"></td></tr>';
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("Comment").'</td><td colspan="3"><input size="80" type="text" name="commentaire" value="'.$_POST["commentaire"].'"></td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user