Bug 21913: Clean up payment details page
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / accountline-details.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [%- USE Price -%]
4 [%- USE KohaDates -%]
5 [%- USE AuthorisedValues -%]
6 [%- USE Branches -%]
7 [% SET footerjs = 1 %]
8 [% PROCESS 'accounts.inc' %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Koha &rsaquo; Patrons &rsaquo; [% INCLUDE 'patron-title.inc' no_html = 1 %] &rsaquo; Details of fee</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 </head>
13
14 <body id="pat_accountline_details" class="pat">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'patron-search.inc' %]
17
18 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Account for [% INCLUDE 'patron-title.inc' %]</a> &rsaquo;
19     [% IF type == 'credit' %]
20         Details of payment
21     [% ELSIF type == 'debit' %]
22         Details of fee
23     [% END %]
24 </div>
25
26 <div class="main container-fluid">
27     <div class="row">
28         <div class="col-sm-10 col-sm-push-2">
29             <main>
30
31             [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
32
33             [% IF accountline %]
34                 [% IF type == 'credit' %]
35                     <h2>Details of payment</h2>
36                 [% ELSIF type == 'debit' %]
37                     <h2>Details of fee</h2>
38                 [% END %]
39
40                 <table id="table_account_fines">
41                     <thead>
42                         <tr>
43                             <th class="title-string">Date</th>
44                             <th>Description of charges</th>
45                             <th>Note</th>
46                             <th>Amount</th>
47                             <th>Outstanding</th>
48                         </tr>
49                     </thead>
50
51                     <tbody>
52                         <tr>
53                             <td>
54                                 <span title="[% accountline.date | html %]">[% accountline.date |$KohaDates %]</span>
55                             </td>
56                             <td>
57                                 [%- PROCESS account_type_description account=accountline -%]
58                                 [%- IF accountline.payment_type -%]
59                                     , [% AuthorisedValues.GetByCode('PAYMENT_TYPE', accountline.payment_type) | html %]
60                                 [%- END =%]
61                                 [%- IF accountline.description -%]
62                                     , [% accountline.description | html %]
63                                 [%- END -%]
64
65                                 &nbsp;
66                                 [% IF ( accountline.itemnumber ) %]
67                                     [% SET biblio = accountline.item.biblio %]
68                                     <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% accountline.itemnumber | uri %]">[% biblio.title | html %]</a>
69                                 [% END %]
70                             </td>
71
72                             <td>
73                                 [% accountline.note | html_line_break %]
74                             </td>
75
76                             <td>
77                                 [% accountline.amount | $Price %]
78                             </td>
79
80                             <td>
81                                 [% accountline.amountoutstanding | $Price %]
82                             </td>
83                         </tr>
84                     </tbody>
85                 </table>
86
87
88                 [% IF type == 'credit' %]
89                     <h3>Fees paid</h3>
90                 [% ELSIF type == 'debit' %]
91                     <h3>Payments</h3>
92                 [% END %]
93
94                 <table class="accountline-offsets-table" id="accountline-debits-table">
95                     <thead>
96                         <tr>
97                             <th>Date created</th>
98                             <th>Date updated</th>
99                             <th>Amount</th>
100                             <th>Amount outstanding</th>
101                             <th>Type</th>
102                             <th>Note</th>
103                             <th>Transacting librarian</th>
104                             <th>Date/time of change</th>
105                             <th>Amount of change</th>
106                             <th>Type of change</th>
107                             <th>&nbsp;</th>
108                         </tr>
109                     </thead>
110
111                     <tbody>
112                         [% FOREACH ao IN account_offsets %]
113                             [% IF type == 'credit' %]
114                                 [% SET offset_accountline = ao.debit %]
115                             [% ELSIF type == 'debit' %]
116                                 [% SET offset_accountline = ao.credit %]
117                             [% END %]
118
119                             [% IF offset_accountline %]
120                                 <tr>
121                                     <td>[% offset_accountline.date | $KohaDates %]</td>
122                                     <td>[% offset_accountline.timestamp | $KohaDates  with_hours => 1 %]</td>
123                                     <td>[% offset_accountline.amount | $Price %]</td>
124                                     <td>[% offset_accountline.amountoutstanding | $Price %]</td>
125                                     <td>[% PROCESS account_type_description account=offset_accountline %]</td>
126                                     <td>[% offset_accountline.note | html %]</td>
127                                     <td>[% IF offset_accountline.manager_id %]<a href="moremember.pl?borrowernumber=[% offset_accountline.manager_id | uri %]">[% offset_accountline.manager_id | html %]</a>[% END %]</td>
128                                     <td>[% ao.created_on | $KohaDates  with_hours => 1 %]</td>
129                                     <td>[% ao.amount | $Price %]</td>
130                                     <td>[% PROCESS offset_type_description account_offset=ao %]</td>
131                                     <td><a href="accountline-details.pl?accountlines_id=[% offset_accountline.id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a></td>
132                                 </tr>
133                             [% END %]
134                         [% END %]
135                     </tbody>
136                 </table>
137             [% ELSE %]
138                 <div class="dialog message">
139                     [% IF type == 'credit' %]
140                         Payment not found
141                     [% ELSIF type == 'debit' %]
142                         Fee not found
143                     [% END %]
144                 </div>
145             [% END %]
146
147             </main>
148         </div> <!-- /.col-sm-10.col-sm-push-2 -->
149
150         <div class="col-sm-2 col-sm-pull-10">
151             <aside>
152                 [% INCLUDE 'circ-menu.inc' %]
153             </aside>
154         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
155     </div> <!-- /.row -->
156
157
158 [% MACRO jsinclude BLOCK %]
159     [% INCLUDE 'str/members-menu.inc' %]
160     [% Asset.js("js/members-menu.js") | $raw %]
161 [% END %]
162
163 [% INCLUDE 'intranet-bottom.inc' %]