[open-ils-commits] r14540 - in trunk/Open-ILS/src: perlmods/OpenILS perlmods/OpenILS/Application/Circ sql/Pg sql/Pg/upgrade (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Oct 21 15:08:47 EDT 2009
Author: erickson
Date: 2009-10-21 15:08:43 -0400 (Wed, 21 Oct 2009)
New Revision: 14540
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0044.data.org-setting-claim-nocheckout-missing.sql
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
trunk/Open-ILS/src/perlmods/OpenILS/Const.pm
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
Log:
Added support for claims-never-checked-out checkin mode. It does this:
1. sets the checkin backdate equal to the xact_start time to void any possible overdue fines
2. increments the patrons claims_never_checked_out count by 1
3. the copy does not capture any holds or go into transit
4. the copy is optionally marked as MISSING, based on org unit setting
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2009-10-21 18:13:24 UTC (rev 14539)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2009-10-21 19:08:43 UTC (rev 14540)
@@ -174,6 +174,7 @@
# --------------------------------------------------------------------------
$circulator->is_renewal(1) if $api =~ /renew/;
$circulator->is_checkin(1) if $api =~ /checkin/;
+ $circulator->noop if $circulator->claims_never_checked_out;
if($legacy_script_support and not $circulator->is_checkin) {
$circulator->mk_script_runner();
@@ -407,6 +408,7 @@
void_overdues
parent_circ
return_patron
+ claims_never_checked_out
/;
@@ -1893,7 +1895,17 @@
}
}
- $self->reshelve_copy;
+ if($self->claims_never_checked_out and
+ $U->ou_ancestor_setting_value($self->circ->circ_lib, 'circ.claim_never_checked_out.mark_missing')) {
+
+ # the item was not supposed to be checked out to the user and should now be marked as missing
+ $self->copy->status(OILS_COPY_STATUS_MISSING);
+ $self->update_copy;
+
+ } else {
+ $self->reshelve_copy;
+ }
+
return if $self->bail_out;
unless($self->checkin_changed) {
@@ -2277,6 +2289,18 @@
my $evt;
my $obt;
+ if($self->claims_never_checked_out) {
+
+ # backdate to void any fines accrued on the circ
+ $self->backdate($circ->xact_start);
+
+ # update the patrons never-checked-out count
+ $self->patron->claims_never_checked_out_count(
+ $self->patron->claims_never_checked_out_count + 1);
+ $self->editor->update_actor_user($self->patron) or
+ $self->bail_on_events($self->editor->event);
+ }
+
# backdate the circ if necessary
if($self->backdate) {
$self->checkin_handle_backdate;
@@ -2292,7 +2316,8 @@
if(!$circ->stop_fines) {
$circ->stop_fines(OILS_STOP_FINES_CHECKIN);
$circ->stop_fines(OILS_STOP_FINES_RENEW) if $self->is_renewal;
- $circ->stop_fines_time('now') unless $self->backdate;
+ $circ->stop_fines(OILS_STOP_FINES_CLAIMS_NEVERCHECKEDOUT) if $self->claims_never_checked_out;
+ $circ->stop_fines_time('now');
$circ->stop_fines_time($self->backdate) if $self->backdate;
}
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Const.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Const.pm 2009-10-21 18:13:24 UTC (rev 14539)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Const.pm 2009-10-21 19:08:43 UTC (rev 14540)
@@ -67,6 +67,7 @@
econst OILS_STOP_FINES_CLAIMSRETURNED => 'CLAIMSRETURNED';
econst OILS_STOP_FINES_LONGOVERDUE => 'LONGOVERDUE';
econst OILS_STOP_FINES_MAX_FINES => 'MAXFINES';
+econst OILS_STOP_FINES_CLAIMS_NEVERCHECKEDOUT => 'CLAIMSNEVERCHECKEDOUT';
econst OILS_UNLIMITED_CIRC_DURATION => 'unlimited';
# ---------------------------------------------------------------------
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-10-21 18:13:24 UTC (rev 14539)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-10-21 19:08:43 UTC (rev 14540)
@@ -51,7 +51,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0043'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0044'); -- berick
CREATE TABLE config.bib_source (
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2009-10-21 18:13:24 UTC (rev 14539)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2009-10-21 19:08:43 UTC (rev 14540)
@@ -2265,3 +2265,13 @@
'bool'
);
+-- claims never checked out mark item missing
+INSERT INTO
+ config.org_unit_setting_type ( name, label, description, datatype )
+ VALUES (
+ 'circ.claim_never_checked_out.mark_missing',
+ 'Claim Never Checked Out: Mark copy as missing',
+ 'When a circ is marked as claims-never-checked-out, mark the copy as missing',
+ 'bool'
+ );
+
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0044.data.org-setting-claim-nocheckout-missing.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0044.data.org-setting-claim-nocheckout-missing.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0044.data.org-setting-claim-nocheckout-missing.sql 2009-10-21 19:08:43 UTC (rev 14540)
@@ -0,0 +1,15 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0044');
+
+INSERT INTO
+ config.org_unit_setting_type ( name, label, description, datatype )
+ VALUES (
+ 'circ.claim_never_checked_out.mark_missing',
+ 'Claim Never Checked Out: Mark copy as missing',
+ 'When a circ is marked as claims-never-checked-out, mark the copy as missing',
+ 'bool'
+ );
+
+
+COMMIT;
More information about the open-ils-commits
mailing list