Correct payments-across-billings case user/jboyer/lp1174498_payment_by_billing_rebase
authorJason Boyer <jboyer@equinoxinitiative.org>
Wed, 5 Aug 2020 18:11:32 +0000 (14:11 -0400)
committerJason Boyer <jboyer@equinoxinitiative.org>
Wed, 5 Aug 2020 18:11:32 +0000 (14:11 -0400)
Without this change a payment that finished one billing and also
applied to another was just ignored after finishing the initial billing.

Open-ILS/src/sql/Pg/upgrade/XXXX.money.materialized_payment_by_billing_type.sql

index ca167a2..09863dc 100644 (file)
@@ -133,6 +133,7 @@ BEGIN
                 billing_offset = billing_offset + 1;
                 billing_id_used = array_append( billing_id_used, current_billing_id );
                 continuing_payment := TRUE;
+                maintain_billing_remainder := FALSE;
             END IF;
 
             current_result.billing_leftover = billing_remainder; -- debugging