[% PROCESS "opac/parts/header.tt2"; PROCESS "opac/parts/misc_util.tt2"; WRAPPER "opac/parts/myopac/main_base.tt2"; myopac_page = "main"; myopac_main_page = "main"; myopac_cc_allowed = 0; IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1; myopac_cc_allowed = 1; END %]

[% l('My Account Summary') %]

[% IF myopac_cc_allowed; # http://www.w3.org/TR/WCAG20-TECHS/H32.html # avoid forms w/ no submit action %]
[% END %] [% IF ctx.fines.circulation.size > 0 %]
[% IF myopac_cc_allowed %] [% l("Pay Selected Circulation Charges") %] [% ELSE %] [% l("Circulation Charges") %] [% END %]
[% IF myopac_cc_allowed %] [% END %] [% 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 %] [% IF myopac_cc_allowed %] [% END %] [% END %]
[% l("Owed") %] [% l("Billing Type") %] [% l("Title") %] [% l("Checkout") %] [% l(" Due ") %] [% l(" Returned/Renewed") %] [% l(" Returned*") %]
[% money(f.xact.balance_owed)%] [% f.xact.last_billing_type %] [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id; IF recid; %] [% attrs.title | html %] [% ELSE %] [% attrs.title | html %] [% END %] [% 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; due_org = f.xact.circulation.circ_lib || f.xact.reservation.pickup_lib; IF ts; date.format(ctx.parse_datetime(ts, due_org), 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 %]
*Items may have been renewed.
[% END %] [% IF ctx.fines.grocery.size > 0 %]


[% IF myopac_cc_allowed %] [% l("Pay Selected Other Charges") %] [% ELSE %] [% l("Other Charges") %] [% END %]
[% IF myopac_cc_allowed %] [% END %] [% FOR f IN ctx.fines.grocery %] [% IF myopac_cc_allowed %] [% END %] [% END %]
[% l("Owed") %] [% l("Billing Type") %] [% l("Note") %] [% l("Date") %]
[% money(f.xact.balance_owed) %] [% f.xact.last_billing_type %] [% f.xact.last_billing_note %] [% date.format( ctx.parse_datetime(f.xact.xact_start), DATE_FORMAT ) %]
[% END %] [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
[% l('You have no current fines.') %]
[% ELSIF myopac_cc_allowed %]
[% END %] [% IF myopac_cc_allowed %]
[% END %] [% END %]