diff --git a/index.php b/index.php index edf7513..94ee923 100755 --- a/index.php +++ b/index.php @@ -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('invoices', secureDisplay($invoices_list)); $tpl->assign('paybacks', secureDisplay($paybacks)); diff --git a/tpl/default_en/index.html b/tpl/default_en/index.html index 59f9d17..7e55410 100755 --- a/tpl/default_en/index.html +++ b/tpl/default_en/index.html @@ -53,6 +53,7 @@ {/if} {/loop} +

Balance : {if condition="$user_balance > 0"}+{/if}{$user_balance}{$currency}

{/if}
diff --git a/tpl/default_fr/index.html b/tpl/default_fr/index.html index 17cc6da..2aa4941 100755 --- a/tpl/default_fr/index.html +++ b/tpl/default_fr/index.html @@ -53,6 +53,7 @@ {/if} {/loop} +

Solde : {if condition="$user_balance > 0"}+{/if}{$user_balance}{$currency}

{/if}