diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 90e2ede1119..7df75b89f7c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4282,7 +4282,6 @@ class Facture extends CommonInvoice $displayWarranty = true; // Check if this situation invoice is 100% for real if(!empty($this->lines)){ - $displayWarranty = true; foreach( $this->lines as $i => $line ){ if($line->product_type < 2 && $line->situation_percent < 100){ $displayWarranty = false; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 5fdc7dde6a5..bea5ee3b0f5 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -370,7 +370,7 @@ $sql.= ' f.paye as paye, f.fk_statut,'; $sql.= ' f.datec as date_creation, f.tms as date_update,'; if($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY) { - $sql.= ' f.retained_warranty,'; + $sql.= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final,'; } $sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,'; $sql.= " typent.code as typent_code,"; @@ -942,7 +942,12 @@ if ($resql) $facturestatic->date_lim_reglement=$db->jdate($obj->datelimite); $facturestatic->note_public=$obj->note_public; $facturestatic->note_private=$obj->note_private; - + if($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY) + { + $facturestatic->retained_warranty=$obj->retained_warranty; + $facturestatic->retained_warranty_date_limit=$obj->retained_warranty_date_limit; + $facturestatic->situation_final=$obj->retained_warranty_date_limit; + } $thirdpartystatic->id=$obj->socid; $thirdpartystatic->name=$obj->name; $thirdpartystatic->client=$obj->client; @@ -1018,7 +1023,7 @@ if ($resql) print '