From 4eba0d790056ae13a394c83618df1e2b9d0fe0ff Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 29 Dec 2009 17:30:48 +0000 Subject: [PATCH] display resource and resource type information for reservations in the original billing interface git-svn-id: svn://svn.open-ils.org/ILS/trunk@15241 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../staff_client/chrome/content/main/constants.js | 3 ++ .../server/locale/en-US/patron.properties | 3 ++ Open-ILS/xul/staff_client/server/patron/bills.js | 44 ++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index c253ea1f0..240bc0fb2 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -178,6 +178,9 @@ const api = { 'FM_AUSP_PCRUD_UPDATE' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.update.ausp', 'secure' : false }, 'FM_AUSP_UPDATE_NOTE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.penalty.note.update' }, 'FM_BOOKING_CREATE_BRT_AND_BRSRC' : { 'app' : 'open-ils.booking', 'method' : 'open-ils.booking.create_brt_and_brsrc_from_copies' }, + 'FM_BRESV_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.bresv.atomic' }, + 'FM_BRSRC_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.brsrc.atomic' }, + 'FM_BRT_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.brt.atomic' }, 'FM_BRE_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve', 'secure' : false }, 'FM_BRE_RETRIEVE_VIA_ID.authoritative' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve.authoritative', 'secure' : false }, 'FM_BRE_ID_VIA_BARCODE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.bib_id.by_barcode', 'secure' : false }, diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties index d46ac0cfa..e8abd8235 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties @@ -55,6 +55,9 @@ staff.patron.bills.pay.annotate_payment=Please annotate this payment: staff.patron.bills.pay.annotate_payment.title=Annotate Payment staff.patron.bills.pay.refund_exceeds_desk_payment=%1$s\n\nAnother way to "zero" this transaction is to use Add Billing and add a miscellaneous bill to counter the negative balance. staff.patron.bills.pay.payment_failed=Bill payment likely failed +staff.patron.bills.info_box.label_value.reservation=Reservation +# 1 - Resource Barcode 2 - Resource Type Name +staff.patron.bills.info_box.value_format.reservation=%1$s : %2$s staff.patron.bills.info_box.label_value.title=Title staff.patron.bills.info_box.label_value.type=Type staff.patron.bills.info_box.label_value.last_billing=Last Billing: diff --git a/Open-ILS/xul/staff_client/server/patron/bills.js b/Open-ILS/xul/staff_client/server/patron/bills.js index 8d1ac8a39..998dd4176 100644 --- a/Open-ILS/xul/staff_client/server/patron/bills.js +++ b/Open-ILS/xul/staff_client/server/patron/bills.js @@ -905,6 +905,50 @@ patron.bills.prototype = { } ); break; + case 'reservation': + xt_label.setAttribute( 'value', $("patronStrings").getString('staff.patron.bills.info_box.label_value.reservation') ); + obj.network.simple_request( + 'FM_BRESV_RETRIEVE_VIA_PCRUD', + [ ses(), { 'id' : { '=' : my.mobts.id() } } ], + function (req) { + try { + var reservation = req.getResultObject()[0]; + if (typeof reservation.ilsevent != 'undefined') { return; } + obj.network.simple_request( + 'FM_BRSRC_RETRIEVE_VIA_PCRUD', + [ ses(), { 'id' : { '=' : reservation.target_resource() } } ], + function (rreq) { + try { + var resource = rreq.getResultObject()[0]; + if (typeof resource.ilsevent != 'undefined') { return; } + obj.network.simple_request( + 'FM_BRT_RETRIEVE_VIA_PCRUD', + [ ses(), { 'id' : { '=' : resource.type() } } ], + function (rrreq) { + try { + var resource_type = rrreq.getResultObject()[0]; + if (typeof resource_type.ilsevent != 'undefined') { return; } + xt_value.appendChild( + document.createTextNode( + $("patronStrings").getFormattedString('staff.patron.bills.info_box.value_format.reservation', [resource.barcode(), resource_type.name()]) + ) + ); + } catch(E) { + alert(E); + } + } + ); + } catch(E) { + alert(E); + } + } + ); + } catch(E) { + alert(E); + } + } + ); + break; default: xt_label.setAttribute( 'value', my.mvr ? $("patronStrings").getString('staff.patron.bills.info_box.label_value.title') : $("patronStrings").getString('staff.patron.bills.info_box.label_value.type') ); -- 2.11.0