diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php
index 9e9d5cad8f1..9e5bcd9ca72 100644
--- a/htdocs/admin/menus/edit.php
+++ b/htdocs/admin/menus/edit.php
@@ -144,9 +144,9 @@ if ($action == 'add')
}
$leftmenu=''; $mainmenu='';
- if (GETPOST('menuId', 'int') && ! is_numeric(GETPOST('menuId', 'int')))
+ if (GETPOST('menuId', 'alpha') && ! is_numeric(GETPOST('menuId', 'alpha')))
{
- $tmp=explode('&', GETPOST('menuId', 'int'));
+ $tmp=explode('&', GETPOST('menuId', 'alpha'));
foreach($tmp as $s)
{
if (preg_match('/fk_mainmenu=/', $s))
diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php
index 54e1d285f3e..33a06e09136 100644
--- a/htdocs/compta/charges/index.php
+++ b/htdocs/compta/charges/index.php
@@ -106,7 +106,7 @@ if ($year) $param.='&year='.$year;
if ($mode != 'sconly')
{
- print $langs->trans("DescTaxAndDividendsArea").'
';
+ print ''.$langs->trans("DescTaxAndDividendsArea").'
';
print "
";
}
diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php
index fa1aa068283..f67160c698e 100644
--- a/htdocs/compta/compta-files.php
+++ b/htdocs/compta/compta-files.php
@@ -81,6 +81,8 @@ if ($user->societe_id > 0)
* Actions
*/
+$entity = GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity;
+
//$parameters = array('socid' => $id);
//$reshook = $hookmanager->executeHooks('doActions', $parameters, $object); // Note that $object may have been modified by some hooks
//if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -91,21 +93,27 @@ if(($action=="searchfiles" || $action=="dl" ) && $date_start && $date_stop) {
$wheretail=" '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'";
$sql="SELECT rowid as id, ref as ref,paye as paid, total_ttc, fk_soc, datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture";
$sql.=" WHERE datef between ".$wheretail;
+ $sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" UNION ALL";
$sql.=" SELECT rowid as id, ref, paye as paid, total_ttc, fk_soc, datef as date, 'InvoiceSupplier' as item FROM ".MAIN_DB_PREFIX."facture_fourn";
$sql.=" WHERE datef between ".$wheretail;
+ $sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" UNION ALL";
$sql.=" SELECT rowid as id, ref, paid, total_ttc, fk_user_author as fk_soc, date_fin as date,'ExpenseReport' as item FROM ".MAIN_DB_PREFIX."expensereport";
$sql.=" WHERE date_fin between ".$wheretail;
+ $sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" UNION ALL";
$sql.=" SELECT rowid as id, ref,paid,amount as total_ttc, '0' as fk_soc, datedon as date,'Donation' as item FROM ".MAIN_DB_PREFIX."don";
$sql.=" WHERE datedon between ".$wheretail;
+ $sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" UNION ALL";
$sql.=" SELECT rowid as id, label as ref, 1 as paid, amount as total_ttc, fk_user as fk_soc,datep as date,'SalaryPayment' as item FROM ".MAIN_DB_PREFIX."payment_salary";
$sql.=" WHERE datep between ".$wheretail;
+ $sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" UNION ALL";
$sql.=" SELECT rowid as id, libelle as ref, paye as paid, amount as total_ttc, 0 as fk_soc, date_creation as date, 'SocialContributions' as item FROM ".MAIN_DB_PREFIX."chargesociales";
$sql.=" WHERE date_creation between ".$wheretail;
+ $sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
$resd = $db->query($sql);
$files=array();
$link='';
@@ -264,8 +272,37 @@ $form = new Form($db);
$userstatic=new User($db);
$title=$langs->trans("ComptaFiles").' - '.$langs->trans("List");
print '