From 0eaad32a9d73a3274f77400064880ae0026ba1ac Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 1 Sep 2011 15:01:39 -0400 Subject: [PATCH] Add Reserve circ rules for Boreal Still need some clarification on how these rules are to be applied, but better to get the durations working right now and fix up the fines later. Signed-off-by: Dan Scott --- .../src/javascript/backend/circ/circ_duration_OSBO.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Open-ILS/src/javascript/backend/circ/circ_duration_OSBO.js b/Open-ILS/src/javascript/backend/circ/circ_duration_OSBO.js index b1062cf438..6225838752 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_duration_OSBO.js +++ b/Open-ILS/src/javascript/backend/circ/circ_duration_OSBO.js @@ -39,3 +39,18 @@ if (copy.circ_modifier == 'DVD VIDEO') { result.durationRule = '7_days_1_renew'; result.recurringFinesRule = '1_dollar_per_day'; } + +/* Reserve items - let's use regular expressions to save some pain */ +res_day_re = /^RESERVE (\d+) DAY$/; +res_hour_re = /^RESERVE (\d+) HOUR$/; +res_day_match = res_day_re.exec(copy.circ_modifier); +res_hour_match = res_hour_re.exec(copy.circ_modifier); +if (res_day_match) { + result.durationRule = res_day_match[1] + '_days_0_renew'; + result.recurringFinesRule = '25_cent_per_day'; +} else if (res_hour_match) { + result.durationRule = res_hour_match[1] + '_hours_0_renew'; + result.recurringFinesRule = '25_cent_per_hour'; +} + + -- 2.11.0