LP1759343: Bills Annotation Persistance
authorJason Boyer <jboyer@library.in.gov>
Fri, 18 Jan 2019 17:38:22 +0000 (12:38 -0500)
committerJane Sandberg <sandbej@linnbenton.edu>
Thu, 13 Jun 2019 21:41:47 +0000 (14:41 -0700)
Make the Annotate option on the patron Bills page
persistant and a workstation setting.

Signed-off-by: Jason Boyer <jboyer@library.in.gov>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>

Open-ILS/src/sql/Pg/upgrade/XXXX.data.annotate_payment_setting.sql [new file with mode: 0644]
Open-ILS/src/templates/staff/circ/patron/t_bills.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.annotate_payment_setting.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.annotate_payment_setting.sql
new file mode 100644 (file)
index 0000000..ed749c9
--- /dev/null
@@ -0,0 +1,8 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.workstation_setting_type (name,label,grp,datatype) VALUES ('eg.circ.bills.annotatepayment','Bills: Annotate Payment', 'circ', 'bool');
+
+COMMIT;
+
index 52c2965..69d0439 100644 (file)
@@ -81,7 +81,7 @@
         <div class="form-group">
           <label for="annotate-payment" class="control-label col-md-5">[% l('Annotate') %]</label>
           <div class="col-md-1">
-            <input id="annotate-payment" type="checkbox" ng-model="annotate_payment"/>
+            <input id="annotate-payment" type="checkbox" ng-model="annotate_payment" ng-change="onAnnotatePaymentChanged()"/>
           </div>
           <div class="col-md-6">
             <button
index 14b84c0..495c85b 100644 (file)
@@ -194,12 +194,17 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
     $scope.amount_verified = false;
     $scope.disable_auto_print = false;
 
-    // check receipt_on_pay setting default persisted
+    // Load persistant settings
     egCore.hatch.getItem('circ.bills.receiptonpay')
                 .then(function(rcptOnPay){
                     if (rcptOnPay) $scope.receipt_on_pay.isChecked = rcptOnPay;
                 });
 
+    egCore.hatch.getItem('circ.bills.annotatepayment')
+                .then(function(annoPay){
+                    if (annoPay) $scope.annotate_payment = annoPay;
+                });
+
     // pre-define list-returning funcs in case we access them
     // before the grid instantiates
     $scope.gridControls = {
@@ -406,6 +411,10 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
         egCore.hatch.setItem('circ.bills.receiptonpay', $scope.receipt_on_pay.isChecked);
     }
 
+    $scope.onAnnotatePaymentChanged = function(){
+        egCore.hatch.setItem('circ.bills.annotatepayment', $scope.annotate_payment);
+    }
+
     function printReceipt(type, payment_ids, payments_made, note) {
         var payment_blobs = [];
         var cusr = patronSvc.current;