Skip to content

Commit

Permalink
Fix: missing current entity record
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Apr 15, 2013
1 parent b7edb3f commit c9dba00
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion htdocs/compta/sociales/charges.php
@@ -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
Expand Down
7 changes: 5 additions & 2 deletions htdocs/compta/sociales/class/chargesociales.class.php
Expand Up @@ -115,6 +115,8 @@ function fetch($id)
*/
function create($user)
{
global $conf;

// Nettoyage parametres
$newamount=price2num($this->amount,'MT');

Expand All @@ -127,10 +129,11 @@ function create($user)

$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);
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/tva/class/tva.class.php
Expand Up @@ -500,13 +500,13 @@ function addPayment($user)
$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);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/tva/fiche.php
@@ -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
Expand Down

0 comments on commit c9dba00

Please sign in to comment.