Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6cbd3aaf

Von Kivitendo Admin vor fast 2 Jahren hinzugefügt

  • ID 6cbd3aaf080a5a95694e92dc749ff0eab6cb6700
  • Vorgänger eeba798e
  • Nachfolger dabb630b

Design 4.0: Jahresabschluß Templates im neuen Design

Unterschiede anzeigen:

templates/design40_webpages/yearend/_charts.html
1
[%- USE LxERP -%]
2
[%- USE T8    -%]
3
[%- USE L     -%]
4
[%- USE HTML  -%]
5
[%- USE P     -%]
6

  
7

  
8
[%- SET dec = 2 %]
9

  
10
<h2>[% 'Balance accounts' | $T8 %]</h2>
11
<table class="tbl-list wi-moderate">
12
 <thead>
13
 <tr>
14
  <th            >[%- 'Account'          | $T8 %]</th>
15
  <th            >[%- 'Description'      | $T8 %]</th>
16
  <th colspan="2">[%- 'Starting Balance' | $T8 %]</th>
17
  <th colspan="2">[%- 'Balance with CB'  | $T8 %]</th>
18
  <th colspan="2">[%- 'Closing Balance'  | $T8 %]</th>
19
 </tr>
20
 </thead>
21
 <thead>
22
 <tr>
23
  <th></th>
24
  <th></th>
25
  <th>[%- 'Debit'  | $T8 %]</th>
26
  <th>[%- 'Credit' | $T8 %]</th>
27
  <th>[%- 'Debit'  | $T8 %]</th>
28
  <th>[%- 'Credit' | $T8 %]</th>
29
  <th>[%- 'Debit'  | $T8 %]</th>
30
  <th>[%- 'Credit' | $T8 %]</th>
31
 </tr>
32
 </thead>
33
 <tbody>
34
 [% FOREACH chart = charts %]
35
   [%- NEXT UNLESS chart.account_type == 'asset_account' -%]
36
 <tr id="tr_[% loop.count %]" class="listrow[% loop.count % 2 %]">
37
  <td>                 [% chart.accno | html %]</td>
38
  <td>                 [% chart.description | html %]</td>
39
  <td class="numeric"> [% IF chart.ob_amount < 0      %]  [% LxERP.format_amount(chart.ob_amount * -1, dec)       %] [% END %]</td>
40
  <td class="numeric"> [% IF chart.ob_amount > 0      %]  [% LxERP.format_amount(chart.ob_amount, dec)            %] [% END %]</td>
41
  <td class="numeric"> [% IF chart.amount_with_cb < 0 %]  [% LxERP.format_amount(chart.amount_with_cb * -1, dec)  %] [% END %]</td>
42
  <td class="numeric"> [% IF chart.amount_with_cb > 0 %]  [% LxERP.format_amount(chart.amount_with_cb, dec)       %] [% END %]</td>
