#-------------------------------------------------------------------------------
+package action::open_circulation;
+use base qw/action/;
+__PACKAGE__->table('action_open_circulation');
+__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
+ max_fine max_fine_rule fine_interval
+ stop_fines xact_finish due_date renewal/);
+
+#-------------------------------------------------------------------------------
+
package action::hold_request;
use base qw/action/;
__PACKAGE__->table('action_hold_request');
action::circulation->sequence( 'money.billable_xact_id_seq' );
#---------------------------------------------------------------------
+ package action::open_circulation;
+
+ action::open_circulation->table( 'action.open_circulation' );
+
+ #---------------------------------------------------------------------
package action::survey;
action::survey->table( 'action.survey' );
'Fieldmapper::action::survey_response' => { hint => 'asvr' },
'Fieldmapper::action::circulation' => { hint => 'circ',
proto_fields => {} },
+
+ 'Fieldmapper::action::open_circulation' => { hint => 'aoc',
+ readonly => 1 },
+
'Fieldmapper::actor::user' => { hint => 'au',
proto_fields => { cards => 1,
survey_responses => 1,
max_fine NUMERIC(6,2) NOT NULL, -- derived from "max fine" rule
fine_interval INTERVAL NOT NULL DEFAULT '1 day'::INTERVAL, -- derived from "circ fine" rule
due_date TIMESTAMP WITH TIME ZONE NOT NULL,
- stop_fines TEXT CHECK (stop_fines IN ('CHECKIN','CLAIMSRETURNED','LOST','MAXFINES','RENEW'))
+ stop_fines TEXT CHECK (stop_fines IN ('CHECKIN','CLAIMSRETURNED','LOST','MAXFINES','RENEW','LONGOVERDUE'))
) INHERITS (money.billable_xact);
CREATE INDEX circ_open_xacts_idx ON action.circulation (usr) WHERE xact_finish IS NULL;
+CREATE VIEW action.open_circulation AS
+ SELECT *
+ FROM action.circulation
+ WHERE xact_finish IS NULL
+ AND ( stop_fines IS NULL OR
+ stop_fines IN ('CLAIMSRETURNED','MAXFINES','LONGOVERDUE')
+ )
+ ORDER BY due_date;
+
+
CREATE OR REPLACE VIEW action.open_cirulations AS
SELECT *
FROM action.circulation