mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-21 15:32:14 +00:00
Added estimated VAT, as per issue #71
This commit is contained in:
@@ -47,6 +47,8 @@ class EventCreate(generic.CreateView):
|
|||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(EventCreate, self).get_context_data(**kwargs)
|
context = super(EventCreate, self).get_context_data(**kwargs)
|
||||||
context['edit'] = True
|
context['edit'] = True
|
||||||
|
context['new'] = True
|
||||||
|
context['currentVAT'] = models.VatRate.objects.current_rate()
|
||||||
|
|
||||||
form = context['form']
|
form = context['form']
|
||||||
if re.search('"-\d+"', form['items_json'].value()):
|
if re.search('"-\d+"', form['items_json'].value()):
|
||||||
|
|||||||
@@ -29,8 +29,13 @@
|
|||||||
<td colspan="2">£ <span id="sumtotal">{{object.sum_total|default:0|floatformat:2}}</span></td>
|
<td colspan="2">£ <span id="sumtotal">{{object.sum_total|default:0|floatformat:2}}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td id="vat-rate" data-rate="{{object.vat_rate.rate}}">VAT @
|
{% if new %}
|
||||||
{{object.vat_rate.as_percent|floatformat|default:"TBD"}}%</td>
|
<td id="vat-rate" data-rate="{{currentVAT.rate}}">VAT @
|
||||||
|
{{currentVAT.as_percent|floatformat}}% (TBC)</td>
|
||||||
|
{% else %}
|
||||||
|
<td id="vat-rate" data-rate="{{object.vat_rate.rate}}">VAT @
|
||||||
|
{{object.vat_rate.as_percent|floatformat|default:"TBD"}}%</td>
|
||||||
|
{% endif %}
|
||||||
<td colspan="2">£ <span id="vat">{{object.vat|default:0|floatformat:2}}</span></td>
|
<td colspan="2">£ <span id="vat">{{object.vat|default:0|floatformat:2}}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user