Add three columns to acq.invoice, plus a
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Apr 2010 21:06:31 +0000 (21:06 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Apr 2010 21:06:31 +0000 (21:06 +0000)
new table acq.invoice_payment_method.

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/0230.schema.acq-inv-pmt-method.sql
M    Open-ILS/examples/fm_IDL.xml

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16179 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/0230.schema.acq-inv-pmt-method.sql [new file with mode: 0644]

index 18661d7..57914ad 100644 (file)
@@ -4623,6 +4623,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                </links>
        </class>
 
+       <class id="acqipm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_payment_method" oils_persist:tablename="acq.invoice_payment_method" reporter:label="Invoice Payment Method">
+               <fields oils_persist:primary="code">
+                       <field reporter:label="Code" name="code" reporter:datatype="id"/>
+                       <field reporter:label="Name" name="name" reporter:datatype="text"/>
+               </fields>
+               <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+               </permacrud>
+       </class>
+
        <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
                <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
                        <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
@@ -4633,6 +4642,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
                        <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
                        <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
+                       <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
+                       <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
+                       <field reporter:label="Note" name="note" reporter:datatype="text" />
                        <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
                        <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
                </fields>
@@ -4641,6 +4653,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
                        <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
                        <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
+                       <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
                        <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
                        <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
                </links>
index e2ee3a9..c604289 100644 (file)
@@ -60,7 +60,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0229'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0230'); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index 42414f3..16f865b 100644 (file)
@@ -785,6 +785,11 @@ CREATE TABLE acq.invoice_method (
     name    TEXT    NOT NULL -- i18n-ize
 );
 
+CREATE TABLE acq.invoice_payment_method (
+    code    TEXT    PRIMARY KEY,
+    name    TEXT    NOT NULL -- i18n-ize
+);
+
 CREATE TABLE acq.invoice (
     id          SERIAL      PRIMARY KEY,
     receiver    INT         NOT NULL REFERENCES actor.org_unit (id),
@@ -793,7 +798,11 @@ CREATE TABLE acq.invoice (
     recv_date   TIMESTAMPTZ NOT NULL DEFAULT NOW(),
     recv_method TEXT        NOT NULL REFERENCES acq.invoice_method (code) DEFAULT 'EDI',
     inv_type    TEXT,       -- A "type" field is desired, but no idea what goes here
-    inv_ident   TEXT        NOT NULL -- vendor-supplied invoice id/number
+    inv_ident   TEXT        NOT NULL, -- vendor-supplied invoice id/number
+       payment_auth TEXT,
+       payment_method TEXT     REFERENCES acq.invoice_payment_method (code)
+                               DEFERRABLE INITIALLY DEFERRED,
+       note        TEXT
 );
 
 CREATE TABLE acq.invoice_entry (
diff --git a/Open-ILS/src/sql/Pg/upgrade/0230.schema.acq-inv-pmt-method.sql b/Open-ILS/src/sql/Pg/upgrade/0230.schema.acq-inv-pmt-method.sql
new file mode 100644 (file)
index 0000000..0a2c21b
--- /dev/null
@@ -0,0 +1,21 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0230'); -- Scott McKellar
+
+CREATE TABLE acq.invoice_payment_method (
+       code      TEXT     PRIMARY KEY,
+       name      TEXT     NOT NULL
+);
+
+ALTER TABLE acq.invoice
+       ADD COLUMN payment_auth TEXT;
+
+ALTER TABLE acq.invoice
+       ADD COLUMN payment_method TEXT
+               REFERENCES acq.invoice_payment_method (code)
+               DEFERRABLE INITIALLY DEFERRED;
+
+ALTER TABLE acq.invoice
+       ADD COLUMN note TEXT;
+
+COMMIT;