From: miker Date: Wed, 4 Aug 2010 20:36:10 +0000 (+0000) Subject: allow ACQ-driven ordering and claiming of serial items X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bd208e78bdbdd1d73f6e0227d3d6dbea7e8b4aff;p=evergreen%2Fbjwebb.git allow ACQ-driven ordering and claiming of serial items git-svn-id: svn://svn.open-ils.org/ILS/trunk@17080 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index bb4fd5836..3ee30f52f 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -3238,7 +3238,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - @@ -3269,14 +3268,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + - - - + @@ -4216,7 +4217,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - @@ -4248,11 +4248,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + @@ -5167,6 +5169,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + @@ -5879,6 +5882,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + @@ -6728,6 +6732,38 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 92e899571..4a79a63a8 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -68,7 +68,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0359'); -- Scott McKellar +INSERT INTO config.upgrade_log (version) VALUES ('0360'); -- miker CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/040.schema.asset.sql b/Open-ILS/src/sql/Pg/040.schema.asset.sql index 5e34d0d6d..7a4d23e67 100644 --- a/Open-ILS/src/sql/Pg/040.schema.asset.sql +++ b/Open-ILS/src/sql/Pg/040.schema.asset.sql @@ -78,7 +78,8 @@ CREATE TABLE asset.copy ( floating BOOL NOT NULL DEFAULT FALSE, dummy_isbn TEXT, status_changed_time TIMESTAMP WITH TIME ZONE, - mint_condition BOOL NOT NULL DEFAULT TRUE + mint_condition BOOL NOT NULL DEFAULT TRUE, + cost NUMERIC(8,2) ); CREATE UNIQUE INDEX copy_barcode_key ON asset.copy (barcode) WHERE deleted = FALSE OR deleted IS FALSE; CREATE INDEX cp_cn_idx ON asset.copy (call_number); diff --git a/Open-ILS/src/sql/Pg/200.schema.acq.sql b/Open-ILS/src/sql/Pg/200.schema.acq.sql index 289cd793b..18c0b65cc 100644 --- a/Open-ILS/src/sql/Pg/200.schema.acq.sql +++ b/Open-ILS/src/sql/Pg/200.schema.acq.sql @@ -880,7 +880,8 @@ CREATE TABLE acq.po_item ( note TEXT, estimated_cost NUMERIC(8,2), fund INT REFERENCES acq.fund (id) - DEFERRABLE INITIALLY DEFERRED + DEFERRABLE INITIALLY DEFERRED, + target BIGINT ); CREATE TABLE acq.invoice_item ( -- for invoice-only debits: taxes/fees/non-bib items/etc @@ -898,7 +899,8 @@ CREATE TABLE acq.invoice_item ( -- for invoice-only debits: taxes/fees/non-bib i DEFERRABLE INITIALLY DEFERRED, amount_paid NUMERIC (8,2), po_item INT REFERENCES acq.po_item (id) - DEFERRABLE INITIALLY DEFERRED + DEFERRABLE INITIALLY DEFERRED, + target BIGINT ); -- Patron requests @@ -2622,4 +2624,29 @@ CREATE TABLE acq.claim_event ( CREATE INDEX claim_event_claim_date_idx ON acq.claim_event( claim, event_date ); +-- And the serials version of claiming +CREATE TABLE acq.serial_claim ( + id SERIAL PRIMARY KEY, + type INT NOT NULL REFERENCES acq.claim_type + DEFERRABLE INITIALLY DEFERRED, + item BIGINT NOT NULL REFERENCES serial.item + DEFERRABLE INITIALLY DEFERRED +); + +CREATE INDEX serial_claim_lid_idx ON acq.serial_claim( item ); + +CREATE TABLE acq.serial_claim_event ( + id BIGSERIAL PRIMARY KEY, + type INT NOT NULL REFERENCES acq.claim_event_type + DEFERRABLE INITIALLY DEFERRED, + claim SERIAL NOT NULL REFERENCES acq.serial_claim + DEFERRABLE INITIALLY DEFERRED, + event_date TIMESTAMPTZ NOT NULL DEFAULT now(), + creator INT NOT NULL REFERENCES actor.usr + DEFERRABLE INITIALLY DEFERRED, + note TEXT +); + +CREATE INDEX serial_claim_event_claim_date_idx ON acq.serial_claim_event( claim, event_date ); + COMMIT; diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 6b45300c2..11eaac2fc 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -5569,6 +5569,7 @@ INSERT INTO acq.invoice_item_type (code,name) VALUES ('PRO',oils_i18n_gettext('P INSERT INTO acq.invoice_item_type (code,name) VALUES ('SHP',oils_i18n_gettext('SHP', 'Shipping Charge', 'aiit', 'name')); INSERT INTO acq.invoice_item_type (code,name) VALUES ('HND',oils_i18n_gettext('HND', 'Handling Charge', 'aiit', 'name')); INSERT INTO acq.invoice_item_type (code,name) VALUES ('ITM',oils_i18n_gettext('ITM', 'Non-library Item', 'aiit', 'name')); +INSERT INTO acq.invoice_item_type (code,name) VALUES ('SUB',oils_i18n_gettext('SUB', 'Searial Subscription', 'aiit', 'name')); INSERT INTO acq.invoice_method (code,name) VALUES ('EDI',oils_i18n_gettext('EDI', 'EDI', 'acqim', 'name')); INSERT INTO acq.invoice_method (code,name) VALUES ('PPR',oils_i18n_gettext('PPR', 'Paper', 'acqit', 'name')); diff --git a/Open-ILS/src/sql/Pg/upgrade/0360.schema.acq-serials-integration.sql b/Open-ILS/src/sql/Pg/upgrade/0360.schema.acq-serials-integration.sql new file mode 100644 index 000000000..548593c23 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0360.schema.acq-serials-integration.sql @@ -0,0 +1,36 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0360'); -- miker + +INSERT INTO acq.invoice_item_type (code,name) VALUES ('SUB',oils_i18n_gettext('SUB', 'Searial Subscription', 'aiit', 'name')); + +ALTER TABLE acq.po_item ADD COLUMN target BIGINT; +ALTER TABLE acq.invoice_item ADD COLUMN target BIGINT; +ALTER TABLE asset.copy ADD COLUMN cost NUMERIC(8,2); + +CREATE TABLE acq.serial_claim ( + id SERIAL PRIMARY KEY, + type INT NOT NULL REFERENCES acq.claim_type + DEFERRABLE INITIALLY DEFERRED, + item BIGINT NOT NULL REFERENCES serial.item + DEFERRABLE INITIALLY DEFERRED +); + +CREATE INDEX serial_claim_lid_idx ON acq.serial_claim( item ); + +CREATE TABLE acq.serial_claim_event ( + id BIGSERIAL PRIMARY KEY, + type INT NOT NULL REFERENCES acq.claim_event_type + DEFERRABLE INITIALLY DEFERRED, + claim SERIAL NOT NULL REFERENCES acq.serial_claim + DEFERRABLE INITIALLY DEFERRED, + event_date TIMESTAMPTZ NOT NULL DEFAULT now(), + creator INT NOT NULL REFERENCES actor.usr + DEFERRABLE INITIALLY DEFERRED, + note TEXT +); + +CREATE INDEX serial_claim_event_claim_date_idx ON acq.serial_claim_event( claim, event_date ); + +COMMIT; +