diff options
| author | Magnus Hagander | 2020-04-06 16:30:16 +0000 |
|---|---|---|
| committer | Magnus Hagander | 2020-04-06 16:30:16 +0000 |
| commit | ed4c4a29b7bb832ba3eec1a6b0680aaa79c69402 (patch) | |
| tree | a699bbf52fdd18f18f463f3b50b88573b3317ea2 | |
| parent | 4026c172c3005cd1a736340686667fb32476fd47 (diff) | |
Fix incorrect query for refund exposure
It accidentally multiplied the cost of a bulk payment with the number of
people on it, which is clearly not correct.
| -rw-r--r-- | postgresqleu/invoices/backendviews.py | 2 | ||||
| -rw-r--r-- | template/invoices/refund_exposure.html | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/postgresqleu/invoices/backendviews.py b/postgresqleu/invoices/backendviews.py index 81161f30..ed2684e0 100644 --- a/postgresqleu/invoices/backendviews.py +++ b/postgresqleu/invoices/backendviews.py @@ -628,7 +628,7 @@ def refundexposure(request): authenticate_backend_group(request, 'Invoice managers') data = exec_to_dict("""WITH t AS ( - SELECT c.conferencename as confname, coalesce(r.invoice_id, b.invoice_id) as invoiceid + SELECT DISTINCT c.conferencename as confname, coalesce(r.invoice_id, b.invoice_id) as invoiceid FROM confreg_conferenceregistration r INNER JOIN confreg_conference c ON c.id=r.conference_id LEFT JOIN confreg_bulkpayment b on b.id=r.bulkpayment_id diff --git a/template/invoices/refund_exposure.html b/template/invoices/refund_exposure.html index 6e577d02..6d028f0e 100644 --- a/template/invoices/refund_exposure.html +++ b/template/invoices/refund_exposure.html @@ -6,7 +6,8 @@ <p> This view shows the refund exposure if upcoming conferences. Refund exposure is defined as any attendee invoices that have been paid but might need to be - refunded in case the event is canceled. + refunded in case the event is canceled. Note that partial invoice refunds + are <em>not</em> counted, those invoices are counted at full value. </p> <p> The calculation includes all upcoming conferences as well as any conference that @@ -18,7 +19,7 @@ <tr> <th>Conference</th> <th>Payment provider</th> - <th>Registrations</th> + <th>Invoices</th> <th>Total exposure</th> </tr> {%for d in data %} |
