Fix: missing current entity record

This commit is contained in:
Regis Houssin 2013-04-15 21:27:01 +02:00
parent b7edb3f472
commit c9dba00f3f
4 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -115,6 +115,8 @@ class ChargeSociales extends CommonObject
*/ */
function create($user) function create($user)
{ {
global $conf;
// Nettoyage parametres // Nettoyage parametres
$newamount=price2num($this->amount,'MT'); $newamount=price2num($this->amount,'MT');
@ -127,10 +129,11 @@ class ChargeSociales extends CommonObject
$this->db->begin(); $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.= " VALUES (".$this->type.",'".$this->db->escape($this->lib)."',";
$sql.= " '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."',"; $sql.= " '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."',";
$sql.= " ".price2num($newamount); $sql.= " ".price2num($newamount)."',";
$sql.= " ".$conf->entity;
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::create sql=".$sql); dol_syslog(get_class($this)."::create sql=".$sql);

View File

@ -500,13 +500,13 @@ class Tva extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep, datev, amount"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep, datev, amount";
if ($this->note) $sql.=", note"; if ($this->note) $sql.=", note";
if ($this->label) $sql.=", label"; if ($this->label) $sql.=", label";
$sql.= ", fk_user_creat, fk_bank"; $sql.= ", fk_user_creat, fk_bank, entity";
$sql.= ") "; $sql.= ") ";
$sql.= " VALUES ('".$this->db->idate($this->datep)."',"; $sql.= " VALUES ('".$this->db->idate($this->datep)."',";
$sql.= "'".$this->db->idate($this->datev)."'," . $this->amount; $sql.= "'".$this->db->idate($this->datev)."'," . $this->amount;
if ($this->note) $sql.=", '".$this->db->escape($this->note)."'"; if ($this->note) $sql.=", '".$this->db->escape($this->note)."'";
if ($this->label) $sql.=", '".$this->db->escape($this->label)."'"; if ($this->label) $sql.=", '".$this->db->escape($this->label)."'";
$sql.=", '".$user->id."', NULL"; $sql.=", '".$user->id."', NULL, ".$conf->entity;
$sql.= ")"; $sql.= ")";
dol_syslog("Tva::addPayment sql=".$sql); dol_syslog("Tva::addPayment sql=".$sql);

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by