[open-ils-commits] r17594 - in branches/rel_2_0/Open-ILS/xul/staff_client/server: locale/en-US patron (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 10 16:15:46 EDT 2010
Author: phasefx
Date: 2010-09-10 16:15:41 -0400 (Fri, 10 Sep 2010)
New Revision: 17594
Modified:
branches/rel_2_0/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill2.js
branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill_details.js
branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/util.js
Log:
merge r17588-r17592 from trunk for patron refunds and misc tweaks
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties 2010-09-10 20:13:05 UTC (rev 17593)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties 2010-09-10 20:15:41 UTC (rev 17594)
@@ -42,6 +42,12 @@
staff.patron.bill_history.handle_void.btn_yes=Yes
staff.patron.bill_history.handle_void.btn_no=No
staff.patron.bill_history.handle_void.confirm_message=Check here to confirm this message
+staff.patron.bills.handle_refund.message_plural=Are you sure you would like to refund excess payment on bills %1$s? This action will simply put the amount in the Payment Pending column as a negative value. You must still select Apply Payment! Certain types of payments may not be refunded. The refund may be applied to checked transactions that follow the refunded transaction.
+staff.patron.bills.handle_refund.message_singular=Are you sure you would like to refund excess payment on bill %1$s? This action will simply put the amount in the Payment Pending column as a negative value. You must still select Apply Payment! Certain types of payments may not be refunded. The refund may be applied to checked transactions that follow the refunded transaction.
+staff.patron.bills.handle_refund.title=Refund Excess Payment
+staff.patron.bills.handle_refund.btn_yes=Yes
+staff.patron.bills.handle_refund.btn_no=No
+staff.patron.bills.handle_refund.confirm_message=Check here to confirm this message
staff.patron.bill_history.print_bills.print_error=printing bills
staff.patron.bill_history.column.xact_type.label=Transaction Type
staff.patron.bill_history.column.last_billing_type.label=Last Billing Type
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill2.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill2.js 2010-09-10 20:13:05 UTC (rev 17593)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill2.js 2010-09-10 20:15:41 UTC (rev 17594)
@@ -78,6 +78,12 @@
false
);
+ $('refund').addEventListener(
+ 'command',
+ handle_refund,
+ false
+ );
+
$('opac').addEventListener(
'command',
handle_opac,
@@ -95,7 +101,7 @@
function(ev) {
if ($('payment_type').value == 'credit_payment') {
JSAN.use('util.money');
- JSAN.use('patron.util'); g.patron = patron.util.retrieve_au_via_id(ses(),g.patron_id);
+ JSAN.use('patron.util'); g.patron = patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id,null);
var proposed = util.money.dollars_float_to_cents_integer(ev.target.value);
var available = util.money.dollars_float_to_cents_integer(g.patron.credit_forward_balance());
if (proposed > available) {
@@ -319,6 +325,33 @@
}
}
+function handle_refund() {
+ if(g.bill_list_selection.length > 1) {
+ var msg = $("patronStrings").getFormattedString('staff.patron.bills.handle_refund.message_plural', [g.bill_list_selection]);
+ } else {
+ var msg = $("patronStrings").getFormattedString('staff.patron.bills.handle_refund.message_singular', [g.bill_list_selection]);
+ }
+
+ var r = g.error.yns_alert(msg,
+ $("patronStrings").getString('staff.patron.bills.handle_refund.title'),
+ $("patronStrings").getString('staff.patron.bills.handle_refund.btn_yes'),
+ $("patronStrings").getString('staff.patron.bills.handle_refund.btn_no'),null,
+ $("patronStrings").getString('staff.patron.bills.handle_refund.confirm_message'));
+ if (r == 0) {
+ for (var i = 0; i < g.bill_list_selection.length; i++) {
+ var bill_id = g.bill_list_selection[i];
+ //alert('g.check_map['+bill_id+'] = '+g.check_map[bill_id]+' bill_map['+bill_id+'] = ' + js2JSON(g.bill_map[bill_id]));
+ g.check_map[bill_id] = true;
+ var row_params = g.row_map[bill_id];
+ row_params.row.my.checked = true;
+ g.bill_list.refresh_row(row_params);
+ }
+ }
+ tally_all();
+ distribute_payment();
+}
+
+
function check_all() {
try {
for (var i in g.bill_map) {
@@ -438,6 +471,7 @@
$('details').setAttribute('disabled', g.bill_list_selection.length == 0);
$('add').setAttribute('disabled', g.bill_list_selection.length == 0);
$('voidall').setAttribute('disabled', g.bill_list_selection.length == 0);
+ $('refund').setAttribute('disabled', g.bill_list_selection.length == 0);
$('opac').setAttribute('disabled', g.bill_list_selection.length == 0);
$('copy_details').setAttribute('disabled', g.bill_list_selection.length == 0);
},
@@ -647,8 +681,9 @@
try {
var template = 'bills_historical'; if (xul_param('current')) template = 'bills_current';
JSAN.use('patron.util');
+ g.patron = patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id,null);
var params = {
- 'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id,null),
+ 'patron' : g.patron,
'printer_context' : 'receipt',
'template' : template
};
@@ -899,7 +934,7 @@
function refresh_patron() {
JSAN.use('patron.util'); JSAN.use('util.money');
- patron.util.retrieve_au_via_id(ses(),g.patron_id, function(req) {
+ patron.util.retrieve_fleshed_au_via_id(ses(),g.patron_id,null,function(req) {
var au_obj = req.getResultObject();
if (typeof au_obj.ilsevent == 'undefined') {
g.patron = au_obj;
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill_details.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill_details.js 2010-09-10 20:13:05 UTC (rev 17593)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill_details.js 2010-09-10 20:15:41 UTC (rev 17594)
@@ -5,7 +5,7 @@
if (g.patron_id) {
JSAN.use('patron.util');
- g.au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), g.patron_id );
+ g.au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), g.patron_id, null );
$('patron_name').setAttribute('value',
patron.util.format_name( g.au_obj ) + ' : ' + g.au_obj.card().barcode()
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/util.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/util.js 2010-09-10 20:13:05 UTC (rev 17593)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/util.js 2010-09-10 20:15:41 UTC (rev 17594)
@@ -599,7 +599,7 @@
typeof func == 'function' ? func : null
);
if (typeof func != 'function') {
- patron.util.set_penalty_css(patron_obj);
+ if (!fields) { patron.util.set_penalty_css(patron_obj); }
return patron_obj;
}
}
@@ -619,34 +619,34 @@
patron.util.set_penalty_css = function(patron) {
try {
- removeCSSClass(document.documentElement,'PATRON_HAS_BILLS');
- removeCSSClass(document.documentElement,'PATRON_HAS_OVERDUES');
- removeCSSClass(document.documentElement,'PATRON_HAS_NOTES');
- removeCSSClass(document.documentElement,'PATRON_EXCEEDS_CHECKOUT_COUNT');
- removeCSSClass(document.documentElement,'PATRON_EXCEEDS_OVERDUE_COUNT');
- removeCSSClass(document.documentElement,'PATRON_EXCEEDS_FINES');
- removeCSSClass(document.documentElement,'NO_PENALTIES');
- removeCSSClass(document.documentElement,'ONE_PENALTY');
- removeCSSClass(document.documentElement,'MULTIPLE_PENALTIES');
- removeCSSClass(document.documentElement,'PATRON_HAS_ALERT');
- removeCSSClass(document.documentElement,'PATRON_BARRED');
- removeCSSClass(document.documentElement,'PATRON_INACTIVE');
- removeCSSClass(document.documentElement,'PATRON_EXPIRED');
- removeCSSClass(document.documentElement,'PATRON_HAS_INVALID_DOB');
- removeCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS');
- removeCSSClass(document.documentElement,'PATRON_AGE_GE_65');
- removeCSSClass(document.documentElement,'PATRON_AGE_LT_65');
- removeCSSClass(document.documentElement,'PATRON_AGE_GE_24');
- removeCSSClass(document.documentElement,'PATRON_AGE_LT_24');
- removeCSSClass(document.documentElement,'PATRON_AGE_GE_21');
- removeCSSClass(document.documentElement,'PATRON_AGE_LT_21');
- removeCSSClass(document.documentElement,'PATRON_AGE_GE_18');
- removeCSSClass(document.documentElement,'PATRON_AGE_LT_18');
- removeCSSClass(document.documentElement,'PATRON_AGE_GE_13');
- removeCSSClass(document.documentElement,'PATRON_AGE_LT_13');
- removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_1');
- removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_2');
- removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_3');
+ removeCSSClass(document.documentElement,'PATRON_HAS_BILLS');
+ removeCSSClass(document.documentElement,'PATRON_HAS_OVERDUES');
+ removeCSSClass(document.documentElement,'PATRON_HAS_NOTES');
+ removeCSSClass(document.documentElement,'PATRON_EXCEEDS_CHECKOUT_COUNT');
+ removeCSSClass(document.documentElement,'PATRON_EXCEEDS_OVERDUE_COUNT');
+ removeCSSClass(document.documentElement,'PATRON_EXCEEDS_FINES');
+ removeCSSClass(document.documentElement,'NO_PENALTIES');
+ removeCSSClass(document.documentElement,'ONE_PENALTY');
+ removeCSSClass(document.documentElement,'MULTIPLE_PENALTIES');
+ removeCSSClass(document.documentElement,'PATRON_HAS_ALERT');
+ removeCSSClass(document.documentElement,'PATRON_BARRED');
+ removeCSSClass(document.documentElement,'PATRON_INACTIVE');
+ removeCSSClass(document.documentElement,'PATRON_EXPIRED');
+ removeCSSClass(document.documentElement,'PATRON_HAS_INVALID_DOB');
+ removeCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS');
+ removeCSSClass(document.documentElement,'PATRON_AGE_GE_65');
+ removeCSSClass(document.documentElement,'PATRON_AGE_LT_65');
+ removeCSSClass(document.documentElement,'PATRON_AGE_GE_24');
+ removeCSSClass(document.documentElement,'PATRON_AGE_LT_24');
+ removeCSSClass(document.documentElement,'PATRON_AGE_GE_21');
+ removeCSSClass(document.documentElement,'PATRON_AGE_LT_21');
+ removeCSSClass(document.documentElement,'PATRON_AGE_GE_18');
+ removeCSSClass(document.documentElement,'PATRON_AGE_LT_18');
+ removeCSSClass(document.documentElement,'PATRON_AGE_GE_13');
+ removeCSSClass(document.documentElement,'PATRON_AGE_LT_13');
+ removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_1');
+ removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_2');
+ removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_3');
JSAN.use('util.network'); var net = new util.network();
net.simple_request('FM_MOUS_RETRIEVE.authoritative',[ ses(), patron.id() ], function(req) {
@@ -672,6 +672,7 @@
*/
var penalties = patron.standing_penalties();
+ if (!penalties) { penalties = []; }
for (var i = 0; i < penalties.length; i++) {
/* this comes from /opac/common/js/utils.js */
addCSSClass(document.documentElement,penalties[i].standing_penalty().name());
@@ -743,12 +744,12 @@
if ( get_bool( patron.juvenile() ) ) addCSSClass(document.documentElement,'PATRON_JUVENILE');
else removeCSSClass(document.documentElement,'PATRON_JUVENILE');
- if (patron.mailing_address()) {
+ if (patron.mailing_address() && typeof patron.mailing_address() == 'object') {
if (!get_bool(patron.mailing_address().valid())) {
addCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS');
}
}
- if (patron.billing_address()) {
+ if (patron.billing_address() && typeof patron.billing_address() == 'object') {
if (!get_bool(patron.billing_address().valid())) {
addCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS');
}
More information about the open-ils-commits
mailing list