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>
</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;
%]
<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>