From: Mike Risher Date: Tue, 28 Jan 2020 23:54:05 +0000 (+0000) Subject: lp1772955 total billed total paid inaccurate X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fmrisher%2Flp1735828-copy-bucket-show-status;p=working%2FEvergreen.git lp1772955 total billed total paid inaccurate Fix the bug on the patron billing UI that's causing the total billed and total paid amounts to be inaccurate. The bug causes it to include amounts from bills that have already been completely paid. Signed-off-by: Mike Risher Changes to be committed: modified: Open-ILS/src/templates/staff/circ/patron/t_bills.tt2 modified: Open-ILS/web/js/ui/default/staff/circ/patron/bills.js --- diff --git a/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2 b/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2 index 7b5106ba4e..d0ac3dcef0 100644 --- a/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2 +++ b/Open-ILS/src/templates/staff/cat/bucket/copy/t_view.tt2 @@ -19,7 +19,7 @@ + label="[% l('Open in Item Status') %]">
[% l('Total Owed:') %]
-
{{(summary.balance_owed() || 0) | currency}}
+
{{owed_all() | currency}}
[% l('Refunds Available:') %]
{{refunds_available() | currency}}
[% l('Total Billed:') %]
-
{{(summary.total_owed() || 0) | currency}}
+
{{billed_all() | currency}}
[% l('Credit Available:') %]
{{patron().credit_forward_balance() | currency}}
[% l('Total Paid/Credited:') %]
-
{{(summary.total_paid() || 0) | currency}}
+
{{paid_all() | currency}}
[% l('Session Voided:') %]
{{session_voided | currency}}
+ +

[% l('Owed for Selected:') %]
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js index cb10593068..6870dc8006 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js @@ -292,6 +292,19 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location, return info; } + function all_payment_info() { + var info = {owed : 0, billed : 0, paid : 0}; + angular.forEach($scope.gridControls.allItems(), function(item) { + info.owed += Number(item['summary.balance_owed']) * 100; + info.billed += Number(item['summary.total_owed']) * 100; + info.paid += Number(item['summary.total_paid']) * 100; + }); + info.owed /= 100; + info.billed /= 100; + info.paid /= 100; + return info; + } + $scope.pending_payment = function() { return pending_payment_info().payment; } @@ -307,6 +320,15 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location, $scope.paid_selected = function() { return selected_payment_info().paid; } + $scope.owed_all = function() { + return all_payment_info().owed; + } + $scope.billed_all = function() { + return all_payment_info().billed; + } + $scope.paid_all = function() { + return all_payment_info().paid; + } $scope.refunds_available = function() { var amount = 0; angular.forEach($scope.gridControls.allItems(), function(item) {