Skip to content

Commit

Permalink
Remove call of $mc->dao than hangs. Replaced with $mc use.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 19, 2020
1 parent 91899d2 commit 3fafbb3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
21 changes: 16 additions & 5 deletions htdocs/compta/accounting-files.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@
accessforbidden();
}

$entity = GETPOST('entity', 'int') ?GETPOST('entity', 'int') : $conf->entity;
$entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : (GETPOSTISSET('search_entity') ? GETPOST('search_entity', 'int') : $conf->entity));
if (empty($entity) && ! empty($conf->global->MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES)) {
$tmparray = $mc->getEntitiesList();
$entity = '0,'.join(',', array_keys($tmparray));
}
if (empty($entity)) $entity = $conf->entity;



/*
Expand Down Expand Up @@ -400,13 +406,18 @@
print $langs->trans("ReportPeriod").': '.$form->selectDate($date_start, 'date_start', 0, 0, 0, "", 1, 1, 0);
print ' - '.$form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0)."\n</a>";

// Export is for current company only !
// Export is for current company only
if (!empty($conf->multicompany->enabled) && is_object($mc))
{
$mc->getInfo($conf->entity);
print '<span class="marginleftonly marginrightonly">('.$langs->trans("Entity").' : ';
$mc->dao->getEntities();
$mc->dao->fetch($conf->entity);
print $mc->dao->label;
print "<td>";
if (! empty($conf->global->MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES)) {
print $mc->select_entities(GETPOSTISSET('search_entity') ? GETPOST('search_entity', 'int') : $mc->id, 'search_entity', '', false, false, false, false, true);
} else {
print $mc->label;
}
print "</td>";
print ")</span>\n";
}

Expand Down
7 changes: 5 additions & 2 deletions htdocs/compta/bank/treso.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,14 @@
else print $langs->trans("NotDefined");
print "</td>";
print "<td>".$ref."</td>";
if($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED ){
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) {
if($obj->family == 'invoice'){
$mc->getInfo($obj->entity);
print "<td>".$mc->label."</td>";
}else print "<td></td>";
}
else {
print "<td></td>";
}
}
print "<td>".$refcomp."</td>";
if ($obj->total_ttc < 0) { print '<td class="nowrap right">'.price(abs($total_ttc))."</td><td>&nbsp;</td>"; };
Expand Down

0 comments on commit 3fafbb3

Please sign in to comment.