LP#1697754 - WebStaff make receipt on payment sticky
authorCesar Velez <Cesar.Velez@equinoxinitiative.org>
Fri, 23 Jun 2017 16:45:15 +0000 (17:45 +0100)
committerJason Etheridge <jason@equinoxinitiative.org>
Fri, 30 Jun 2017 20:00:59 +0000 (16:00 -0400)
    Add circ.bills.receiptonpay local storage setting.

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Signed-off-by: Jason Etheridge <jason@equinoxinitiative.org>

Open-ILS/src/templates/staff/circ/patron/t_bills.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index bbf6595..c3fda5c 100644 (file)
@@ -108,7 +108,7 @@ not sure what's up, there. -->
   <form class="form-inline" role="form">
    <div class="checkbox">
       <label>
-        <input id="receipt_on_pay" type="checkbox" ng-model="receipt_on_pay.isChecked"/>
+        <input id="receipt_on_pay" type="checkbox" ng-model="receipt_on_pay.isChecked" ng-change="onReceiptOnPayChanged()"/>
         [% l('Receipt On Payment') %]
       </label>
     </div>
index 836100f..c648def 100644 (file)
@@ -165,6 +165,12 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
     $scope.amount_verified = false;
     $scope.disable_auto_print = false;
 
+    // check receipt_on_pay setting default persisted
+    egCore.hatch.getItem('circ.bills.receiptonpay')
+                .then(function(rcptOnPay){
+                    if (rcptOnPay) $scope.receipt_on_pay.isChecked = rcptOnPay;
+                });
+
     // pre-define list-returning funcs in case we access them
     // before the grid instantiates
     $scope.gridControls = {
@@ -325,6 +331,10 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
         })
     }
 
+    $scope.onReceiptOnPayChanged = function(){
+        egCore.hatch.setItem('circ.bills.receiptonpay', $scope.receipt_on_pay.isChecked);
+    }
+
     function printReceipt(type, payment_ids, payments_made, note) {
         var payment_blobs = [];
         angular.forEach(payments_made, function(payment) {