<field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
<field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
+ <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
+ <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
</fields>
<links>
<link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
<link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
<link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
<link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
+ <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
+ <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
</links>
</class>
<class id="acirc" controller="open-ils.cstore" oils_obj:fieldmapper="action::aged_circulation" oils_persist:tablename="action.aged_circulation" reporter:core="true" reporter:label="Aged (patronless) Circulation">
{ target_copy => $copy_id, dest_recv_time => undef } )->[0];
# find the latest circ, open or closed
- my $circ = $e->search_action_circulation(
+ my $circ = $e->search_action_all_circulation(
[
{ target_copy => $copy_id },
{
- flesh => 1,
+ flesh => 2,
flesh_fields => {
+ combcirc => [
+ 'active_circ',
+ 'aged_circ'
+ ],
circ => [
'workstation',
- 'checkin_workstation',
- 'duration_rule',
- 'max_fine_rule',
+ 'checkin_workstation',
+ 'duration_rule',
+ 'max_fine_rule',
+ 'recurring_fine_rule'
+ ],
+ acirc => [
+ 'workstation',
+ 'checkin_workstation',
+ 'duration_rule',
+ 'max_fine_rule',
'recurring_fine_rule'
]
},
]
)->[0];
+ if ($circ) {
+ $circ = $circ->active_circ ? $circ->active_circ : $circ->aged_circ;
+ }
return {
copy => $copy,