From d818cb6941b2c352a0fd8c0a0bbea6b782078e71 Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 2 Nov 2009 22:29:14 +0000 Subject: [PATCH] Reintroduce the previous Charge Patron for Damage? dialog for its conciseness, but add option for modifying the billing git-svn-id: svn://svn.open-ils.org/ILS/trunk@14724 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/util.js | 62 ++++++++++++++-------- .../server/locale/en-US/cat.properties | 6 +++ 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js index 09cb7f11dc..20196b4117 100644 --- a/Open-ILS/xul/staff_client/server/cat/util.js +++ b/Open-ILS/xul/staff_client/server/cat/util.js @@ -352,32 +352,50 @@ cat.util.mark_item_damaged = function(copy_ids) { 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('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 ) + 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 ) + } + ); + + 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); } diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties index 9b601e0a63..f2301ecb01 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties @@ -348,6 +348,12 @@ staff.cat.util.mark_item_damaged.checkin.no_checkin=Cancel 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. -- 2.11.0