[open-ils-commits] r16179 - 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
Thu Apr 8 17:06:37 EDT 2010
Author: scottmk
Date: 2010-04-08 17:06:31 -0400 (Thu, 08 Apr 2010)
New Revision: 16179
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0230.schema.acq-inv-pmt-method.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 three columns to acq.invoice, plus a
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
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-04-08 20:58:50 UTC (rev 16178)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-04-08 21:06:31 UTC (rev 16179)
@@ -4623,6 +4623,15 @@
</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 @@
<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 @@
<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>
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-04-08 20:58:50 UTC (rev 16178)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-04-08 21:06:31 UTC (rev 16179)
@@ -60,7 +60,7 @@
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,
Modified: trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-04-08 20:58:50 UTC (rev 16178)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-04-08 21:06:31 UTC (rev 16179)
@@ -785,6 +785,11 @@
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 @@
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 (
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0230.schema.acq-inv-pmt-method.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0230.schema.acq-inv-pmt-method.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0230.schema.acq-inv-pmt-method.sql 2010-04-08 21:06:31 UTC (rev 16179)
@@ -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;
More information about the open-ils-commits
mailing list