diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index b151565f3a3..3f7c84cd23f 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -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. diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index bda8d793840..ae9872b70a0 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -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 '