LP1775639: Refresh required to see Patron Credit user/gcollum/lp1775639-refresh-required-to-see-patron-credit-signoff
authora. bellenir <abelleni@grpl.org>
Mon, 11 Mar 2019 17:39:00 +0000 (13:39 -0400)
committerGarry Collum <gcollum@gmail.com>
Wed, 22 May 2019 18:45:47 +0000 (14:45 -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>
Signed-off-by: Garry Collum <gcollum@gmail.com>
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;
         });
     }