From c9dba00f3fb690eaf2a5fdae403c33148155d6d5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 15 Apr 2013 21:27:01 +0200 Subject: [PATCH] Fix: missing current entity record --- htdocs/compta/sociales/charges.php | 2 +- htdocs/compta/sociales/class/chargesociales.class.php | 7 +++++-- htdocs/compta/tva/class/tva.class.php | 4 ++-- htdocs/compta/tva/fiche.php | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 70065d7b7d2..2ec6539db9e 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2013 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 diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 1f85a99916d..44779b8b0de 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -115,6 +115,8 @@ class ChargeSociales extends CommonObject */ function create($user) { + global $conf; + // Nettoyage parametres $newamount=price2num($this->amount,'MT'); @@ -127,10 +129,11 @@ class ChargeSociales extends CommonObject $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount, entity)"; $sql.= " VALUES (".$this->type.",'".$this->db->escape($this->lib)."',"; $sql.= " '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."',"; - $sql.= " ".price2num($newamount); + $sql.= " ".price2num($newamount)."',"; + $sql.= " ".$conf->entity; $sql.= ")"; dol_syslog(get_class($this)."::create sql=".$sql); diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index ab393c12ba2..34dc0262c2e 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -500,13 +500,13 @@ class Tva extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep, datev, amount"; if ($this->note) $sql.=", note"; if ($this->label) $sql.=", label"; - $sql.= ", fk_user_creat, fk_bank"; + $sql.= ", fk_user_creat, fk_bank, entity"; $sql.= ") "; $sql.= " VALUES ('".$this->db->idate($this->datep)."',"; $sql.= "'".$this->db->idate($this->datev)."'," . $this->amount; if ($this->note) $sql.=", '".$this->db->escape($this->note)."'"; if ($this->label) $sql.=", '".$this->db->escape($this->label)."'"; - $sql.=", '".$user->id."', NULL"; + $sql.=", '".$user->id."', NULL, ".$conf->entity; $sql.= ")"; dol_syslog("Tva::addPayment sql=".$sql); diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index c8139c5575f..a95f7b85963 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2013 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