2013-08-07 20:32:44 +02:00
|
|
|
{include="header"}
|
|
|
|
|
2013-08-12 09:52:50 +02:00
|
|
|
{if condition="$notice != ''"}
|
|
|
|
<div id="notice"><p>{$notice}</p></div>
|
|
|
|
{/if}
|
|
|
|
|
2013-08-07 20:32:44 +02:00
|
|
|
<div id="quick_summary">
|
2014-08-31 14:27:57 +02:00
|
|
|
<h2>{$i18n['balance']}</h2>
|
2013-10-04 13:38:24 +02:00
|
|
|
{if condition="$current_user->getAdmin()"}
|
2014-08-31 14:27:57 +02:00
|
|
|
<p class="center">{$i18n['home_table_caption']}
|
|
|
|
<table id="balance_table">
|
2013-08-09 23:35:20 +02:00
|
|
|
<tr>
|
2014-08-31 14:27:57 +02:00
|
|
|
<th>{$i18n['owes']}\{$i18n['to']}</th>
|
2013-08-17 18:43:35 +02:00
|
|
|
{loop="users"}
|
2013-10-04 13:38:24 +02:00
|
|
|
<th>{$value->getDisplayName()}</th>
|
2013-08-17 18:43:35 +02:00
|
|
|
{/loop}
|
2013-08-09 23:35:20 +02:00
|
|
|
</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>
|
2014-08-31 14:27:57 +02:00
|
|
|
<th>{$i18n['users']}</th>
|
|
|
|
<th>{$i18n['you_owe_him']}</th>
|
2014-08-31 15:09:50 +02:00
|
|
|
<th>{$i18n['he_owes_you']}</th>
|
2013-10-04 13:38:24 +02:00
|
|
|
</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>
|
2014-08-31 14:27:57 +02:00
|
|
|
<p class="center">{$i18n['balance']}{$i18n['before_double_ponctuation']}: {if condition="$user_balance > 0"}+{/if}{$user_balance}{$currency}</p>
|
2013-10-04 13:38:24 +02:00
|
|
|
{/if}
|
2013-08-07 20:32:44 +02:00
|
|
|
</div>
|
|
|
|
<div id="detailed_summary">
|
2014-08-31 14:27:57 +02:00
|
|
|
<h2>{$i18n['detailed_list_bills']}{if condition="$all == 0"} {$i18n['for_last_month']}{/if}</h2>
|
2013-09-15 15:28:27 +02:00
|
|
|
|
|
|
|
{if condition="$all == 0"}
|
2014-08-31 14:27:57 +02:00
|
|
|
<p class="center"><a href="?all=1">{$i18n['display_all_bills']}</a></p>
|
2013-09-15 15:28:27 +02:00
|
|
|
{else}
|
2014-08-31 14:27:57 +02:00
|
|
|
<p class="center"><a href="?all=0">{$i18n['only_last_month_bills']}</a></p>
|
2013-09-15 15:28:27 +02:00
|
|
|
{/if}
|
2013-08-07 20:32:44 +02:00
|
|
|
|
2013-09-08 18:36:59 +02:00
|
|
|
{if condition="$invoices !== false && count($invoices)>=1"}
|
2013-09-01 23:09:37 +02:00
|
|
|
<table id="list_expenses">
|
2013-08-09 23:35:20 +02:00
|
|
|
<tr>
|
2014-08-31 14:27:57 +02:00
|
|
|
<th>{$i18n['date']}</th>
|
|
|
|
<th>{$i18n['paid_by']}</th>
|
|
|
|
<th>{$i18n['users_in']}</th>
|
|
|
|
<th>{$i18n['amount']}</th>
|
|
|
|
<th>{$i18n['what']}{$i18n['before_double_ponctuation']}?</th>
|
|
|
|
<th>{$i18n['edit']}</th>
|
|
|
|
<th>{$i18n['delete']}</th>
|
2013-08-09 23:35:20 +02:00
|
|
|
</tr>
|
2013-09-01 23:09:37 +02:00
|
|
|
{loop="invoices"}
|
|
|
|
<tr>
|
2013-09-11 00:51:45 +02:00
|
|
|
<td>{$value->getDate('d/m/Y A')}</td>
|
2013-09-08 13:52:00 +02:00
|
|
|
<td>{$users[$value->getBuyer()]->getDisplayName()}</td>
|
2013-09-10 23:08:05 +02:00
|
|
|
<td>
|
|
|
|
{loop="$value->getUsersIn()->get()"}
|
|
|
|
{$users[$key2]->getDisplayName()}
|
|
|
|
{if condition="$value2 > 1"}
|
2014-08-31 14:27:57 +02:00
|
|
|
({$value2} {$i18n['guests']})
|
2013-09-10 23:08:05 +02:00
|
|
|
{elseif condition="$value2 == 1"}
|
2014-08-31 14:27:57 +02:00
|
|
|
({$value2} {$i18n['guest']})
|
2013-09-10 23:08:05 +02:00
|
|
|
{/if}
|
2013-09-15 16:28:44 +02:00
|
|
|
{if condition="$value1->getBuyer() != $key2"}
|
2014-08-31 14:27:57 +02:00
|
|
|
-
|
2013-09-15 16:28:44 +02:00
|
|
|
{if condition="$paybacks[$value1->getId()] === false || !in_array($key2, array_keys($paybacks[$value1->getId()]))"}
|
2013-09-11 00:51:45 +02:00
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
2014-08-31 14:27:57 +02:00
|
|
|
<a href="?do=confirm_payback&from={$key2}&to={$value1->getBuyer()}&invoice_id={$value1->getId()}&token={$token}" title="{$i18n['confirm_payback']}">
|
2013-09-11 00:51:45 +02:00
|
|
|
{/if}
|
2014-08-31 14:27:57 +02:00
|
|
|
{$i18n['remains']} {$value1->getAmountPerPerson($key2)} {$currency}
|
2013-09-11 00:51:45 +02:00
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
|
|
|
</a>
|
|
|
|
{/if}
|
2013-09-15 16:28:44 +02:00
|
|
|
{else}
|
|
|
|
{if condition="$paybacks[$value1->getId()][$key2]->getAmount() == $value1->getAmountPerPerson($key2)"}
|
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
2014-08-31 14:27:57 +02:00
|
|
|
<a href="?do=delete_payback&from={$key2}&to={$value1->getBuyer()}&invoice_id={$value1->getId()}&token={$token}" title="{$i18n['delete_payback']}">
|
2013-09-15 16:28:44 +02:00
|
|
|
{/if}
|
2014-08-31 14:27:57 +02:00
|
|
|
{$i18n['paid']}
|
2013-09-15 16:28:44 +02:00
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
|
|
|
</a>
|
2014-08-31 14:27:57 +02:00
|
|
|
{/if}
|
2013-09-15 16:28:44 +02:00
|
|
|
{else}
|
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
2014-08-31 14:27:57 +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="{$i18n['confirm_payback']}">
|
2013-09-15 16:28:44 +02:00
|
|
|
{/if}
|
2014-08-31 14:27:57 +02:00
|
|
|
{$i18n['remains']} {$value1->getAmountPerPerson($key2) - $paybacks[$value1->getId()][$key2]->getAmount()}{$currency}
|
2013-09-15 16:28:44 +02:00
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
|
|
|
</a>
|
|
|
|
{/if}
|
2013-09-11 00:51:45 +02:00
|
|
|
{/if}
|
|
|
|
{/if}
|
|
|
|
{/if}
|
2013-09-10 23:08:05 +02:00
|
|
|
<br/>
|
|
|
|
{/loop}
|
|
|
|
</td>
|
2013-09-11 00:51:45 +02:00
|
|
|
<td>{$value->getAmount()}{$currency}</td>
|
2013-09-01 23:09:37 +02:00
|
|
|
<td>{$value->getWhat()}</td>
|
2013-09-17 00:03:26 +02:00
|
|
|
<td>
|
|
|
|
{if condition="$value->getBuyer() == $current_user->getId() || $current_user->getAdmin()"}
|
2014-08-31 14:27:57 +02:00
|
|
|
<a href="index.php?do=edit_invoice&id={$value->getId()}">{$i18n['edit']}</a>
|
2013-09-17 00:03:26 +02:00
|
|
|
{else}
|
|
|
|
-
|
|
|
|
{/if}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{if condition="$value->getBuyer() == $current_user->getId() || $current_user->getAdmin()"}
|
2014-08-31 14:27:57 +02:00
|
|
|
<a href="index.php?do=delete_invoice&id={$value->getId()}&token={$token}">{$i18n['delete']}</a>
|
2013-09-17 00:03:26 +02:00
|
|
|
{else}
|
|
|
|
-
|
|
|
|
{/if}
|
|
|
|
</td>
|
2013-09-01 23:09:37 +02:00
|
|
|
</tr>
|
|
|
|
{/loop}
|
|
|
|
</table>
|
|
|
|
{else}
|
2014-08-31 15:09:50 +02:00
|
|
|
<p class="center">{$i18n['no_bills']}</p>
|
2013-09-01 23:09:37 +02:00
|
|
|
{/if}
|
2013-08-07 20:32:44 +02:00
|
|
|
</div>
|
2013-08-12 09:52:50 +02:00
|
|
|
{include="footer"}
|