LP1156905 lineitem worksheet sorts copies by org
authorMark Cooper <markchristophercooper@gmail.com>
Mon, 18 Mar 2013 22:45:14 +0000 (15:45 -0700)
committerBill Erickson <berick@esilibrary.com>
Wed, 10 Jul 2013 15:49:22 +0000 (11:49 -0400)
Lineitem copies (details) were set to be sorted by branch ('owning_lib')
by default. However this was not happening because the lineitem_details
'owning_lib' referenced a fieldmapper object (not an id or name).
This submission sets the owning_lib to the shortname so that sorting can
occur in the intended way.

Signed-off-by: Mark Cooper <markchristophercooper@gmail.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/sql/Pg/950.data.seed-values.sql

index cd0bb36..08f8766 100644 (file)
@@ -8006,6 +8006,11 @@ $$
             </tr>
         </thead>
         <tbody>
+        <!-- set detail.owning_lib from fm object to org name -->
+        [% 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;
@@ -8018,7 +8023,7 @@ $$
             %]
             <tr>
                 <!-- acq.lineitem_detail.id = [%- detail.id -%] -->
-                <td style='padding:5px;'>[% detail.owning_lib.shortname %]</td>
+                <td style='padding:5px;'>[% detail.owning_lib %]</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>