epic-s6ts
[kivitendo-erp.git] / templates / webpages / am / list_accounts.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3  <h1>[% title %]</h1>
4
5  <table width="100%">
6
7   <colgroup>
8    <col width="10%">
9    <col width="10%">
10    <col width="10%">
11    <col width="50%">
12    <col width="10%">
13    <col width="10%">
14   </colgroup>
15
16   <tr class="listheading">
17    <th>[% 'Account' | $T8 %]</td>
18    <th colspan="3">[% 'Description (Click on Description for details)' | $T8 %]</td>
19    <th>[% 'Debit' | $T8 %]</td>
20    <th>[% 'Credit' | $T8 %]</td>
21   </tr>
22
23 [%- FOREACH row = CA %]
24  [%- IF row.heading %]
25   <tr class="listheading">
26    <td><a href="[% row.link_edit_account %]">[% row.accno | html %]</a></td>
27    <td colspan="5">[% row.description | html %]</td>
28   </tr>
29  [% ELSE %]
30   <tr class="listrow[% loop.count % 2 %]">
31    <td><b><a href="[% row.link_edit_account %]">[% row.accno | html %]</a></b></td>
32    <td colspan="3" onclick="account_details([% row.id %])">[% row.description | html %]</td>
33    <td class='numeric'>[% row.debit | html %]</td>
34    <td class='numeric'>[% row.credit | html %]</td>
35   </tr>
36
37   <tr id="ajaxrow[% row.id %]" style="display:none", onclick="$(this).toggle()">
38    <td colspan="6" width="100%"><div id="ajaxcontent[% row.id %]"></div></td>
39   </tr>
40  [% END %]
41 [% END %]
42
43  </table>
44
45 <script type='text/javascript'>
46   function account_details(id) {
47     $.ajax({
48       url: 'am.pl?action=list_account_details',
49       data: { args: id },
50       dataType: 'html',
51       success: function (data) { $('#ajaxcontent' + id).html(data) },
52     });
53     $('#ajaxrow' + id).toggle();
54   }
55 </script>
56
57