Hello all,
Lists of recent transactions appear in the commercial section and generally on the home page of other modules. ex: “Proposal” almost hundreds of transactions appear here. I couldn’t find a setting to limit these. Thanks in advance to anyone who can help on this issue.
Hello,
In Home/Setup/Other setup, try to define the MAIN_MAXLIST_OVERLOAD with the number of items you need to display.
Unfortunately, this was not the solution. I think there is a BUG in this area for v.14.xx.
I had to intervene in the source code. It seems that there was an overlooked software error, I am sharing the details below for those who experience similar problems.
file: htdocs/commande/index.php
normally defined here…
line: 54~61
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
// Maximum elements of the tables
$maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
$maxLatestEditCount = 5;
$maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
The part that needs to be changed.
line: 106~108
print '<div class="fichecenter"><div class="fichethirdleft">';
$tmp = getCustomerOrderPieChart($socid);
if ($tmp) {
print $tmp;
print '<br>';
}
/*
* Draft orders
*/
if (!empty($conf->commande->enabled)) {
$sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid";
$sql .= ", s.client";
$sql .= ", s.code_client";
$sql .= ", s.canvas";
$sql .= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity IN (".getEntity('commande').")";
$sql .= " AND c.fk_statut = 0";
if ($socid) {
$sql .= " AND c.fk_soc = ".((int) $socid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
add new line: $sql .= " LIMIT ".$maxOpenCount;
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
$sql .= " LIMIT ".$maxOpenCount;
Thank you @umigun i will check if it is fixed in dolibarr recent versions and i will submit your fix if necessary.
Sorry but the fix is not so easy because the limit is different between widgets in this screen and i don’t know why but i think there is a reason.
I propose you to put an issue to explain your point of view and try to have answers here : Issues · Dolibarr/dolibarr · GitHub