From 2777c4d4a5ec16142c4ae0317f1d7227f4b4e31c Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 14 Dec 2016 18:35:59 +0100 Subject: [PATCH] FIX: Setting supplier as client when accept a supplier proposal --- .../class/supplier_proposal.class.php | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 09fa2dc69e9..d14591b6b9f 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -11,6 +11,7 @@ * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Marcos GarcĂ­a + * Copyright (C) 2016 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1631,24 +1632,11 @@ class SupplierProposal extends CommonObject $trigger_name='SUPPLIER_PROPOSAL_CLOSE_SIGNED'; $modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf; - // The connected company is classified as a client - $soc=new Societe($this->db); - $soc->id = $this->socid; - $result=$soc->set_as_client(); - - if ($result < 0) + if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists { - $this->error=$this->db->error(); - $this->db->rollback(); - return -2; + $result = $this->updateOrCreatePriceFournisseur($user); } - else - { - if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists - { - $result = $this->updateOrCreatePriceFournisseur($user); - } - } + } if ($statut == 4) {