Put Huntington's $15/hour computer fines into effect
authordbs <dbs@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Tue, 8 Mar 2011 17:40:23 +0000 (17:40 +0000)
committerdbs <dbs@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Tue, 8 Mar 2011 17:40:23 +0000 (17:40 +0000)
Because I have broken the link with the circ_duration_OSUL.js script,
we will have to manually keep these rules in sync (at least until
we move to in-database circ rules)

git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/branches/rel_1_6_1@1258 6d9bc8c9-1ec2-4278-b937-99fde70a366f

circ/circ_duration_HUNTINGTON.js [changed from symlink to file mode: 0644]

deleted file mode 120000 (symlink)
index e54bfe16facc6b22a396f234a48b9a068f16c4f8..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-circ_duration_OSUL.js
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..8b06795c6648beaa99abaf3e9a72e543e37f62da
--- /dev/null
@@ -0,0 +1,70 @@
+/* grab the config from the config script */
+var config = getItemConfig();
+var itemForm    = (marcXMLDoc) ? extractFixedField(marcXMLDoc,'Form') : "";
+
+/* Set the defaults for books for most patron types */
+result.durationRule = '3_weeks_3_renew';
+result.recurringFinesRule = 'OSUL_daily';
+result.maxFine = 'OSUL_daily';
+
+if (patronProfile == 'Faculty' || 
+    patronProfile == 'Graduate') {
+    result.durationRule = '120_days_1_renew';
+}
+
+/* Distance education laptops */
+if (copy.circ_modifier == 'COMPUTER LONG') {
+    result.durationRule = 'OSUL_computer_long';
+    result.recurringFinesRule = 'OSUL_computer';
+    result.maxFine = 'overdue_equip_max';
+}
+
+/* Short term laptops */
+if (copy.circ_modifier == 'COMPUTER SHORT') {
+    result.durationRule = '4_hours_0_renew';
+    result.recurringFinesRule = 'HUNT_computer';
+    result.maxFine = 'overdue_equip_max';
+}
+
+/* Study room keys */
+if (copy.circ_modifier == 'KEYS') {
+    result.durationRule = '3_hours_1_renew';
+    result.recurringFinesRule = 'OSUL_hourly';
+    result.maxFine = 'OSUL_hourly';
+}
+
+/* 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 = 'OSUL_reserves_daily';
+    result.maxFine = 'OSUL_reserves';
+} else if (res_hour_match) {
+    result.durationRule = res_hour_match[1] + '_hours_0_renew';
+    result.recurringFinesRule = 'OSUL_hourly';
+    result.maxFine = 'OSUL_reserves';
+}
+
+/* RACER books */
+if (copy.circ_modifier == 'PEB-LIVRE') {
+    result.durationRule = '14_days_0_renew';
+    result.recurringFinesRule = '1_dollar_per_day';
+    result.maxFine = 'INFINITY_AND_BEYOND';
+}
+
+/* VIDEO recordings */
+if (copy.circ_modifier == 'VIDEO') {
+    result.durationRule = '3_days_0_renew';
+    result.recurringFinesRule = '1_dollar_per_day';
+    result.maxFine = 'OSUL_reserves';
+}
+
+/* SOUND and DVD VIDEO recordings */
+if (copy.circ_modifier == 'SOUND' || copy.circ_modifier == 'DVD VIDEO') {
+    result.durationRule = '7_days_0_renew';
+    result.recurringFinesRule = '1_dollar_per_day';
+    result.maxFine = 'OSUL_reserves';
+}