[% 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;"> $ </span>[% END %]</a></li>
</ul>
[% PROCESS "customer_vendor/tabs/billing.html" %]
--- /dev/null
+[%- 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>
--- /dev/null
+[%- 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>
--- /dev/null
+[%- 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>
--- /dev/null
+[%- 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>
--- /dev/null
+[%- 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>
--- /dev/null
+[%- USE T8 %]
+[%- USE LxERP %]
+[%- USE L %]
+[%- USE HTML %]
+[%- USE JavaScript -%]
+
+[%- IF open_items %]
+[% open_items %]
+[% END %]
+
+[% PROCESS "customer_vendor_turnover/_statistic_tabs.html" %]
--- /dev/null
+[%- 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>