From: Chris Sharp <csharp@georgialibraries.org>
Date: Tue, 21 Feb 2017 13:03:55 +0000 (-0500)
Subject: LP#1666512 - Add billing types from 2009-era features.
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6b49fd7834b6f7c2e7d26a71cee8cf22e3b34829;p=evergreen%2Fjoelewis.git

LP#1666512 - Add billing types from 2009-era features.

For systems that were running Evergreen 1.2 or so and upgraded to 1.4
or so, there were billing types added that did not make it into an
upgrade script.  We add them here just in case you don't have them.
Systems installed since Evergreen 1.4 are probably not affected.

Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Ben Shum <ben@evergreener.net>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
---

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.add_possibly_missing_billing_types.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.add_possibly_missing_billing_types.sql
new file mode 100644
index 0000000000..a9d3d5c732
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.add_possibly_missing_billing_types.sql
@@ -0,0 +1,17 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+-- The following billing types would not have been automatically added
+-- in upgrade scripts between versions 1.2 and 1.4 (early 2009).  We
+-- add them here.  It's okay if they fail, so this should probably be 
+-- run outside a transaction if added to the version-upgrade scripts.
+
+INSERT INTO config.billing_type (id, name, owner) VALUES
+    ( 7, oils_i18n_gettext(7, 'Damaged Item', 'cbt', 'name'), 1);
+INSERT INTO config.billing_type (id, name, owner) VALUES
+    ( 8, oils_i18n_gettext(8, 'Damaged Item Processing Fee', 'cbt', 'name'), 1);
+INSERT INTO config.billing_type (id, name, owner) VALUES
+    ( 9, oils_i18n_gettext(9, 'Notification Fee', 'cbt', 'name'), 1);
+
+COMMIT;