2
0
forked from Wavyzz/dolibarr

Backport Fix wrong invoice status when invoice has discount (#31323)

Co-authored-by: Ulysse Valdenaire <uvaldenaire@easya.solutions>
This commit is contained in:
UltraViolet33
2024-10-13 21:04:17 +02:00
committed by GitHub
parent 94ed718782
commit 33c6d95b1c
9 changed files with 71 additions and 25 deletions

View File

@@ -2451,7 +2451,16 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
} else {
$morehtmlstatus .= '<span class="statusrefbuy">'.$object->getLibStatut(6, 1).'</span>';
}
} elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'chargesociales', 'loan', 'tva', 'salary'))) {
} elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier'))) {
$totalallpayments = $object->getSommePaiement(0);
$totalallpayments += $object->getSumCreditNotesUsed(0);
$totalallpayments += $object->getSumDepositsUsed(0);
$tmptxt = $object->getLibStatut(6, $totalallpayments);
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
$tmptxt = $object->getLibStatut(5, $totalallpayments);
}
$morehtmlstatus .= $tmptxt;
} elseif (in_array($object->element, array('chargesociales', 'loan', 'tva'))) {
$tmptxt = $object->getLibStatut(6, $object->totalpaid);
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
$tmptxt = $object->getLibStatut(5, $object->totalpaid);