<!ENTITY staff.patron.bill_history.selected_billed.label "Selected Billed:">
<!ENTITY staff.patron.bill_history.selected_paid.label "Selected Paid:">
+<!ENTITY staff.patron.bill_interface.total_owed "Total Owed:">
+<!ENTITY staff.patron.bill_interface.total_checked "Total Checked:">
+<!ENTITY staff.patron.bill_interface.refunds_available "Refunds Available:">
+<!ENTITY staff.patron.bill_interface.credit_available "Credit Available:">
+<!ENTITY staff.patron.bill_interface.payment_received.label "Payment Received:">
+<!ENTITY staff.patron.bill_interface.payment_received.accesskey "R">
+<!ENTITY staff.patron.bill_interface.actions.label "Actions for Selected Transactions">
+<!ENTITY staff.patron.bill_interface.actions.accesskey "A">
<!ENTITY staff.patron.bill_interface.add_billing.label "Add Billing">
+<!ENTITY staff.patron.bill_interface.add_billing.accesskey "B">
+<!ENTITY staff.patron.bill_interface.void_all_billings.label "Void All Billings">
+<!ENTITY staff.patron.bill_interface.void_all_billings.accesskey "V">
+<!ENTITY staff.patron.bill_interface.refund.label "Refund">
+<!ENTITY staff.patron.bill_interface.refund.accesskey "R">
<!ENTITY staff.patron.bill_interface.full_details.label "Full Details">
<!ENTITY staff.patron.bill_interface.full_details.accesskey "D">
<!ENTITY staff.patron.bill_interface.show_in_catalog.label "Show in Catalog">
<!ENTITY staff.patron.bills_overlay.new_balance.value "= New Balance">
<!ENTITY staff.patron.bills_overlay.pay_bill.label "Pay Bill">
<!ENTITY staff.patron.bills_overlay.payment_type.value "Payment Type">
-<!ENTITY staff.patron.bills_overlay.payment_type.accesskey "t">
+<!ENTITY staff.patron.bills_overlay.payment_type.accesskey "T">
<!ENTITY staff.patron.bills_overlay.cash.label "Cash">
<!ENTITY staff.patron.bills_overlay.check.label "Check">
<!ENTITY staff.patron.bills_overlay.credit_card.label "Credit Card">
+<!ENTITY staff.patron.bills_overlay.patron_credit.label "Patron Credit">
<!ENTITY staff.patron.bills_overlay.word.label "Work">
<!ENTITY staff.patron.bills_overlay.forgive.label "Forgive">
<!ENTITY staff.patron.bills_overlay.goods.label "Goods">
<!ENTITY staff.patron.bills_overlay.history.label "History">
<!ENTITY staff.patron.bills_overlay.history.accesskey "H">
<!ENTITY staff.patron.bills_overlay.annotate_payment.label "Annotate Payment">
+<!ENTITY staff.patron.bills_overlay.annotate_payment.accesskey "n">
<!ENTITY staff.patron.bills_overlay.convert_change_to_credit.label "Convert Change to Patron Credit">
+<!ENTITY staff.patron.bills_overlay.convert_change_to_credit.accesskey "C">
+<!ENTITY staff.patron.bills_overlay.see_distribution.label "See Distribution">
+<!ENTITY staff.patron.bills_overlay.see_distribution.accesskey "D">
<!ENTITY staff.patron.bills_overlay.apply_payment.label "Apply Payment!">
<!ENTITY staff.patron.bills_overlay.apply_payment.accesskey "P">
<!ENTITY staff.patron.bill_summary_overlay.bill_number.value "Bill #">
}
switch(a) {
+ case 'staff' : return data.list.au[0]; break;
case 'staff_id' : return data.list.au[0].id(); break;
case 'staff_usrname' : return data.list.au[0].usrname(); break;
case 'ws_ou' :
<script>var djConfig = { 'baseUrl' : '/js/dojo/dojo/',parseOnLoad: true,isDebug:false };</script>
<script type="text/javascript" src="/js/dojo/dojo/dojo.js" />
<script>try { dojo.require('fieldmapper.AutoIDL'); } catch(E) { alert(E); }</script>
+ <script>try { dojo.require('dojo.date.locale'); } catch(E) { alert(E); }</script>
+ <script>try { dojo.require('dojo.date.stamp'); } catch(E) { alert(E); }</script>
<script type="text/javascript" src="/xul/server/main/constants.js" />
<script type="text/javascript" src="/xul/server/OpenILS/data.js" />
<script type="text/javascript" src="/xul/server/util/barcode.js" />
common.ok=Ok
common.clear=Clear
common.confirm=Check here to confirm this message.
+common.cancelled=Action Cancelled
common.error.default=Please report that this happened.
common.barcode.status.warning=Warning: As of %1$s, this barcode (%2$s) was flagged %3$s.
common.barcode.status.warning.lost=Lost
}
function event_listeners() {
+ try {
$('details').addEventListener(
'command',
handle_details,
false
);
+ $('convert_change_to_credit').addEventListener(
+ 'command',
+ function(ev) {
+ if (ev.target.checked) {
+ addCSSClass( $('change_due'), 'change_to_credit' );
+ } else {
+ removeCSSClass( $('change_due'), 'change_to_credit' );
+ }
+ },
+ false
+ );
+
+ } catch(E) {
+ alert('Error in bill2.js, event_listeners(): ' + E);
+ }
}
function $(id) { return document.getElementById(id); }
function tally_pending() {
try {
+ var payments = [];
JSAN.use('util.money');
var tb = $('payment');
var payment_tendered = util.money.dollars_float_to_cents_integer( tb.value );
for (var i = 0; i < retrieve_ids.length; i++) {
var row_params = g.row_map[retrieve_ids[i]];
if (g.check_map[retrieve_ids[i]]) {
- payment_pending += util.money.dollars_float_to_cents_integer( row_params.row.my.payment_pending );
+ var value = util.money.dollars_float_to_cents_integer( row_params.row.my.payment_pending );
+ payment_pending += value;
+ if (value != '0.00') { payments.push( [ retrieve_ids[i], value ] ); }
}
}
var change_pending = payment_tendered - payment_pending;
$('pending_payment').value = util.money.cents_as_dollars( payment_pending );
$('pending_change').value = util.money.cents_as_dollars( change_pending );
+ $('change_due').value = util.money.cents_as_dollars( change_pending );
+ return { 'payments' : payments, 'change' : change_pending };
} catch(E) {
alert('Error in bill2.js, tally_pending(): ' + E);
}
}
}
+function apply_payment() {
+ try {
+ var payment_blob = {};
+ JSAN.use('util.window');
+ var win = new util.window();
+ switch($('payment_type').value) {
+ case 'credit_card_payment' :
+ g.data.temp = '';
+ g.data.stash('temp');
+ var my_xulG = win.open(
+ urls.XUL_PATRON_BILL_CC_INFO,
+ 'billccinfo',
+ 'chrome,resizable,modal',
+ {'patron_id': g.patron_id}
+ );
+ g.data.stash_retrieve();
+ payment_blob = JSON2js( g.data.temp ); // FIXME - replace with my_xulG and update_modal_xulG, though it looks like we were using that before and moved away from it
+ break;
+ case 'check_payment' :
+ g.data.temp = '';
+ g.data.stash('temp');
+ var my_xulG = win.open(
+ urls.XUL_PATRON_BILL_CHECK_INFO,
+ 'billcheckinfo',
+ 'chrome,resizable,modal'
+ );
+ g.data.stash_retrieve();
+ payment_blob = JSON2js( g.data.temp );
+ break;
+ }
+ if (
+ (typeof payment_blob == 'undefined') ||
+ payment_blob=='' ||
+ payment_blob.cancelled=='true'
+ ) {
+ alert( $('commonStrings').getString('common.cancelled') );
+ return;
+ }
+ payment_blob.userid = g.patron_id;
+ payment_blob.note = payment_blob.note || '';
+ //payment_blob.cash_drawer = 1; // FIXME: get new Config() to work
+ payment_blob.payment_type = $('payment_type').value;
+ var tally_blob = tally_pending();
+ payment_blob.payments = tally_blob.payments;
+ payment_blob.patron_credit = $('convert_change_to_credit').checked ? tally_blob.change : '0.00';
+ if ( payment_blob.payments.length == 0 && payment_blob.patron_credit == '0.00' ) {
+ alert($("patronStrings").getString('staff.patron.bills.apply_payment.nothing_applied'));
+ return;
+ }
+ if ( pay( payment_blob ) ) {
+
+ g.data.voided_billings = []; g.data.stash('voided_billings');
+ g.bill_list.clear();
+ retrieve_mbts_for_list();
+ if (typeof window.refresh == 'function') window.refresh();
+ if (typeof window.xulG == 'object' && typeof window.xulG.refresh == 'function') window.xulG.refresh();
+ try {
+ var no_print_prompting = g.data.hash.aous['circ.staff_client.do_not_auto_attempt_print'];
+ if (no_print_prompting) {
+ if (no_print_prompting.indexOf( "Bill Pay" ) > -1) return; // Skip print attempt
+ }
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ g.data.stash_retrieve();
+ var template = 'bill_payment';
+ JSAN.use('patron.util'); JSAN.use('util.functional');
+ var params = {
+ 'patron' : g.patron,
+ 'lib' : data.hash.aou[ ses('ws_ou') ],
+ 'staff' : ses('staff'),
+ 'header' : data.print_list_templates[template].header,
+ 'line_item' : data.print_list_templates[template].line_item,
+ 'footer' : data.print_list_templates[template].footer,
+ 'type' : data.print_list_templates[template].type,
+ 'list' : util.functional.map_list(
+ payment_blob.payments,
+ function(o) {
+ return {
+ 'bill_id' : o[0],
+ 'payment' : o[1],
+ 'last_billing_type' : g.bill_map[ o[0] ].transaction.last_billing_type(),
+ 'last_billing_note' : g.bill_map[ o[0] ].transaction.last_billing_note(),
+ 'title' : typeof g.bill_map[ o[0] ].title != 'undefined' ? g.bill_map[ o[0] ].title : '',
+ 'barcode' : typeof g.bill_map[ o[0] ].barcode != 'undefined' ? g.bill_map[ o[0] ].barcode : ''
+ };
+ }
+ ),
+ 'data' : g.previous_summary
+ };
+ g.error.sdump('D_DEBUG',js2JSON(params));
+ if ($('auto_print').checked) params.no_prompt = true;
+ JSAN.use('util.print'); var print = new util.print();
+ print.tree_list( params );
+ } catch(E) {
+ g.standard_unexpected_error_alert('bill receipt', E);
+ }
+ }
+ } catch(E) {
+ alert('Error in bill2.js, apply_payment(): ' + E);
+ }
+}
+
+function pay(payment_blob) {
+ try {
+ var x = $('annotate_payment');
+ if (x && x.checked && (! payment_blob.note)) {
+ payment_blob.note = window.prompt(
+ $("patronStrings").getString('staff.patron.bills.pay.annotate_payment'),
+ '',
+ $("patronStrings").getString('staff.patron.bills.pay.annotate_payment.title')
+ );
+ }
+ previous_summary = {
+ original_balance : obj.controller.view.bill_total_owed.value,
+ voided_balance : obj.controller.view.voided_balance.value,
+ payment_received : obj.controller.view.bill_payment_amount.value,
+ payment_applied : obj.controller.view.bill_payment_applied.value,
+ change_given : obj.controller.view.bill_change_amount.value,
+ credit_given : obj.controller.view.bill_credit_amount.value,
+ new_balance : obj.controller.view.bill_new_balance.value,
+ payment_type : obj.controller.view.payment_type.getAttribute('label'),
+ note : payment_blob.note
+ }
+ var robj = g.network.request(
+ api.BILL_PAY.app,
+ api.BILL_PAY.method,
+ [ ses(), payment_blob ]
+ );
+ if (robj == 1) { return true; }
+ if (typeof robj.ilsevent != 'undefined') {
+ switch(Number(robj.ilsevent)) {
+ case 0 /* SUCCESS */ : return true; break;
+ case 1226 /* REFUND_EXCEEDS_DESK_PAYMENTS */ : alert($("patronStrings").getFormattedString('staff.patron.bills.pay.refund_exceeds_desk_payment', [robj.desc])); return false; break;
+ default: throw(robj); break;
+ }
+ }
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert($("patronStrings").getString('staff.patron.bills.pay.payment_failed'),E);
+ return false;
+ }
+}
+
+
<popupset>
<popup id="actions_popup">
<menuitem command="opac" label="&staff.patron.bill_interface.show_in_catalog.label;" accesskey="&staff.patron.bill_interface.show_in_catalog.accesskey;" oncommand="alert('Not Yet Implemented');"/>
- <menuitem command="voidall" label="Void All Billings" accesskey="" />
- <menuitem command="refund" label="Refund" accesskey="" />
- <menuitem command="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="" />
+ <menuitem command="voidall" label="&staff.patron.bill_interface.void_all_billings.label;" accesskey="&staff.patron.bill_interface.void_all_billings.accesskey;" />
+ <menuitem command="refund" label="&staff.patron.bill_interface.refund.label;" accesskey="&staff.patron.bill_interface.refund.accesskey;" />
+ <menuitem command="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="&staff.patron.bill_interface.add_billing.accesskey;" />
<menuitem command="details" label="&staff.patron.bill_interface.full_details.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;"/>
</popup>
</popupset>
</columns>
<rows>
<row>
- <vbox pack="center"><label value="Total Owed:" class="big_emphasis1" /></vbox><vbox pack="center"><label id="total_owed2" class="big_emphasis1"/></vbox>
+ <vbox pack="center"><label value="&staff.patron.bill_interface.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>
+ <vbox pack="center"><label value="&staff.patron.bill_interface.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>
+ <vbox pack="center"><label value="&staff.patron.bill_interface.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>
+ <vbox pack="center"><label value='&staff.patron.bill_interface.credit_available;' class="big_emphasis2"/></vbox><vbox pack="center"><label id="credit_forward" class="big_emphasis2"/></vbox>
</row>
</rows>
</grid>
<spacer flex="1"/>
<groupbox>
- <caption label="Pay Bill"/>
+ <caption label="&staff.patron.bills_overlay.pay_bill.label;"/>
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
- <label value="Payment Type:" class="emphasis1" accesskey="T" control="payment_type"/>
+ <label value="&staff.patron.bills_overlay.payment_type.value;" class="emphasis1" accesskey="&staff.patron.bills_overlay.payment_type.accesskey;" control="payment_type"/>
<menulist id="payment_type">
<menupopup id="payment_type_menupopup">
<menuitem id="payment_type_menuitem1" label="&staff.patron.bills_overlay.cash.label;" value="cash_payment"/>
<menuitem id="payment_type_menuitem2" label="&staff.patron.bills_overlay.check.label;" value="check_payment"/>
<menuitem id="payment_type_menuitem3" label="&staff.patron.bills_overlay.credit_card.label;" value="credit_card_payment"/>
- <menuitem id="payment_type_menuitem4" label="Patron Credit" value="credit_payment" />
+ <menuitem id="payment_type_menuitem4" label="&staff.patron.bills_overlay.patron_credit.label;" value="credit_payment" />
<menuitem id="payment_type_menuitem5" label="&staff.patron.bills_overlay.word.label;" value="work_payment"/>
<menuitem id="payment_type_menuitem6" label="&staff.patron.bills_overlay.forgive.label;" value="forgive_payment"/>
<menuitem id="payment_type_menuitem7" label="&staff.patron.bills_overlay.goods.label;" value="goods_payment"/>
</menulist>
</row>
<row>
- <label value="Payment Received:" class="emphasis1" />
+ <label value="&staff.patron.bill_interface.payment_received.label;" accesskey="&staff.patron.bill_interface.payment_received.accesskey;" class="emphasis1" control="payment" />
<hbox><textbox id="payment" size="6"/></hbox>
</row>
</rows>
</grid>
<hbox>
- <checkbox id="annotate_payment" label="&staff.patron.bills_overlay.annotate_payment.label;" accesskey="n" oils_persist="checked" checked="false" oncommand="default_focus();"/>
- <button label="See Distribution" accesskey="D" oncommand="distribute_payment(); default_focus();"/>
- <button id="apply_payment_btn" label="Apply Payment" accesskey="P"/>
+ <checkbox id="annotate_payment" label="&staff.patron.bills_overlay.annotate_payment.label;" accesskey="&staff.patron.bills_overlay.annotate_payment.accesskey;" oils_persist="checked" checked="false" oncommand="default_focus();"/>
+ <button label="&staff.patron.bills_overlay.see_distribution.label;" accesskey="&staff.patron.bills_overlay.see_distribution.accesskey;" oncommand="distribute_payment(); default_focus();"/>
+ <button id="apply_payment_btn" label="&staff.patron.bills_overlay.apply_payment.label;" accesskey="&staff.patron.bills_overlay.apply_payment.accesskey;"/>
</hbox>
</groupbox>
</hbox>
<splitter />
<hbox>
- <button id="bill_patron_btn" label="Bill Patron" accesskey="" />
- <button label="History" accesskey="" />
+ <button id="bill_patron_btn" label="&staff.patron.bills_overlay.bill_patron.label;" accesskey="&staff.patron.bills_overlay.bill_patron.accesskey;" />
+ <button id="bill_history_btn" label="&staff.patron.bills_overlay.history.label;" accesskey="&staff.patron.bills_overlay.history.accesskey;" />
<spacer flex="1"/>
<menubar>
- <menu label="Actions for Selected Rows" accesskey="A">
+ <menu label="&staff.patron.bill_interface.actions.label;" accesskey="&staff.patron.bill_interface.actions.accesskey;">
<menupopup>
<menuitem command="opac" label="&staff.patron.bill_interface.show_in_catalog.label;" accesskey="&staff.patron.bill_interface.show_in_catalog.accesskey;" oncommand="alert('Not Yet Implemented');"/>
- <menuitem command="voidall" label="Void All Billings" accesskey="V" />
- <menuitem command="refund" label="Refund" accesskey="R" />
- <menuitem command="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="A" />
+ <menuitem command="voidall" label="&staff.patron.bill_interface.void_all_billings.label;" accesskey="&staff.patron.bill_interface.void_all_billings.accesskey;" />
+ <menuitem command="refund" label="&staff.patron.bill_interface.refund.label;" accesskey="&staff.patron.bill_interface.refund.accesskey;" />
+ <menuitem command="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="&staff.patron.bill_interface.add_billing.accesskey;" />
<menuitem command="details" label="&staff.patron.bill_interface.full_details.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;"/>
</menupopup>
</menu>
<label value='&staff.patron.bill_interface.voided_this_session.label;' class="emphasis1"/><label id="currently_voided" 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>
+ <checkbox id="convert_change_to_credit" label="Convert to Patron Credit" />
</vbox>
<spacer flex="1"/>
<grid>
.hideme { display: none; }
+.change_to_credit { text-decoration: line-through; }
+
hbox#PatronNotNavBar { border-top: solid thin black; }
deck#patron_deck { border-left: solid thin black; }
.patronNameLarge { font-weight: bold; }