Kundenstatistik: Templates
authorWerner Hahn <wh@futureworldsearch.net>
Thu, 12 Nov 2015 08:59:49 +0000 (09:59 +0100)
committerWerner Hahn <wh@futureworldsearch.net>
Mon, 10 Sep 2018 17:54:03 +0000 (19:54 +0200)
templates/webpages/customer_vendor/form.html
templates/webpages/customer_vendor_turnover/_list_open_items.html [new file with mode: 0644]
templates/webpages/customer_vendor_turnover/count_open_items_by_year.html [new file with mode: 0644]
templates/webpages/customer_vendor_turnover/count_turnover.html [new file with mode: 0644]
templates/webpages/customer_vendor_turnover/dun_statistic.html [new file with mode: 0644]
templates/webpages/customer_vendor_turnover/invoices_statistic.html [new file with mode: 0644]
templates/webpages/customer_vendor_turnover/turnover.html [new file with mode: 0644]
templates/webpages/customer_vendor_turnover/turnover_statistic.html [new file with mode: 0644]

index 4b6e32e..ae05d85 100644 (file)
@@ -36,6 +36,7 @@
       [% IF SELF.cv.id %]
         <li><a href="#price_rules">[% 'Price Rules' | $T8 %]</a></li>
       [% END %]
+      <li><a href="[% 'controller.pl?action=CustomerVendorTurnover/list_turnover&id=' _ SELF.cv.id | html %]">[% LxERP.t8('Turnovers') %] [%- IF SELF.open_items > 0 %] <span style="background-color:red;color:black;">&nbsp; $&nbsp; </span>[% END %]</a></li>
     </ul>
 
     [% PROCESS "customer_vendor/tabs/billing.html" %]
