From: Bill Erickson Date: Thu, 5 Jun 2014 14:24:37 +0000 (-0400) Subject: minor billing / print template repairs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=009aa1fd3419b76e55ee7c62a2b5b9148c161ef5;p=working%2FEvergreen.git minor billing / print template repairs Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/admin/workstation/t_print_templates.tt2 b/Open-ILS/src/templates/staff/admin/workstation/t_print_templates.tt2 index 71cd5b35ef..29d85318d0 100644 --- a/Open-ILS/src/templates/staff/admin/workstation/t_print_templates.tt2 +++ b/Open-ILS/src/templates/staff/admin/workstation/t_print_templates.tt2 @@ -19,7 +19,6 @@
-
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bill_patron_dialog.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bill_patron_dialog.tt2 index 4f849710c5..2170d32820 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_bill_patron_dialog.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_bill_patron_dialog.tt2 @@ -59,7 +59,8 @@ [% l('Billing Type:') %]
- 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 5f2a44531d..94ead2a340 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 @@ -408,10 +408,10 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location, // page data not yet refreshed, capture data from current scope var print_data = { payment_note : note, - previous_balance : $scope.summary.balance_owed, - payment_total : $scope.payment_amount, + previous_balance : Number($scope.summary.balance_owed()), + payment_total : Number($scope.payment_amount), payment_applied : $scope.pending_payment(), - amount_voided : $scope.session_voided, + amount_voided : Number($scope.session_voided), change_given : $scope.pending_change(), payments : payment_blobs, current_location : egCore.idl.toHash( @@ -447,8 +447,8 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location, return $modal.open({ templateUrl: './circ/patron/t_bill_patron_dialog', controller: - ['$scope','$modalInstance','billingTypes', - function($scope , $modalInstance , billingTypes) { + ['$scope','$modalInstance','$timeout','billingTypes', + function($scope , $modalInstance , $timeout , billingTypes) { $scope.focus = true; $scope.xact = xact; $scope.patron = patronSvc.current; @@ -459,6 +459,12 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location, } $scope.ok = function(args) { $modalInstance.close(args) } $scope.cancel = function () { $modalInstance.dismiss() } + $scope.updateDefaultPrice = function() { + var type = billingTypes.filter(function(t) { + return t.id() == $scope.billArgs.billingType })[0]; + if (type.default_price() && !$scope.billArgs.amount) + $scope.billArgs.amount = Number(type.default_price()); + } }], resolve : { // if we don't already have them, fetch the billing types @@ -501,8 +507,10 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location, $scope.gridControls.selectItems([]); } }); + $scope.gridControls.allItemsRetrieved = function() { if (selectOnLoad) { + selectOnLoad = false; // only for initial controller load. // select all non-refund items $scope.gridControls.selectItems( $scope.gridControls.allItems() @@ -561,8 +569,10 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location, var bill_ids = []; var cents = 0; angular.forEach(bills, function(b) { - cents += b.amount() * 100; - bill_ids.push(b.id()) + if (b.voided() != 't') { + cents += b.amount() * 100; + bill_ids.push(b.id()) + } }); $scope.session_voided = @@ -670,10 +680,7 @@ function($scope, $q , $routeParams , egCore , egGridDataProvider , patronSvc , } // batch-edit billing and payment notes, depending on 'type' - function editNotes(selected, type) { - var notes = selected.map(function(b){ return b.note() }).join(','); - var ids = selected.map(function(b){ return b.id() }); - + function editNotes(ids, notes, type) { // show the note edit prompt egPromptDialog.open( egCore.strings.EDIT_BILL_PAY_NOTE, notes, { @@ -701,11 +708,16 @@ function($scope, $q , $routeParams , egCore , egGridDataProvider , patronSvc , } $scope.editBillNotes = function(selected) { - editNotes(selected, 'bill'); + // 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'); } $scope.editPaymentNotes = function(selected) { - editNotes(selected, 'payment'); + var notes = selected.map(function(b){ return b.note() }).join(','); + var ids = selected.map(function(b){ return b.id() }); + editNotes(ids, notes, 'payment'); } // -- retrieve our data diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js index 57af67e279..e7101c2101 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -1295,7 +1295,6 @@ angular.module('egGridMod', return $q.when(); var query = provider.query(); - console.log(JSON.stringify(query)); if (!query || angular.equals(query, {})) return $q.when();