From 7f851b8b00cf3caed6b5b974acd2c6adb0833e2b Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 5 Jun 2014 10:40:18 -0400 Subject: [PATCH] xact detail payments via flattener/pcrud Signed-off-by: Bill Erickson --- Open-ILS/examples/fm_IDL.xml | 63 +++++++++++++++++++--- .../templates/staff/circ/patron/t_xact_details.tt2 | 10 ++-- .../web/js/ui/default/staff/circ/patron/bills.js | 38 +++++-------- 3 files changed, 75 insertions(+), 36 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 7a5a756d66..451975f944 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -2439,7 +2439,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - + @@ -2467,6 +2467,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + @@ -3492,7 +3499,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - + @@ -3511,8 +3518,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + - + @@ -3529,6 +3543,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + @@ -5984,7 +6005,7 @@ SELECT usr, - + @@ -6001,6 +6022,13 @@ SELECT usr, + + + + + + + @@ -6258,7 +6286,7 @@ SELECT usr, - + @@ -6275,8 +6303,15 @@ SELECT usr, + + + + + + + - + @@ -6293,6 +6328,13 @@ SELECT usr, + + + + + + + @@ -6362,7 +6404,7 @@ SELECT usr, - + @@ -6382,6 +6424,13 @@ SELECT usr, + + + + + + + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 index 13455628fb..078b9f1a87 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 @@ -134,13 +134,17 @@
+ query="paymentQuery" + sort="paymentSort" + revision="paymentRevision" + page-size="10"> + + 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 94ead2a340..0e0e93c937 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 @@ -163,6 +163,7 @@ function($q , egCore , patronSvc) { ); } + // TODO: no longer needed? service.fetchPayments = function(xact_id) { return egCore.net.request( 'open-ils.circ', @@ -645,13 +646,9 @@ function($scope, $q , $routeParams , egCore , egGridDataProvider , patronSvc , $scope.billSort = ['billing_ts']; $scope.billRevision = 0; - // --- payments grid - var paymentProvider = egGridDataProvider.instance(); - paymentProvider.get = function(offset, count) { - return paymentProvider.arrayNotifier(payments, offset, count); - } - paymentProvider.itemFieldValue = paymentProvider.nestedItemFieldValue; - $scope.paymentGridProvider = paymentProvider; + $scope.paymentQuery = function() {return {xact : xact_id}}; + $scope.paymentSort = ['payment_ts']; + $scope.paymentRevision = 0; // -- actions $scope.voidBillings = function(bill_list) { @@ -680,7 +677,10 @@ function($scope, $q , $routeParams , egCore , egGridDataProvider , patronSvc , } // batch-edit billing and payment notes, depending on 'type' - function editNotes(ids, notes, type) { + function editNotes(selected, type) { + var notes = selected.map(function(b){ return b.note }).join(','); + var ids = selected.map(function(b){ return b.id }); + // show the note edit prompt egPromptDialog.open( egCore.strings.EDIT_BILL_PAY_NOTE, notes, { @@ -691,13 +691,8 @@ function($scope, $q , $routeParams , egCore , egGridDataProvider , patronSvc , if (type == 'payment') func = 'updatePaymentNotes'; billSvc[func](value, ids).then(function() { - if (type == 'payment') { - billSvc.fetchPayments(xact_id).then(function(ps) { - payments = ps; - paymentProvider.increment(); - }); - + $scope.paymentRevision++; } else { $scope.billRevision++; } @@ -708,16 +703,11 @@ function($scope, $q , $routeParams , egCore , egGridDataProvider , patronSvc , } $scope.editBillNotes = function(selected) { - // bill data is flattened - var notes = selected.map(function(b){ return b.note }).join(','); - var ids = selected.map(function(b){ return b.id }); - editNotes(ids, notes, 'bill'); + editNotes(selected, 'bill'); } $scope.editPaymentNotes = function(selected) { - var notes = selected.map(function(b){ return b.note() }).join(','); - var ids = selected.map(function(b){ return b.id() }); - editNotes(ids, notes, 'payment'); + editNotes(selected, 'payment'); } // -- retrieve our data @@ -737,11 +727,6 @@ function($scope, $q , $routeParams , egCore , egGridDataProvider , patronSvc , } } }); - - billSvc.fetchPayments(xact_id).then(function(ps) { - payments = ps; - paymentProvider.increment(); - }); }]) @@ -825,6 +810,7 @@ function($scope, $q , egCore , patronSvc , billSvc , egPromptDialog , $location .controller('BillPaymentHistoryCtrl', ['$scope','$q','egCore','patronSvc','billSvc','$location', function($scope, $q , egCore , patronSvc , billSvc , $location) { + $scope.gridControls = { selectedItems : function(){return []}, activateItem : function(item) { -- 2.11.0