Add fund column to acq.invoice_item.
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 7 Apr 2010 19:40:36 +0000 (19:40 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 7 Apr 2010 19:40:36 +0000 (19:40 +0000)
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/0229.schema.acq-inv-item-fund.sql
M    Open-ILS/examples/fm_IDL.xml

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16160 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/200.schema.acq.sql
Open-ILS/src/sql/Pg/upgrade/0229.schema.acq-inv-item-fund.sql [new file with mode: 0644]

index 9294d40..cadcf1f 100644 (file)
@@ -4702,12 +4702,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Note" name="note" reporter:datatype="text" />
                        <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
                        <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
                        <field reporter:label="Note" name="note" reporter:datatype="text" />
                        <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
                        <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
+                       <field reporter:label="Fund" name="fund" reporter:datatype="link" />
                </fields>
                <links>
                        <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
                        <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
                        <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"/>
                </fields>
                <links>
                        <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
                        <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
                        <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"/>
                </links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
             <actions>
                </links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
             <actions>
index 753412b..e2ee3a9 100644 (file)
@@ -60,7 +60,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0228'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0229'); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index ad78809..42414f3 100644 (file)
@@ -825,7 +825,9 @@ CREATE TABLE acq.invoice_item ( -- for invoice-only debits: taxes/fees/non-bib i
     author          TEXT,
     note            TEXT,
     cost_billed     NUMERIC(8,2),
     author          TEXT,
     note            TEXT,
     cost_billed     NUMERIC(8,2),
-    actual_cost     NUMERIC(8,2)
+    actual_cost     NUMERIC(8,2),
+       fund            INT         REFERENCES acq.fund (id)
+                                   DEFERRABLE INITIALLY DEFERRED
 );
 
 -- Patron requests
 );
 
 -- Patron requests
diff --git a/Open-ILS/src/sql/Pg/upgrade/0229.schema.acq-inv-item-fund.sql b/Open-ILS/src/sql/Pg/upgrade/0229.schema.acq-inv-item-fund.sql
new file mode 100644 (file)
index 0000000..7bf3714
--- /dev/null
@@ -0,0 +1,10 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0229'); -- Scott McKellar
+
+ALTER TABLE acq.invoice_item
+       ADD COLUMN FUND INT
+               REFERENCES acq.fund (id)
+               DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;