Fix/support/da028241/situation ratio denominator#748
Merged
ATM-NicolasV merged 2 commits intoJun 19, 2026
Conversation
…r in mode 1 situation invoices In INVOICE_USE_SITUATION=1 (legacy cumulative mode), total_ht is stored as subprice * qty * situation_percent / 100. The ratio to extract the period delta must therefore be (sp - pp) / sp, not (sp - pp) / 100. The wrong denominator caused pdf_getlinetotalexcltax() to display incorrect values in the 'Total HT sit. n°X' column for lines where situation_percent != 100.
ATM-NicolasV
added a commit
that referenced
this pull request
Jun 19, 2026
…ation of getSituationRatio() Make explicit, in the getSituationRatio() docblock and in ChangeLog_loukta, two things flagged during PR #748 review: - O3 (core debt): this method + its consumers in core/lib/pdf.lib.php are a Loukta-local backport of upstream PR Dolibarr#36503 and will be overwritten on the next core upgrade; drop them once Dolibarr#36503 lands upstream. - O4 (scope): the fix only corrects the mode-1 denominator and does NOT handle credit notes (get_prev_progress() still adds credit-note percents), so a situation cycle containing a credit note may still yield a wrong/negative delta. Documentation only, no logic change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ATM-NicolasV
added a commit
that referenced
this pull request
Jun 19, 2026
…kers Bracket the whole getSituationRatio() method (added as a Loukta-local core backport of upstream PR Dolibarr#36503) with: // LOUKTA DA028241 - START ... // LOUKTA DA028241 - END so the local core patch can be located and removed in one block on the next Dolibarr core upgrade. The markers also cover the previously-merged PR #748 denominator change, which was not wrapped. Comment-only, no logic change. Committed with --no-verify (claudemd gate blocks on missing root CLAUDE.md; bypass authorized by user). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ATM-NicolasV
added a commit
that referenced
this pull request
Jun 19, 2026
…ation-ratio-denominator DOC : DA028241 - getSituationRatio() core-patch debt + credit-note scope limit (suivi #748)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://doliboard.atm-consulting.fr/ticket/messaging.php?track_id=548mpbb2cau5wra2
Contexte
DA028241 — Facture de situation FA2605-0251 (client Loukta) : montants de lignes incorrects dans le PDF en mode 1 cumulatif (
INVOICE_USE_SITUATION = 1).Commit
FIX : DA028241 - FactureLigne::getSituationRatio() - wrong denominator in mode 1 situation invoices
Dans
getSituationRatio()(factureligne.class.php), le calcul du ratio de la situation courante en mode 1 utilisait100comme dénominateur au lieu desituation_percent.Formule incorrecte :
Formule corrigée :
Résultat de la régression :
pdf_getlinetotalexcltax()retournait un montant HT de ligne erroné (sous-évalué), provoquant des totaux incohérents dans le PDF de la facture de situation.Test plan