[open-ils-commits] r15960 - in trunk/Open-ILS: examples src/sql/Pg src/sql/Pg/upgrade (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Mar 24 15:50:48 EDT 2010


Author: erickson
Date: 2010-03-24 15:50:43 -0400 (Wed, 24 Mar 2010)
New Revision: 15960

Added:
   trunk/Open-ILS/src/sql/Pg/upgrade/0208.data.titles_received_worksheet_tweaks.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/950.data.seed-values.sql
Log:
added some data to the acq lineitem worksheet.  added distib formula link from lineitems in the IDL

Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2010-03-24 19:43:49 UTC (rev 15959)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2010-03-24 19:50:43 UTC (rev 15960)
@@ -5261,6 +5261,7 @@
 			<field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
 			<field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
 			<field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
+			<field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
 		</fields>
 		<links>
 			<link field="selector" reltype="has_a" key="id" map="" class="au"/>
@@ -5274,6 +5275,7 @@
 			<link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
 			<link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
 			<link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
+			<link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
 		</links>
 		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
             <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">

Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-03-24 19:43:49 UTC (rev 15959)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-03-24 19:50:43 UTC (rev 15960)
@@ -59,7 +59,7 @@
     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,

Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-03-24 19:43:49 UTC (rev 15959)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-03-24 19:50:43 UTC (rev 15960)
@@ -3889,7 +3889,7 @@
         14,
         TRUE,
         1,
-        'Titles Received Lineitem Worksheet',
+        'Lineitem Worksheet',
         'format.acqli.html',
         'NOOP_True',
         'ProcessTemplate',
@@ -3898,47 +3898,70 @@
 [%- USE date -%]
 [%- SET li = target; -%]
 <div class="wrapper">
-    <div class="summary">
+    <div class="summary" style='font-size:110%; font-weight:bold;'>
+
+        <div>Title: [% helpers.get_li_attr("title", "", li.attributes) %]</div>
+        <div>Author: [% helpers.get_li_attr("author", "", li.attributes) %]</div>
+        <div class="count">Item Count: [% li.lineitem_details.size %]</div>
         <div class="lineid">Lineitem ID: [% li.id %]</div>
-        <div class="count"><span id="countno">[% li.lineitem_details.size %]</span> items</div>
-        [% IF detail.recv_time %]<div class="dateformat">Expected: [% li.expected_recv_time %]</div>[% END %]
+
+        [% IF li.distribution_formulas.size > 0 %]
+            [% SET forms = [] %]
+            [% FOREACH form IN li.distribution_formulas; forms.push(form.formula.name); END %]
+            <div>Distribution Formulas: [% forms.join(',') %]</div>
+        [% END %]
+
+        [% IF li.lineitem_notes.size > 0 %]
+            Lineitem Notes:
+            <ul>
+                [%- FOR note IN li.lineitem_notes -%]
+                    <li>
+                    [% IF note.alert_text %]
+                        [% note.alert_text.code -%] 
+                        [% IF note.value -%]
+                            : [% note.value %]
+                        [% END %]
+                    [% ELSE %]
+                        [% note.value -%] 
+                    [% END %]
+                    </li>
+                [% END %]
+            </ul>
+        [% END %]
     </div>
+    <br/>
     <table>
         <thead>
             <tr>
-                <th>Title</th>
-                <th>Recd.</th>
+                <th>Branch</th>
                 <th>Barcode</th>
                 <th>Call Number</th>
-                <th>Distribution</th>
+                <th>Fund</th>
+                <th>Recd.</th>
                 <th>Notes</th>
             </tr>
         </thead>
         <tbody>
-    [% 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 
+            %]
             <tr>
-                [% IF loop.first %]
-                <td rowspan='[% li.lineitem_details.size %]'>
-                 [%- helpers.get_li_attr("title", "", li.attributes) -%]
-                </td>
-                [% END %]
                 <!-- acq.lineitem_detail.id = [%- detail.id -%] -->
-                <td>[% IF detail.recv_time %]<span class="recv_time">[% detail.recv_time %]</span>[% END %]</td>
-                <td>[% IF detail.barcode   %]<span class="barcode"  >[% detail.barcode   %]</span>[% END %]</td>
-                <td>[% IF detail.cn_label  %]<span class="cn_label" >[% detail.cn_label  %]</span>[% END %]</td>
-                <td>
-                    ==&gt; [% detail.owning_lib.shortname %] ([% detail.owning_lib.name %])
-                    [% IF detail.note %]( [% detail.note %] )[% END %]
-                </td>
-                <td>
-                    [%- SET notelist = []             -%]
-                    [%- FOR note IN li.lineitem_notes -%]
-                    [%-     notelist.push(note.value) -%]
-                    [%- END                           -%]
-                    [%- notelist.join('<br/>')        -%]
-                </td>
+                <td style='padding:5px;'>[% detail.owning_lib.shortname %]</td>
+                <td style='padding:5px;'>[% IF copy.barcode   %]<span class="barcode"  >[% detail.barcode   %]</span>[% END %]</td>
+                <td style='padding:5px;'>[% IF cn_label %]<span class="cn_label" >[% cn_label  %]</span>[% END %]</td>
+                <td style='padding:5px;'>[% IF detail.fund %]<span class="fund">[% detail.fund.code %] ([% detail.fund.year %])</span>[% END %]</td>
+                <td style='padding:5px;'>[% IF detail.recv_time %]<span class="recv_time">[% detail.recv_time %]</span>[% END %]</td>
+                <td style='padding:5px;'>[% detail.note %]</td>
             </tr>
-    [% END %]
+        [% END %]
         </tbody>
     </table>
 </div>

Added: trunk/Open-ILS/src/sql/Pg/upgrade/0208.data.titles_received_worksheet_tweaks.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0208.data.titles_received_worksheet_tweaks.sql	                        (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0208.data.titles_received_worksheet_tweaks.sql	2010-03-24 19:50:43 UTC (rev 15960)
@@ -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; -%]
+<div class="wrapper">
+    <div class="summary" style='font-size:110%; font-weight:bold;'>
+
+        <div>Title: [% helpers.get_li_attr("title", "", li.attributes) %]</div>
+        <div>Author: [% helpers.get_li_attr("author", "", li.attributes) %]</div>
+        <div class="count">Item Count: [% li.lineitem_details.size %]</div>
+        <div class="lineid">Lineitem ID: [% li.id %]</div>
+
+        [% IF li.distribution_formulas.size > 0 %]
+            [% SET forms = [] %]
+            [% FOREACH form IN li.distribution_formulas; forms.push(form.formula.name); END %]
+            <div>Distribution Formulas: [% forms.join(',') %]</div>
+        [% END %]
+
+        [% IF li.lineitem_notes.size > 0 %]
+            Lineitem Notes:
+            <ul>
+                [%- FOR note IN li.lineitem_notes -%]
+                    <li>
+                    [% IF note.alert_text %]
+                        [% note.alert_text.code -%] 
+                        [% IF note.value -%]
+                            : [% note.value %]
+                        [% END %]
+                    [% ELSE %]
+                        [% note.value -%] 
+                    [% END %]
+                    </li>
+                [% END %]
+            </ul>
+        [% END %]
+    </div>
+    <br/>
+    <table>
+        <thead>
+            <tr>
+                <th>Branch</th>
+                <th>Barcode</th>
+                <th>Call Number</th>
+                <th>Fund</th>
+                <th>Recd.</th>
+                <th>Notes</th>
+            </tr>
+        </thead>
+        <tbody>
+        [% 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 
+            %]
+            <tr>
+                <!-- acq.lineitem_detail.id = [%- detail.id -%] -->
+                <td style='padding:5px;'>[% detail.owning_lib.shortname %]</td>
+                <td style='padding:5px;'>[% IF copy.barcode   %]<span class="barcode"  >[% detail.barcode   %]</span>[% END %]</td>
+                <td style='padding:5px;'>[% IF cn_label %]<span class="cn_label" >[% cn_label  %]</span>[% END %]</td>
+                <td style='padding:5px;'>[% IF detail.fund %]<span class="fund">[% detail.fund.code %] ([% detail.fund.year %])</span>[% END %]</td>
+                <td style='padding:5px;'>[% IF detail.recv_time %]<span class="recv_time">[% detail.recv_time %]</span>[% END %]</td>
+                <td style='padding:5px;'>[% detail.note %]</td>
+            </tr>
+        [% END %]
+        </tbody>
+    </table>
+</div>
+$$
+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;
+



More information about the open-ils-commits mailing list