[open-ils-commits] r15466 - 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
Fri Feb 5 16:24:02 EST 2010
Author: scottmk
Date: 2010-02-05 16:23:56 -0500 (Fri, 05 Feb 2010)
New Revision: 15466
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0153.schema.acq.fund-spending-limits.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:
New columns to acq.fund: balance_wqarning_percent and balance_stop_percent.
When the balance of a fund falls below these percentages, the system should
issue a warning or stop further charges.
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/0153.schema.acq.fund-spending-limits.sql
M Open-ILS/examples/fm_IDL.xml
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-02-05 20:11:33 UTC (rev 15465)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-02-05 21:23:56 UTC (rev 15466)
@@ -4630,6 +4630,8 @@
<field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
<field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
<field reporter:label="Active" name="active" reporter:datatype="bool" />
+ <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
+ <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
<field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
<field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-02-05 20:11:33 UTC (rev 15465)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-02-05 21:23:56 UTC (rev 15466)
@@ -51,7 +51,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0152'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0153'); -- 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-02-05 20:11:33 UTC (rev 15465)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-02-05 21:23:56 UTC (rev 15466)
@@ -172,6 +172,10 @@
rollover BOOL NOT NULL DEFAULT FALSE,
propagate BOOL NOT NULL DEFAULT TRUE,
active BOOL NOT NULL DEFAULT TRUE,
+ balance_warning_percent INT CONSTRAINT balance_warning_percent_limit
+ CHECK( balance_warning_percent <= 100 ),
+ balance_stop_percent INT CONSTRAINT balance_stop_percent_limit
+ CHECK( balance_stop_percent <= 100 ),
CONSTRAINT name_once_per_org_year UNIQUE (org,name,year),
CONSTRAINT code_once_per_org_year UNIQUE (org, code, year),
CONSTRAINT acq_fund_rollover_implies_propagate CHECK ( propagate OR NOT rollover )
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0153.schema.acq.fund-spending-limits.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0153.schema.acq.fund-spending-limits.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0153.schema.acq.fund-spending-limits.sql 2010-02-05 21:23:56 UTC (rev 15466)
@@ -0,0 +1,15 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0153'); -- Scott McKellar
+
+ALTER TABLE acq.fund
+ ADD COLUMN balance_warning_percent INT
+ CONSTRAINT balance_warning_percent_limit
+ CHECK( balance_warning_percent <= 100 );
+
+ALTER TABLE acq.fund
+ ADD COLUMN balance_stop_percent INT
+ CONSTRAINT balance_stop_percent_limit
+ CHECK( balance_stop_percent <= 100 );
+
+COMMIT;
More information about the open-ils-commits
mailing list