Commit 2fc41a2d authored by Patrick Kimber's avatar Patrick Kimber

Update reconcile day view

parent 8ac5efb1
Pipeline #81737152 passed with stage
in 5 minutes and 37 seconds
......@@ -7,6 +7,9 @@
</thead>
<tbody>
{% for issue in invoiceissue_list %}
<tr>
<td colspan="3">Issues</td>
</tr>
<tr valign="top">
<td>
<a href="{% url 'invoice.issue.update' issue.pk %}">
......
......@@ -12,17 +12,24 @@
{% block content %}
<div class="pure-menu pure-menu-horizontal">
<ul class="pure-menu-list">
<a href="{% url 'invoice.reconcile.day' year=yesturday.year month=yesturday.month day=yesturday.day %}" class="pure-menu-link">
<i class="fa fa-history"></i> Previous Day
<a href="{% url 'invoice.reconcile.day' year=yesterday.year month=yesterday.month day=yesterday.day %}" class="pure-menu-link">
<i class="fa fa-arrow-circle-left"></i>
{{ yesterday|date:'d/m/Y' }}
</a>
</ul>
<ul class="pure-menu-list">
<a href="{% url 'project.dash' %}" class="pure-menu-link">
<i class="fa fa-tachometer"></i>
Dashboard
</a>
</ul>
<ul class="pure-menu-list">
<a href="{% url 'invoice.reconcile.day' year=tomorrow.year month=tomorrow.month day=tomorrow.day %}" class="pure-menu-link">
<i class="fa fa-history"></i> Next Day
{{ tomorrow|date:'d/m/Y' }}
<i class="fa fa-arrow-circle-right"></i>
</a>
</ul>
</div>
<h1>Issues</h1>
{% if invoiceissue_list %}
<div class="pure-g">
<div class="pure-u-1">
......@@ -31,33 +38,15 @@
</table>
</div>
</div>
{% else %}
No invoice issues
{% endif %}
<h1>Batches</h1>
{% if batches %}
<div class="pure-g">
<div class="pure-u-1 ">
<div class="r-box">
<table width="100%" class="pure-table pure-table-bordered small-margin-top">
<tbody>
<tr>
<td>Total net:</td>
<td>£ {{ batch_net|intcomma }}</td>
</tr>
<tr>
<td>Total gross:</td>
<td>£ {{ batch_gross|intcomma }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="pure-g">
<div class="pure-u-1">
<table class="pure-table pure-table-bordered" width="100%">
<table width="100%" class="pure-table pure-table-bordered small-margin-top">
<thead>
<tr>
<td colspan="3">Batches</td>
</tr>
<tr valign="top">
<th>Number</th>
<th>Currency</th>
......@@ -66,51 +55,41 @@
</thead>
<tbody>
{% for batch in batches %}
<tr valign="top">
<td>
<a href="{% url 'invoice.batch.invoice.list' batch.pk %}">
{{ batch.pk }}
</a>
</td>
<td>
{{ batch.currency.slug }}
</td>
<td>
{{ batch.payment_processor.slug }}
</td>
</tr>
<tr valign="top">
<td>
<a href="{% url 'invoice.batch.invoice.list' batch.pk %}">
{{ batch.pk }}
</a>
</td>
<td>
{{ batch.currency.slug }}
</td>
<td>
{{ batch.payment_processor.slug }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% else %}
No invoice batches
{% endif %}
<h1>Unbatched Invoices</h1>
{% if invoices %}
<div class="pure-g">
<div class="pure-u-1 ">
<div class="r-box">
<table width="100%" class="pure-table pure-table-bordered small-margin-top">
<tbody>
<tr>
<td>Total net:</td>
<td> £ {{invoice_net|intcomma}} </td>
<td colspan="2">Total net</td>
<td>&pound;{{ batch_net|intcomma }}</td>
</tr>
<tr>
<td>Total gross:</td>
<td> £ {{invoice_gross|intcomma}} </td>
<td colspan="2">Total gross</td>
<td>&pound;{{ batch_gross|intcomma }}</td>
</tr>
</tbody>
</table>
</div>
</tbody>
</table>
</div>
</div>
{% endif %}
{% if invoices %}
<div class="pure-g">
<div class="pure-u-1">
<table class="pure-table pure-table-bordered" width="100%">
<table width="100%" class="pure-table pure-table-bordered small-margin-top">
<thead>
<tr>
<td colspan="2">Unbatched Invoices</td>
</tr>
<tr valign="top">
<th>Number</th>
<th>Currency</th>
......@@ -118,30 +97,38 @@
</thead>
<tbody>
{% for invoice in invoices %}
<tr valign="top">
<td>
<a href="{% url 'invoice.detail' invoice.pk %}">
{{ invoice.invoice_number }}
</a>
</td>
<td>
{{ invoice.currency.slug }}
</td>
</tr>
<tr valign="top">
<td>
<a href="{% url 'invoice.detail' invoice.pk %}">
{{ invoice.invoice_number }}
</a>
</td>
<td>
{{ invoice.currency.slug }}
</td>
</tr>
{% endfor %}
<tr>
<td>Total net</td>
<td>&pound;{{invoice_net|intcomma}} </td>
</tr>
<tr>
<td>Total gross</td>
<td>&pound;{{invoice_gross|intcomma}} </td>
</tr>
</tbody>
</table>
</div>
</div>
{% else %}
No unbatched invoices
{% endif %}
<h1>Credit Notes</h1>
{% if credit_notes %}
<div class="pure-g">
<div class="pure-u-1">
<table class="pure-table pure-table-bordered" width="100%">
<table width="100%" class="pure-table pure-table-bordered small-margin-top">
<thead>
<tr>
<td colspan="2">Credit Notes</td>
</tr>
<tr valign="top">
<th>Number</th>
<th>Currency</th>
......@@ -164,7 +151,5 @@
</table>
</div>
</div>
{% else %}
No credit notes
{% endif %}
{% endblock content %}
......@@ -1008,14 +1008,6 @@ class ReconcileDayView(
pass
return total_net, total_gross
def different_day(self, batch_date, date_diff):
year = (batch_date + relativedelta(days=date_diff)).strftime("%Y")
month = (batch_date + relativedelta(days=date_diff)).strftime("%m")
day = (batch_date + relativedelta(days=date_diff)).strftime("%d")
date = {"year": year, "month": month, "day": day}
return date
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
batch_date = self._date()
......@@ -1027,21 +1019,19 @@ class ReconcileDayView(
)
issues = self._issues()
credit_notes = self._credit_notes()
yesturday = self.different_day(batch_date, -1)
tomorrow = self.different_day(batch_date, 1)
context.update(
dict(
batch_date=batch_date,
batches=batches,
batch_net=batch_net,
batch_gross=batch_gross,
invoices=invoices,
invoice_net=invoice_net_total,
invoice_gross=invoice_gross_total,
batch_net=batch_net,
batches=batches,
credit_notes=credit_notes,
yesturday=yesturday,
tomorrow=tomorrow,
invoice_gross=invoice_gross_total,
invoice_net=invoice_net_total,
invoiceissue_list=issues,
invoices=invoices,
tomorrow=batch_date + relativedelta(days=1),
yesterday=batch_date + relativedelta(days=-1),
)
)
return context
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment