Start work on bank sharing for multi-company

This commit is contained in:
Maxime Kohlhaas 2013-07-19 09:19:20 +02:00
parent 4aa9d92a49
commit 01e4d905fb
5 changed files with 5 additions and 5 deletions

View File

@ -604,7 +604,7 @@ if (! empty($conf->banque->enabled))
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE clos = 0";
$sql.= " AND courant = 1";
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND entity IN (".getEntity('bank_account', 1).")";
$resql=$db->query($sql);
if ($resql)
{

View File

@ -613,7 +613,7 @@ class Account extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON ba.fk_pays = p.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.state_id = d.rowid';
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " WHERE entity IN (".getEntity($this->element, 1).")";
if ($id) $sql.= " AND ba.rowid = ".$id;
if ($ref) $sql.= " AND ba.ref = '".$this->db->escape($ref)."'";

View File

@ -59,7 +59,7 @@ $accounts = array();
$sql = "SELECT rowid, courant, rappro";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " WHERE entity IN (".getEntity('bank_account', 1).")";
if ($statut != 'all') $sql.= " AND clos = 0";
$sql.= $db->order('label', 'ASC');

View File

@ -55,7 +55,7 @@ $sql = "SELECT count(b.rowid)";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= " WHERE ba.rowid = b.fk_account";
$sql.= " AND ba.entity = ".$conf->entity;
$sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")";
$sql.= " AND b.fk_type = 'CHQ'";
$sql.= " AND b.fk_bordereau = 0";
$sql.= " AND b.amount > 0";

View File

@ -2326,7 +2326,7 @@ class Form
$sql = "SELECT rowid, label, bank";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE clos = '".$statut."'";
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND entity IN (".getEntity('bank_account', 1).")";
if ($filtre) $sql.=" AND ".$filtre;
$sql.= " ORDER BY label";