From 4793ff6afe0b740cc26bc27567c79f4e4385587c Mon Sep 17 00:00:00 2001 From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4> Date: Thu, 15 Oct 2009 20:59:24 +0000 Subject: [PATCH] layout tweaks, uncheck refundable transactions by default git-svn-id: svn://svn.open-ils.org/ILS/trunk@14458 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/patron/bill2.js | 32 ++++++++++++++++++++--- Open-ILS/xul/staff_client/server/patron/bill2.xul | 20 ++++++++++---- Open-ILS/xul/staff_client/server/skin/circ.css | 1 + 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js index 38716097c9..dfb3e217d1 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill2.js +++ b/Open-ILS/xul/staff_client/server/patron/bill2.js @@ -43,6 +43,7 @@ function tally_all() { var total_billed = 0; var total_paid = 0; var total_balance = 0; + var refunds_owed = 0; var retrieve_ids = g.bill_list.dump_retrieve_ids(); for (var i = 0; i < retrieve_ids.length; i++) { @@ -56,6 +57,7 @@ function tally_all() { $('total_owed2').setAttribute('value', '???'); $('total_billed').setAttribute('value', '???'); $('total_paid').setAttribute('value', '???'); + $('refunds_owed').setAttribute('value', '???'); return; } var to = util.money.dollars_float_to_cents_integer( bill.transaction.total_owed() ); @@ -64,6 +66,7 @@ function tally_all() { total_billed += to; total_paid += tp; total_balance += bo; + if ( bo < 0 ) refunds_owed += bo; if (g.check_map[retrieve_ids[i]]) { checked_billed += to; checked_paid += tp; @@ -78,6 +81,7 @@ function tally_all() { $('total_paid').setAttribute('value', '$' + util.money.cents_as_dollars( total_paid ) ); $('total_owed').setAttribute('value', '$' + util.money.cents_as_dollars( total_balance ) ); $('total_owed2').setAttribute('value', '$' + util.money.cents_as_dollars( total_balance ) ); + $('refunds_owed').setAttribute('value', '$' + util.money.cents_as_dollars( Math.abs( refunds_owed ) ) ); } catch(E) { alert('Error in bill2.js, tally_all(): ' + E); } @@ -191,12 +195,15 @@ function init_lists() { row.my.circ = blob.circ; row.my.acp = blob.copy; row.my.mvr = blob.record; - g.bill_map[ id ] = blob; - g.check_map[ id ] = row.my.checked; if (typeof params.on_retrieve == 'function') { - if ( Number( row.my.mbts.balance_owed() ) < 0 ) params.row_node.firstChild.setAttribute('properties','refundable'); + if ( Number( row.my.mbts.balance_owed() ) < 0 ) { + params.row_node.firstChild.setAttribute('properties','refundable'); + row.my.checked = false; + } params.on_retrieve(row); }; + g.bill_map[ id ] = blob; + g.check_map[ id ] = row.my.checked; tally_selected(); tally_all(); } ); @@ -259,6 +266,25 @@ function my_init() { exec.on_error = function(E) { alert(E); return true; } exec.timer(g.funcs,100); + $('credit_forward').setAttribute('value','???'); + if (!g.patron) { + g.network.simple_request( + 'FM_AU_FLESHED_RETRIEVE_VIA_ID.authoritative', + [ ses(), g.patron_id ], + function(req) { + try { + g.patron = req.getResultObject(); + if (typeof g.patron.ilsevent != 'undefined') throw(g.patron); + $('credit_forward').setAttribute('value','$' + util.money.sanitize( g.patron.credit_forward_balance() )); + } catch(E) { + alert('Error in bill2.js, retrieve patron callback: ' + E); + } + } + ); + } else { + $('credit_forward').setAttribute('value','$' + util.money.sanitize( g.patron.credit_forward_balance() )); + } + default_focus(); } catch(E) { diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.xul b/Open-ILS/xul/staff_client/server/patron/bill2.xul index e22175d4ab..4c8ee0e3c4 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill2.xul +++ b/Open-ILS/xul/staff_client/server/patron/bill2.xul @@ -57,14 +57,25 @@ <groupbox orient="vertical" flex="1"> <caption id="caption" label="&staff.patron.bill_interface.caption.label;"/> <hbox> - <grid> - <columns> + <grid flex="1"> + <columns flex="1"> + <column/> + <column/> + <column flex="1"/> <column/> <column/> </columns> <rows> - <row><label value="Total Owed:" class="big_emphasis1" /><label id="total_owed2" class="big_emphasis1"/></row> - <row><label value="Total Checked:" class="big_emphasis1" /><label id="checked_owed2" class="big_emphasis1"/></row> + <row> + <vbox pack="center"><label value="Total Owed:" class="big_emphasis1" /></vbox><vbox pack="center"><label id="total_owed2" class="big_emphasis1"/></vbox> + <spacer flex="1"/> + <vbox pack="center"><label value="Refunds Available:" class="big_emphasis2"/></vbox><vbox pack="center"><label id="refunds_owed" class="big_emphasis2"/></vbox> + </row> + <row> + <vbox pack="center"><label value="Total Checked:" class="big_emphasis1" /></vbox><vbox pack="center"><label id="checked_owed2" class="big_emphasis1"/></vbox> + <spacer flex="1"/> + <vbox pack="center"><label value='Credit Available:' class="big_emphasis2"/></vbox><vbox pack="center"><label id="credit_forward" class="big_emphasis2"/></vbox> + </row> </rows> </grid> <spacer flex="1"/> @@ -147,7 +158,6 @@ <vbox> <hbox> <label value='&staff.patron.bill_interface.voided_this_session.label;' class="emphasis1"/><label id="currently_voided" value="$0.00"/> - <label value='Credit Available:' class="emphasis1"/><label id="credit_forward" value="$0.00"/> </hbox> <hbox><label value='Change Due Upon Payment:' class="big_emphasis1"/><label id="change_due" value="$0.00" class="big_emphasis1"/></hbox> </vbox> diff --git a/Open-ILS/xul/staff_client/server/skin/circ.css b/Open-ILS/xul/staff_client/server/skin/circ.css index 2f0facc812..7425cd9b24 100644 --- a/Open-ILS/xul/staff_client/server/skin/circ.css +++ b/Open-ILS/xul/staff_client/server/skin/circ.css @@ -21,5 +21,6 @@ treechildren::-moz-tree-row(refundable) { #checkin_auto_print_slips_indicator { background-color: -moz-dialog; color: -moz-dialog-text; font-size: large; font-weight: bold; } .big_emphasis1 { font-weight: bold; font-size: x-large; } +.big_emphasis2 { font-weight: bold; font-size: large; } .emphasis1 { font-weight: bold; } .emphasis2 { font-weight: normal; } -- 2.11.0