bouffeatulm/tpl/default_en/index.html
2013-09-14 23:30:14 +02:00

100 lines
4.9 KiB
HTML
Executable File

{include="header"}
{if condition="$notice != ''"}
<div id="notice"><p>{$notice}</p></div>
{/if}
<div id="quick_summary">
<h2>Balance</h2>
<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.
<table id="balance_table">
<tr>
<th>Owes\To</th>
{loop="users"}
<th>{$value->getDisplayName()}</th>
{/loop}
</tr>
{loop="users"}
<tr>
<th>{$value->getDisplayName()}</th>
{loop="users"}
{if condition="$balances[$value1->getId()][$value2->getId()] === 'X'"}
<td class="cell-disabled"></td>
{else}
<td>{$balances[$value1->getId()][$value2->getId()]}</td>
{/if}
{/loop}
</tr>
{/loop}
</table>
</div>
<div id="detailed_summary">
<h2>Detailed list of bills for last month</h2>
{if condition="$invoices !== false && count($invoices)>=1"}
<table id="list_expenses">
<tr>
<th>Date</th>
<th>Paid by</th>
<th>Users in</th>
<th>Amount</th>
<th>What ?</th>
<th>Edit</th>
<th>Delete</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"}
({$value2} guests)
{elseif condition="$value2 == 1"}
({$value2} guest)
{/if}
-
{if condition="$paybacks[$value1->getId()] === false || !in_array($key2, array_keys($paybacks[$value1->getId()]))"}
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
<a href="?do=confirm_payback&amp;from={$key2}&amp;to={$value1->getBuyer()}&amp;invoice_id={$value1->getId()}" title="Confirm payback">
{/if}
Remains {$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()"}
<a href="?do=delete_payback&amp;from={$key2}&amp;to={$value1->getBuyer()}&amp;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&amp;from={$key2}&amp;to={$value1->getBuyer()}&amp;invoice_id={$value1->getId()}&amp;payback_id={$paybacks[$value1->getId()][$key2]->getId()}" title="Confirm payback">
{/if}
Remains {$value1->getAmountPerPerson($key2) - $paybacks[$value1->getId()][$key2]->getAmount()}{$currency}
{if condition="$current_user->getId() == $value1->getBuyer() || $current_user->getAdmin()"}
</a>
{/if}
{/if}
{/if}
<br/>
{/loop}
</td>
<td>{$value->getAmount()}{$currency}</td>
<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}
</div>
{include="footer"}