[open-ils-commits] r8534 - in branches/acq-experiment/Open-ILS:
examples src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jan 30 11:30:09 EST 2008
Author: miker
Date: 2008-01-30 11:02:39 -0500 (Wed, 30 Jan 2008)
New Revision: 8534
Modified:
branches/acq-experiment/Open-ILS/examples/fm_IDL.xml
branches/acq-experiment/Open-ILS/src/sql/Pg/200.schema.acq.sql
Log:
changing fund to funding_source and budget to fund
Modified: branches/acq-experiment/Open-ILS/examples/fm_IDL.xml
===================================================================
--- branches/acq-experiment/Open-ILS/examples/fm_IDL.xml 2008-01-30 03:23:21 UTC (rev 8533)
+++ branches/acq-experiment/Open-ILS/examples/fm_IDL.xml 2008-01-30 16:02:39 UTC (rev 8534)
@@ -2354,13 +2354,13 @@
</links>
</class>
- <class id="acqfund" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund">
- <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
+ <class id="acqfs" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source" oils_persist:tablename="acq.funding_source">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
<field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
<field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
- <field reporter:label="Fund ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
- <field reporter:label="Fund Name" name="name" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true" />
+ <field reporter:label="Funding Source ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
+ <field reporter:label="Funding Source Name" name="name" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true" />
<field reporter:label="Owner" name="owner" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="org_unit" />
<field reporter:label="Currency" name="currency_type" oils_obj:array_position="6" oils_persist:virtual="false" oils_persist:primitive="string" reporter:datatype="link" />
</fields>
@@ -2370,25 +2370,25 @@
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
- <create permission="CREATE_ACQ_FUND" context_field="owner"/>
- <retrieve permission="VIEW_ACQ_FUND" context_field="owner"/>
- <update permission="UPDATE_ACQ_FUND" context_field="owner"/>
- <delete permission="DELETE_ACQ_FUND" context_field="owner"/>
+ <create permission="CREATE_ACQ_FUNDING_SOURCE" context_field="owner"/>
+ <retrieve permission="VIEW_ACQ_FUNDING_SOURCE" context_field="owner"/>
+ <update permission="UPDATE_ACQ_FUNDING_SOURCE" context_field="owner"/>
+ <delete permission="DELETE_ACQ_FUNDING_SOURCE" context_field="owner"/>
</actions>
</permacrud>
</class>
- <class id="acqfsm" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_share_map" oils_persist:tablename="acq.fund_share_map">
- <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_share_map_id_seq">
+ <class id="acqfssm" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_share_map" oils_persist:tablename="acq.funding_source_share_map">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_share_map_id_seq">
<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
<field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
<field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
<field reporter:label="Share ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
- <field reporter:label="Fund ID" name="fund" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link" />
+ <field reporter:label="Funding Source ID" name="funding_source" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link" />
<field reporter:label="Org" name="org" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="org_unit" />
</fields>
<links>
- <link field="fund" reltype="has_a" key="id" map="" class="acqfund"/>
+ <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
<link field="org" reltype="has_a" key="id" map="" class="aou"/>
</links>
</class>
@@ -2408,45 +2408,45 @@
</links>
</class>
- <class id="acqfcred" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_credit" oils_persist:tablename="acq.fund_credit">
- <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_credit_id_seq">
+ <class id="acqfscred" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_credit" oils_persist:tablename="acq.funding_source_credit">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
<field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
<field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
<field reporter:label="Credit ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
- <field reporter:label="Fund ID" name="fund" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link" />
+ <field reporter:label="Funding Source ID" name="funding_source" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link" />
<field reporter:label="Amount" name="amount" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
<field reporter:label="Note" name="note" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text" />
</fields>
<links>
- <link field="fund" reltype="has_a" key="id" map="" class="acqfund"/>
+ <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
</links>
</class>
- <class id="acqfdeb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_debit" oils_persist:tablename="acq.fund_debit">
- <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
+ <class id="acqfsdeb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_debit" oils_persist:tablename="acq.funding_source_debit">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_debit_id_seq">
<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
<field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
<field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
<field reporter:label="Debit ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
- <field reporter:label="Fund ID" name="fund" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link" />
+ <field reporter:label="Funding Source ID" name="funding_source" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link" />
<field reporter:label="Origin Amount" name="origin_amount" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="money" />
<field reporter:label="Origin Currency" name="origin_currency_type" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="link" />
<field reporter:label="Amount" name="amount" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="money" />
<field reporter:label="Encumberance" name="encumberance" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text" />
</fields>
<links>
- <link field="fund" reltype="has_a" key="id" map="" class="acqfund"/>
+ <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
<link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
</links>
</class>
- <class id="acqb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::budget" oils_persist:tablename="acq.budget">
- <fields oils_persist:primary="id" oils_persist:sequence="acq.budget_id_seq">
+ <class id="acqf" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
<field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
<field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
- <field reporter:label="Budget ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
+ <field reporter:label="Fund ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
<field reporter:label="Org Unit" name="org" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="org_unit" />
<field reporter:label="Name" name="name" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text" />
<field reporter:label="Year" name="year" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="int" />
@@ -2456,14 +2456,14 @@
</links>
</class>
- <class id="acqba" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::budget_allocation" oils_persist:tablename="acq.budget_allocation">
- <fields oils_persist:primary="id" oils_persist:sequence="acq.budget_allocation_id_seq">
+ <class id="acqfa" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_allocation" oils_persist:tablename="acq.fund_allocation">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
<field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
<field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
<field reporter:label="Allocation ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
- <field reporter:label="Budget" name="budget" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link" />
- <field reporter:label="Fund" name="fund" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link" />
+ <field reporter:label="Fund" name="fund" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link" />
+ <field reporter:label="Funding Source" name="funding_source" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link" />
<field reporter:label="Amount" name="amount" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="money" />
<field reporter:label="Percent" name="percent" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="float" />
<field reporter:label="Allocating User" name="allocator" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link" />
@@ -2471,8 +2471,8 @@
</fields>
<links>
<link field="allocator" reltype="has_a" key="id" map="" class="au"/>
- <link field="budget" reltype="has_a" key="id" map="" class="acqb"/>
- <link field="fund" reltype="has_a" key="id" map="" class="acqfund"/>
+ <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
+ <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
</links>
</class>
Modified: branches/acq-experiment/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- branches/acq-experiment/Open-ILS/src/sql/Pg/200.schema.acq.sql 2008-01-30 03:23:21 UTC (rev 8533)
+++ branches/acq-experiment/Open-ILS/src/sql/Pg/200.schema.acq.sql 2008-01-30 16:02:39 UTC (rev 8534)
@@ -40,31 +40,31 @@
CONSTRAINT provider_share_once_per_owner UNIQUE (provider,org)
);
-CREATE TABLE acq.fund (
+CREATE TABLE acq.funding_source (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
owner INT NOT NULL REFERENCES actor.org_unit (id),
currency_type TEXT NOT NULL REFERENCES acq.currency_type (code),
- CONSTRAINT fund_name_once_per_owner UNIQUE (name,owner)
+ CONSTRAINT funding_source_name_once_per_owner UNIQUE (name,owner)
);
-CREATE TABLE acq.fund_share_map (
+CREATE TABLE acq.funding_source_share_map (
id SERIAL PRIMARY KEY,
- fund INT NOT NULL REFERENCES acq.fund (id),
+ funding_source INT NOT NULL REFERENCES acq.funding_source (id),
org INT NOT NULL REFERENCES actor.org_unit (id),
- CONSTRAINT fund_share_once_per_owner UNIQUE (fund,org)
+ CONSTRAINT funding_source_share_once_per_owner UNIQUE (funding_source,org)
);
-CREATE TABLE acq.fund_credit (
+CREATE TABLE acq.funding_source_credit (
id SERIAL PRIMARY KEY,
- fund INT NOT NULL REFERENCES acq.fund (id),
+ funding_source INT NOT NULL REFERENCES acq.funding_source (id),
amount NUMERIC NOT NULL,
note TEXT
);
-CREATE TABLE acq.fund_debit (
+CREATE TABLE acq.funding_source_debit (
id SERIAL PRIMARY KEY,
- fund INT NOT NULL REFERENCES acq.fund (id),
+ funding_source INT NOT NULL REFERENCES acq.funding_source (id),
origin_amount NUMERIC NOT NULL, -- pre-exchange-rate amount
origin_currency_type TEXT NOT NULL REFERENCES acq.currency_type (code),
amount NUMERIC NOT NULL,
@@ -208,7 +208,7 @@
AFTER INSERT OR UPDATE ON acq.picklist_entry
FOR EACH ROW EXECUTE PROCEDURE public.ingest_acq_marc();
-CREATE TABLE acq.budget (
+CREATE TABLE acq.fund (
id SERIAL PRIMARY KEY,
org INT NOT NULL REFERENCES actor.org_unit (id) ON UPDATE CASCADE ON DELETE CASCADE,
name TEXT NOT NULL,
@@ -216,10 +216,10 @@
CONSTRAINT name_once_per_org_year UNIQUE (org,name,year)
);
-CREATE TABLE acq.budget_allocation (
+CREATE TABLE acq.fund_allocation (
id SERIAL PRIMARY KEY,
+ funding_source INT NOT NULL REFERENCES acq.funding_source (id) ON UPDATE CASCADE ON DELETE CASCADE,
fund INT NOT NULL REFERENCES acq.fund (id) ON UPDATE CASCADE ON DELETE CASCADE,
- budget INT NOT NULL REFERENCES acq.budget (id) ON UPDATE CASCADE ON DELETE CASCADE,
amount NUMERIC,
percent NUMERIC CHECK (percent IS NULL OR percent BETWEEN 0.0 AND 100.0),
allocator INT NOT NULL REFERENCES actor.usr (id),
More information about the open-ils-commits
mailing list