[open-ils-commits] [GIT] Evergreen ILS branch master updated. 69f14123ea9ba3f3a0fa10f3c77e9538a37b866f

Evergreen Git git at git.evergreen-ils.org
Mon Jun 19 10:41:57 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  69f14123ea9ba3f3a0fa10f3c77e9538a37b866f (commit)
      from  05dcc80a8a66ada38cba56704c6bca6f34708914 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 69f14123ea9ba3f3a0fa10f3c77e9538a37b866f
Author: Jason Etheridge <jason at equinoxinitiative.org>
Date:   Tue Jun 6 16:59:02 2017 -0400

    LP#1671596 webstaff: add Adjust to Zero option to Bill UI
    
    To test
    -------
    1. Apply patch.
    2. Go to a patron record that has one or more active billings.
    3. Note that in the billing grid, there is now an "Adjust to Zero"
       action.
    4. Select one or more billings and apply the action.
    5. Verify that the billings are adjusted to zero and that
       the adjustments show up as "payments".
    
    Signed-off-by: Jason Etheridge <jason at equinoxinitiative.org>
    Signed-off-by: Andrea Neiman <abneiman at equinoxinitiative.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/staff/circ/patron/index.tt2 b/Open-ILS/src/templates/staff/circ/patron/index.tt2
index b017f19..f140dab 100644
--- a/Open-ILS/src/templates/staff/circ/patron/index.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/index.tt2
@@ -35,6 +35,8 @@
 <script>
 angular.module('egCoreMod').run(['egStrings', function(s) {
   s.ANNOTATE_PAYMENT_MSG = "[% l('Please annotate this payment') %]";
+  s.CONFIRM_ADJUST_TO_ZERO = 
+    "[% |l('{{xactIds}}') -%]Are you sure you would like to adjust to zero the balance on bills [_1]?[% END %]";
   s.CONFIRM_REFUND_PAYMENT = 
     "[% |l('{{xactIds}}') -%]Are you sure you would like to refund excess payment on bills [_1]?  This action will simply put the amount in the Payment Pending column as a negative value.  You must still select Apply Payment!  Certain types of payments may not be refunded.  The refund may be applied to checked transactions that follow the refunded transaction.[% END %]";
   s.EDIT_BILL_PAY_NOTE = "[% l('Enter new note for #[_1]:','{{ids}}') %]";
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
index c98d041..cde7cbf 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_bills_list.tt2
@@ -35,6 +35,9 @@
   <eg-grid-action label="[% l('Void All Billings') %]" 
     handler="voidAllBillings"></eg-grid-action>
 
+  <eg-grid-action label="[% l('Adjust to Zero') %]" 
+    handler="adjustToZero"></eg-grid-action>
+
   <eg-grid-action label="[% l('Refund') %]" 
     handler="refundXact"></eg-grid-action>
 
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
index 601956a..57bb094 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
@@ -99,6 +99,18 @@ function($q , egCore , egWorkLog , patronSvc) {
         });
     }
 
+    service.adjustBillsToZero = function(bill_ids) {
+        return egCore.net.request(
+            'open-ils.circ',
+            'open-ils.circ.money.billable_xact.adjust_to_zero',
+            egCore.auth.token(),
+            bill_ids
+        ).then(function(resp) {
+            if (evt = egCore.evt.parse(resp)) return alert(evt);
+            return resp;
+        });
+    }
+
     service.updateBillNotes = function(note, ids) {
         return egCore.net.requestWithParamList(
             'open-ils.circ',
@@ -534,6 +546,25 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
         });
     }
 
+    $scope.adjustToZero = function(items) {
+        if (items.length == 0) return;
+
+        var ids = items.map(function(item) {return item.id});
+
+        egCore.audio.play('warning.circ.adjust_to_zero_confirmation');
+        egConfirmDialog.open(
+            egCore.strings.CONFIRM_ADJUST_TO_ZERO, '', 
+            {   xactIds : ''+ids,
+                ok : function() {
+                    billSvc.adjustBillsToZero(ids).then(function() {
+                        refreshDisplay();
+                    });
+                }
+            }
+        );
+
+    }
+
     // note this is functionally equivalent to selecting a neg. transaction
     // then clicking Apply Payment -- this just adds a speed bump (ditto
     // the XUL client).

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/staff/circ/patron/index.tt2 |    2 +
 .../templates/staff/circ/patron/t_bills_list.tt2   |    3 ++
 .../web/js/ui/default/staff/circ/patron/bills.js   |   31 ++++++++++++++++++++
 3 files changed, 36 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list