From: Galen Charlton Date: Wed, 2 Dec 2015 21:08:34 +0000 (-0500) Subject: fix some typos, syntax errors, and stray invisible characters X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0455bab25269aa4e6dfd6d31576cc7f776ef5486;p=working%2FEvergreen.git fix some typos, syntax errors, and stray invisible characters Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql index d949db84eb..3792ff99c1 100644 --- a/Open-ILS/src/sql/Pg/040.schema.asset.sql +++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql @@ -988,27 +988,27 @@ CREATE INDEX asset_copy_tag_copy_map_copy_idx CREATE INDEX asset_copy_tag_copy_map_tag_idx ON asset.copy_tag_copy_map (tag); -CREATE OR REPLACE FUNCTION asset.copy_state  (cid BIGINT) RETURNS TEXT AS $$ +CREATE OR REPLACE FUNCTION asset.copy_state (cid BIGINT) RETURNS TEXT AS $$ DECLARE last_circ_stop TEXT; the_copy asset.copy%ROWTYPE; BEGIN SELECT * INTO the_copy FROM asset.copy WHERE id = cid; - RETURN NULL WHEN NOT FOUND; + IF NOT FOUND THEN RETURN NULL; END IF; IF the_copy.status = 3 THEN -- Lost RETURN 'LOST'; - ELIF the_copy.status = 4 THEN -- Missing + ELSIF the_copy.status = 4 THEN -- Missing RETURN 'MISSING'; - ELIF the_copy.status = 14 THEN -- Damaged + ELSIF the_copy.status = 14 THEN -- Damaged RETURN 'DAMAGED'; - END; + END IF; - SELECT stop_fines INTO last_circ_stop -  FROM action.circulation -  WHERE target_copy = cid -  ORDER BY xact_start DESC LIMIT 1; + SELECT stop_fines INTO last_circ_stop + FROM action.circulation + WHERE target_copy = cid + ORDER BY xact_start DESC LIMIT 1; IF FOUND THEN IF last_circ_stop IN ( @@ -1017,8 +1017,8 @@ BEGIN 'LONGOVERDUE' ) THEN RETURN last_circ_stop; - END; - END; + END IF; + END IF; RETURN 'NORMAL'; END; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql index bb67c0c54d..054e365480 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql @@ -1,26 +1,26 @@ BEGIN; -CREATE OR REPLACE FUNCTION asset.copy_state  (cid BIGINT) RETURNS TEXT AS $$ +CREATE OR REPLACE FUNCTION asset.copy_state (cid BIGINT) RETURNS TEXT AS $$ DECLARE last_circ_stop TEXT; the_copy asset.copy%ROWTYPE; BEGIN SELECT * INTO the_copy FROM asset.copy WHERE id = cid; - RETURN NULL WHEN NOT FOUND; + IF NOT FOUND THEN RETURN NULL; END IF; IF the_copy.status = 3 THEN -- Lost RETURN 'LOST'; - ELIF the_copy.status = 4 THEN -- Missing + ELSIF the_copy.status = 4 THEN -- Missing RETURN 'MISSING'; - ELIF the_copy.status = 14 THEN -- Damaged + ELSIF the_copy.status = 14 THEN -- Damaged RETURN 'DAMAGED'; - END; + END IF; - SELECT stop_fines INTO last_circ_stop -  FROM action.circulation -  WHERE target_copy = cid -  ORDER BY xact_start DESC LIMIT 1; + SELECT stop_fines INTO last_circ_stop + FROM action.circulation + WHERE target_copy = cid + ORDER BY xact_start DESC LIMIT 1; IF FOUND THEN IF last_circ_stop IN ( @@ -29,8 +29,8 @@ BEGIN 'LONGOVERDUE' ) THEN RETURN last_circ_stop; - END; - END; + END IF; + END IF; RETURN 'NORMAL'; END;