[open-ils-commits] r14458 - in trunk/Open-ILS/xul/staff_client/server: patron skin (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Oct 15 16:59:29 EDT 2009
Author: phasefx
Date: 2009-10-15 16:59:24 -0400 (Thu, 15 Oct 2009)
New Revision: 14458
Modified:
trunk/Open-ILS/xul/staff_client/server/patron/bill2.js
trunk/Open-ILS/xul/staff_client/server/patron/bill2.xul
trunk/Open-ILS/xul/staff_client/server/skin/circ.css
Log:
layout tweaks, uncheck refundable transactions by default
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill2.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill2.js 2009-10-15 20:53:59 UTC (rev 14457)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill2.js 2009-10-15 20:59:24 UTC (rev 14458)
@@ -43,6 +43,7 @@
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 @@
$('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 @@
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 @@
$('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 @@
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 @@
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) {
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill2.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill2.xul 2009-10-15 20:53:59 UTC (rev 14457)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill2.xul 2009-10-15 20:59:24 UTC (rev 14458)
@@ -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>
Modified: trunk/Open-ILS/xul/staff_client/server/skin/circ.css
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/skin/circ.css 2009-10-15 20:53:59 UTC (rev 14457)
+++ trunk/Open-ILS/xul/staff_client/server/skin/circ.css 2009-10-15 20:59:24 UTC (rev 14458)
@@ -21,5 +21,6 @@
#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; }
More information about the open-ils-commits
mailing list