Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2be5630a

Von Bernd Bleßmann vor etwa 2 Jahren hinzugefügt

  • ID 2be5630a37424773a5c02e3c7b39bd202e6cd10f
  • Vorgänger bfcc4c7a
  • Nachfolger fe51b1d2

Umsatzstatistik: Chart direkt laden

Unterschiede anzeigen:

js/kivi.CustomerVendorTurnover.js
43 43
  };
44 44

  
45 45
  ns.show_turnover_chart = function(period, year_for_month) {
46
    const html = '<div class="chart-container" style="position: relative;">'
47
               + '<canvas id="chart"></canvas>'
48
               + '</div>';
49
    $('#turnovers').html(html);
50

  
51 46
    let mode = "month";
52 47
    if (period === 'y') {
53 48
      mode    = "year";
......
63 58
                   year: year_for_month
64 59
                 };
65 60
    $.getJSON('controller.pl', data, function( returned_data ) {
61
      const html = '<canvas id="turnovers_chart"></canvas>';
62
      $('#turnovers_chart_container').html(html);
66 63
      ns.draw_chart(returned_data);
67
      $("html, body").animate({ scrollTop: $("#chart").offset().top }, "slow");
64
      $("html, body").animate({ scrollTop: $("#turnovers_chart").offset().top }, "slow");
68 65
    });
69 66
  };
70 67

  
......
89 86
  };
90 87

  
91 88
  ns.chart = function(data) {
92
    const ctx = 'chart';
89
    const ctx = 'turnovers_chart';
93 90
    const chart = new Chart(ctx, {
94 91
      type: 'bar',
95 92
      data: {
......
185 182
      if (ui.newPanel.attr('id') == 'quotations') {
186 183
        ns.get_sales_quotations();
187 184
      }
185
      if (ui.newPanel.attr('id') == 'turnover_stat') {
186
        ns.show_turnover_chart("y");
187
      }
188 188
      return 1;
189 189
    });
190 190

  
......
192 192
      if (ui.panel.attr('id') == 'quotations') {
193 193
        ns.get_sales_quotations();
194 194
      }
195
      if (ui.panel.attr('id') == 'turnover_stat') {
196
        ns.show_turnover_chart("y");
197
      }
195 198
      return 1;
196 199
    });
197 200
  };
locale/de/all
2225 2225
  'Monat'                       => 'Monat',
2226 2226
  'Monday'                      => 'Montag',
2227 2227
  'Month'                       => 'Monat',
2228
  'Month as chart'              => 'Monat als Grafik',
2229 2228
  'Month/Year'                  => 'Monat/Jahr',
2230 2229
  'Monthly'                     => 'monatlich',
2231 2230
  'More than one control file with the tag \'%s\' exist.' => 'Es gibt mehr als eine Kontrolldatei mit dem Tag \'%s\'.',
......
4478 4477
  'X'                           => 'X',
4479 4478
  'YYYY'                        => 'JJJJ',
4480 4479
  'Year'                        => 'Jahr',
4481
  'Year as chart'               => 'Jahr als Grafik',
4482 4480
  'Year-end bookings were successfully completed!' => 'Die Jahresabschlußbuchungen wurden erfolgreich durchgeführt!',
4483 4481
  'Year-end closing'            => 'Jahresabschluß',
4484 4482
  'Year-end date'               => 'Jahresabschlußdatum',
locale/en/all
2158 2158
  'Monat'                       => '',
2159 2159
  'Monday'                      => '',
2160 2160
  'Month'                       => '',
2161
  'Month as chart'              => '',
2162 2161
  'Month/Year'                  => '',
2163 2162
  'Monthly'                     => '',
2164 2163
  'More than one control file with the tag \'%s\' exist.' => '',
......
4347 4346
  'X'                           => '',
4348 4347
  'YYYY'                        => '',
4349 4348
  'Year'                        => '',
4350
  'Year as chart'               => '',
4351 4349
  'Year-end bookings were successfully completed!' => '',
4352 4350
  'Year-end closing'            => '',
4353 4351
  'Year-end date'               => '',
templates/webpages/customer_vendor_turnover/turnover_statistic.html
2 2
[%- USE LxERP %]
3 3
[%- USE L %]
4 4
[%- USE HTML %]
5
<p>
6
[% L.radio_button_tag('period', value='year', label= LxERP.t8('Year'), onclick='kivi.CustomerVendorTurnover.show_turnover_stat("y");') %]
7

  
8
[% L.radio_button_tag('period', value='year_chart', label= LxERP.t8('Year as chart'), onclick='kivi.CustomerVendorTurnover.show_turnover_chart("y");') %]
9

  
10
[% L.radio_button_tag('period', value='month', label= LxERP.t8('Month'), onclick='kivi.CustomerVendorTurnover.show_turnover_stat("m");') %]
11

  
12
[% L.radio_button_tag('period', value='month_chart', label= LxERP.t8('Month as chart'), onclick='kivi.CustomerVendorTurnover.show_turnover_chart("m");') %]
13
</p>
5
<div class="chart-container" id="turnovers_chart_container" style="position: relative;">
6
  [%- LxERP.t8("Loading...") %]
7
</div>
14 8
<div id="turnovers"></div>

Auch abrufbar als: Unified diff