updating views
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 16:12:29 +0000 (16:12 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 16:12:29 +0000 (16:12 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1484 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/090.schema.action.sql

index 457a8ff..e04a2b2 100644 (file)
@@ -71,17 +71,17 @@ CREATE TABLE action.circulation (
 ) 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
+CREATE OR REPLACE 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')
+                       stop_fines NOT IN ('CHECKIN','RENEW')
                )
          ORDER BY due_date;
                
 
-CREATE OR REPLACE VIEW action.open_cirulations AS
+CREATE OR REPLACE VIEW action.billable_cirulations AS
        SELECT  *
          FROM  action.circulation
          WHERE xact_finish IS NULL;
@@ -94,9 +94,6 @@ BEGIN
        IF NEW.stop_fines <> OLD.stop_fines AND NEW.stop_fines = 'LOST' THEN
                UPDATE asset.copy SET status = 3 WHERE id = NEW.target_copy;
        END IF;
-       IF NEW.stop_fines <> OLD.stop_fines AND NEW.stop_fines = 'MISSING' THEN
-               UPDATE asset.copy SET status = 4 WHERE id = NEW.target_copy;
-       END IF;
        RETURN NEW;
 END;
 $$ LANGUAGE 'plpgsql';