From 146bd33e90540254ccf451a6aa2c59f9268a288c Mon Sep 17 00:00:00 2001 From: EchoLoGeek <73399671+EchoLoGeek@users.noreply.github.com> Date: Tue, 4 Mar 2025 11:00:24 +0100 Subject: [PATCH] Fix updateline method for INVOICE_USE_SITUATION = 2 If there is no progress on a line, percent must not be 100% --- htdocs/compta/facture/class/facture.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9772c590d85..d364265c5b2 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4140,7 +4140,12 @@ class Facture extends CommonInvoice $special_code = 0; } if (!isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '' || $situation_percent == null) { - $situation_percent = 100; + // INVOICE_USE_SITUATION = 2 - If there is no progress on a line, percent must not be 100% (No cumulative) + if ($this->type == Facture::TYPE_SITUATION && getDolGlobalInt('INVOICE_USE_SITUATION') == 2 && (int) $situation_percent < 100) { + $situation_percent = 0; + } else { + $situation_percent = 100; + } } if (empty($ref_ext)) { $ref_ext = '';