diff --git a/ChangeLog_loukta b/ChangeLog_loukta index f5ea567bac3c3..1c92d8430e4f4 100644 --- a/ChangeLog_loukta +++ b/ChangeLog_loukta @@ -1,5 +1,6 @@ ***** ChangeLog for loukta ***** - FIX DA028241 - FactureLigne::getSituationRatio() - wrong denominator (100 instead of situation_percent) in mode 1 caused incorrect line amounts in situation invoice PDFs. - *18/06/2026* +- NOTE DA028241 - getSituationRatio() is a LOCAL CORE PATCH (factureligne.class.php + core/lib/pdf.lib.php), overwritten on each Dolibarr core upgrade; to be dropped once upstream PR Dolibarr#36503 lands. Scope is the mode-1 denominator only - credit notes in a situation cycle are NOT handled (get_prev_progress() still adds credit-note percents), so such a cycle may still yield a wrong/negative delta. - *19/06/2026* - FIX DA027405 - merging PR Dolibarr#36503 in advance for Loukta: PDF for situation invoices uses legacy calculations (cumulative) instead of the new algorithm (delta). Once the community PR is merged, this specific code can be discarded and replaced with the community equivalent. - *03/12/2025* diff --git a/htdocs/compta/facture/class/factureligne.class.php b/htdocs/compta/facture/class/factureligne.class.php index c8134eb8af9c6..2339b03a53286 100644 --- a/htdocs/compta/facture/class/factureligne.class.php +++ b/htdocs/compta/facture/class/factureligne.class.php @@ -980,6 +980,7 @@ public function getAllPrevProgress($invoiceid, $include_credit_note = true) } } + // LOUKTA DA028241 - START /** * Determines if we are using situation invoices. * If so, determines if we are using the new mode (2) or legacy mode (1). @@ -991,6 +992,17 @@ public function getAllPrevProgress($invoiceid, $include_credit_note = true) * New mode = the values on the line already represent the delta between the previous * state and the current state, so we don't need a conversion (we return 1). * + * LOCAL CORE PATCH (technical debt) — DA027405 / DA028241: + * This method and its consumers in core/lib/pdf.lib.php are a Loukta-local backport of + * upstream PR Dolibarr#36503. They modify core files and WILL be overwritten on the next + * Dolibarr core upgrade — re-apply, or preferably drop them, once #36503 is merged upstream. + * + * SCOPE LIMITATION — DA028241: + * This fix only corrects the mode-1 denominator. It does NOT handle credit notes: in + * get_prev_progress() the credit-note percents are still ADDED (+=) to the previous + * progress, so a situation cycle that contains a credit note can still produce a wrong + * (possibly negative) delta here. Credit-note progression is tracked separately. + * * @return int */ public function getSituationRatio() @@ -1011,4 +1023,5 @@ public function getSituationRatio() // or not a situation invoice: no ratio needed either return 1; } + // LOUKTA DA028241 - END }