From 271e11c47f37b5313dd707dd816e787ad0c55374 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 24 Mar 2010 19:50:43 +0000 Subject: [PATCH] added some data to the acq lineitem worksheet. added distib formula link from lineitems in the IDL git-svn-id: svn://svn.open-ils.org/ILS/trunk@15960 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/examples/fm_IDL.xml | 2 + Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 79 ++++++++++------ ....data.titles_received_worksheet_tweaks.sql | 92 +++++++++++++++++++ 4 files changed, 146 insertions(+), 29 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0208.data.titles_received_worksheet_tweaks.sql diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index d6844f0586..1d5e262345 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -5261,6 +5261,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + @@ -5274,6 +5275,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index c4820b979c..8d51d8a90b 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -59,7 +59,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0207'); -- Scott McKellar +INSERT INTO config.upgrade_log (version) VALUES ('0208'); -- berick CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index ac29b8cd48..d60c09dd56 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -3889,7 +3889,7 @@ INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, vali 14, TRUE, 1, - 'Titles Received Lineitem Worksheet', + 'Lineitem Worksheet', 'format.acqli.html', 'NOOP_True', 'ProcessTemplate', @@ -3898,47 +3898,70 @@ $$ [%- USE date -%] [%- SET li = target; -%]
-
+
+ +
Title: [% helpers.get_li_attr("title", "", li.attributes) %]
+
Author: [% helpers.get_li_attr("author", "", li.attributes) %]
+
Item Count: [% li.lineitem_details.size %]
Lineitem ID: [% li.id %]
-
[% li.lineitem_details.size %] items
- [% IF detail.recv_time %]
Expected: [% li.expected_recv_time %]
[% 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 %] + [% FOREACH detail IN li.lineitem_details.sort('owning_lib') %] + [% + IF copy.eg_copy_id; + SET copy = copy.eg_copy_id; + SET cn_label = copy.call_number.label; + ELSE; + SET copy = detail; + SET cn_label = detail.cn_label; + END + %] - [% IF loop.first %] - - [% END %] - - - - - + + + + + + - [% END %] + [% END %]
TitleRecd.Branch Barcode Call NumberDistributionFundRecd. Notes
- [%- helpers.get_li_attr("title", "", li.attributes) -%] - [% IF detail.recv_time %][% detail.recv_time %][% END %][% IF detail.barcode %][% detail.barcode %][% END %][% IF detail.cn_label %][% detail.cn_label %][% END %] - ==> [% detail.owning_lib.shortname %] ([% detail.owning_lib.name %]) - [% IF detail.note %]( [% detail.note %] )[% END %] - - [%- SET notelist = [] -%] - [%- FOR note IN li.lineitem_notes -%] - [%- notelist.push(note.value) -%] - [%- END -%] - [%- notelist.join('
') -%] -
[% detail.owning_lib.shortname %][% IF copy.barcode %][% detail.barcode %][% END %][% IF cn_label %][% cn_label %][% END %][% IF detail.fund %][% detail.fund.code %] ([% detail.fund.year %])[% END %][% IF detail.recv_time %][% detail.recv_time %][% END %][% detail.note %]
diff --git a/Open-ILS/src/sql/Pg/upgrade/0208.data.titles_received_worksheet_tweaks.sql b/Open-ILS/src/sql/Pg/upgrade/0208.data.titles_received_worksheet_tweaks.sql new file mode 100644 index 0000000000..0c6e995ec8 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0208.data.titles_received_worksheet_tweaks.sql @@ -0,0 +1,92 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0208'); + +UPDATE action_trigger.event_definition SET + name = 'Lineitem Worksheet', + template = +$$ +[%- USE date -%] +[%- SET li = target; -%] +
+
+ +
Title: [% helpers.get_li_attr("title", "", li.attributes) %]
+
Author: [% helpers.get_li_attr("author", "", li.attributes) %]
+
Item Count: [% li.lineitem_details.size %]
+
Lineitem ID: [% li.id %]
+ + [% 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.sort('owning_lib') %] + [% + IF copy.eg_copy_id; + SET copy = copy.eg_copy_id; + SET cn_label = copy.call_number.label; + ELSE; + SET copy = detail; + SET cn_label = detail.cn_label; + END + %] + + + + + + + + + + [% END %] + +
BranchBarcodeCall NumberFundRecd.Notes
[% detail.owning_lib.shortname %][% IF copy.barcode %][% detail.barcode %][% END %][% IF cn_label %][% cn_label %][% END %][% IF detail.fund %][% detail.fund.code %] ([% detail.fund.year %])[% END %][% IF detail.recv_time %][% detail.recv_time %][% END %][% detail.note %]
+
+$$ +WHERE id = 14; + + +INSERT INTO action_trigger.environment (event_def, path) VALUES + ( 14, 'lineitem_notes.alert_text' ), + ( 14, 'distribution_formulas.formula' ), + ( 14, 'lineitem_details.fund' ), + ( 14, 'lineitem_details.eg_copy_id' ), + ( 14, 'lineitem_details.eg_copy_id.call_number' ) +; + +COMMIT; + -- 2.43.2