From e3ab6f304ade8c73107414f06f5f9a7d96a9fe99 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 25 Jun 2014 12:44:07 -0400 Subject: [PATCH] fine tally; improved already-checked-in alert Signed-off-by: Bill Erickson --- .../src/templates/staff/circ/checkin/index.tt2 | 55 +++++++++++++--------- .../web/js/ui/default/staff/circ/checkin/app.js | 26 ++++++---- 2 files changed, 52 insertions(+), 29 deletions(-) diff --git a/Open-ILS/src/templates/staff/circ/checkin/index.tt2 b/Open-ILS/src/templates/staff/circ/checkin/index.tt2 index 272212b0c3..89ce0e8623 100644 --- a/Open-ILS/src/templates/staff/circ/checkin/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/checkin/index.tt2 @@ -56,25 +56,36 @@
-
-
-
+
+ +
- + - + - -
- + +
+
-
+
+
+ + [% l('[_1] was already checked in.', '{{alert.already_checked_in}}') %] + + + [% l('Item [_1] has never circulated.', '{{alert.item_never_circed}}') %] + +
+
+ +
[% l('Effective Date') %]
@@ -86,13 +97,15 @@
-
- - [% l('[_1] was already checked in.', '{{alert.already_checked_in}}') %] - - - [% l('Item [_1] has never circulated.', '{{alert.item_never_circed}}') %] - +
+
+ [% l('Fine Tally:') %] + {{fine_total | currency}} + + [% l('Transaction for [_1] billed:', '{{billable_barcode}}') %] + {{billable_amount | currency}} + +

diff --git a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js index 00be1dffd9..61a807820e 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js @@ -22,12 +22,12 @@ function($scope , $q , $window , $location , egCore , checkinSvc , egGridDataPro var suppress_popups = false; var today = new Date(); - var seen_barcodes = {}; $scope.focusMe = true; $scope.checkins = checkinSvc.checkins; $scope.checkinArgs = {backdate : today} $scope.using_hatch = egCore.hatch.usingHatch(); $scope.modifiers = {}; + $scope.fine_total = 0; // run egCore.startup here since it's not handled via resolver egCore.startup.go().then( @@ -107,18 +107,13 @@ function($scope , $q , $window , $location , egCore , checkinSvc , egGridDataPro args.copy_barcode = ''; // reset UI for next scan $scope.focusMe = true; delete $scope.alert; + delete $scope.billable_amount; + delete $scope.billable_barcode; var params = compiled.params; var options = compiled.options; if (!params.copy_barcode) return; - - if (seen_barcodes[params.copy_barcode]) { - $scope.alert = {already_checked_in : params.copy_barcode}; - return; - } - - seen_barcodes[params.copy_barcode] = true; delete $scope.alert; var row_item = { @@ -159,6 +154,21 @@ function($scope , $q , $window , $location , egCore , checkinSvc , egGridDataPro // TODO holds shelf, cataloging } + if (row_item.mbts) { + var amt = Number(row_item.mbts.balance_owed()); + if (amt != 0) { + $scope.billable_barcode = row_item.copy_barcode; + $scope.billable_amount = amt; + $scope.fine_total = + ($scope.fine_total * 100 + amt * 100) / 100; + } + } + + if (final_resp.evt.textcode == 'NO_CHANGE') { + $scope.alert = + {already_checked_in : final_resp.evt.copy_barcode}; + } + if ($scope.trim_list && checkinSvc.checkins.length > 20) checkinSvc.checkins = checkinSvc.checkins.splice(0, 20); }, -- 2.11.0