From 27c1e7614f313c21c4a1d96ec5006ed9f2985923 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Feb 2009 14:07:09 +0000 Subject: [PATCH] Fix: Public note not stored in private note when creating a supplier invoice. --- htdocs/fourn/facture/fiche.php | 2 +- htdocs/fourn/fournisseur.facture.class.php | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 709ff7aff70..86f9cfb8820 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -188,7 +188,7 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer) $facfou->libelle = $_POST['libelle']; $facfou->date = $datefacture; $facfou->date_echeance = $datedue; - $facfou->note = $_POST['note']; + $facfou->note_public = $_POST['note']; $facid = $facfou->create($user); diff --git a/htdocs/fourn/fournisseur.facture.class.php b/htdocs/fourn/fournisseur.facture.class.php index dc1e1c97ad3..636031ef816 100644 --- a/htdocs/fourn/fournisseur.facture.class.php +++ b/htdocs/fourn/fournisseur.facture.class.php @@ -67,6 +67,7 @@ class FactureFournisseur extends Facture var $total_tva; var $total_ttc; var $note; + var $note_public; var $propalid; var $lignes; var $fournisseur; @@ -120,9 +121,13 @@ class FactureFournisseur extends Facture if (! $remise) $remise = 0 ; $totalht = ($amount - $remise); - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn (facnumber, libelle, fk_soc, datec, datef, note, fk_user_author, date_lim_reglement) '; - $sql .= " VALUES ('".addslashes($number)."','".addslashes($this->libelle)."',"; - $sql .= $this->socid.", ".$this->db->idate(mktime()).",'".$this->db->idate($this->date)."','".addslashes($this->note)."', ".$user->id.",'".$this->db->idate($this->date_echeance)."');"; + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn (facnumber, libelle, fk_soc, datec, datef,'; + $sql.= ' note, note_public, fk_user_author, date_lim_reglement) '; + $sql.= " VALUES ('".addslashes($number)."','".addslashes($this->libelle)."',"; + $sql.= " ".$this->socid.", ".$this->db->idate(gmmktime()).",'".$this->db->idate($this->date)."',"; + $sql.= " '".addslashes($this->note)."',"; + $sql.= " '".addslashes($this->note_public)."',"; + $sql.= " ".$user->id.",'".$this->db->idate($this->date_echeance)."');"; dolibarr_syslog("FactureFournisseur::create sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql);