From 9f5a3f4f8e27ade07a4aee67c7bcf92f9ce32f47 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 17 Apr 2010 08:43:01 +0000 Subject: [PATCH] Fix: pgsql compatibility Todo: paiement COMMIT Transaction but nothing in table --- htdocs/compta/bank/account.class.php | 4 ++-- htdocs/paiement.class.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php index 29061cb5314..a17e0ec26dd 100644 --- a/htdocs/compta/bank/account.class.php +++ b/htdocs/compta/bank/account.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2004 Christophe Combelles - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2010 Regis Houssin * * 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 @@ -250,7 +250,7 @@ class Account extends CommonObject $sql.= ", fk_type"; $sql.= ",emetteur,banque"; $sql.= ") VALUES ("; - $sql.= $this->db->idate(mktime()); + $sql.= "'".$this->db->idate(mktime())."'"; $sql.= ", '".$this->db->idate($date)."'"; $sql.= ", '".$this->db->idate($datev)."'"; $sql.= ", '".addslashes($label)."'"; diff --git a/htdocs/paiement.class.php b/htdocs/paiement.class.php index c7e3c8cc4d8..09ff8890bed 100644 --- a/htdocs/paiement.class.php +++ b/htdocs/paiement.class.php @@ -143,8 +143,8 @@ class Paiement if ($this->total <> 0) // On accepte les montants negatifs pour les rejets de prelevement { - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiement (datec, datep, amount, fk_paiement, num_paiement, note, fk_user_creat)'; - $sql.= ' VALUES ('.$this->db->idate($now).', '.$this->db->idate($this->datepaye).', \''.$this->total.'\', '.$this->paiementid.', \''.$this->num_paiement.'\', \''.addslashes($this->note).'\', '.$user->id.')'; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (datec, datep, amount, fk_paiement, num_paiement, note, fk_user_creat)"; + $sql.= " VALUES ('".$this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$this->total."', ".$this->paiementid.", '".$this->num_paiement."', '".addslashes($this->note)."', ".$user->id.")"; dol_syslog("Paiement::Create insert paiement sql=".$sql); $resql = $this->db->query($sql);