From ee786ee0e4cc9d7ded82704b233c73cd15157b0c Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Fri, 21 Feb 2014 09:31:39 -0500 Subject: [PATCH] LP 1198465: Fix staff client to handle new virtual field in mb object. Alter server/patron/util.js to get values for voided, voider, and void_time from the virtual void_payment object on the money.billing. Alter server/patron/bill2.js to use the void_payment field instead of the removed voided field to determine if a bill is voided. Signed-off-by: Jason Stephenson --- Open-ILS/xul/staff_client/server/patron/bill2.js | 2 +- Open-ILS/xul/staff_client/server/patron/util.js | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js index 8a248f3c90..323811f8c5 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill2.js +++ b/Open-ILS/xul/staff_client/server/patron/bill2.js @@ -1028,7 +1028,7 @@ function void_all_billings(mobts_id) { var mb_list = g.network.simple_request( 'FM_MB_RETRIEVE_VIA_MBTS_ID.authoritative', [ ses(), mobts_id ] ); if (typeof mb_list.ilsevent != 'undefined') throw(mb_list); - mb_list = util.functional.filter_list( mb_list, function(o) { return ! get_bool( o.voided() ) }); + mb_list = util.functional.filter_list( mb_list, function(o) { return ! get_bool( o.void_payment() ) }); if (mb_list.length == 0) { alert($("patronStrings").getString('staff.patron.bills.void_all_billings.all_voided')); return; } diff --git a/Open-ILS/xul/staff_client/server/patron/util.js b/Open-ILS/xul/staff_client/server/patron/util.js index 6849c346c4..50be099ca5 100644 --- a/Open-ILS/xul/staff_client/server/patron/util.js +++ b/Open-ILS/xul/staff_client/server/patron/util.js @@ -151,20 +151,21 @@ patron.util.mb_columns = function(modify,params) { }, { 'persist' : 'hidden width ordinal', 'id' : 'voided', 'label' : commonStrings.getString('staff.mb_voided_label'), 'flex' : 1, - 'primary' : false, 'hidden' : false, 'editable' : false, 'render' : function(my) { return get_bool( my.mb.voided() ) ? "Yes" : "No"; } + 'primary' : false, 'hidden' : false, 'editable' : false, 'render' : function(my) { return ( typeof my.mb.void_payment() == 'undefined' ) ? "No" : "Yes"; } }, { 'persist' : 'hidden width ordinal', 'id' : 'voider', 'label' : commonStrings.getString('staff.mb_voider_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'editable' : false, 'render' : function(my) { return my.mb.voider() ? "Id = " + my.mb.voider() : ""; } + 'primary' : false, 'hidden' : true, 'editable' : false, 'render' : function(my) { return ( typeof my.mb.void_payment() == 'undefined' ) ? "" : "Id = " + my.mb.void_payment().accepting_usr(); } }, { 'persist' : 'hidden width ordinal', 'id' : 'void_time', 'label' : commonStrings.getString('staff.mb_void_time_label'), 'flex' : 1, 'sort_type' : 'date', - 'primary' : false, 'hidden' : true, 'editable' : false, 'render' : function(my) { return util.date.formatted_date( my.mb.void_time(), "%{localized}" ); } + 'primary' : false, 'hidden' : true, 'editable' : false, + 'render' : function(my) { return ( typeof my.mb.void_payment() == 'undefined' ) ? "" : util.date.formatted_date( my.mb.void_payment().payment_ts(), "%{localized}" ); } ,'sort_value' : function(my) { return util.date.db_date2Date( - my.mbts - ? my.mb.void_time() - : null + ( typeof my.mb.void_payment() == 'undefined' ) + ? null + : my.mb.void_payment().payment_ts() ).getTime(); } }, -- 2.11.0