LP#1402797 Allow forgive-fines on forced checkout
authorMike Rylander <mrylander@gmail.com>
Tue, 10 Feb 2015 17:24:14 +0000 (12:24 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 25 Feb 2015 16:16:09 +0000 (11:16 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/circ/share/t_circ_exists_dialog.tt2
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 9c41ddd..8772d5f 100644 (file)
         </div>
       </div>
       <div class="modal-footer">
-        <input ng-if="!sameUser" type="submit" class="btn btn-primary" 
-            value="[% l('Normal Checkin then Checkout') %]"/>
-        <input ng-if="sameUser" type="submit" class="btn btn-primary" 
-            value="[% l('Renew') %]"/>
-        <button class="btn btn-warning" 
-            ng-click="cancel($event)">[% l('Cancel') %]</button>
+        <div class="form-group row">
+          <div class="col-md-3">
+            <label for="forgive-checkbox">[% l('Forgive fines?') %]</label>
+          </div>
+          <div class="col-md-1">
+            <input type="checkbox" class="checkbox"
+              id="forgive-checkbox" ng-model="args.forgive_fines"/>
+          </div>
+          <div class="col-md-8">
+            <input ng-if="!sameUser" type="submit" class="btn btn-primary" 
+                value="[% l('Normal Checkin then Checkout') %]"/>
+            <input ng-if="sameUser" type="submit" class="btn btn-primary" 
+                value="[% l('Renew') %]"/>
+            <button class="btn btn-warning" 
+                ng-click="cancel($event)">[% l('Cancel') %]</button>
+        </div>
       </div>
     </div> <!-- modal-content -->
   </div> <!-- modal-dialog -->
index e4db7a2..eea4a18 100644 (file)
@@ -850,24 +850,28 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
             controller: 
                        ['$scope','$modalInstance',
                 function($scope , $modalInstance) {
+                $scope.args = {forgive_fines : false};
                 $scope.circDate = openCirc.xact_start();
                 $scope.sameUser = sameUser;
-                $scope.ok = function() { $modalInstance.close() }
+                $scope.ok = function() { $modalInstance.close($scope.args) }
                 $scope.cancel = function($event) { 
                     $modalInstance.dismiss();
                     $event.preventDefault(); // form, avoid calling ok();
                 }
             }]
         }).result.then(
-            function() {
+            function(args) {
                 if (sameUser) {
+                    params.void_overdues = args.forgive_fines;
                     options.override = true;
                     return service.renew(params, options);
                 }
 
-                return service.checkin(
-                    {barcode : params.copy_barcode, noop : true}
-                ).then(function(checkin_resp) {
+                return service.checkin({
+                    barcode : params.copy_barcode,
+                    noop : true,
+                    void_overdues : args.forgive_fines
+                }).then(function(checkin_resp) {
                     if (checkin_resp.evt.textcode == 'SUCCESS') {
                         return service.checkout(params, options);
                     } else {