From cf89b850ee3f174d782864fe6e571687c2a3cb48 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Thu, 4 Oct 2018 11:37:04 +0200 Subject: [PATCH] Fix retained warranty delay --- htdocs/compta/facture/class/facture.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; }