[open-ils-commits] r14724 - in trunk/Open-ILS/xul/staff_client/server: cat locale/en-US (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 2 17:29:20 EST 2009
Author: phasefx
Date: 2009-11-02 17:29:14 -0500 (Mon, 02 Nov 2009)
New Revision: 14724
Modified:
trunk/Open-ILS/xul/staff_client/server/cat/util.js
trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Log:
Reintroduce the previous Charge Patron for Damage? dialog for its conciseness, but add option for modifying the billing
Modified: trunk/Open-ILS/xul/staff_client/server/cat/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/util.js 2009-11-02 22:08:15 UTC (rev 14723)
+++ trunk/Open-ILS/xul/staff_client/server/cat/util.js 2009-11-02 22:29:14 UTC (rev 14724)
@@ -352,32 +352,50 @@
if (typeof robj.ilsevent != 'undefined') {
switch(robj.textcode) {
case 'DAMAGE_CHARGE' :
+ var params = {};
JSAN.use('util.money');
var circ_obj = robj.payload.circ;
var patron_obj = circ_obj.usr();
+ JSAN.use('patron.util');
+ var patron_name = patron.util.format_name( patron_obj ) + ' : ' + patron_obj.card().barcode();
+ var r1 = error.yns_alert(
+ $("catStrings").getFormattedString('staff.cat.util.mark_item_damaged.charge_patron_prompt.message', [
+ copies[i].barcode(),
+ patron_name,
+ circ_obj.checkin_time().substr(0,10), // FIXME: need to replace with something better
+ util.money.sanitize(robj.payload.charge) ]),
+ $("catStrings").getString('staff.cat.util.mark_item_damaged.charge_patron_prompt.title'),
+ $("catStrings").getString('staff.cat.util.mark_item_damaged.charge_patron_prompt.ok_label'),
+ $("catStrings").getString('staff.cat.util.mark_item_damaged.charge_patron_prompt.change_amount_label'),
+ $("catStrings").getString('staff.cat.util.mark_item_damaged.charge_patron_prompt.cancel_label'),
+ $("catStrings").getString('staff.cat.util.mark_item_damaged.charge_patron_prompt.confirm_action'));
+ if (r1 == 0) {
+ params.apply_fines = 'apply';
+ } else if (r1 == 1) {
+ JSAN.use('util.window'); var win = new util.window();
+ var my_xulG = win.open(
+ urls.XUL_PATRON_BILL_WIZARD,
+ 'billwizard',
+ 'chrome,resizable,modal',
+ {
+ 'patron' : patron_obj,
+ 'patron_id' : patron_obj.id(),
+ 'circ' : circ_obj,
+ 'xact_id' : circ_obj.id(),
+ 'do_not_process_bill' : true,
+ /* 'override_default_billing_type' : 7, FIXME: maybe reintroduce this with an org setting for the specific btype? */
+ 'override_default_price' : util.money.sanitize( robj.payload.charge )
+ }
+ );
- JSAN.use('util.window'); var win = new util.window();
- var my_xulG = win.open(
- urls.XUL_PATRON_BILL_WIZARD,
- 'billwizard',
- 'chrome,resizable,modal',
- {
- 'patron' : patron_obj,
- 'patron_id' : patron_obj.id(),
- 'circ' : circ_obj,
- 'xact_id' : circ_obj.id(),
- 'do_not_process_bill' : true,
- 'override_default_billing_type' : 7, /* Damaged Item */
- 'override_default_price' : util.money.sanitize( robj.payload.charge )
+ params.apply_fines = my_xulG.proceed ? 'apply' : 'noapply';
+ if (my_xulG.proceed) {
+ params.override_amount = my_xulG.amount;
+ params.override_btype = my_xulG.cbt_id;
+ params.override_note = my_xulG.note;
}
- );
-
- var params = {};
- params.apply_fines = my_xulG.proceed ? 'apply' : 'noapply';
- if (my_xulG.proceed) {
- params.override_amount = my_xulG.amount;
- params.override_btype = my_xulG.cbt_id;
- params.override_note = my_xulG.note;
+ } else {
+ params.apply_fines = 'noapply';
}
robj = network.simple_request('MARK_ITEM_DAMAGED',[ ses(), copies[i].id(), params ]);
if (typeof robj.ilsevent != 'undefined') { throw(robj); }
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2009-11-02 22:08:15 UTC (rev 14723)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2009-11-02 22:29:14 UTC (rev 14724)
@@ -348,6 +348,12 @@
staff.cat.util.mark_item_damaged.checkin.forgiving_checkin=Forgiving Checkin
staff.cat.util.mark_item_damaged.checkin.confirm_action=Check here to confirm this action
staff.cat.util.mark_item_damaged.item_circulating_to_patron=Item %1$s is checked out to patron, %2$s, and is due on %3$s.
+staff.cat.util.mark_item_damaged.charge_patron_prompt.message=Item %1$s will be marked damaged. Was returned on %3$s for %2$s. Charge this patron $%4$s for the damage?
+staff.cat.util.mark_item_damaged.charge_patron_prompt.title=Charge Patron For Damaged Item?
+staff.cat.util.mark_item_damaged.charge_patron_prompt.ok_label=OK
+staff.cat.util.mark_item_damaged.charge_patron_prompt.change_amount_label=Change Amount
+staff.cat.util.mark_item_damaged.charge_patron_prompt.cancel_label=Cancel
+staff.cat.util.mark_item_damaged.charge_patron_prompt.confirm_action=Check here to confirm this action
staff.cat.util.mark_item_damaged.marking_error=Error marking item %1$s damaged.
staff.cat.util.mark_item_damaged.one_item_damaged=Item marked Damaged
staff.cat.util.mark_item_damaged.multiple_item_damaged=%1$s items marked Damaged.
More information about the open-ils-commits
mailing list