Changeset - 83b11cd7224d
[Not reviewed]
0 3 0
Christopher Neugebauer - 8 years ago 2016-03-24 03:20:29
chrisjrn@gmail.com
Fixes invoicing payment logic
3 files changed with 16 insertions and 2 deletions:
0 comments (0 inline, 0 general)
registrasion/controllers/invoice.py
Show inline comments
...
 
@@ -124,3 +124,3 @@ class InvoiceController(object):
 

	
 
        payments = rego.Payment.objects .filter(invoice=self.invoice)
 
        payments = rego.Payment.objects.filter(invoice=self.invoice)
 
        agg = payments.aggregate(Sum("amount"))
registrasion/templates/invoice.html
Show inline comments
...
 
@@ -35,2 +35,16 @@
 

	
 
<table>
 
  <tr>
 
    <th>Payment time</th>
 
    <th>Reference</th>
 
    <th>Amount</th>
 
  </tr>
 
  {% for payment in invoice.payment_set.all %}
 
    <tr>
 
      <td>{{payment.time}}</td>
 
      <td>{{payment.reference}}</td>
 
      <td>{{payment.amount}}</td>
 
    </tr>
 
  {% endfor %}
 
</table>
 

	
registrasion/views.py
Show inline comments
...
 
@@ -219,3 +219,3 @@ def pay_invoice(request, invoice_id):
 
    current_invoice = InvoiceController(inv)
 
    if not inv.paid and not current_invoice.is_valid():
 
    if not inv.paid and current_invoice.is_valid():
 
        current_invoice.pay("Demo invoice payment", inv.value)
0 comments (0 inline, 0 general)