[% PROCESS "default/opac/parts/header.tt2"; PROCESS "default/opac/parts/misc_util.tt2"; WRAPPER "default/opac/parts/myopac/main_base.tt2"; myopac_page = "main"; myopac_main_page = "main"; %]
[% IF ctx.fines.circulation.size > 0 %]
[% FOR f IN ctx.fines.circulation; attrs = {marc_xml => f.marc_xml}; IF f.marc_xml; PROCESS get_marc_attrs args=attrs; ELSIF f.xact.reservation; attrs.title = f.xact.reservation.target_resource_type.name; END %] [% END %]
[% l("Fines") %]
[% l("Title") %] [% l("Author") %] [% l("Checkout Date") %] [% l("Due Date") %] [% l("Date Returned") %] [% l("Balance Owed") %]
[% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id; IF recid; %] [% attrs.title %] [% ELSE %] [% attrs.title %] [% END %] [% attrs.author %] [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0; IF ts; date.format(ctx.parse_datetime(ts), DATE_FORMAT); END %] [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0; IF ts; date.format(ctx.parse_datetime(ts), DATE_FORMAT); END %] [% ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0; IF ts; date.format(ctx.parse_datetime(ts), DATE_FORMAT); ELSE %] [% l('(fines accruing)') %] [% END %] [% money(f.xact.balance_owed) %]
[% END %] [% IF ctx.fines.grocery.size > 0 %]



[% FOR f IN ctx.fines.grocery %] [% END %]
[% l("Other Fees") %]
[% l("Transaction Start Time") %] [% l("Last Payment Time") %] [% l("Initial Amount Owed") %] [% l("Total Amount Paid") %] [% l("Balance Owed") %] [% l("Billing Type") %]
[% date.format( ctx.parse_datetime(f.xact.xact_start), DATE_FORMAT ) %] [% IF f.xact.last_payment_ts; date.format( ctx.parse_datetime( f.xact.last_payment_ts ), DATE_FORMAT ); END %] [% money(f.xact.total_owed) %] [% money(f.xact.total_paid) %] [% money(f.xact.balance_owed) %] [% f.xact.last_billing_type %]
[% END %] [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
[% l('You have no current fines.') %]
[% ELSE %]
[% END %]
[% END %]