From: Bill Erickson Date: Thu, 1 Nov 2018 20:53:21 +0000 (-0400) Subject: JBAS-2101 Payment grid shows A/D login X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=90f6b04e3f85762b106959f57089f3ab030138ce;p=working%2FEvergreen.git JBAS-2101 Payment grid shows A/D login In the XUL client transaction details payment grid: 1. Rename the existing "Staff" column to "Login" (i.e. shared ILS login) 2. Add a new column labeled "Staff" which shows the KCLS login (first part of email) of the staff that accepted a lost payment. Column will be empty for non-lost payments. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/RefundablePayment.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/RefundablePayment.pm index 18bad4be65..8327a4646f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/RefundablePayment.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/RefundablePayment.pm @@ -473,6 +473,32 @@ sub generate_refundable_payment_receipt { } } +__PACKAGE__->register_method( + method => 'retrieve_refundable_payment', + api_name => 'open-ils.circ.refundable_payment.retrieve.by_payment', + signature => { + desc => q/Return a refundable payment by money.payment.id/, + params => [ + {desc => 'Authentication token', type => 'string'}, + {desc => 'Payment (mp.id) ID', type => 'number'} + ], + return => { + desc => 'Refundable payment object on success, undef on not-found' + } + } +); + +# NOTE: adding this for XUL client -- browser client just uses pcrud. +sub retrieve_refundable_payment { + my ($self, $client, $auth, $payment_id) = @_; + + my $e = new_editor(authtoken => $auth); + return $e->event unless $e->checkauth; + return $e->event unless $e->allowed('STAFF_LOGIN'); + + return $e->search_money_refundable_payment({payment => $payment_id})->[0]; +} + 1; diff --git a/Open-ILS/xul/staff_client/server/patron/util.js b/Open-ILS/xul/staff_client/server/patron/util.js index ce36b6eb3f..0abd47534d 100644 --- a/Open-ILS/xul/staff_client/server/patron/util.js +++ b/Open-ILS/xul/staff_client/server/patron/util.js @@ -269,9 +269,26 @@ patron.util.mp_columns = function(modify,params) { 'primary' : false, 'hidden' : false, 'editable' : false, 'render' : function(my) { return my.mp.cash_drawer().name(); } }, { - 'id' : 'mp_staff', 'label' : commonStrings.getString('staff.mp_accepting_usr_label'), 'flex' : 1, + 'id' : 'mp_staff', 'label' : 'Login', 'flex' : 1, 'primary' : false, 'hidden' : false, 'editable' : false, 'render' : function(my) { var s = my.mp.accepting_usr(); if (s && typeof s != "object") s = patron.util.retrieve_fleshed_au_via_id(ses(),s,["card"]); return s.family_name() + " (" + s.card().barcode() + ") @ " + data.hash.aou[ s.home_ou() ].shortname(); } }, + { // KCLS JBAS-2101 + 'id' : 'mp_lost_staff', 'label' : 'Staff', 'flex' : 1, + 'primary' : false, 'hidden' : false, 'editable' : false, + 'render' : function(my) { + var rf_payment = g.network.request( + 'open-ils.circ', + 'open-ils.circ.refundable_payment.retrieve.by_payment', + [ses(), my.mp.id()] + ); + + if (rf_payment) { + return rf_payment.staff_email().replace(/@.*/g, ''); // remove @kcls.org + } else { + return ''; + } + } + }, { 'id' : 'mp_xact', 'label' : commonStrings.getString('staff.mp_xact_label'), 'flex' : 1, 'primary' : false, 'hidden' : true, 'editable' : false, 'render' : function(my) { return my.mp.xact(); }