<field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
<field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
<field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
- <field reporter:label="Recurring Fine Amount" name="recuring_fine" reporter:datatype="money" />
- <field reporter:label="Recurring Fine Rule" name="recuring_fine_rule" reporter:datatype="link"/>
+ <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
+ <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
<field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
<field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
<field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
<link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
<link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
<link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
- <link field="recuring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
+ <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
<link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
<link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
<link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
<field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
<field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
<field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
- <field reporter:label="Recurring Fine Amount" name="recuring_fine" reporter:datatype="money" />
- <field reporter:label="Recurring Fine Rule" name="recuring_fine_rule" reporter:datatype="link"/>
+ <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
+ <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
<field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
<field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
<field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
<link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
<link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
<link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
- <link field="recuring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
+ <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
<link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
<link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
<link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
<field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
<field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
<field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
- <field reporter:label="Recurring Fine Amount" name="recuring_fine" reporter:datatype="money" />
- <field reporter:label="Recurring Fine Rule" name="recuring_fine_rule" reporter:datatype="link"/>
+ <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
+ <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
<field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
<field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
<field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
<link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
<link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
<link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
- <link field="recuring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
+ <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
<link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
<link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
<link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
<field name="max_fine_rule" reporter:datatype="link"/>
<field name="opac_renewal" reporter:datatype="bool"/>
<field name="phone_renewal" reporter:datatype="bool"/>
- <field name="recuring_fine" reporter:datatype="money" />
- <field name="recuring_fine_rule" reporter:datatype="link"/>
+ <field name="recurring_fine" reporter:datatype="money" />
+ <field name="recurring_fine_rule" reporter:datatype="link"/>
<field name="renewal_remaining" reporter:datatype="int" />
<field name="stop_fines" reporter:datatype="text"/>
<field name="stop_fines_time" reporter:datatype="timestamp"/>
<link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
<link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
<link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
- <link field="recuring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
+ <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
</links>
</class>
<class id="msfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::subject_field_entry" oils_persist:tablename="metabib.subject_field_entry" reporter:label="Subject Field Entry">
<link field="field" reltype="has_a" key="id" map="" class="cmf"/>
</links>
</class>
- <class id="crrf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::recuring_fine" oils_persist:tablename="config.rule_recuring_fine" reporter:label="Recurring Fine Rule">
- <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recuring_fine_id_seq">
+ <class id="crrf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::recurring_fine" oils_persist:tablename="config.rule_recurring_fine" reporter:label="Recurring Fine Rule">
+ <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
<field name="high" reporter:datatype="money" />
<field name="id" reporter:selector="name" reporter:datatype="id"/>
<field name="low" reporter:datatype="money" />
<field name="name" reporter:datatype="text"/>
<field name="normal" reporter:datatype="money" />
- <field name="recurance_interval" reporter:datatype="interval"/>
+ <field name="recurrence_interval" reporter:datatype="interval"/>
</fields>
<links/>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
- <create permission="ADMIN_RECURING_FINE_RULE" global_required="true"/>
+ <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
<retrieve/>
- <update permission="ADMIN_RECURING_FINE_RULE" global_required="true"/>
- <delete permission="ADMIN_RECURING_FINE_RULE" global_required="true"/>
+ <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
+ <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
</actions>
</permacrud>
</class>
<field name="data" reporter:datatype="link"/>
<field name="folder" reporter:datatype="link"/>
<field name="recur" reporter:datatype="bool"/>
- <field name="recurance" reporter:datatype="interval"/>
+ <field name="recurrence" reporter:datatype="interval"/>
<field name="name" reporter:datatype="text"/>
<field name="description" reporter:datatype="text"/>
<field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
<field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
<field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
- <field reporter:label="Recurring Fine Amount" name="recuring_fine" reporter:datatype="money" />
- <field reporter:label="Recurring Fine Rule" name="recuring_fine_rule" reporter:datatype="link"/>
+ <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
+ <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
<field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
<field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
<field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
<link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
<link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
<link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
- <link field="recuring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
+ <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
<link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
<link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
<link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
high => "High",
normal => "Normal",
low => "Low",
- recurance_interval => "Interval",
+ recurrence_interval => "Interval",
);
-my @fine_display_order = ( qw/name recurance_interval normal high low/ );
+my @fine_display_order = ( qw/name recurrence_interval normal high low/ );
my %age_cols = (
name => "Name",
{ map { ($_ => $cgi->param($_)) } keys %dur_cols }
);
}
- } elsif ($form eq 'recuring_fine') {
+ } elsif ($form eq 'recurring_fine') {
if ($action eq 'Remove Selected') {
for my $id ( ($cgi->param('remove_me')) ) {
- config::rules::recuring_fine->retrieve($id)->delete;
+ config::rules::recurring_fine->retrieve($id)->delete;
}
} elsif ( $action eq 'Add New' ) {
- config::rules::recuring_fine->create(
+ config::rules::recurring_fine->create(
{ map { ($_ => $cgi->param($_)) } keys %fine_cols }
);
}
{
#-----------------------------------------------------------------------
- # Recuring Fine form
+ # Recurring Fine form
#-----------------------------------------------------------------------
print "<form method='POST'>".
- "<input type='hidden' name='rules_form' value='recuring_fine'>".
- "<h2>Recuring Fine Levels</h2>".
+ "<input type='hidden' name='rules_form' value='recurring_fine'>".
+ "<h2>Recurring Fine Levels</h2>".
"<table class='table_class'><tr class='header_class'>\n";
for my $col ( @fine_display_order ) {
print "<td/>\n";
- for my $row ( config::rules::recuring_fine->retrieve_all ) {
+ for my $row ( config::rules::recurring_fine->retrieve_all ) {
print "</tr><tr class='row_class'>\n";
for my $col ( @fine_display_order ) {
print td($row->$col);
<event code='1608' textcode='METABIB_SUBJECT_FIELD_ENTRY_NOT_FOUND'>
<desc xml:lang='en-US'>The requested metabib_subject_field_entry was not found</desc>
</event>
- <event code='1609' textcode='CONFIG_RULES_RECURING_FINE_NOT_FOUND'>
- <desc xml:lang='en-US'>The requested config_rules_recuring_fine was not found</desc>
+ <event code='1609' textcode='CONFIG_RULES_RECURRING_FINE_NOT_FOUND'>
+ <desc xml:lang='en-US'>The requested config_rules_recurring_fine was not found</desc>
</event>
<event code='1610' textcode='MONEY_CHECK_PAYMENT_NOT_FOUND'>
<desc xml:lang='en-US'>The requested money_check_payment was not found</desc>
my( $obj, $evt );
$obj = $self->simplereq(
'open-ils.cstore',
- 'open-ils.cstore.direct.config.rules.recuring_fine.search.atomic', { name => $name } );
+ 'open-ils.cstore.direct.config.rules.recurring_fine.search.atomic', { name => $name } );
$obj = $obj->[0];
- $evt = OpenILS::Event->new('CONFIG_RULES_RECURING_FINE_NOT_FOUND') unless $obj;
+ $evt = OpenILS::Event->new('CONFIG_RULES_RECURRING_FINE_NOT_FOUND') unless $obj;
return ($obj, $evt);
}
'checkin_workstation',
'duration_rule',
'max_fine_rule',
- 'recuring_fine_rule'
+ 'recurring_fine_rule'
]
},
order_by => { circ => 'xact_start desc' },
recurring_fine_rule => $recurring_fine_rule->name,
max_fine_rule => $max_fine_rule->name,
max_fine => $self->get_max_fine_amount($max_fine_rule),
- fine_interval => $recurring_fine_rule->recurance_interval,
+ fine_interval => $recurring_fine_rule->recurrance_interval,
renewal_remaining => $duration_rule->max_renewals
};
"with duration=$dname, maxfine=$mname, recurring=$rname");
$circ->duration($policy->{duration});
- $circ->recuring_fine($policy->{recurring_fine});
+ $circ->recurring_fine($policy->{recurring_fine});
$circ->duration_rule($duration->name);
- $circ->recuring_fine_rule($recurring->name);
+ $circ->recurring_fine_rule($recurring->name);
$circ->max_fine_rule($max->name);
$circ->max_fine($policy->{max_fine});
- $circ->fine_interval($recurring->recurance_interval);
+ $circ->fine_interval($recurring->recurrance_interval);
$circ->renewal_remaining($duration->max_renewals);
} else {
$logger->info("circulator: copy found with an unlimited circ duration");
$circ->duration_rule(OILS_UNLIMITED_CIRC_DURATION);
- $circ->recuring_fine_rule(OILS_UNLIMITED_CIRC_DURATION);
+ $circ->recurring_fine_rule(OILS_UNLIMITED_CIRC_DURATION);
$circ->max_fine_rule(OILS_UNLIMITED_CIRC_DURATION);
$circ->renewal_remaining(0);
}
__PACKAGE__->columns(Primary => 'id');
__PACKAGE__->columns(Essential => qw/xact_start usr target_copy circ_lib
duration duration_rule renewal_remaining
- recuring_fine_rule recuring_fine stop_fines
+ recurring_fine_rule recurring_fine stop_fines
max_fine max_fine_rule fine_interval
stop_fines xact_finish due_date opac_renewal
checkin_staff circ_staff circ_lib checkin_lib
__PACKAGE__->columns(Primary => 'id');
__PACKAGE__->columns(Essential => qw/xact_start usr target_copy circ_lib
duration duration_rule renewal_remaining
- recuring_fine_rule recuring_fine stop_fines
+ recurring_fine_rule recurring_fine stop_fines
max_fine max_fine_rule fine_interval
stop_fines xact_finish due_date opac_renewal
checkin_staff circ_staff circ_lib checkin_lib
__PACKAGE__->columns(Essential => qw/name amount is_percent/);
#-------------------------------------------------------------------------------
-package config::rules::recuring_fine;
+package config::rules::recurring_fine;
use base qw/config/;
-__PACKAGE__->table('config_rule_recuring_fine');
+__PACKAGE__->table('config_rule_recurring_fine');
__PACKAGE__->columns(Primary => 'id');
-__PACKAGE__->columns(Essential => qw/name high normal low recurance_interval/);
+__PACKAGE__->columns(Essential => qw/name high normal low recurrence_interval/);
#-------------------------------------------------------------------------------
package config::rules::age_hold_protect;
config::rules::max_fine->sequence( 'config.rule_max_fine_id_seq' );
#---------------------------------------------------------------------
- package config::rules::recuring_fine;
+ package config::rules::recurring_fine;
- config::rules::recuring_fine->table( 'config.rule_recuring_fine' );
- config::rules::recuring_fine->sequence( 'config.rule_recuring_fine_id_seq' );
+ config::rules::recurring_fine->table( 'config.rule_recurring_fine' );
+ config::rules::recurring_fine->sequence( 'config.rule_recurring_fine_id_seq' );
#---------------------------------------------------------------------
package config::net_access_level;
$client->respond( "\t$pending_fine_count pending fine(s)\n" );
- my $recuring_fine = int($c->recuring_fine * 100);
+ my $recurring_fine = int($c->recurring_fine * 100);
my $max_fine = int($c->max_fine * 100);
my ($latest_billing_ts, $latest_amount) = ('',0);
);
next if (@cl);
- $current_fine_total += $recuring_fine;
- $latest_amount += $recuring_fine;
+ $current_fine_total += $recurring_fine;
+ $latest_amount += $recurring_fine;
$latest_billing_ts = $timestamptz;
money::billing->create(
note => "System Generated Overdue Fine",
billing_type => "Overdue materials",
btype => 1,
- amount => sprintf('%0.2f', $recuring_fine/100),
+ amount => sprintf('%0.2f', $recurring_fine/100),
billing_ts => $timestamptz,
}
);
$r->{folder},
$r->{runner},
$r->{run_time},
- $r->{report}->{recurance},
+ $r->{report}->{recurrence},
$r->{email},
$r->{csv_format},
$r->{excel_format},
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0084'); -- senator
+INSERT INTO config.upgrade_log (version) VALUES ('0085'); -- dbs
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
*/
$$;
-CREATE TABLE config.rule_recuring_fine (
+CREATE TABLE config.rule_recurring_fine (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL UNIQUE CHECK ( name ~ E'^\\w+$' ),
high NUMERIC(6,2) NOT NULL,
normal NUMERIC(6,2) NOT NULL,
low NUMERIC(6,2) NOT NULL,
- recurance_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL
+ recurrence_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL
);
-COMMENT ON TABLE config.rule_recuring_fine IS $$
+COMMENT ON TABLE config.rule_recurring_fine IS $$
/*
* Copyright (C) 2005 Georgia Public Library Service
* Mike Rylander <mrylander@gmail.com>
* Circulation Recurring Fine rules
*
* Each circulation is given a recurring fine amount based on one of
- * these rules. The recurance_interval should not be any shorter
+ * these rules. The recurrence_interval should not be any shorter
* than the interval between runs of the fine_processor.pl script
* (which is run from CRON), or you could miss fines.
*
create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
duration INTERVAL, -- derived from "circ duration" rule
fine_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL, -- derived from "circ fine" rule
- recuring_fine NUMERIC(6,2), -- derived from "circ fine" rule
+ recurring_fine NUMERIC(6,2), -- derived from "circ fine" rule
max_fine NUMERIC(6,2), -- derived from "max fine" rule
phone_renewal BOOL NOT NULL DEFAULT FALSE,
desk_renewal BOOL NOT NULL DEFAULT FALSE,
opac_renewal BOOL NOT NULL DEFAULT FALSE,
duration_rule TEXT NOT NULL, -- name of "circ duration" rule
- recuring_fine_rule TEXT NOT NULL, -- name of "circ fine" rule
+ recurring_fine_rule TEXT NOT NULL, -- name of "circ fine" rule
max_fine_rule TEXT NOT NULL, -- name of "max fine" rule
stop_fines TEXT CHECK (stop_fines IN (
'CHECKIN','CLAIMSRETURNED','LOST','MAXFINES','RENEW','LONGOVERDUE','CLAIMSNEVERCHECKEDOUT')),
SELECT id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, due_date,
- stop_fines_time, checkin_time, create_time, duration, fine_interval, recuring_fine,
- max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recuring_fine_rule,
+ stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
+ max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ
FROM action.aged_circulation
UNION ALL
cp.call_number AS copy_call_number, cp.location AS copy_location, cn.owning_lib AS copy_owning_lib, cp.circ_lib AS copy_circ_lib,
cn.record AS copy_bib_record, circ.xact_start, circ.xact_finish, circ.target_copy, circ.circ_lib, circ.circ_staff, circ.checkin_staff,
circ.checkin_lib, circ.renewal_remaining, circ.due_date, circ.stop_fines_time, circ.checkin_time, circ.create_time, circ.duration,
- circ.fine_interval, circ.recuring_fine, circ.max_fine, circ.phone_renewal, circ.desk_renewal, circ.opac_renewal, circ.duration_rule,
- circ.recuring_fine_rule, circ.max_fine_rule, circ.stop_fines, circ.workstation, circ.checkin_workstation, circ.checkin_scan_time,
+ circ.fine_interval, circ.recurring_fine, circ.max_fine, circ.phone_renewal, circ.desk_renewal, circ.opac_renewal, circ.duration_rule,
+ circ.recurring_fine_rule, circ.max_fine_rule, circ.stop_fines, circ.workstation, circ.checkin_workstation, circ.checkin_scan_time,
circ.parent_circ
FROM action.circulation circ
JOIN asset.copy cp ON (circ.target_copy = cp.id)
(id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, due_date,
- stop_fines_time, checkin_time, create_time, duration, fine_interval, recuring_fine,
- max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recuring_fine_rule,
+ stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
+ max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ)
SELECT
id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, due_date,
- stop_fines_time, checkin_time, create_time, duration, fine_interval, recuring_fine,
- max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recuring_fine_rule,
+ stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
+ max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ
FROM action.all_circulation WHERE id = OLD.id;
ALTER TABLE config.circ_matrix_matchpoint ADD COLUMN juvenile_flag BOOL;
ALTER TABLE config.circ_matrix_matchpoint ADD COLUMN circulate BOOL NOT NULL DEFAULT TRUE;
ALTER TABLE config.circ_matrix_matchpoint ADD COLUMN duration_rule INT REFERENCES config.rule_circ_duration (id) DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE config.circ_matrix_matchpoint ADD COLUMN recurring_fine_rule INT REFERENCES config.rule_recuring_fine (id) DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE config.circ_matrix_matchpoint ADD COLUMN recurring_fine_rule INT REFERENCES config.rule_recurring_fine (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE config.circ_matrix_matchpoint ADD COLUMN max_fine_rule INT REFERENCES config.rule_max_fine (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE config.circ_matrix_matchpoint ADD COLUMN script_test TEXT;
usr_age_upper_bound INTERVAL,
circulate BOOL NOT NULL DEFAULT TRUE, -- Hard "can't circ" flag requiring an override
duration_rule INT NOT NULL REFERENCES config.rule_circ_duration (id) DEFERRABLE INITIALLY DEFERRED,
- recurring_fine_rule INT NOT NULL REFERENCES config.rule_recuring_fine (id) DEFERRABLE INITIALLY DEFERRED,
+ recurring_fine_rule INT NOT NULL REFERENCES config.rule_recurring_fine (id) DEFERRABLE INITIALLY DEFERRED,
max_fine_rule INT NOT NULL REFERENCES config.rule_max_fine (id) DEFERRABLE INITIALLY DEFERRED,
script_test TEXT, -- javascript source
total_copy_hold_ratio FLOAT,
(7, oils_i18n_gettext(7, 'overdue_equip_max', 'crmf', 'name'), 100.00);
SELECT SETVAL('config.rule_max_fine_id_seq'::TEXT, 100);
-INSERT INTO config.rule_recuring_fine VALUES
+INSERT INTO config.rule_recurring_fine VALUES
(1, oils_i18n_gettext(1, 'default', 'crrf', 'name'), 0.50, 0.10, 0.05, '1 day');
-INSERT INTO config.rule_recuring_fine VALUES
+INSERT INTO config.rule_recurring_fine VALUES
(2, oils_i18n_gettext(2, '10_cent_per_day', 'crrf', 'name'), 0.50, 0.10, 0.10, '1 day');
-INSERT INTO config.rule_recuring_fine VALUES
+INSERT INTO config.rule_recurring_fine VALUES
(3, oils_i18n_gettext(3, '50_cent_per_day', 'crrf', 'name'), 0.50, 0.50, 0.50, '1 day');
-SELECT SETVAL('config.rule_recuring_fine_id_seq'::TEXT, 100);
+SELECT SETVAL('config.rule_recurring_fine_id_seq'::TEXT, 100);
INSERT INTO config.rule_age_hold_protect VALUES
(1, oils_i18n_gettext(1, '3month', 'crahp', 'name'), '3 months', 0);
data TEXT NOT NULL,
folder INT NOT NULL REFERENCES reporter.report_folder (id) DEFERRABLE INITIALLY DEFERRED,
recur BOOL NOT NULL DEFAULT FALSE,
- recurance INTERVAL
+ recurrence INTERVAL
);
CREATE INDEX rpt_rpt_owner_idx ON reporter.report (owner);
CREATE INDEX rpt_rpt_fldr_idx ON reporter.report (folder);
checkin_time TIMESTAMP WITH TIME ZONE,
duration INTERVAL NOT NULL,
fine_interval INTERVAL NOT NULL,
- recuring_fine NUMERIC(6,2) NOT NULL,
+ recurring_fine NUMERIC(6,2) NOT NULL,
max_fine NUMERIC(6,2) NOT NULL,
opac_renewal BOOL NOT NULL,
phone_renewal BOOL NOT NULL,
desk_renewal BOOL NOT NULL,
duration_rule TEXT NOT NULL,
- recuring_fine_rule TEXT NOT NULL,
+ recurring_fine_rule TEXT NOT NULL,
max_fine_rule TEXT NOT NULL,
stop_fines TEXT
) WITHOUT OIDS;
circ_desk_renewal BOOL,
circ_phone_renewal BOOL,
circ_self_checkout BOOL,
- circ_recuring_fine NUMERIC(6,2) NOT NULL,
+ circ_recurring_fine NUMERIC(6,2) NOT NULL,
circ_max_fine NUMERIC(6,2) NOT NULL,
circ_fine_interval INTERVAL NOT NULL,
circ_duration INTERVAL NOT NULL,
circ_due_date TIMESTAMP WITH TIME ZONE NOT NULL,
circ_duration_rule TEXT NOT NULL,
- circ_recuring_fine_rule TEXT NOT NULL,
+ circ_recurring_fine_rule TEXT NOT NULL,
circ_max_fine_rule TEXT NOT NULL,
circ_stop_fines TEXT
) WITHOUT OIDS;
circ_staff,
circ_opac_renewal,
circ_self_checkout,
- circ_recuring_fine,
+ circ_recurring_fine,
circ_max_fine,
circ_fine_interval,
circ_duration,
circ_due_date,
circ_duration_rule,
- circ_recuring_fine_rule,
+ circ_recurring_fine_rule,
circ_max_fine_rule,
circ_stop_fines,
circ_staff,
circ_opac_renewal,
circ_self_checkout,
- circ_recuring_fine,
+ circ_recurring_fine,
circ_max_fine,
circ_fine_interval,
circ_duration,
circ_due_date,
circ_duration_rule,
- circ_recuring_fine_rule,
+ circ_recurring_fine_rule,
circ_max_fine_rule,
circ_stop_fines,
circ_staff,
circ_opac_renewal,
circ_self_checkout,
- circ_recuring_fine,
+ circ_recurring_fine,
circ_max_fine,
circ_fine_interval,
circ_duration,
circ_due_date,
circ_duration_rule,
- circ_recuring_fine_rule,
+ circ_recurring_fine_rule,
circ_max_fine_rule,
circ_stop_fines,
--- /dev/null
+-- Correct the long-standing "recuring" (recurring) and "recurance" (recurrence) typos
+
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0085'); -- dbs
+
+ALTER TABLE config.rule_recuring_fine RENAME TO rule_recurring_fine;
+ALTER TABLE config.rule_recurring_fine RENAME COLUMN recurance_interval TO recurrence_interval;
+
+ALTER TABLE action.circulation RENAME COLUMN recuring_fine TO recurring_fine;
+ALTER TABLE action.circulation RENAME COLUMN recuring_fine_rule TO recurring_fine_rule;
+
+ALTER TABLE action.aged_circulation RENAME COLUMN recuring_fine TO recurring_fine;
+ALTER TABLE action.aged_circulation RENAME COLUMN recuring_fine_rule TO recurring_fine_rule;
+
+-- Might as well keep the comment in sync as well
+COMMENT ON TABLE config.rule_recurring_fine IS $$
+/*
+ * Copyright (C) 2005 Georgia Public Library Service
+ * Mike Rylander <mrylander@gmail.com>
+ *
+ * Circulation Recurring Fine rules
+ *
+ * Each circulation is given a recurring fine amount based on one of
+ * these rules. The recurrence_interval should not be any shorter
+ * than the interval between runs of the fine_processor.pl script
+ * (which is run from CRON), or you could miss fines.
+ *
+ *
+ * ****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+$$;
+
+ALTER TABLE reporter.report RENAME COLUMN recurance TO recurrence;
+
+-- You would think that CREATE OR REPLACE would be enough, but in testing
+-- PostgreSQL complained about renaming the columns in the view. So we
+-- drop the view first.
+DROP VIEW action.all_circulation;
+
+-- Now we can recreate the view successfully
+CREATE OR REPLACE VIEW action.all_circulation AS
+ SELECT id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
+ copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
+ circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, due_date,
+ stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
+ max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
+ max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ
+ FROM action.aged_circulation
+ UNION ALL
+ SELECT DISTINCT circ.id,COALESCE(a.post_code,b.post_code) AS usr_post_code, p.home_ou AS usr_home_ou, p.profile AS usr_profile, EXTRACT(YEAR FROM p.dob)::INT AS usr_birth_year,
+ cp.call_number AS copy_call_number, cp.location AS copy_location, cn.owning_lib AS copy_owning_lib, cp.circ_lib AS copy_circ_lib,
+ cn.record AS copy_bib_record, circ.xact_start, circ.xact_finish, circ.target_copy, circ.circ_lib, circ.circ_staff, circ.checkin_staff,
+ circ.checkin_lib, circ.renewal_remaining, circ.due_date, circ.stop_fines_time, circ.checkin_time, circ.create_time, circ.duration,
+ circ.fine_interval, circ.recurring_fine, circ.max_fine, circ.phone_renewal, circ.desk_renewal, circ.opac_renewal, circ.duration_rule,
+ circ.recurring_fine_rule, circ.max_fine_rule, circ.stop_fines, circ.workstation, circ.checkin_workstation, circ.checkin_scan_time,
+ circ.parent_circ
+ FROM action.circulation circ
+ JOIN asset.copy cp ON (circ.target_copy = cp.id)
+ JOIN asset.call_number cn ON (cp.call_number = cn.id)
+ JOIN actor.usr p ON (circ.usr = p.id)
+ LEFT JOIN actor.usr_address a ON (p.mailing_address = a.id)
+ LEFT JOIN actor.usr_address b ON (p.billing_address = a.id);
+
+CREATE OR REPLACE FUNCTION action.age_circ_on_delete () RETURNS TRIGGER AS $$
+DECLARE
+found char := 'N';
+BEGIN
+
+ -- If there are any renewals for this circulation, don't archive or delete
+ -- it yet. We'll do so later, when we archive and delete the renewals.
+
+ SELECT 'Y' INTO found
+ FROM action.circulation
+ WHERE parent_circ = OLD.id
+ LIMIT 1;
+
+ IF found = 'Y' THEN
+ RETURN NULL; -- don't delete
+ END IF;
+
+ -- Archive a copy of the old row to action.aged_circulation
+
+ INSERT INTO action.aged_circulation
+ (id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
+ copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
+ circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, due_date,
+ stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
+ max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
+ max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ)
+ SELECT
+ id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
+ copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
+ circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, due_date,
+ stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
+ max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
+ max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ
+ FROM action.all_circulation WHERE id = OLD.id;
+
+ RETURN OLD;
+END;
+$$ LANGUAGE 'plpgsql';
+
+-- Get the permissions right
+UPDATE permission.perm_list SET code = 'ADMIN_RECURRING_FINE_RULE' WHERE code = 'ADMIN_RECURING_FINE_RULE';
+
+-- Let's not break existing reports
+UPDATE reporter.template SET data = REGEXP_REPLACE(data, E'^(.*)recuring(.*)$', E'\\1recurring\\2') WHERE data LIKE '%recuring%';
+UPDATE reporter.template SET data = REGEXP_REPLACE(data, E'^(.*)recurance(.*)$', E'\\1recurrence\\2') WHERE data LIKE '%recurance%';
+
+COMMIT;
print "Duration [".$rule_set->duration_rule->name."] = $dur\n";
print "Recurring fines [".$rule_set->recurring_fine_rule->name."; interval='".
- $rule_set->recurring_fine_rule->recurance_interval."'] = \$$recf\n";
+ $rule_set->recurring_fine_rule->recurrence_interval."'] = \$$recf\n";
print "Max fine [".$rule_set->max_fine_rule->name."] = \$".$rule_set->max_fine_rule->amount."\n";
print "took: $rundur\n";
'template',
'create_time',
'recur',
- 'recurance',
+ 'recurrence',
'owner',
]
},
report.name( DOM.oils_rpt_report_editor_name.value );
report.description( DOM.oils_rpt_report_editor_desc.value );
report.recur(this.paramEditor.recur());
- report.recurance(this.paramEditor.recurInterval());
+ report.recurrence(this.paramEditor.recurInterval());
/* collect the param data */
set("max_fine_rule", '');
set("opac_renewal", '');
set("phone_renewal", '');
- set("recuring_fine", '');
- set("recuring_fine_rule", '');
+ set("recurring_fine", '');
+ set("recurring_fine_rule", '');
set("renewal_remaining", '');
set("stop_fines", '');
set("stop_fines_time", '');
set("opac_renewal", details.circ.opac_renewal());
set("phone_renewal", details.circ.phone_renewal());
set("renewal_type", renewal_composite_kludge(details.circ));
- set("recuring_fine", details.circ.recuring_fine());
- set("recuring_fine_rule", details.circ.recuring_fine_rule());
+ set("recurring_fine", details.circ.recurring_fine());
+ set("recurring_fine_rule", details.circ.recurring_fine_rule());
set("renewal_remaining", details.circ.renewal_remaining());
set("stop_fines", details.circ.stop_fines());
set("stop_fines_time", details.circ.stop_fines_time());
<!ENTITY field.rodcirc.duration.label "Quisque pharetra">
<!ENTITY field.aws.name.label "lectus vitae aliquam">
<!ENTITY class.auoi.label "venenatis, mi nisl">
-<!ENTITY field.rodcirc.recuring_fine_rule.label "suscipit sapien, eu sollicitudin">
+<!ENTITY field.rodcirc.recurring_fine_rule.label "suscipit sapien, eu sollicitudin">
<!ENTITY field.rodcirc.duration_rule.label "neque dolor a nulla">
<!ENTITY field.auoi.id.label "Phasellus aliquam vulputate justo">
<!ENTITY field.rodcirc.payment_total.label "Proin augue libero">
<!ENTITY field.rodcirc.max_fine_rule.label "ultricies quam">
<!ENTITY field.rodcirc.xact_start.label "lacinia accumsan">
<!ENTITY field.rodcirc.billable_transaction.label "Nullam imperdiet">
-<!ENTITY field.rodcirc.recuring_fine.label "tincidunt mauris">
+<!ENTITY field.rodcirc.recurring_fine.label "tincidunt mauris">
<!ENTITY field.auoi.staff.label "Staff Member">
<!ENTITY field.aws.id.label "Workstation ID">
<!ENTITY field.rodcirc.usr.label "Mauris ac diam">
<field reporter:label="Max Fine Rule" name="max_fine_rule" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="link"/>
<field reporter:label="OPAC Renewal" name="opac_renewal" oils_obj:array_position="16" oils_persist:virtual="false" reporter:datatype="bool"/>
<field reporter:label="Phone Renewal" name="phone_renewal" oils_obj:array_position="17" oils_persist:virtual="false" reporter:datatype="bool"/>
- <field reporter:label="Recurring Fine Amount" name="recuring_fine" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="money" />
- <field reporter:label="Recurring Fine Rule" name="recuring_fine_rule" oils_obj:array_position="19" oils_persist:virtual="false" reporter:datatype="link"/>
+ <field reporter:label="Recurring Fine Amount" name="recurring_fine" oils_obj:array_position="18" oils_persist:virtual="false" reporter:datatype="money" />
+ <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" oils_obj:array_position="19" oils_persist:virtual="false" reporter:datatype="link"/>
<field reporter:label="Remaining Renewals" name="renewal_remaining" oils_obj:array_position="20" oils_persist:virtual="false" reporter:datatype="int" />
<field reporter:label="Fine Stop Reason" name="stop_fines" oils_obj:array_position="21" oils_persist:virtual="false" reporter:datatype="text"/>
<field reporter:label="Fine Stop Date/Time" name="stop_fines_time" oils_obj:array_position="22" oils_persist:virtual="false" reporter:datatype="timestamp"/>
<link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
<link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
<link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
- <link field="recuring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
+ <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
<link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
<link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
<link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
<field reporter:label='&field.rodcirc.max_fine_rule.label;' oils_persist:virtual='false' name='max_fine_rule' reporter:datatype='link' oils_obj:array_position='15' />
<field reporter:label='&field.rodcirc.opac_renewal.label;' oils_persist:virtual='false' name='opac_renewal' reporter:datatype='bool' oils_obj:array_position='16' />
<field reporter:label='&field.rodcirc.phone_renewal.label;' oils_persist:virtual='false' name='phone_renewal' reporter:datatype='bool' oils_obj:array_position='17' />
- <field reporter:label='&field.rodcirc.recuring_fine.label;' oils_persist:virtual='false' name='recuring_fine' reporter:datatype='money' oils_obj:array_position='18' />
- <field reporter:label='&field.rodcirc.recuring_fine_rule.label;' oils_persist:virtual='false' name='recuring_fine_rule' reporter:datatype='link' oils_obj:array_position='19' />
+ <field reporter:label='&field.rodcirc.recurring_fine.label;' oils_persist:virtual='false' name='recurring_fine' reporter:datatype='money' oils_obj:array_position='18' />
+ <field reporter:label='&field.rodcirc.recurring_fine_rule.label;' oils_persist:virtual='false' name='recurring_fine_rule' reporter:datatype='link' oils_obj:array_position='19' />
<field reporter:label='&field.rodcirc.renewal_remaining.label;' oils_persist:virtual='false' name='renewal_remaining' reporter:datatype='int' oils_obj:array_position='20' />
<field reporter:label='&field.rodcirc.stop_fines.label;' oils_persist:virtual='false' name='stop_fines' reporter:datatype='text' oils_obj:array_position='21' />
<field reporter:label='&field.rodcirc.stop_fines_time.label;' oils_persist:virtual='false' name='stop_fines_time' reporter:datatype='timestamp' oils_obj:array_position='22' />
<link field='billings' reltype='has_many' class='mb' key='xact' map='' />
<link field='duration_rule' reltype='has_a' class='crcd' key='name' map='' />
<link field='max_fine_rule' reltype='has_a' class='crmf' key='name' map='' />
- <link field='recuring_fine_rule' reltype='has_a' class='crrf' key='name' map='' />
+ <link field='recurring_fine_rule' reltype='has_a' class='crrf' key='name' map='' />
<link field='circ_type' reltype='might_have' class='rcirct' key='id' map='' />
<link field='billing_total' reltype='might_have' class='rxbt' key='xact' map='' />
<link field='payment_total' reltype='might_have' class='rxpt' key='xact' map='' />
</links>
</class>
-</IDL>
\ No newline at end of file
+</IDL>