43
  [% # cb amounts: >/< are switched and cb_amounts are multiplied with -1. The closing balance as calculated by cb_amount negates the actual balance, but when displaying it as the closing balance we want to display it in the same form as the actual balance %]
44
  <td class="numeric"> [% IF chart.cb_amount > 0 %]  [% LxERP.format_amount(chart.cb_amount *  1, dec) %] [% END %]</td>
45
  <td class="numeric"> [% IF chart.cb_amount < 0 %]  [% LxERP.format_amount(chart.cb_amount * -1, dec) %] [% END %]</td>
46
 </tr>
47
 [% END %]
48
 </tbody>
49
</table>
50

  
51
<h2>[% 'Profit and loss accounts' | $T8 %]</h2>
52

  
53
<p>
54
[% IF profit_loss_sum < 0 %] [% THEN %][% 'Loss' | $T8 %] [% ELSE %] [% 'Profit' | $T8 %] [% END %]:   
55
[% LxERP.format_amount(profit_loss_sum, dec) %]
56
</p>
57

  
58
<table class="tbl-list wi-moderate">
59
 <thead>
60
 <tr>
61
  <th          >[%- 'Account'         | $T8 %]</th>
62
  <th          >[%- 'Description'     | $T8 %]</th>
63
  <th colspan=2>[%- 'Balance with CB' | $T8 %]</th>
64
  <th colspan=2>[%- 'Closing Balance' | $T8 %]</th>
65
 </tr>
66
 </thead>
67
 <thead>
68
 <tr>
69
  <th></th>
70
  <th></th>
71
  <th>[%- 'Debit'  | $T8 %]</th>
72
  <th>[%- 'Credit' | $T8 %]</th>
73
  <th>[%- 'Debit'  | $T8 %]</th>
74
  <th>[%- 'Credit' | $T8 %]</th>
75
 </tr>
76
 </thead>
77
 <tbody>
78
 [% FOREACH chart = charts %]
79
   [%- NEXT UNLESS chart.account_type == 'profit_loss_account' -%]
80
 <tr id="tr_[% loop.count %]" class="listrow[% loop.count % 2 %]">
81
  <td                >[% chart.accno | html %]</td>
82
  <td                >[% chart.description | html %]</td>
83
  <td class="numeric">[% IF chart.amount_with_cb < 0 %] [% LxERP.format_amount(chart.amount_with_cb * -1, dec) %] [% END %]</td>
84
  <td class="numeric">[% IF chart.amount_with_cb > 0 %] [% LxERP.format_amount(chart.amount_with_cb, dec)      %] [% END %]</td>
85
  <td class="numeric">[% IF chart.cb_amount > 0 %] [% LxERP.format_amount(chart.cb_amount *  1, dec) %] [% END %]</td>
86
  <td class="numeric">[% IF chart.cb_amount < 0 %] [% LxERP.format_amount(chart.cb_amount * -1, dec)      %] [% END %]</td>
87
 </tr>
88
 [% END %]
89
 </tbody>
90
</table>
91
[% # L.dump(charts) %]
templates/design40_webpages/yearend/form.html
1
[%- USE HTML %]
2
[%- USE T8 %]
3
[%- USE L %]
4
[%- USE LxERP %]
5

  
6
<h1>[% title | html %]</h1>
7

  
8
[%- INCLUDE 'common/flash.html' %]
9

  
10
<div class="wrapper">
11

  
12
[% IF carry_over_chart AND profit_chart AND loss_chart %] [% THEN %]
13
<form id="filter" name="filter" method="post" action="controller.pl">
14
<table class="tbl-horizontal">
15
  <tr>
16
    <td>[% 'Year-end date' | $T8 %]</td>
17
    <td>[% L.date_tag('cb_date', SELF.cb_date) %]</td>
18
  </tr>
19
  <tr class="startdate">
20
   <td>[% 'Startdate method' | $T8 %]</td>
21
   <td>[% L.select_tag('balance_startdate_method', balance_startdate_method_options, value_key = 'value', title_key = 'title') %]</td>
22
  </tr>
23
  <tr class="startdate">
24
    <td>[% 'Start date' | $T8 %]</td>
25
    <td>[% L.date_tag('cb_startdate', '', readonly=1) %]</td>
26
  </tr>
27
  <tr>
28
    <td>[% 'Carry over account for year-end closing' | $T8 %]</td>
29
    <td>[% carry_over_chart.displayable_name | html %]</td>
30
  </tr>
31
  <tr>
32
    <td>[% 'Profit carried forward account' | $T8 %]</td>
33
    <td>[% profit_chart.displayable_name | html %]</td>
34
  </tr>
35
  <tr>
36
    <td>[% 'Loss carried forward account' | $T8 %]</td>
37
    <td>[% loss_chart.displayable_name | html %]</td>
38
  </tr>
39
</table>
40
</form>
41
[% ELSE %]
42
  [% 'Please configure the carry over and profit and loss accounts for year-end closing in the client configuration!' | $T8 %]
43
[% END %]
44

  
45
[% # L.button_tag("refresh_charts();", LxERP.t8("Preview")) %]
46
[% L.button_tag("year_end_bookings();", LxERP.t8("Apply year-end bookings"), id='apply_year_end_bookings_button', confirm=LxERP.t8("Are you sure?")) %]
47

  
48
<div id="charts" style="padding-top: 20px">
49
</div>
50

  
51
</div> <!-- wrapper -->
52

  
53
<script type="text/javascript">
54

  
55
  function get_startdate() {
56
    $.get("controller.pl", {
57
      action:                   'YearEndTransactions/get_start_date',
58
      cb_date:                  $('#cb_date').val(),
59
      balance_startdate_method: $('#balance_startdate_method').val()
60
    }, kivi.eval_json_result)
61
  }
62

  
63
  function year_end_bookings() {
64
    $.post("controller.pl", {
65
      action:  'YearEndTransactions/year_end_bookings',
66
      cb_date: $('#cb_date').val(),
67
    }, kivi.eval_json_result)
68
  }
69

  
70
  function refresh_charts() {
71
    var filterdata = $('#filter').serialize()
72
    var url = './controller.pl?action=YearEndTransactions/update_charts&' + filterdata;
73
    $.ajax({
74
       url : url,
75
       type: 'GET',
76
       success: function(data){
77
           $('#charts').html(data);
78
       }
79
    })
80
  };
81

  
82
$(function(){
83

  
84
  $('#apply_year_end_bookings_button').hide();
85
  $('.startdate').hide();
86

  
87
  $('#balance_startdate_method').change(function(){
88
    get_startdate();
89
    setTimeout(function() {
90
      refresh_charts();
91
    }, 200);    
92
  });
93

  
94
  $('#cb_date').change(function(){
95
    get_startdate();
96
    setTimeout(function() {
97
      refresh_charts();
98
    }, 200);    
99
  });
100
})
101

  
102
</script>

Auch abrufbar als: Unified diff