2013-09-17 00:03:26 +02:00
{include="header"}
{if condition="$notice != ''"}
< div id = "notice" > < p > {$notice}< / p > < / div >
{/if}
< div id = "quick_summary" >
< h2 > Bilan< / h2 >
2013-10-04 13:38:24 +02:00
{if condition="$current_user->getAdmin()"}
< p class = "center" > Lire < em > ligne< / em > doit < em > case< / em > {$currency} à < em > colonne< / em > . Vous pouvez cliquer sur les liens pour confirmer les remboursements.
< table id = "balance_table" >
2013-09-17 00:03:26 +02:00
< tr >
2013-10-04 13:38:24 +02:00
< th > Doit\À< / th >
2013-09-17 00:03:26 +02:00
{loop="users"}
2013-10-04 13:38:24 +02:00
< th > {$value->getDisplayName()}< / th >
2013-09-17 00:03:26 +02:00
{/loop}
< / tr >
2013-10-04 13:38:24 +02:00
{loop="users"}
< tr >
< th > {$value->getDisplayName()}< / th >
{loop="users"}
{if condition="$balances[$value1->getId()][$value2->getId()] === 'X'"}
< td class = "cell-disabled" > < / td >
{elseif condition="$balances[$value1->getId()][$value2->getId()] === '-' || ($value2->getId() != $current_user->getId() & & !$current_user->getAdmin())"}
< td > {$balances[$value1->getId()][$value2->getId()]}< / td >
{else}
< td > < a href = "?do=payall&from={$value1->getId()}&to={$value2->getId()}&token={$token}" > {$balances[$value1->getId()][$value2->getId()]}< / a > < / td >
{/if}
{/loop}
< / tr >
{/loop}
< / table >
{else}
< table >
< tr >
< th > Utilisateurs< / th >
< th > Vous devez< / th >
< th > Il vous doit< / th >
< / tr >
{loop="$users"}
{if condition="$balances[$value->getId()][$current_user->getId()] !== 'X' & & $balances[$value->getId()][$current_user->getId()] !== '-'"}
< / tr >
< td > {$value->getDisplayName()}< / td >
< td > -< / td >
< td > {$balances[$value->getId()][$current_user->getId()]}{$currency}< / td >
< / tr >
{elseif condition="$balances[$current_user->getId()][$value->getId()] !== 'X' & & $balances[$current_user->getId()][$value->getId()] !== '-'"}
< / tr >
< td > {$value->getDisplayName()}< / td >
< td > {$balances[$current_user->getId()][$value->getId()]}{$currency}< / td >
< td > -< / td >
< / tr >
{/if}
{/loop}
< / table >
{/if}
2013-09-17 00:03:26 +02:00
< / div >
< div id = "detailed_summary" >
< h2 > Liste détaillée des dépenses{if condition="$all == 0"} du dernier mois{/if}< / h2 >
{if condition="$all == 0"}
< p class = "center" > < a href = "?all=1" > Afficher toutes les dépenses< / a > < / p >
{else}
< p class = "center" > < a href = "?all=0" > Afficher uniquement les dépenses du dernier mois< / a > < / p >
{/if}
{if condition="$invoices !== false & & count($invoices)>=1"}
< table id = "list_expenses" >
< tr >
< th > Date< / th >
< th > Payé par< / th >
< th > Participants< / th >
< th > Montant< / th >
< th > Quoi ?< / th >
< th > Modifier< / th >
< th > Supprimer< / th >
< / tr >
{loop="invoices"}
< tr >
< td > {$value->getDate('d/m/Y A')}< / td >
< td > {$users[$value->getBuyer()]->getDisplayName()}< / td >
< td >
{loop="$value->getUsersIn()->get()"}
{$users[$key2]->getDisplayName()}
{if condition="$value2 > 1"}
2013-09-27 17:33:04 +02:00
({$value2} invités)
2013-09-17 00:03:26 +02:00
{elseif condition="$value2 == 1"}
2013-09-27 17:33:04 +02:00
({$value2} invité)
2013-09-17 00:03:26 +02:00
{/if}
{if condition="$value1->getBuyer() != $key2"}
-
{if condition="$paybacks[$value1->getId()] === false || !in_array($key2, array_keys($paybacks[$value1->getId()]))"}
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
2013-09-25 22:09:25 +02:00
< a href = "?do=confirm_payback&from={$key2}&to={$value1->getBuyer()}&invoice_id={$value1->getId()}&token={$token}" title = "Confirmer le remboursement" >
2013-09-17 00:03:26 +02:00
{/if}
Reste {$value1->getAmountPerPerson($key2)} {$currency}
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
< / a >
{/if}
{else}
{if condition="$paybacks[$value1->getId()][$key2]->getAmount() == $value1->getAmountPerPerson($key2)"}
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
2013-09-25 22:09:25 +02:00
< a href = "?do=delete_payback&from={$key2}&to={$value1->getBuyer()}&invoice_id={$value1->getId()}&token={$token}" title = "Supprimer le remboursement" >
2013-09-17 00:03:26 +02:00
{/if}
Payé
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
< / a >
{/if}
{else}
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
2013-09-25 22:09:25 +02:00
< a href = "?do=confirm_payback&from={$key2}&to={$value1->getBuyer()}&invoice_id={$value1->getId()}&payback_id={$paybacks[$value1->getId()][$key2]->getId()}&token={$token}" title = "Confirmer le remboursement" >
2013-09-17 00:03:26 +02:00
{/if}
Reste {$value1->getAmountPerPerson($key2) - $paybacks[$value1->getId()][$key2]->getAmount()}{$currency}
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
< / a >
{/if}
{/if}
{/if}
{/if}
< br / >
{/loop}
< / td >
< td > {$value->getAmount()}{$currency}< / td >
< td > {$value->getWhat()}< / td >
< td >
{if condition="$value->getBuyer() == $current_user->getId() || $current_user->getAdmin()"}
< a href = "index.php?do=edit_invoice&id={$value->getId()}" > Modifier< / a >
{else}
-
{/if}
< / td >
< td >
{if condition="$value->getBuyer() == $current_user->getId() || $current_user->getAdmin()"}
2013-09-25 22:09:25 +02:00
< a href = "index.php?do=delete_invoice&id={$value->getId()}&token={$token}" > Supprimer< / a >
2013-09-17 00:03:26 +02:00
{else}
-
{/if}
< / td >
< / tr >
{/loop}
< / table >
{else}
< p class = "center" > Aucune dépense à afficher.< / p >
{/if}
< / div >
{include="footer"}