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