FIX #7567
This commit is contained in:
parent
d07ec07896
commit
d808add499
@ -53,6 +53,7 @@ UseDateWithoutHourOnFichinter=Hides hours and minutes off the date field for int
|
||||
InterventionStatistics=Statistics of interventions
|
||||
NbOfinterventions=Nb of intervention cards
|
||||
NumberOfInterventionsByMonth=Nb of intervention cards by month (date of validation)
|
||||
AmountOfInteventionNotIncludedByDefault=Amount of intervention is not included by default into profit. Add option PROJECT_INCLUDE_INTERVENTION_AMOUNT_IN_PROFIT to 1 into home-setup-other to include them.
|
||||
##### Exports #####
|
||||
InterId=Intervention id
|
||||
InterRef=Intervention ref.
|
||||
|
||||
@ -610,23 +610,31 @@ foreach ($listofreferent as $key => $value)
|
||||
if ($qualifiedfortotal) $total_ttc = $total_ttc + $total_ttc_by_line;
|
||||
}
|
||||
|
||||
// Calculate margin
|
||||
if ($margin=="add")
|
||||
{
|
||||
$balance_ht+= $total_ht;
|
||||
$balance_ttc+= $total_ttc;
|
||||
}
|
||||
else
|
||||
{
|
||||
$balance_ht-= $total_ht;
|
||||
$balance_ttc-= $total_ttc;
|
||||
}
|
||||
// Each element with at least one line is output
|
||||
$qualifiedforfinalprofit=true;
|
||||
if ($key == 'intervention' && empty($conf->global->PROJECT_INCLUDE_INTERVENTION_AMOUNT_IN_PROFIT)) $qualifiedforfinalprofit=false;
|
||||
//var_dump($key);
|
||||
|
||||
// Show $total_ht & $total_ttc -- add a minus when necessary
|
||||
if ($margin!="add")
|
||||
// Calculate margin
|
||||
if ($qualifiedforfinalprofit)
|
||||
{
|
||||
$total_ht = -$total_ht;
|
||||
$total_ttc = -$total_ttc;
|
||||
if ($margin=="add")
|
||||
{
|
||||
$balance_ht+= $total_ht;
|
||||
$balance_ttc+= $total_ttc;
|
||||
}
|
||||
else
|
||||
{
|
||||
$balance_ht-= $total_ht;
|
||||
$balance_ttc-= $total_ttc;
|
||||
}
|
||||
|
||||
// Show $total_ht & $total_ttc -- add a minus when necessary
|
||||
if ($margin!="add")
|
||||
{
|
||||
$total_ht = -$total_ht;
|
||||
$total_ttc = -$total_ttc;
|
||||
}
|
||||
}
|
||||
|
||||
/*switch ($classname) {
|
||||
@ -655,16 +663,21 @@ foreach ($listofreferent as $key => $value)
|
||||
$newclassname = $classname;
|
||||
}*/
|
||||
|
||||
$var = ! $var;
|
||||
print '<tr class="oddeven">';
|
||||
// Module
|
||||
print '<td align="left">'.$name.'</td>';
|
||||
// Nb
|
||||
print '<td align="right">'.$i.'</td>';
|
||||
// Amount HT
|
||||
print '<td align="right">'.price($total_ht).'</td>';
|
||||
print '<td align="right">';
|
||||
if (! $qualifiedforfinalprofit) print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("NA"), $langs->trans("AmountOfInteventionNotIncludedByDefault")).'</span>';
|
||||
else print price($total_ht);
|
||||
print '</td>';
|
||||
// Amount TTC
|
||||
print '<td align="right">'.price($total_ttc).'</td>';
|
||||
print '<td align="right">';
|
||||
if (! $qualifiedforfinalprofit) print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("NA"), $langs->trans("AmountOfInteventionNotIncludedByDefault")).'</span>';
|
||||
else print price($total_ttc);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user