Added a balance statement on the index page

This commit is contained in:
Phyks 2013-11-19 14:14:29 +01:00
parent af2363c7cd
commit 9c90c37dd8
3 changed files with 11 additions and 0 deletions

View File

@ -1143,6 +1143,15 @@
} }
} }
if(!$current_user->getAdmin()) {
$user_balance = 0;
foreach($users_list as $user1) {
$user_balance -= $balances[$current_user->getId()][$user1->getId()];
$user_balance += $balances[$user1->getId()][$current_user->getId()];
}
$tpl->assign('user_balance', $user_balance);
}
$tpl->assign('users', secureDisplay($users_list)); $tpl->assign('users', secureDisplay($users_list));
$tpl->assign('invoices', secureDisplay($invoices_list)); $tpl->assign('invoices', secureDisplay($invoices_list));
$tpl->assign('paybacks', secureDisplay($paybacks)); $tpl->assign('paybacks', secureDisplay($paybacks));

View File

@ -53,6 +53,7 @@
{/if} {/if}
{/loop} {/loop}
</table> </table>
<p class="center">Balance : {if condition="$user_balance > 0"}+{/if}{$user_balance}{$currency}</p>
{/if} {/if}
</div> </div>
<div id="detailed_summary"> <div id="detailed_summary">

View File

@ -53,6 +53,7 @@
{/if} {/if}
{/loop} {/loop}
</table> </table>
<p class="center">Solde : {if condition="$user_balance > 0"}+{/if}{$user_balance}{$currency}</p>
{/if} {/if}
</div> </div>
<div id="detailed_summary"> <div id="detailed_summary">