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">
|
2013-08-09 23:35:20 +02:00
|
|
|
<h2>Balance</h2>
|
2013-08-17 18:43:35 +02:00
|
|
|
<p class="center">Read <em>line</em> owes <em>case</em> {$currency} to <em>column</em>. You can click on links to confirm the payback.
|
2013-08-30 20:07:52 +02:00
|
|
|
<table id="balance_table">
|
2013-08-07 20:32:44 +02:00
|
|
|
<tr>
|
2013-08-09 23:35:20 +02:00
|
|
|
<th>Owes\To</th>
|
|
|
|
{loop="users"}
|
2013-08-13 17:58:14 +02:00
|
|
|
<th>{$value->getDisplayName()}</th>
|
2013-08-09 23:35:20 +02:00
|
|
|
{/loop}
|
2013-08-07 20:32:44 +02:00
|
|
|
</tr>
|
2013-08-09 23:35:20 +02:00
|
|
|
{loop="users"}
|
|
|
|
<tr>
|
2013-08-13 17:58:14 +02:00
|
|
|
<th>{$value->getDisplayName()}</th>
|
2013-08-17 18:43:35 +02:00
|
|
|
{loop="users"}
|
2013-09-13 19:18:49 +02:00
|
|
|
{if condition="$balances[$value1->getId()][$value2->getId()] == 'X'"}
|
|
|
|
<td class="cell-disabled"></td>
|
|
|
|
{else}
|
|
|
|
|
|
|
|
<td>{$balances[$value1->getId()][$value2->getId()]}</td>
|
|
|
|
{/if}
|
2013-08-17 18:43:35 +02:00
|
|
|
{/loop}
|
2013-08-09 23:35:20 +02:00
|
|
|
</tr>
|
|
|
|
{/loop}
|
2013-08-07 20:32:44 +02:00
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div id="detailed_summary">
|
2013-08-09 23:35:20 +02:00
|
|
|
<h2>Detailed list of bills for last month</h2>
|
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>
|
2013-09-01 23:09:37 +02:00
|
|
|
<th>Date</th>
|
|
|
|
<th>Paid by</th>
|
|
|
|
<th>Users in</th>
|
|
|
|
<th>Amount</th>
|
|
|
|
<th>What ?</th>
|
|
|
|
<th>Edit</th>
|
|
|
|
<th>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"}
|
|
|
|
({$value2} guests)
|
|
|
|
{elseif condition="$value2 == 1"}
|
|
|
|
({$value2} guest)
|
|
|
|
{/if}
|
2013-09-11 00:51:45 +02:00
|
|
|
-
|
|
|
|
{if condition="$paybacks[$value1->getId()] === false"}
|
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
|
|
|
<a href="?do=confirm_payback&from={$key2}&to={$value1->getBuyer()}&invoice_id={$value1->getId()}" title="Confirm payback">
|
|
|
|
{/if}
|
2013-09-12 18:44:04 +02:00
|
|
|
Remains {$value1->getAmountPerPerson()} {$currency}
|
2013-09-11 00:51:45 +02:00
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
|
|
|
</a>
|
|
|
|
{/if}
|
|
|
|
{else}
|
2013-09-12 18:44:04 +02:00
|
|
|
{if condition="$paybacks[$value1->getId()][$key2]->getAmount() == $value1->getAmountPerPerson()"}
|
2013-09-11 00:51:45 +02:00
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
|
|
|
<a href="?do=delete_payback&from={$key2}&to={$value1->getBuyer()}&invoice_id={$value1->getId()}" title="Delete payback">
|
|
|
|
{/if}
|
|
|
|
Paid
|
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
|
|
|
</a>
|
|
|
|
{/if}
|
|
|
|
{else}
|
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
|
|
|
<a href="?do=confirm_payback&from={$key2}&to={$value1->getBuyer()}&invoice_id={$value1->getId()}&payback_id={$paybacks[$value1->getId()][$key2]->getId()}" title="Confirm payback">
|
|
|
|
{/if}
|
2013-09-12 18:44:04 +02:00
|
|
|
Remains {$value1->getAmountPerPerson() - $paybacks[$value1->getId()][$key2]->getAmount()}{$currency}
|
2013-09-11 00:51:45 +02:00
|
|
|
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
|
|
|
|
</a>
|
|
|
|
{/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>
|
|
|
|
<td><a href="index.php?do=edit_invoice&id={$value->getId()}">Edit</a></td>
|
|
|
|
<td><a href="index.php?do=delete_invoice&id={$value->getId()}">Delete</a></td>
|
|
|
|
</tr>
|
|
|
|
{/loop}
|
|
|
|
</table>
|
|
|
|
{else}
|
|
|
|
<p class="center">No bills added.</p>
|
|
|
|
{/if}
|
2013-08-07 20:32:44 +02:00
|
|
|
</div>
|
2013-08-12 09:52:50 +02:00
|
|
|
{include="footer"}
|