Fix selection of fields
This commit is contained in:
parent
3dc9bc89d8
commit
7f5fd3bbc0
@ -414,12 +414,10 @@ print '</tr>';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$total = array(); $found = 0;
|
$total = array(); $found = 0; $i=0;
|
||||||
$var=true;
|
$var=true;
|
||||||
foreach ($accounts as $key=>$type)
|
foreach ($accounts as $key=>$type)
|
||||||
{
|
{
|
||||||
//if ($type == 1)
|
|
||||||
//{
|
|
||||||
$found++;
|
$found++;
|
||||||
|
|
||||||
$acc = new Account($db);
|
$acc = new Account($db);
|
||||||
@ -434,12 +432,14 @@ foreach ($accounts as $key=>$type)
|
|||||||
if (! empty($arrayfields['b.ref']['checked']))
|
if (! empty($arrayfields['b.ref']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="titlefield">'.$acc->getNomUrl(1).'</td>';
|
print '<td class="titlefield">'.$acc->getNomUrl(1).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
if (! empty($arrayfields['b.label']['checked']))
|
if (! empty($arrayfields['b.label']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$acc->label.'</td>';
|
print '<td>'.$acc->label.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account type
|
// Account type
|
||||||
@ -448,12 +448,14 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
print $acc->type_lib[$acc->type];
|
print $acc->type_lib[$acc->type];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number
|
// Number
|
||||||
if (! empty($arrayfields['b.number']['checked']))
|
if (! empty($arrayfields['b.number']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$acc->number.'</td>';
|
print '<td>'.$acc->number.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
@ -461,6 +463,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
print '<td>'.length_accountg($acc->account_number).'</td>';
|
print '<td>'.length_accountg($acc->account_number).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transactions to reconcile
|
// Transactions to reconcile
|
||||||
@ -479,6 +482,7 @@ foreach ($accounts as $key=>$type)
|
|||||||
}
|
}
|
||||||
else print $langs->trans("FeatureDisabled");
|
else print $langs->trans("FeatureDisabled");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -525,14 +529,18 @@ foreach ($accounts as $key=>$type)
|
|||||||
if (! empty($arrayfields['b.clos']['checked']))
|
if (! empty($arrayfields['b.clos']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.$acc->getLibStatut(5).'</td>';
|
print '<td align="center">'.$acc->getLibStatut(5).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Balance
|
// Balance
|
||||||
if (! empty($arrayfields['balance']['checked']))
|
if (! empty($arrayfields['balance']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/bankentries.php?id='.$acc->id.'">'.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries.php?id='.$acc->id.'">'.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield'];
|
||||||
|
$totalarray['totalbalance'] += $solde;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
@ -549,13 +557,29 @@ foreach ($accounts as $key=>$type)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$total[$acc->currency_code] += $solde;
|
$total[$acc->currency_code] += $solde;
|
||||||
//}
|
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
if (! $found) print '<tr '.$bc[$var].'><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
|
||||||
// Total
|
if (! $found) print '<tr '.$bc[$var].'><td colspan="'.$totalarray['nbfield'].'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
foreach ($total as $key=>$solde)
|
|
||||||
|
// Show total line
|
||||||
|
if (isset($totalarray['totalbalancefield']))
|
||||||
{
|
{
|
||||||
print '<tr class="liste_total"><td colspan="6" class="liste_total">'.$langs->trans("Total").' '.$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td><td></td></tr>';
|
print '<tr class="liste_total">';
|
||||||
|
$i=0;
|
||||||
|
while ($i < $totalarray['nbfield'])
|
||||||
|
{
|
||||||
|
$i++;
|
||||||
|
if ($i == 1)
|
||||||
|
{
|
||||||
|
if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>';
|
||||||
|
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||||
|
}
|
||||||
|
elseif ($totalarray['totalbalancefield'] == $i) print '<td align="right">'.price($totalarray['totalbalance'], 0, $langs, 0, 0, -1, $key).'</td>';
|
||||||
|
else print '<td></td>';
|
||||||
|
}
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user