Kundenstatistik: javascript uas Templates in eigene js ausgelagert
[kivitendo-erp.git] / templates / webpages / customer_vendor_turnover / turnover_statistic.html
index 0ee39bf..3908358 100644 (file)
@@ -3,19 +3,8 @@
 [%- USE L %]
 [%- USE HTML %]
 <p>
-[% L.radio_button_tag('period', value='year', label= LxERP.t8('Year'), onclick='show_turnover_stat("y");') %]
+[% L.radio_button_tag('period', value='year', label= LxERP.t8('Year'), onclick='kivi.CustomerVendorTurnover.show_turnover_stat("y");') %]
 
-[% L.radio_button_tag('period', value='month', label= LxERP.t8('Month'), onclick='show_turnover_stat("m");') %]
+[% L.radio_button_tag('period', value='month', label= LxERP.t8('Month'), onclick='kivi.CustomerVendorTurnover.show_turnover_stat("m");') %]
 </p>
-<script type="text/javascript">
-  function show_turnover_stat(period) {
-    if (period === 'y') {
-      var url = 'controller.pl?action=CustomerVendorTurnover/turnover_by_year&id=' + $('#cv_id').val() + '&db=' + $('#db').val();
-      $('#turnovers').load(url);
-    } else {
-      var url = 'controller.pl?action=CustomerVendorTurnover/turnover_by_month&id=' + $('#cv_id').val() + '&db=' + $('#db').val();
-      $('#turnovers').load(url);
-    }
-  }
-</script>
 <div id="turnovers"></div>