diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e8ee9adb763..90e2ede1119 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4246,7 +4246,11 @@ class Facture extends CommonInvoice $RetainedWarrantyAmount = $this->getRetainedWarrantyAmount(); if($totalpaye >= 0 && $RetainedWarrantyAmount>= 0) { - if( ($totalpaye < $this->total_ttc - $RetainedWarrantyAmount) && $this->retained_warranty_date_limit < ($now - $conf->facture->client->warning_delay) ) + if( ($totalpaye < $this->total_ttc - $RetainedWarrantyAmount) && $this->date_lim_reglement < ($now - $conf->facture->client->warning_delay) ) + { + $hasDelay = 1; + } + elseif($totalpaye < $this->total_ttc && $this->retained_warranty_date_limit < ($now - $conf->facture->client->warning_delay) ) { $hasDelay = 1; }