FIX allow a situation with credit to be removed from cycle

This commit is contained in:
tnegre
2025-10-17 13:59:59 +02:00
parent e801a7602c
commit 66d72d0bba

View File

@@ -5128,9 +5128,9 @@ if ($action == 'create') {
$total_next_ht = $total_next_ttc = 0; $total_next_ht = $total_next_ttc = 0;
foreach ($object->tab_next_situation_invoice as $next_invoice) { foreach ($object->tab_next_situation_invoice as $next_invoice) {
$totalpaid = $next_invoice->getSommePaiement(0); $next_invoice_total_paid = $next_invoice->getSommePaiement(0);
$totalcreditnotes = $next_invoice->getSumCreditNotesUsed(0); $next_invoice_totalcreditnotes = $next_invoice->getSumCreditNotesUsed(0);
$totaldeposits = $next_invoice->getSumDepositsUsed(0); $next_invoice_totaldeposits = $next_invoice->getSumDepositsUsed(0);
$total_next_ht += $next_invoice->total_ht; $total_next_ht += $next_invoice->total_ht;
$total_next_ttc += $next_invoice->total_ttc; $total_next_ttc += $next_invoice->total_ttc;
@@ -5143,7 +5143,7 @@ if ($action == 'create') {
} }
print '<td class="right"><span class="amount">'.price($next_invoice->total_ht).'</span></td>'; print '<td class="right"><span class="amount">'.price($next_invoice->total_ht).'</span></td>';
print '<td class="right"><span class="amount">'.price($next_invoice->total_ttc).'</span></td>'; print '<td class="right"><span class="amount">'.price($next_invoice->total_ttc).'</span></td>';
print '<td class="right">'.$next_invoice->getLibStatut(3, $totalpaid + $totalcreditnotes + $totaldeposits).'</td>'; print '<td class="right">'.$next_invoice->getLibStatut(3, $next_invoice_total_paid + $next_invoice_totalcreditnotes + $next_invoice_totaldeposits).'</td>';
print '</tr>'; print '</tr>';
} }