2
0
forked from Wavyzz/dolibarr

Limit list of draft element in home sections

This commit is contained in:
Laurent Destailleur
2021-02-02 11:34:34 +01:00
parent c2db7ccf14
commit c94ecb8a42
2 changed files with 106 additions and 6 deletions

View File

@@ -161,10 +161,18 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
if ($num > 0) {
$i = 0;
$othernb = 0;
while ($i < $nbofloop) {
while ($i < $num && $i < $conf->liste_limit) {
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
continue;
}
$propalstatic->id = $obj->rowid;
$propalstatic->ref = $obj->ref;
$propalstatic->ref_client = $obj->ref_client;
@@ -196,6 +204,15 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$i++;
$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
}
addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
@@ -236,10 +253,18 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
if ($num > 0) {
$i = 0;
$othernb = 0;
while ($i < $nbofloop) {
while ($i < $num && $i < $conf->liste_limit) {
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
continue;
}
$supplierproposalstatic->id = $obj->rowid;
$supplierproposalstatic->ref = $obj->ref;
$supplierproposalstatic->total_ht = $obj->total_ht;
@@ -270,6 +295,15 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$i++;
$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
}
addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
@@ -310,10 +344,18 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
if ($num > 0) {
$i = 0;
$othernb = 0;
while ($i < $nbofloop) {
while ($i < $num && $i < $conf->liste_limit) {
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
continue;
}
$orderstatic->id = $obj->rowid;
$orderstatic->ref = $obj->ref;
$orderstatic->ref_client = $obj->ref_client;
@@ -345,6 +387,15 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$i++;
$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
}
addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");
@@ -385,10 +436,18 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
if ($num > 0) {
$i = 0;
$othernb = 0;
while ($i < $nbofloop) {
while ($i < $num && $i < $conf->liste_limit) {
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
continue;
}
$supplierorderstatic->id = $obj->rowid;
$supplierorderstatic->ref = $obj->ref;
$supplierorderstatic->ref_supplier = $obj->ref_suppliert;
@@ -420,6 +479,15 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$i++;
$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
}
addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal");

View File

@@ -193,11 +193,19 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
$companystatic = new Societe($db);
$i = 0;
$othernb = 0;
$tot_ttc = 0;
while ($i < $num)
while ($i < $num && $i < $conf->liste_limit)
{
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$tot_ttc += $obj->total_ttc;
continue;
}
$tmpinvoice->id = $obj->rowid;
$tmpinvoice->ref = $obj->ref;
$tmpinvoice->date = $db->jdate($obj->date);
@@ -232,6 +240,14 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
$i++;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="3">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
print '<tr class="liste_total"><td class="left">'.$langs->trans("Total").'</td>';
print '<td colspan="2" class="right">'.price($tot_ttc).'</td>';
print '</tr>';
@@ -290,11 +306,19 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$companystatic = new Societe($db);
$i = 0;
$othernb = 0;
$tot_ttc = 0;
while ($i < $num)
while ($i < $num && $i < $conf->liste_limit)
{
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$tot_ttc += $obj->total_ttc;
continue;
}
$facturesupplierstatic->ref = $obj->ref;
$facturesupplierstatic->id = $obj->rowid;
$facturesupplierstatic->total_ht = $obj->total_ht;
@@ -328,6 +352,14 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$i++;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="3">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
print '<tr class="liste_total"><td class="left">'.$langs->trans("Total").'</td>';
print '<td colspan="2" class="right">'.price($tot_ttc).'</td>';
print '</tr>';