From: erickson Date: Thu, 11 Mar 2010 15:32:24 +0000 (+0000) Subject: update PO printout to include vendor-public PO and LI notes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b88868e287d6a3b88ff2c55433e212afbd465396;p=evergreen%2Ftadl.git update PO printout to include vendor-public PO and LI notes git-svn-id: svn://svn.open-ils.org/ILS/trunk@15793 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index a035d1f79c..9a72989c2d 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -51,7 +51,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0188'); -- miker +INSERT INTO config.upgrade_log (version) VALUES ('0189'); -- 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 c52dec5e3c..42ed0f25a9 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -3008,6 +3008,7 @@ date [% date.format(date.now, '%Y%m%d') %] @@ -3034,7 +3035,18 @@ date [% date.format(date.now, '%Y%m%d') %]
-


+

+
+ Notes to the Vendor + +
+

@@ -3045,6 +3057,7 @@ date [% date.format(date.now, '%Y%m%d') %] + @@ -3054,7 +3067,7 @@ date [% date.format(date.now, '%Y%m%d') %] [% count = li.lineitem_details.size %] - [% price = PROCESS get_li_attr attr_name = 'estimated_price' %] + [% price = li.estimated_unit_price %] [% litotal = (price * count) %] [% subtotal = subtotal + litotal %] [% isbn = PROCESS get_li_attr attr_name = 'isbn' %] @@ -3066,6 +3079,15 @@ date [% date.format(date.now, '%Y%m%d') %] + [% END %] @@ -3088,7 +3110,9 @@ INSERT INTO action_trigger.environment (event_def, path) VALUES (4, 'ordering_agency.mailing_address'), (4, 'ordering_agency.billing_address'), (4, 'provider.addresses'), - (4, 'lineitems.attributes'); + (4, 'lineitems.attributes'), + (4, 'lineitems.lineitem_notes'), + (4, 'notes'); INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, delay, delay_field, group_field, template) diff --git a/Open-ILS/src/sql/Pg/upgrade/0189.data.po_print_template.sql b/Open-ILS/src/sql/Pg/upgrade/0189.data.po_print_template.sql new file mode 100644 index 0000000000..4ceb42b65b --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0189.data.po_print_template.sql @@ -0,0 +1,131 @@ + +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0189'); + +UPDATE action_trigger.event_definition SET template = +$$ +[%- USE date -%] +[%- + # 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 +-%] + +

Purchase Order [% target.id %]

+
+date [% date.format(date.now, '%Y%m%d') %] +
+ + +
Quantity Unit Price Line TotalNotes
[% count %] [% price %] [% litotal %] +
    + [% FOR note IN li.lineitem_notes %] + [% IF note.vendor_public == 't' %] +
  • [% note.value %]
  • + [% END %] + [% END %] +
+
+ + + + + + +
Vendor +
[% target.provider.name %]
+
[% target.provider.addresses.0.street1 %]
+
[% target.provider.addresses.0.street2 %]
+
[% target.provider.addresses.0.city %]
+
[% target.provider.addresses.0.state %]
+
[% target.provider.addresses.0.country %]
+
[% target.provider.addresses.0.post_code %]
+
Ship to / Bill to +
[% target.ordering_agency.name %]
+
[% target.ordering_agency.billing_address.street1 %]
+
[% target.ordering_agency.billing_address.street2 %]
+
[% target.ordering_agency.billing_address.city %]
+
[% target.ordering_agency.billing_address.state %]
+
[% target.ordering_agency.billing_address.country %]
+
[% target.ordering_agency.billing_address.post_code %]
+
+ +

+
+ Notes to the Vendor + +
+

+ + + + + + + + + + + + + + + + [% subtotal = 0 %] + [% FOR li IN target.lineitems %] + + + [% count = li.lineitem_details.size %] + [% price = li.estimated_unit_price %] + [% litotal = (price * count) %] + [% subtotal = subtotal + litotal %] + [% isbn = PROCESS get_li_attr attr_name = 'isbn' %] + [% ident = PROCESS get_li_attr attr_name = 'identifier' %] + + + + + + + + + + [% END %] + + + + + +
PO#ISBN or Item #TitleQuantityUnit PriceLine TotalNotes
[% target.id %][% isbn || ident %][% PROCESS get_li_attr attr_name = 'title' %][% count %][% price %][% litotal %] +
    + [% FOR note IN li.lineitem_notes %] + [% IF note.vendor_public == 't' %] +
  • [% note.value %]
  • + [% END %] + [% END %] +
+
+ Sub Total[% subtotal %]
+ +
+ +Total Line Item Count: [% target.lineitems.size %] +$$ +WHERE id = 4; + +INSERT INTO action_trigger.environment (event_def, path) VALUES + (4, 'lineitems.lineitem_notes'), + (4, 'notes'); + +COMMIT;