6 <h1>[% title | html %]</h1>
8 [%- INCLUDE 'common/flash.html' %]
10 [% IF carry_over_chart AND profit_chart AND loss_chart %] [% THEN %]
11 <form id="filter" name="filter" method="post" action="controller.pl">
14 <td align="right">[% 'Year-end date' | $T8 %]</td>
15 <td>[% L.date_tag('cb_date', SELF.cb_date) %]</td>
17 <tr class="startdate">
18 <td align="right">[% 'Startdate method' | $T8 %]</td>
19 <td>[% L.select_tag('balance_startdate_method', balance_startdate_method_options, value_key = 'value', title_key = 'title') %]</td>
21 <tr class="startdate">
22 <td align="right">[% 'Start date' | $T8 %]</td>
23 <td>[% L.date_tag('cb_startdate', '', readonly=1) %]</td>
26 <td align="right">[% 'Carry over account for year-end closing' | $T8 %]</td>
27 <td>[% carry_over_chart.displayable_name | html %]</td>
30 <td align="right">[% 'Profit carried forward account' | $T8 %]</td>
31 <td>[% profit_chart.displayable_name | html %]</td>
34 <td align="right">[% 'Loss carried forward account' | $T8 %]</td>
35 <td>[% loss_chart.displayable_name | html %]</td>
40 [% 'Please configure the carry over and profit and loss accounts for year-end closing in the client configuration!' | $T8 %]
43 [% # L.button_tag("refresh_charts();", LxERP.t8("Preview")) %]
44 [% L.button_tag("year_end_bookings();", LxERP.t8("Apply year-end bookings"), id='apply_year_end_bookings_button', confirm=LxERP.t8("Are you sure?")) %]
46 <div id="charts" style="padding-top: 20px">
49 <script type="text/javascript">
51 function get_startdate() {
52 $.get("controller.pl", {
53 action: 'YearEndTransactions/get_start_date',
54 cb_date: $('#cb_date').val(),
55 balance_startdate_method: $('#balance_startdate_method').val()
56 }, kivi.eval_json_result)
59 function year_end_bookings() {
60 $.post("controller.pl", {
61 action: 'YearEndTransactions/year_end_bookings',
62 cb_date: $('#cb_date').val(),
63 }, kivi.eval_json_result)
66 function refresh_charts() {
67 var filterdata = $('#filter').serialize()
68 var url = './controller.pl?action=YearEndTransactions/update_charts&' + filterdata;
72 success: function(data){
73 $('#charts').html(data);
80 $('#apply_year_end_bookings_button').hide();
81 $('.startdate').hide();
83 $('#balance_startdate_method').change(function(){
85 setTimeout(function() {
90 $('#cb_date').change(function(){
92 setTimeout(function() {