LP#1665465 - Fix Print receipt on payment cbox not bound to model
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Mon, 5 Jun 2017 21:50:18 +0000 (17:50 -0400)
committerKathy Lussier <klussier@masslnc.org>
Wed, 21 Jun 2017 16:26:05 +0000 (12:26 -0400)
Seems that Angular for some reason has issues binding to literals...
According to the interwebs it's likely due to scope nesting via ng-include

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

Signed-off-by: Jason Etheridge <jason@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/circ/patron/t_bills.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index fcf8012..bbf6595 100644 (file)
@@ -108,7 +108,7 @@ not sure what's up, there. -->
   <form class="form-inline" role="form">
    <div class="checkbox">
       <label>
-        <input type="checkbox" ng-model="receipt_on_pay"/> 
+        <input id="receipt_on_pay" type="checkbox" ng-model="receipt_on_pay.isChecked"/>
         [% l('Receipt On Payment') %]
       </label>
     </div>
index c365c82..836100f 100644 (file)
@@ -159,7 +159,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
     $scope.focus_payment = true;
     $scope.annotate_payment = false;
     $scope.receipt_count = 1;
-    $scope.receipt_on_pay = false;
+    $scope.receipt_on_pay = { isChecked: false };
     $scope.warn_amount = 1000;
     $scope.max_amount = 100000;
     $scope.amount_verified = false;
@@ -316,7 +316,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
             $scope.payment_type, make_payments, note, $scope.check_number)
         .then(function(payment_ids) {
 
-            if (!$scope.disable_auto_print && $scope.receipt_on_pay) {
+            if (!$scope.disable_auto_print && $scope.receipt_on_pay.isChecked) {
                 printReceipt(
                     $scope.payment_type, payment_ids, make_payments, note);
             }