LP1779467: Fix bug with charging fees when marking item damaged.
authorJason Stephenson <jason@sigio.com>
Sun, 3 Feb 2019 16:44:09 +0000 (11:44 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 31 Jul 2019 15:34:12 +0000 (11:34 -0400)
Revert the changes made to the mark_damaged function in the web staff
client code (Open-ILS/web/js/ui/default/staff/circ/services/circ.js)
earlier in this branch.  The new code does not handle the mark damaged
process correctly, but the original code does.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 93a5d03..acf9d94 100644 (file)
@@ -1361,26 +1361,16 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
                                 handle_checkin: !$scope.applyFine
                         }).then(function(resp) {
                             if (evt = egCore.evt.parse(resp)) {
-                                egCore.pcrud.retrieve('ccs', 14)
-                                    .then(function(resp) {
-                                        service.handle_mark_item_event(
-                                            {id : params.id, barcode : params.barcode},
-                                            resp,
-                                            {
-                                                apply_fines: $scope.applyFine,
-                                                override_amount: $scope.billArgs.charge,
-                                                override_btype: $scope.billArgs.type,
-                                                override_note: $scope.billArgs.note,
-                                                handle_checkin: !$scope.applyFine
-                                            },
-                                            evt);
-                                    }).then(function(resp) {
-                                        // noop?
-                                        //if (doRefresh) egItem.add_barcode_to_list(params.barcode);
-                                    }, function(resp) {
-                                        doRefresh = false;
-                                        console.error('mark damaged failed: ' + evt);
-                                    });
+                                doRefresh = false;
+                                console.debug("mark damaged more information required. Pushing back.");
+                                service.mark_damaged({
+                                    id: params.id,
+                                    barcode: params.barcode,
+                                    charge: evt.payload.charge,
+                                    circ: evt.payload.circ,
+                                    refresh: params.refresh
+                                });
+                                console.error('mark damaged failed: ' + evt);
                             }
                         }).then(function() {
                             if (doRefresh) egItem.add_barcode_to_list(params.barcode);