diff --git a/templates/webpages/customer_vendor_turnover/_list_open_items.html b/templates/webpages/customer_vendor_turnover/_list_open_items.html
new file mode 100644 (file)
index 0000000..51eb721
--- /dev/null
@@ -0,0 +1,39 @@
+[%- USE T8 %]
+[%- USE LxERP %]
+[%- USE L %]
+[%- USE HTML %]
+<div class="listtop">[%- HTML.escape(title) %]</div>
+
+<div id="sales_report">
+  <table width="100%">
+    <tbody>
+      <tr>
+        <td class="listheading">[% 'Invoice Number' | $T8 %]</td>
+        <td class="listheading">[% 'Invoice Date' | $T8 %]</td>
+        <td class="listheading">[% 'Amount' | $T8 %]</td>
+        <td class="listheading">[% 'Inv. Duedate' | $T8 %]</td>
+        <td class="listheading">[% 'Paid' | $T8 %]</td>
+        <td class="listheading">[% 'Open Amount' | $T8 %]</td>
+        <td class="listheading">[% 'Dunnings' | $T8 %]</td>
+      </tr>
+
+      [%- FOREACH row = OPEN_ITEMS %]
+      <tr class="listrow[% loop.count % 2 %]">
+        <td>[% row.invnumber | html %]</td>
+        <td>[% row.transdate.to_kivitendo | html %]</td>
+        <td>[%- LxERP.format_amount(row.amount, 2) %]</td>
+        <td>[% row.duedate.to_kivitendo | html %]</td>
+        <td>[%- LxERP.format_amount(row.paid, 2) %]</td>
+        <td>[%- LxERP.format_amount(row.amount - row.paid,2) %]
+        <td>
+        [%- IF row.dunning_config_id != '' %]
+          [%- FOREACH dun = row.dunnings %]
+          [% dun.dunning_id | html %] -- [% dun.duedate.to_kivitendo | html %] -- [% dun.dunning_level | html %] -- [% dun.fee %]<br>
+          [% END %]
+        [% END %]
+        </td>
+      </tr>
+      [% END %]
+    </tbody>
+  </table>
+</div> 
diff --git a/templates/webpages/customer_vendor_turnover/count_open_items_by_year.html b/templates/webpages/customer_vendor_turnover/count_open_items_by_year.html
new file mode 100644 (file)
index 0000000..8309b05
--- /dev/null
@@ -0,0 +1,23 @@
+[%- USE T8 %]
+[%- USE LxERP %]
+[%- USE L %]
+[%- USE HTML %]
+<div id="dun_statistic">
+  <table width="100%">
+    <tbody>
+      <tr>
+        <td class="listheading">[% 'Month/Year' | $T8 %]</td>
+        <td class="listheading">[% 'Dunnings' | $T8 %]</td>
+        <td class="listheading">[% 'Highest Dunninglevel' | $T8 %]</td>
+      </tr>
+
+      [%- FOREACH row = SELF.dun_statistic %]
+      <tr class="listrow[% loop.count % 2 %]">
+        <td>[% row.date_part | html %]</td>
+        <td>[% row.count | html %]</td>
+        <td>[% row.max | html %]</td>
+      </tr>
+      [% END %]
+    </tbody>
+  </table>
+</div>
diff --git a/templates/webpages/customer_vendor_turnover/count_turnover.html b/templates/webpages/customer_vendor_turnover/count_turnover.html
new file mode 100644 (file)
index 0000000..cf793e2
--- /dev/null
@@ -0,0 +1,27 @@
+[%- USE T8 %]
+[%- USE LxERP %]
+[%- USE L %]
+[%- USE HTML %]
+<div id="turnover_statistic">
+  <table width="100%">
+    <tbody>
+      <tr>
+        <td class="listheading">[% 'Month/Year' | $T8 %]</td>
+        <td class="listheading">[% 'Invoices' | $T8 %]</td>
+        <td class="listheading">[% 'Turnover' | $T8 %]</td>
+        <td class="listheading">[% 'Net.Turnover' | $T8 %]</td>
+        <td class="listheading">[% 'Paid' | $T8 %]</td>
+      </tr>
+      [%- FOREACH row = SELF.turnover_statistic %]
+      <tr class="listrow[% loop.count % 2 %]">
+        <td>[% row.date_part | html %]</td>
+        <td>[% row.count | html %]</td>
+        <td>[%- LxERP.format_amount(row.amount,2) %]</td>
+        <td>[%- LxERP.format_amount(row.netamount,2) %]</td>
+        <td>[%- LxERP.format_amount(row.paid,2) %]</td>
+      </tr>
+      [% END %]
+
+    </tbody>
+  </table>
+</div>
diff --git a/templates/webpages/customer_vendor_turnover/dun_statistic.html b/templates/webpages/customer_vendor_turnover/dun_statistic.html
new file mode 100644 (file)
index 0000000..7d46bf9
--- /dev/null
@@ -0,0 +1,22 @@
+[%- USE T8 %]
+[%- USE LxERP %]
+[%- USE L %]
+[%- USE HTML %]
+
+<p> 
+[% L.radio_button_tag('period', value='year', label= LxERP.t8('Year'), onclick='show_dun_stat("y");') %]
+
+[% L.radio_button_tag('period', value='month', label= LxERP.t8('Month'), onclick='show_dun_stat("m");') %]
+</p>
+<script type="text/javascript">
+  function show_dun_stat(period) {
+    if (period === 'y') {
+      var url = 'controller.pl?action=CustomerVendorTurnover/count_open_items_by_year&id=' + $('#cv_id').val();
+      $('#duns').load(url);
+    } else {
+      var url = 'controller.pl?action=CustomerVendorTurnover/count_open_items_by_month&id=' + $('#cv_id').val();
+      $('#duns').load(url);
+    }
+  }
+</script>
+<div id="duns"></div>
diff --git a/templates/webpages/customer_vendor_turnover/invoices_statistic.html b/templates/webpages/customer_vendor_turnover/invoices_statistic.html
new file mode 100644 (file)
index 0000000..7b8f3d9
--- /dev/null
@@ -0,0 +1,33 @@
+[%- USE T8 %]
+[%- USE LxERP %]
+[%- USE L %]
+[%- USE HTML %]
+<div id="invoice_statistic">
+  <table width="100%">
+    <tbody>
+      <tr>
+        <td class="listheading">[% 'Invoice Number' | $T8 %]</td>
+        <td class="listheading">[% 'Invoice Date' | $T8 %]</td>
+        <td class="listheading">[% 'Amount' | $T8 %]</td>
+        <td class="listheading">[% 'Inv. Duedate' | $T8 %]</td>
+        <td class="listheading">[% 'Paid' | $T8 %]</td>
+        <td class="listheading">[% 'Open Amount' | $T8 %]</td>
+      </tr>
+
+      [%- FOREACH row = invoices %]
+      <tr class="listrow[% loop.count % 2 %]">
+        <td>[% row.invnumber | html %]</td>
+        <td>[% row.transdate.to_kivitendo | html %]</td>
+        <td>[%- LxERP.format_amount(row.amount, 2) %]</td>
+        <td>[% row.duedate.to_kivitendo | html %]</td>
+        <td>[%- LxERP.format_amount(row.paid, 2) %]</td>
+        <td>[%- LxERP.format_amount(row.amount - row.paid, 2) %]
+      </tr>
+      [% END %]
+    </tbody>
+  </table>
+
+      
+    </tbody>
+  </table>
+</div>
diff --git a/templates/webpages/customer_vendor_turnover/turnover.html b/templates/webpages/customer_vendor_turnover/turnover.html
new file mode 100644 (file)
index 0000000..310355d
--- /dev/null
@@ -0,0 +1,11 @@
+[%- USE T8 %]
+[%- USE LxERP %]
+[%- USE L %]
+[%- USE HTML %]
+[%- USE JavaScript -%]
+
+[%- IF open_items %]
+[% open_items %]
+[% END %]
+
+[% PROCESS "customer_vendor_turnover/_statistic_tabs.html" %]
diff --git a/templates/webpages/customer_vendor_turnover/turnover_statistic.html b/templates/webpages/customer_vendor_turnover/turnover_statistic.html
new file mode 100644 (file)
index 0000000..c2ea10e
--- /dev/null
@@ -0,0 +1,21 @@
+[%- USE T8 %]
+[%- USE LxERP %]
+[%- 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='month', label= LxERP.t8('Month'), onclick='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();
+      $('#turnovers').load(url);
+    } else {
+      var url = 'controller.pl?action=CustomerVendorTurnover/turnover_by_month&id=' + $('#cv_id').val();
+      $('#turnovers').load(url);
+    }
+  }
+</script>
+<div id="turnovers"></div>