diff --git a/htdocs/fourn/facture/paiementfourn.class.php b/htdocs/fourn/facture/paiementfourn.class.php index 6be4320592a..7e3b3ea7aa0 100644 --- a/htdocs/fourn/facture/paiementfourn.class.php +++ b/htdocs/fourn/facture/paiementfourn.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004 Laurent Destailleur * * 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 @@ -100,16 +100,13 @@ class PaiementFourn $sql .= " VALUES (now(), '$this->datepaye', -$this->amount, '$this->author', '$label', '$this->paiementid', '$this->accountid', '$this->num_paiement')"; $result = $this->db->query($sql); - // Pour l'instant ce code n'est pas actif et n'est pas nécessaire. - // Je l'activerais (Eldy) si besoin de retrouver le lien entre une transaction bancaire - // et la facture générée se fait sentir (fonction futures ?): // Mise a jour fk_bank dans llx_paiement_fourn - //if ($result) { - // $this->bankid = $this->db->last_insert_id(); - // - // $sql = "UPDATE ".MAIN_DB_PREFIX."paiementfourn SET fk_bank=$this->bankid WHERE rowid=$this->id"; - // $result = $this->db->query($sql); - //} + if ($result) { + $this->bankid = $this->db->last_insert_id(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."paiementfourn SET fk_bank=$this->bankid WHERE rowid=$this->id"; + $result = $this->db->query($sql); + } } else