LP1775639: Refresh required to see Patron Credit user/abellenir/lp1775639-refresh-required-to-see-patron-credit
authora. bellenir <abelleni@grpl.org>
Mon, 11 Mar 2019 17:39:00 +0000 (13:39 -0400)
committera. bellenir <abelleni@grpl.org>
Mon, 11 Mar 2019 17:39:00 +0000 (13:39 -0400)
reload patron data when applying a payment
if the payment will change the patron's credit forward balance.

Signed-off-by: a. bellenir <abelleni@grpl.org>
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index ceda5c8..ba2e285 100644 (file)
@@ -76,6 +76,10 @@ function($q , egCore , egWorkLog , patronSvc) {
             // payment API returns the update xact id so we can track it
             // for future payments without having to refresh the user.
             patronSvc.current.last_xact_id(resp.last_xact_id);
+
+            // reload patron data if credit balance has changed:
+            if(type === 'credit_payment' || patron_credit){ patronSvc.refreshPrimary(); }
+
             return resp.payments;
         });
     }