LP#1729934 Webstaff penalty create org/depth repair
authorBill Erickson <berickxx@gmail.com>
Fri, 5 Jan 2018 19:55:56 +0000 (14:55 -0500)
committerKathy Lussier <klussier@masslnc.org>
Wed, 11 Apr 2018 17:27:20 +0000 (13:27 -0400)
Apply correct org unit to patron penalties created in the web staff
client.  Specifically, be sure the standing penalty depth value is
honored when set.

Commit replaces manual pcrud creation with the XUL-tested API, which
calculates the correct org unit by depth for us.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 5a903c7..ec97c30 100644 (file)
@@ -1930,7 +1930,12 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
                 }
                 pen.staff(egCore.auth.user().id());
                 pen.set_date('now');
-                return egCore.pcrud.create(pen);
+
+                return egCore.net.request(
+                    'open-ils.actor',
+                    'open-ils.actor.user.penalty.apply',
+                    egCore.auth.token(), pen
+                );
             }
         );
     }