Merge pull request #22937 from atm-gauthier/FIX_total_invoice_on_show_objects_linked_bloc

FIX : $sign is useless
This commit is contained in:
Laurent Destailleur 2022-11-23 12:27:50 +01:00 committed by GitHub
commit 97863440cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,13 +72,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
print '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
print '<td class="linkedcol-amount right">';
if (!empty($objectlink) && $objectlink->element == 'facture' && $user->hasRight('facture', 'lire')) {
$sign = 1;
if ($objectlink->type == Facture::TYPE_CREDIT_NOTE) {
$sign = -1;
}
if ($objectlink->statut != 3) {
// If not abandonned
$total = $total + $sign * $objectlink->total_ht;
$total += $objectlink->total_ht;
echo price($objectlink->total_ht);
} else {
echo '<strike>'.price($objectlink->total_ht).'</strike>';