Fix: missing current entity record
This commit is contained in:
parent
b7edb3f472
commit
c9dba00f3f
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
Loading…
Reference in New Issue
Block a user