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 ''; - + print ''; print ''; print ''; @@ -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 ""; @@ -290,18 +296,35 @@ print ''; // Amount - if (empty($value['disableamount'])) print ''; + if (empty($value['disableamount'])) + { + print ''; + } // Amount - if (empty($value['disableamount'])) print ''; + if (empty($value['disableamount'])) + { + print ''; + } // Status print ''; print ''; - $total_ht = $total_ht + $element->total_ht; - $total_ttc = $total_ttc + $element->total_ttc; + if ($qualifiedfortotal) + { + $total_ht = $total_ht + $element->total_ht; + $total_ttc = $total_ttc + $element->total_ttc; + } } print ''; @@ -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 '';
'.$langs->trans("Ref").''.$langs->trans("Date").'
'.(isset($element->total_ht)?price($element->total_ht):' ').''; + if (! $qualifiedfortotal) print ''; + print (isset($element->total_ht)?price($element->total_ht):' '); + if (! $qualifiedfortotal) print ''; + print ''.(isset($element->total_ttc)?price($element->total_ttc):' ').''; + if (! $qualifiedfortotal) print ''; + print (isset($element->total_ttc)?price($element->total_ttc):' '); + if (! $qualifiedfortotal) print ''; + print ''.$element->getLibStatut(5).'
'.$langs->trans("Number").': '.$i.'