From 3ce077320c96585de55f0913267c8e71fcd7e4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Jan 2020 10:23:31 +0100 Subject: [PATCH] retrieve extrafields oldline when updating line --- htdocs/contrat/class/contrat.class.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 7434d886072..086327db50a 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * Copyright (C) 2015-2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -675,18 +675,18 @@ class Contrat extends CommonObject { $this->id = $obj->rowid; $this->ref = (!isset($obj->ref) || !$obj->ref) ? $obj->rowid : $obj->ref; - $this->ref_customer = $obj->ref_customer; - $this->ref_supplier = $obj->ref_supplier; + $this->ref_customer = $obj->ref_customer; + $this->ref_supplier = $obj->ref_supplier; $this->ref_ext = $obj->ref_ext; $this->entity = $obj->entity; $this->statut = $obj->statut; $this->mise_en_service = $this->db->jdate($obj->datemise); - $this->date_contrat = $this->db->jdate($obj->datecontrat); - $this->date_creation = $this->db->jdate($obj->datecontrat); + $this->date_contrat = $this->db->jdate($obj->datecontrat); + $this->date_creation = $this->db->jdate($obj->datecontrat); - $this->fin_validite = $this->db->jdate($obj->fin_validite); - $this->date_cloture = $this->db->jdate($obj->date_cloture); + $this->fin_validite = $this->db->jdate($obj->fin_validite); + $this->date_cloture = $this->db->jdate($obj->date_cloture); $this->user_author_id = $obj->fk_user_author; @@ -696,9 +696,9 @@ class Contrat extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; - $this->modelpdf = $obj->model_pdf; + $this->modelpdf = $obj->model_pdf; - $this->fk_projet = $obj->fk_project; // deprecated + $this->fk_projet = $obj->fk_project; // deprecated $this->fk_project = $obj->fk_project; $this->socid = $obj->fk_soc; @@ -708,7 +708,7 @@ class Contrat extends CommonObject $this->db->free($resql); - // Retreive all extrafields + // Retrieve all extrafields // fetch optionals attributes and labels $this->fetch_optionals(); @@ -3004,6 +3004,7 @@ class ContratLigne extends CommonObjectLine $this->oldcopy = new ContratLigne($this->db); $this->oldcopy->fetch($this->id); + $this->oldcopy->fetch_optionals(); // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET";