<!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.adjust_to_zero.label "Adjust to Zero">
+<!ENTITY staff.patron.bill_interface.adjust_to_zero.accesskey "Z">
<!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">
'USER_ORG_UNIT_OPT_IN_FEATURE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.org_unit_opt_in.enabled' },
'USER_ORG_UNIT_OPT_IN_CHECK' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.org_unit_opt_in.check' },
'USER_ORG_UNIT_OPT_IN_CREATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.org_unit_opt_in.create' },
- 'GET_BARCODES' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.get_barcodes' }
+ 'GET_BARCODES' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.get_barcodes' },
+ 'ADJUST_BILLS_TO_ZERO' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.billable_xact.adjust_to_zero' }
}
var urls = {
staff.patron.bills.handle_refund.title=Refund Excess Payment
staff.patron.bills.handle_refund.btn_yes=Yes
staff.patron.bills.handle_refund.btn_no=No
-staff.patron.bills.handle_refund.confirm_message=Check here to confirm this message
+
+staff.patron.bills.handle_adjust_to_zero.confirm_message=Check here to confirm this message
+staff.patron.bills.handle_adjust_to_zero.message_plural=Are you sure you would like to adjust to zero the balance on bills %1$s?
+staff.patron.bills.handle_adjust_to_zero.message_singular=Are you sure you would like to adjust to zero the balance on bill %1$s?
+staff.patron.bills.handle_adjust_to_zero.title=Adjust to Zero
+staff.patron.bills.handle_adjust_to_zero.btn_yes=Yes
+staff.patron.bills.handle_adjust_to_zero.btn_no=No
+
staff.patron.bill_history.print_bills.print_error=printing bills
staff.patron.bill_history.column.xact_type.label=Transaction Type
staff.patron.bill_history.column.last_billing_type.label=Last Billing Type
false
);
+ window.bill_event_listeners.add($('adjust_to_zero'),
+ 'command',
+ handle_adjust_to_zero,
+ false
+ );
+
window.bill_event_listeners.add($('opac'),
'command',
handle_opac,
distribute_payment();
}
+/**
+ * Calls open-ils.circ.money.billable_xact.adjust_to_zero on selected
+ * transactions to produce a zero-balance transaction.
+ * Successfully cleared transactions will disappear from the billing list.
+ */
+function handle_adjust_to_zero() {
+
+ var msgkey = g.bill_list_selection.length > 1 ?
+ 'staff.patron.bills.handle_adjust_to_zero.message_plural' :
+ 'staff.patron.bills.handle_adjust_to_zero.message_singular';
+
+ var msg = $("patronStrings").getFormattedString(
+ msgkey, [g.bill_list_selection]);
+
+ var r = g.error.yns_alert(msg,
+ $("patronStrings").getString(
+ 'staff.patron.bills.handle_adjust_to_zero.title'),
+ $("patronStrings").getString(
+ 'staff.patron.bills.handle_adjust_to_zero.btn_yes'),
+ $("patronStrings").getString(
+ 'staff.patron.bills.handle_adjust_to_zero.btn_no'),null,
+ $("patronStrings").getString(
+ 'staff.patron.bills.handle_adjust_to_zero.confirm_message'));
+
+ if (r == 0) {
+ var xact_ids = [];
+ for (var i = 0; i < g.bill_list_selection.length; i++) {
+ var bill_id = g.bill_list_selection[i];
+ xact_ids.push(bill_id);
+ }
+
+ var mod_ids = g.network.simple_request(
+ 'ADJUST_BILLS_TO_ZERO', [ses(), xact_ids]);
+
+ g.error.sdump('D_DEBUG', 'adjusted to zero transactions ' + mod_ids);
+
+ refresh();
+ tally_all();
+ distribute_payment();
+ }
+}
+
function check_all() {
try {
$('details').setAttribute('disabled', g.bill_list_selection.length == 0);
$('add').setAttribute('disabled', g.bill_list_selection.length == 0);
$('voidall').setAttribute('disabled', g.bill_list_selection.length == 0);
+ $('adjust_to_zero').setAttribute('disabled', g.bill_list_selection.length == 0);
$('refund').setAttribute('disabled', g.bill_list_selection.length == 0);
$('opac').setAttribute('disabled', g.bill_list_selection.length == 0);
$('copy_details').setAttribute('disabled', g.bill_list_selection.length == 0);
<command id="opac" label="&staff.patron.bill_interface.show_in_catalog.label;" accesskey="&staff.patron.bill_interface.show_in_catalog.accesskey;" disabled="true"/>
<command id="copy_details" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" disabled="true"/>
<command id="voidall" label="&staff.patron.bill_interface.void_all_billings.label;" accesskey="&staff.patron.bill_interface.void_all_billings.accesskey;" disabled="true"/>
+ <command id="adjust_to_zero" label="&staff.patron.bill_interface.adjust_to_zero.label;" accesskey="&staff.patron.bill_interface.adjust_to_zero.accesskey;" disabled="true"/>
<command id="refund" label="&staff.patron.bill_interface.refund.label;" accesskey="&staff.patron.bill_interface.refund.accesskey;" disabled="true"/>
<command id="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="&staff.patron.bill_interface.add_billing.accesskey;" disabled="true"/>
<command id="details" label="&staff.patron.bill_interface.full_details.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;" disabled="true"/>
<menuitem command="opac" />
<menuitem command="copy_details" />
<menuitem command="voidall" />
+ <menuitem command="adjust_to_zero" />
<menuitem command="refund" />
<menuitem command="add" />
<menuitem command="details" />