Fix: wrong entity with thirdparty sharing
This commit is contained in:
parent
4683a35532
commit
8c3b4f62db
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
|
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
|
||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
|
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
|
||||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2011-2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
@ -372,6 +372,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$object->name = GETPOST('name', 'alpha');
|
$object->name = GETPOST('name', 'alpha');
|
||||||
}
|
}
|
||||||
|
$object->entity = (GETPOSTISSET('entity')?GETPOST('entity', 'int'):$conf->entity);
|
||||||
$object->name_alias = GETPOST('name_alias');
|
$object->name_alias = GETPOST('name_alias');
|
||||||
$object->address = GETPOST('address');
|
$object->address = GETPOST('address');
|
||||||
$object->zip = GETPOST('zipcode', 'alpha');
|
$object->zip = GETPOST('zipcode', 'alpha');
|
||||||
|
|||||||
@ -472,7 +472,7 @@ class Societe extends CommonObject
|
|||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, name_alias, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, fk_incoterms, location_incoterms ,import_key, fk_multicurrency, multicurrency_code)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, name_alias, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, fk_incoterms, location_incoterms ,import_key, fk_multicurrency, multicurrency_code)";
|
||||||
$sql.= " VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".$conf->entity.", '".$this->db->idate($now)."'";
|
$sql.= " VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".$this->entity.", '".$this->db->idate($now)."'";
|
||||||
$sql.= ", ".(! empty($user->id) ? "'".$user->id."'":"null");
|
$sql.= ", ".(! empty($user->id) ? "'".$user->id."'":"null");
|
||||||
$sql.= ", ".(! empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'":"null");
|
$sql.= ", ".(! empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'":"null");
|
||||||
$sql.= ", ".$this->status;
|
$sql.= ", ".$this->status;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user