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++) {
$('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() );
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;
$('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);
}
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();
} );
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) {
<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"/>
<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>