From: Jane Sandberg Date: Sun, 2 Oct 2022 15:18:01 +0000 (-0700) Subject: LP1942220: stamp upgrade scripts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3149bb69cb3936ab69807c88ffee2180105f10ad;p=working%2FEvergreen.git LP1942220: stamp upgrade scripts Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index b8a1492a60..9dc11888c1 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1331', :eg_version); -- jdavis/gmonti/sandbergja +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1335', :eg_version); -- tlittle/berick/gmcharlt/rfrasur/sandbergja CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1332.data.lp1981714_default_lid_owning_library_setting.sql b/Open-ILS/src/sql/Pg/upgrade/1332.data.lp1981714_default_lid_owning_library_setting.sql new file mode 100644 index 0000000000..bb2a2c6aa5 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1332.data.lp1981714_default_lid_owning_library_setting.sql @@ -0,0 +1,26 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1332', :eg_version); + +INSERT into config.org_unit_setting_type +( name, grp, label, description, datatype, fm_class ) VALUES + +( 'acq.default_owning_lib_for_auto_lids_strategy', 'acq', + oils_i18n_gettext('acq.default_owning_lib_for_auto_lids_strategy', + 'How to set default owning library for auto-created line item items', + 'coust', 'label'), + oils_i18n_gettext('acq.default_owning_lib_for_auto_lids_strategy', + 'Stategy to use to set default owning library to set when line item items are auto-created because the provider''s default copy count has been set. Valid values are "workstation" to use the workstation library, "blank" to leave it blank, and "use_setting" to use the "Default owning library for auto-created line item items" setting. If not set, the workstation library will be used.', + 'coust', 'description'), + 'string', null) +,( 'acq.default_owning_lib_for_auto_lids', 'acq', + oils_i18n_gettext('acq.default_owning_lib_for_auto_lids', + 'Default owning library for auto-created line item items', + 'coust', 'label'), + oils_i18n_gettext('acq.default_owning_lib_for_auto_lids', + 'The default owning library to set when line item items are auto-created because the provider''s default copy count has been set. This applies if the "How to set default owning library for auto-created line item items" setting is set to "use_setting".', + 'coust', 'description'), + 'link', 'aou') +; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/1333.data.picklist-po-angular.sql b/Open-ILS/src/sql/Pg/upgrade/1333.data.picklist-po-angular.sql new file mode 100644 index 0000000000..5927cb9f2f --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1333.data.picklist-po-angular.sql @@ -0,0 +1,245 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1333', :eg_version); + +INSERT INTO config.workstation_setting_type (name, grp, datatype, label) +VALUES ( + 'eg.grid.acq.lineitem.history', 'gui', 'object', + oils_i18n_gettext( + 'eg.grid.acq.lineitem.history', + 'Grid Config: Acq Lineitem History', + 'cwst', 'label' + ) +), ( + 'eg.grid.acq.po.history', 'gui', 'object', + oils_i18n_gettext( + 'eg.grid.acq.po.history', + 'Grid Config: Acq PO History', + 'cwst', 'label' + ) +), ( + 'eg.grid.acq.po.edi_messages', 'gui', 'object', + oils_i18n_gettext( + 'eg.grid.acq.po.edi_messages', + 'Grid Config: Acq PO EDI Messages', + 'cwst', 'label' + ) +), ( + 'acq.lineitem.page_size', 'gui', 'integer', + oils_i18n_gettext( + 'acq.lineitem.page_size', + 'ACQ Lineitem List Page Size', + 'cwst', 'label' + ) +), ( + 'ui.staff.angular_acq_search.enabled', 'gui', 'bool', + oils_i18n_gettext( + 'ui.staff.angular_acq_search.enabled', + 'Enable Experimental ACQ Selection/Purchase Search Interface Links', + 'cwst', 'label' + ) +); + +INSERT INTO config.print_template + (id, name, label, owner, active, locale, template) +VALUES ( + 5, 'lineitem_worksheet', 'Lineitem Worksheet', 1, TRUE, 'en-US', +$TEMPLATE$ +[%- + USE money=format('%.2f'); + USE date; + SET li = template_data.lineitem; + SET title = ''; + SET author = ''; + FOREACH attr IN li.attributes; + IF attr.attr_type == 'lineitem_marc_attr_definition'; + IF attr.attr_name == 'title'; + title = attr.attr_value; + ELSIF attr.attr_name == 'author'; + author = attr.attr_value; + END; + END; + END; +-%] + +
+
+
Title: [% title.substr(0, 80) %][% IF title.length > 80 %]...[% END %]
+
Author: [% author %]
+
Item Count: [% li.lineitem_details.size %]
+
Lineitem ID: [% li.id %]
+
PO # : [% li.purchase_order %]
+
Est. Price: [% money(li.estimated_unit_price) %]
+
Open Holds: [% template_data.hold_count %]
+ [% IF li.cancel_reason.label %] +
[% li.cancel_reason.label %]
+ [% END %] + + [% IF li.distribution_formulas.size > 0 %] + [% SET forms = [] %] + [% FOREACH form IN li.distribution_formulas; forms.push(form.formula.name); END %] +
Distribution Formulas: [% forms.join(',') %]
+ [% END %] + + [% IF li.lineitem_notes.size > 0 %] + Lineitem Notes: +
    + [%- FOR note IN li.lineitem_notes -%] +
  • + [% IF note.alert_text %] + [% note.alert_text.code -%] + [% IF note.value -%] + : [% note.value %] + [% END %] + [% ELSE %] + [% note.value -%] + [% END %] +
  • + [% END %] +
+ [% END %] +
+
+ + + + + + + + + + + + + + + + [% FOREACH detail IN li.lineitem_details %] + [% detail.owning_lib = detail.owning_lib.shortname %] + [% END %] + + [% FOREACH detail IN li.lineitem_details.sort('owning_lib') %] + [% + IF detail.eg_copy_id; + SET copy = detail.eg_copy_id; + SET cn_label = copy.call_number.label; + ELSE; + SET copy = detail; + SET cn_label = detail.cn_label; + END + %] + + + + + + + + + + + + [% END %] + +
BranchBarcodeCall NumberFundShelving LocationRecd.NotesDelayed / Canceled
[% detail.owning_lib %][% IF copy.barcode %][% detail.barcode %][% END %][% IF cn_label %][% cn_label %][% END %][% IF detail.fund %][% detail.fund.code %] ([% detail.fund.year %])[% END %][% copy.location.name %][% IF detail.recv_time %][% date.format(helpers.format_date(detail.recv_time, staff_org_timezone), '%x %r', locale) %][% END %][% detail.note %][% detail.cancel_reason.label %]
+
+$TEMPLATE$ +); + +INSERT INTO config.print_template + (id, name, label, owner, active, locale, template) +VALUES (6, 'purchase_order', 'Purchase Order', 1, TRUE, 'en-US', +$TEMPLATE$ + +[%- + USE date; + USE String; + USE money=format('%.2f'); + SET po = template_data.po; + + # find a lineitem attribute by name and optional type + BLOCK get_li_attr; + FOR attr IN li.attributes; + IF attr.attr_name == attr_name; + IF !attr_type OR attr_type == attr.attr_type; + attr.attr_value; + LAST; + END; + END; + END; + END; + + BLOCK get_li_order_attr_value; + FOR attr IN li.attributes; + IF attr.order_ident == 't'; + attr.attr_value; + LAST; + END; + END; + END; +-%] + + + + + + + + + + + + + + + + +[% + SET subtotal = 0; + FOR li IN po.lineitems; + + SET idval = ''; + IF vendnum != ''; + idval = PROCESS get_li_attr attr_name = 'vendor_num'; + END; + IF !idval; + idval = PROCESS get_li_order_attr_value; + END; +-%] + + + + + + + + [%- + SET count = li.lineitem_details.size; + SET price = li.estimated_unit_price; + SET itotal = (price * count); + %] + + + + + [% END %] + + +
PO#Line#ISBN / Item # / Charge TypeTitleAuthorPub InfoQuantityUnit PriceLine Total
[% po.id %][% li.id %][% idval %][% PROCESS get_li_attr attr_name = 'title' %][% PROCESS get_li_attr attr_name = 'author' %] +
+ [% PROCESS get_li_attr attr_name = 'publisher' %], + [% PROCESS get_li_attr attr_name = 'pubdate' %] +
+
Edition: [% PROCESS get_li_attr attr_name = 'edition' %]
+
[% count %][% money(price) %][% money(litotal) %]
+ + + +$TEMPLATE$ +); + + +COMMIT; + + diff --git a/Open-ILS/src/sql/Pg/upgrade/1334.data.picklist_uploader_templates.sql b/Open-ILS/src/sql/Pg/upgrade/1334.data.picklist_uploader_templates.sql new file mode 100644 index 0000000000..11ac41f369 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1334.data.picklist_uploader_templates.sql @@ -0,0 +1,15 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1334', :eg_version); + +INSERT INTO config.workstation_setting_type (name, grp, datatype, label) +VALUES ( + 'eg.acq.picklist.upload.templates','acq','object', + oils_i18n_gettext( + 'eg.acq.picklist.upload.templates', + 'Acq Picklist Uploader Templates', + 'cwst','label' + ) +); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/1335.data.acq-sprint-4.sql b/Open-ILS/src/sql/Pg/upgrade/1335.data.acq-sprint-4.sql new file mode 100644 index 0000000000..25a88df466 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1335.data.acq-sprint-4.sql @@ -0,0 +1,25 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1335', :eg_version); + +INSERT INTO config.workstation_setting_type (name, grp, datatype, label) +VALUES ( + 'acq.lineitem.sort_order', 'gui', 'integer', + oils_i18n_gettext( + 'acq.lineitem.sort_order', + 'ACQ Lineitem List Sort Order', + 'cwst', 'label' + ) +); + +INSERT INTO config.org_unit_setting_type (name, grp, datatype, label) +VALUES ( + 'ui.staff.acq.show_deprecated_links', 'gui', 'bool', + oils_i18n_gettext( + 'ui.staff.acq.show_deprecated_links', + 'Display Links to Deprecated Acquisitions Interfaces', + 'cwst', 'label' + ) +); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1981714_default_lid_owning_library_setting.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1981714_default_lid_owning_library_setting.sql deleted file mode 100644 index df1e3de118..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1981714_default_lid_owning_library_setting.sql +++ /dev/null @@ -1,26 +0,0 @@ -BEGIN; - ---SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version); - -INSERT into config.org_unit_setting_type -( name, grp, label, description, datatype, fm_class ) VALUES - -( 'acq.default_owning_lib_for_auto_lids_strategy', 'acq', - oils_i18n_gettext('acq.default_owning_lib_for_auto_lids_strategy', - 'How to set default owning library for auto-created line item items', - 'coust', 'label'), - oils_i18n_gettext('acq.default_owning_lib_for_auto_lids_strategy', - 'Stategy to use to set default owning library to set when line item items are auto-created because the provider''s default copy count has been set. Valid values are "workstation" to use the workstation library, "blank" to leave it blank, and "use_setting" to use the "Default owning library for auto-created line item items" setting. If not set, the workstation library will be used.', - 'coust', 'description'), - 'string', null) -,( 'acq.default_owning_lib_for_auto_lids', 'acq', - oils_i18n_gettext('acq.default_owning_lib_for_auto_lids', - 'Default owning library for auto-created line item items', - 'coust', 'label'), - oils_i18n_gettext('acq.default_owning_lib_for_auto_lids', - 'The default owning library to set when line item items are auto-created because the provider''s default copy count has been set. This applies if the "How to set default owning library for auto-created line item items" setting is set to "use_setting".', - 'coust', 'description'), - 'link', 'aou') -; - -COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.picklist-po-angular.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.picklist-po-angular.sql deleted file mode 100644 index 7f8c492d66..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.picklist-po-angular.sql +++ /dev/null @@ -1,245 +0,0 @@ -BEGIN; - ---SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version); - -INSERT INTO config.workstation_setting_type (name, grp, datatype, label) -VALUES ( - 'eg.grid.acq.lineitem.history', 'gui', 'object', - oils_i18n_gettext( - 'eg.grid.acq.lineitem.history', - 'Grid Config: Acq Lineitem History', - 'cwst', 'label' - ) -), ( - 'eg.grid.acq.po.history', 'gui', 'object', - oils_i18n_gettext( - 'eg.grid.acq.po.history', - 'Grid Config: Acq PO History', - 'cwst', 'label' - ) -), ( - 'eg.grid.acq.po.edi_messages', 'gui', 'object', - oils_i18n_gettext( - 'eg.grid.acq.po.edi_messages', - 'Grid Config: Acq PO EDI Messages', - 'cwst', 'label' - ) -), ( - 'acq.lineitem.page_size', 'gui', 'integer', - oils_i18n_gettext( - 'acq.lineitem.page_size', - 'ACQ Lineitem List Page Size', - 'cwst', 'label' - ) -), ( - 'ui.staff.angular_acq_search.enabled', 'gui', 'bool', - oils_i18n_gettext( - 'ui.staff.angular_acq_search.enabled', - 'Enable Experimental ACQ Selection/Purchase Search Interface Links', - 'cwst', 'label' - ) -); - -INSERT INTO config.print_template - (id, name, label, owner, active, locale, template) -VALUES ( - 5, 'lineitem_worksheet', 'Lineitem Worksheet', 1, TRUE, 'en-US', -$TEMPLATE$ -[%- - USE money=format('%.2f'); - USE date; - SET li = template_data.lineitem; - SET title = ''; - SET author = ''; - FOREACH attr IN li.attributes; - IF attr.attr_type == 'lineitem_marc_attr_definition'; - IF attr.attr_name == 'title'; - title = attr.attr_value; - ELSIF attr.attr_name == 'author'; - author = attr.attr_value; - END; - END; - END; --%] - -
-
-
Title: [% title.substr(0, 80) %][% IF title.length > 80 %]...[% END %]
-
Author: [% author %]
-
Item Count: [% li.lineitem_details.size %]
-
Lineitem ID: [% li.id %]
-
PO # : [% li.purchase_order %]
-
Est. Price: [% money(li.estimated_unit_price) %]
-
Open Holds: [% template_data.hold_count %]
- [% IF li.cancel_reason.label %] -
[% li.cancel_reason.label %]
- [% END %] - - [% IF li.distribution_formulas.size > 0 %] - [% SET forms = [] %] - [% FOREACH form IN li.distribution_formulas; forms.push(form.formula.name); END %] -
Distribution Formulas: [% forms.join(',') %]
- [% END %] - - [% IF li.lineitem_notes.size > 0 %] - Lineitem Notes: -
    - [%- FOR note IN li.lineitem_notes -%] -
  • - [% IF note.alert_text %] - [% note.alert_text.code -%] - [% IF note.value -%] - : [% note.value %] - [% END %] - [% ELSE %] - [% note.value -%] - [% END %] -
  • - [% END %] -
- [% END %] -
-
- - - - - - - - - - - - - - - - [% FOREACH detail IN li.lineitem_details %] - [% detail.owning_lib = detail.owning_lib.shortname %] - [% END %] - - [% FOREACH detail IN li.lineitem_details.sort('owning_lib') %] - [% - IF detail.eg_copy_id; - SET copy = detail.eg_copy_id; - SET cn_label = copy.call_number.label; - ELSE; - SET copy = detail; - SET cn_label = detail.cn_label; - END - %] - - - - - - - - - - - - [% END %] - -
BranchBarcodeCall NumberFundShelving LocationRecd.NotesDelayed / Canceled
[% detail.owning_lib %][% IF copy.barcode %][% detail.barcode %][% END %][% IF cn_label %][% cn_label %][% END %][% IF detail.fund %][% detail.fund.code %] ([% detail.fund.year %])[% END %][% copy.location.name %][% IF detail.recv_time %][% date.format(helpers.format_date(detail.recv_time, staff_org_timezone), '%x %r', locale) %][% END %][% detail.note %][% detail.cancel_reason.label %]
-
-$TEMPLATE$ -); - -INSERT INTO config.print_template - (id, name, label, owner, active, locale, template) -VALUES (6, 'purchase_order', 'Purchase Order', 1, TRUE, 'en-US', -$TEMPLATE$ - -[%- - USE date; - USE String; - USE money=format('%.2f'); - SET po = template_data.po; - - # find a lineitem attribute by name and optional type - BLOCK get_li_attr; - FOR attr IN li.attributes; - IF attr.attr_name == attr_name; - IF !attr_type OR attr_type == attr.attr_type; - attr.attr_value; - LAST; - END; - END; - END; - END; - - BLOCK get_li_order_attr_value; - FOR attr IN li.attributes; - IF attr.order_ident == 't'; - attr.attr_value; - LAST; - END; - END; - END; --%] - - - - - - - - - - - - - - - - -[% - SET subtotal = 0; - FOR li IN po.lineitems; - - SET idval = ''; - IF vendnum != ''; - idval = PROCESS get_li_attr attr_name = 'vendor_num'; - END; - IF !idval; - idval = PROCESS get_li_order_attr_value; - END; --%] - - - - - - - - [%- - SET count = li.lineitem_details.size; - SET price = li.estimated_unit_price; - SET itotal = (price * count); - %] - - - - - [% END %] - - -
PO#Line#ISBN / Item # / Charge TypeTitleAuthorPub InfoQuantityUnit PriceLine Total
[% po.id %][% li.id %][% idval %][% PROCESS get_li_attr attr_name = 'title' %][% PROCESS get_li_attr attr_name = 'author' %] -
- [% PROCESS get_li_attr attr_name = 'publisher' %], - [% PROCESS get_li_attr attr_name = 'pubdate' %] -
-
Edition: [% PROCESS get_li_attr attr_name = 'edition' %]
-
[% count %][% money(price) %][% money(litotal) %]
- - - -$TEMPLATE$ -); - - -COMMIT; - - diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.picklist_uploader_templates.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.picklist_uploader_templates.sql deleted file mode 100644 index 7b1e98d417..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.picklist_uploader_templates.sql +++ /dev/null @@ -1,15 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version); - -INSERT INTO config.workstation_setting_type (name, grp, datatype, label) -VALUES ( - 'eg.acq.picklist.upload.templates','acq','object', - oils_i18n_gettext( - 'eg.acq.picklist.upload.templates', - 'Acq Picklist Uploader Templates', - 'cwst','label' - ) -); - -COMMIT; \ No newline at end of file diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq-sprint-4.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq-sprint-4.sql deleted file mode 100644 index 4f3d5567a2..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq-sprint-4.sql +++ /dev/null @@ -1,25 +0,0 @@ -BEGIN; - ---SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version); - -INSERT INTO config.workstation_setting_type (name, grp, datatype, label) -VALUES ( - 'acq.lineitem.sort_order', 'gui', 'integer', - oils_i18n_gettext( - 'acq.lineitem.sort_order', - 'ACQ Lineitem List Sort Order', - 'cwst', 'label' - ) -); - -INSERT INTO config.org_unit_setting_type (name, grp, datatype, label) -VALUES ( - 'ui.staff.acq.show_deprecated_links', 'gui', 'bool', - oils_i18n_gettext( - 'ui.staff.acq.show_deprecated_links', - 'Display Links to Deprecated Acquisitions Interfaces', - 'cwst', 'label' - ) -); - -COMMIT;