[open-ils-commits] r16337 - in trunk/Open-ILS: examples src/sql/Pg src/sql/Pg/upgrade (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Apr 28 15:28:50 EDT 2010
Author: scottmk
Date: 2010-04-28 15:28:45 -0400 (Wed, 28 Apr 2010)
New Revision: 16337
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0243.schema.acq-inv-item-po-item.sql
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
Log:
Add a po_item column, pointing to acq.po_item, to acq.invoice_item.
M Open-ILS/src/sql/Pg/200.schema.acq.sql
M Open-ILS/src/sql/Pg/002.schema.config.sql
A Open-ILS/src/sql/Pg/upgrade/0243.schema.acq-inv-item-po-item.sql
M Open-ILS/examples/fm_IDL.xml
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-04-28 18:34:23 UTC (rev 16336)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-04-28 19:28:45 UTC (rev 16337)
@@ -4731,6 +4731,7 @@
<field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
<field reporter:label="Fund" name="fund" reporter:datatype="link" />
<field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
+ <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
</fields>
<links>
<link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
@@ -4738,6 +4739,7 @@
<link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
<link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
<link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
+ <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-04-28 18:34:23 UTC (rev 16336)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-04-28 19:28:45 UTC (rev 16337)
@@ -60,7 +60,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0242'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0243'); -- Scott McKellar
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-04-28 18:34:23 UTC (rev 16336)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-04-28 19:28:45 UTC (rev 16337)
@@ -828,22 +828,6 @@
prorate BOOL NOT NULL DEFAULT FALSE
);
-CREATE TABLE acq.invoice_item ( -- for invoice-only debits: taxes/fees/non-bib items/etc
- id SERIAL PRIMARY KEY,
- invoice INT NOT NULL REFERENCES acq.invoice (id) ON UPDATE CASCADE ON DELETE CASCADE,
- purchase_order INT REFERENCES acq.purchase_order (id) ON UPDATE CASCADE ON DELETE SET NULL,
- fund_debit INT REFERENCES acq.fund_debit (id),
- inv_item_type TEXT NOT NULL REFERENCES acq.invoice_item_type (code),
- title TEXT,
- author TEXT,
- note TEXT,
- cost_billed NUMERIC(8,2),
- actual_cost NUMERIC(8,2),
- fund INT REFERENCES acq.fund (id)
- DEFERRABLE INITIALLY DEFERRED,
- amount_paid NUMERIC (8,2)
-);
-
CREATE TABLE acq.po_item (
id SERIAL PRIMARY KEY,
purchase_order INT REFERENCES acq.purchase_order (id)
@@ -862,6 +846,24 @@
DEFERRABLE INITIALLY DEFERRED
);
+CREATE TABLE acq.invoice_item ( -- for invoice-only debits: taxes/fees/non-bib items/etc
+ id SERIAL PRIMARY KEY,
+ invoice INT NOT NULL REFERENCES acq.invoice (id) ON UPDATE CASCADE ON DELETE CASCADE,
+ purchase_order INT REFERENCES acq.purchase_order (id) ON UPDATE CASCADE ON DELETE SET NULL,
+ fund_debit INT REFERENCES acq.fund_debit (id),
+ inv_item_type TEXT NOT NULL REFERENCES acq.invoice_item_type (code),
+ title TEXT,
+ author TEXT,
+ note TEXT,
+ cost_billed NUMERIC(8,2),
+ actual_cost NUMERIC(8,2),
+ fund INT REFERENCES acq.fund (id)
+ DEFERRABLE INITIALLY DEFERRED,
+ amount_paid NUMERIC (8,2),
+ po_item INT REFERENCES acq.po_item (id)
+ DEFERRABLE INITIALLY DEFERRED
+);
+
-- Patron requests
CREATE TABLE acq.user_request_type (
id SERIAL PRIMARY KEY,
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0243.schema.acq-inv-item-po-item.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0243.schema.acq-inv-item-po-item.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0243.schema.acq-inv-item-po-item.sql 2010-04-28 19:28:45 UTC (rev 16337)
@@ -0,0 +1,9 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0243'); -- Scott McKellar
+
+ALTER TABLE acq.invoice_item
+ ADD COLUMN po_item INT REFERENCES acq.po_item (id)
+ DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;
More information about the open-ils-commits
mailing list