mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix compatibility with multicompany module
This commit is contained in:
parent
f306b21d80
commit
07d121a7a0
|
|
@ -70,14 +70,14 @@ $label=$somme=$nb=array();
|
|||
$totalnb=$totalsum=0;
|
||||
$sql = "SELECT tf.code, tf.label, count(de.rowid) as nb, sum(de.total_ht) as km";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."expensereport_det as de, ".MAIN_DB_PREFIX."c_type_fees as tf";
|
||||
$sql.= " WHERE de.fk_expensereport = d.rowid AND de.entity IN (".getEntity('expensereport', 1)." AND de.fk_c_type_fees = tf.id";
|
||||
$sql.= " WHERE de.fk_expensereport = d.rowid AND d.entity IN (".getEntity('expensereport', 1).") AND de.fk_c_type_fees = tf.id";
|
||||
// RESTRICT RIGHTS
|
||||
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
|
||||
&& (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)))
|
||||
{
|
||||
$childids = $user->getAllChildIds();
|
||||
$childids[]=$user->id;
|
||||
$sql.= " AND de.fk_user_author IN (".join(',',$childids).")\n";
|
||||
$sql.= " AND d.fk_user_author IN (".join(',',$childids).")\n";
|
||||
}
|
||||
|
||||
$sql.= " GROUP BY tf.code, tf.label";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user