diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 6101f33747165..6edaec7b35ab5 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -246,7 +246,7 @@ print ''; } print '
'.$langs->trans("Ref").' | '; print ''.$langs->trans("Date").' | '; @@ -269,6 +269,12 @@ $element->fetch_thirdparty(); //print $classname; + $qualifiedfortotal=true; + if ($key == 'invoice') + { + if ($element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice + } + $var=!$var; print "|||
'.(isset($element->total_ht)?price($element->total_ht):' ').' | '; + if (empty($value['disableamount'])) + { + print '';
+ if (! $qualifiedfortotal) print ' | ';
+ }
// Amount
- if (empty($value['disableamount'])) print ''.(isset($element->total_ttc)?price($element->total_ttc):' ').' | '; + if (empty($value['disableamount'])) + { + print '';
+ if (! $qualifiedfortotal) print ' | ';
+ }
// Status
print ''.$element->getLibStatut(5).' | '; print '
'.$langs->trans("Number").': '.$i.' | '; @@ -385,9 +408,11 @@ $element->fetch($elementarray[$i]); $element->fetch_thirdparty(); //print $classname; - - $total_ht = $total_ht + $element->total_ht; - $total_ttc = $total_ttc + $element->total_ttc; + if ($qualified) + { + $total_ht = $total_ht + $element->total_ht; + $total_ttc = $total_ttc + $element->total_ttc; + } } print '||||