mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-23 16:32:15 +00:00
Merge branch 'hotfixes'
Rapid fix for incorrect addition
This commit is contained in:
@@ -115,6 +115,7 @@ class InvoiceEvent(generic.View):
|
|||||||
|
|
||||||
class PaymentCreate(generic.CreateView):
|
class PaymentCreate(generic.CreateView):
|
||||||
model = models.Payment
|
model = models.Payment
|
||||||
|
fields = ['invoice','date','amount','method']
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
initial = super(generic.CreateView, self).get_initial()
|
initial = super(generic.CreateView, self).get_initial()
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ class Event(models.Model, RevisionMixin):
|
|||||||
#total = 0.0
|
#total = 0.0
|
||||||
#for item in self.items.filter(cost__gt=0).extra(select="SUM(cost * quantity) AS sum"):
|
#for item in self.items.filter(cost__gt=0).extra(select="SUM(cost * quantity) AS sum"):
|
||||||
# total += item.sum
|
# total += item.sum
|
||||||
total = EventItem.objects.filter(event=self).aggregate(sum_total=models.Sum('cost',field="quantity * cost"))['sum_total']
|
total = EventItem.objects.filter(event=self).aggregate(sum_total=models.Sum(models.F('cost')*models.F('quantity')))['sum_total']
|
||||||
if total:
|
if total:
|
||||||
return total
|
return total
|
||||||
return Decimal("0.00")
|
return Decimal("0.00")
|
||||||
|
|||||||
@@ -110,7 +110,7 @@
|
|||||||
{% if event.is_rig %}
|
{% if event.is_rig %}
|
||||||
<dt>Event MIC</dt>
|
<dt>Event MIC</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{% if perms.RIGS.view_profile %}
|
{% if event.mic and perms.RIGS.view_profile %}
|
||||||
<a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href">
|
<a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href">
|
||||||
{{ event.mic.name }}
|
{{ event.mic.name }}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user