diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php
index cfeab2f7fc8..4c0873d73aa 100644
--- a/htdocs/contrat/fiche.php
+++ b/htdocs/contrat/fiche.php
@@ -1140,8 +1140,7 @@ else
print '
'.$langs->trans("PriceUHT").' | ';
print ''.$langs->trans("Qty").' | ';
print ''.$langs->trans("ReductionShort").' | ';
- if ($conf->margin->enabled)
- print ''.$langs->trans("BuyingPrice").' | ';
+ if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) print ''.$langs->trans("BuyingPrice").' | ';
print ' | ';
print "\n";
@@ -1186,8 +1185,8 @@ else
print ' | ';
}
- if ($conf->margin->enabled)
- print ''.price($objp->pa_ht).' | ';
+ // Margin
+ if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) print ''.price($objp->pa_ht).' | ';
// Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme)
print '';
@@ -1292,9 +1291,13 @@ else
print ' | ';
print ' ';
print ' | ';
+
+ $colspan=5;
+ if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) $colspan++;
+
// Ligne dates prevues
print "";
- print '| ';
+ print ' | ';
print $langs->trans("DateStartPlanned").' ';
$form->select_date($db->jdate($objp->date_debut),"date_start_update",$usehm,$usehm,($db->jdate($objp->date_debut)>0?0:1),"update");
print ' '.$langs->trans("DateEndPlanned").' ';
@@ -1644,9 +1647,9 @@ else
}
print "";
- print ' ';
}
+
print ' |