Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8e99e751

Von Werner Hahn vor etwa 6 Jahren hinzugefügt

  • ID 8e99e751c3617f03dbbca3210b1bf127aceabb40
  • Vorgänger c092c963
  • Nachfolger 29318a62

Kundenstatistik: offene Rechnungen, offene Aufträge, Angebote, Aufträge,

Kunden und Lieferanten
Kunden Angebote, Aufträge, Rechnungen
Lieferanten Preisanfragen, Lieferantenaufträge, Rechnungen

Unterschiede anzeigen:

SL/Controller/CustomerVendor.pm
28 28
use SL::DB::History;
29 29
use SL::DB::Currency;
30 30
use SL::DB::Invoice;
31
use SL::DB::PurchaseInvoice;
32
use SL::DB::Order;
31 33

  
32 34
use Data::Dumper;
33 35

  
......
945 947
    ],
946 948
    with_objects => ['follow_up'],
947 949
  );
948
  
949
  $self->{open_items} = SL::DB::Manager::Invoice->get_all_count(
950
    query => [
951
      customer_id => $self->{cv}->id,
952
      paid => {lt_sql => 'amount'},      
953
    ],
954
  );
955
  
950

  
951
  if ( $self->is_vendor()) {
952
    $self->{open_items} = SL::DB::Manager::PurchaseInvoice->get_all_count(
953
      query => [
954
        vendor_id => $self->{cv}->id,
955
        paid => {lt_sql => 'amount'},
956
      ],
957
    );
958
  } else {
959
    $self->{open_items} = SL::DB::Manager::Invoice->get_all_count(
960
      query => [
961
        customer_id => $self->{cv}->id,
962
        paid => {lt_sql => 'amount'},
963
      ],
964
    );
965
  }
966

  
967
  if ( $self->is_vendor() ) {
968
    $self->{open_orders} = SL::DB::Manager::Order->get_all_count(
969
      query => [
970
        vendor_id => $self->{cv}->id,
971
        closed => 'F',
972
      ],
973
    );
974
  } else {
975
    $self->{open_orders} = SL::DB::Manager::Order->get_all_count(
976
      query => [
977
        customer_id => $self->{cv}->id,
978
        closed => 'F',
979
      ],
980
    );
981
  }
956 982
  $self->{template_args} ||= {};
957 983

  
958 984
  $::request->{layout}->add_javascripts('kivi.CustomerVendor.js');
SL/Controller/CustomerVendorTurnover.pm
4 4
use SL::DBUtils;
5 5
use SL::DB::AccTransaction;
6 6
use SL::DB::Invoice;
7
use SL::DB::Order;
7 8
use SL::DB;
8 9

  
9 10
__PACKAGE__->run_before('check_auth');
......
15 16

  
16 17
  my $cv = $::form->{id} || {};
17 18
  my $open_invoices;
19
  if ( $::form->{db} eq 'customer' ) {
18 20
  $open_invoices = SL::DB::Manager::Invoice->get_all(
19 21
    query => [customer_id => $cv,
20
              paid => {lt_sql => 'amount'},
22
                or => [
23
                      amount => { gt => \'paid'},
24
                      amount => { lt => \'paid'},
25
                    ],
21 26
    ],
22 27
    with_objects => ['dunnings'],
23 28
  );
29
  } else {
30
    $open_invoices = SL::DB::Manager::PurchaseInvoice->get_all(
31
      query   => [ vendor_id => $cv,
32
                or => [
33
                      amount => { gt => \'paid'},
34
                      amount => { lt => \'paid'},
35
                    ],
36
               ],
37
      sort_by => 'invnumber DESC',
38
    );
39
  }
24 40
  my $open_items;
25 41
  if (@{$open_invoices}) {
26 42
    return $self->render(\'', { type => 'json' }) unless scalar @{$open_invoices};
27 43
    $open_items = $self->_list_open_items($open_invoices);
28 44
  }
29
  return $self->render('customer_vendor_turnover/turnover', { header => 0 }, open_items => $open_items, id => $cv);
45
  my $open_orders = $self->_get_open_orders();
46
  return $self->render('customer_vendor_turnover/turnover', { header => 0 }, open_orders => $open_orders, open_items => $open_items, id => $cv);
30 47
}
31 48

  
32 49
sub _list_open_items {
......
39 56
  my ($self) = @_;
40 57

  
41 58
  return $self->render('generic/error', { layout => 0 }, label_error => "list_transactions needs a trans_id") unless $::form->{id};
42
  my $dbh = SL::DB->client->dbh()
59
  my $dbh = SL::DB->client->dbh;
43 60

  
44 61
  my $cv = $::form->{id} || {};
45 62

  
......
63 80
  my ($self) = @_;
64 81

  
65 82
  return $self->render('generic/error', { layout => 0 }, label_error => "list_transactions needs a trans_id") unless $::form->{id};
66
  my $dbh = SL::DB->client->dbh()
83
  my $dbh = SL::DB->client->dbh;
67 84

  
68 85
  my $cv = $::form->{id} || {};
69 86

  
......
88 105

  
89 106
  return $self->render('generic/error', { layout => 0 }, label_error => "list_transactions needs a trans_id") unless $::form->{id};
90 107

  
91
  my $dbh = SL::DB->client->dbh()
108
  my $dbh = SL::DB->client->dbh;
92 109
  my $cv = $::form->{id} || {};
93
  my $query = "SELECT CONCAT(EXTRACT (MONTH FROM transdate),'/',EXTRACT (YEAR FROM transdate)) AS date_part,
110
  my ($db, $cv_type);
111
  if ($::form->{db} eq 'customer') {
112
    $db      = "ar";
113
    $cv_type = "customer_id";
114
  } else {
115
    $db      = "ap";
116
    $cv_type = "vendor_id";
117
  }
118
  my $query = <<SQL;
119
SELECT CONCAT(EXTRACT (MONTH FROM transdate),'/',EXTRACT (YEAR FROM transdate)) AS date_part,
94 120
    count(id) as count,
95 121
    sum(amount) as amount,
96 122
    sum(netamount) as netamount,
97 123
    sum(paid) as paid
98
    FROM ar WHERE customer_id = $cv
124
    FROM $db WHERE $cv_type = $cv
99 125
    GROUP BY EXTRACT (YEAR FROM transdate), EXTRACT (MONTH FROM transdate)
100
    ORDER BY EXTRACT (YEAR FROM transdate) DESC, EXTRACT (MONTH FROM transdate) DESC";
101

  
126
    ORDER BY EXTRACT (YEAR FROM transdate) DESC, EXTRACT (MONTH FROM transdate) DESC
127
SQL
102 128
   $self->{turnover_statistic} = selectall_hashref_query($::form, $dbh, $query);
103 129
   $self->render('customer_vendor_turnover/count_turnover', { layout => 0 });
104 130
}
105 131
sub action_turnover_by_year {
106

  
107 132
  my ($self) = @_;
108 133

  
109 134
  return $self->render('generic/error', { layout => 0 }, label_error => "list_transactions needs a trans_id") unless $::form->{id};
110 135

  
111
  my $dbh = SL::DB->client->dbh()
136
  my $dbh = SL::DB->client->dbh;
112 137
  my $cv = $::form->{id} || {};
113
  my $query = "SELECT EXTRACT (YEAR FROM transdate) as date_part,
138
  my ($db, $cv_type);
139
  if ($::form->{db} eq 'customer') {
140
    $db      = "ar";
141
    $cv_type = "customer_id";
142
  } else {
143
    $db      = "ap";
144
    $cv_type = "vendor_id";
145
  }
146
  my $query = <<SQL;
147
SELECT EXTRACT (YEAR FROM transdate) as date_part,
114 148
    count(id) as count,
115 149
    sum(amount) as amount,
116 150
    sum(netamount) as netamount,
117 151
    sum(paid) as paid
118
    FROM ar WHERE customer_id = $cv
152
    FROM $db WHERE $cv_type = $cv
119 153
    GROUP BY date_part
120
    ORDER BY date_part DESC";
121

  
154
    ORDER BY date_part DESC
155
SQL
122 156
   $self->{turnover_statistic} = selectall_hashref_query($::form, $dbh, $query);
123 157
   $self->render('customer_vendor_turnover/count_turnover', { layout => 0 });
124 158
}
159

  
125 160
sub action_get_invoices {
126 161
  my ($self) = @_;
127 162

  
128 163
  return $self->render('generic/error', { layout => 0 }, label_error => "list_transactions needs a trans_id") unless $::form->{id};
129 164

  
130 165
  my $cv = $::form->{id} || {};
131
  my $invoices = SL::DB::Manager::Invoice->get_all(
132
    query => [ customer_id => $cv, ],
133
    sort_by => 'invnumber DESC',
134
  );
166
  my $invoices;
167
  if ( $::form->{db} eq 'customer' ) {
168
    $invoices = SL::DB::Manager::Invoice->get_all(
169
      query => [ customer_id => $cv, ],
170
      sort_by => 'invnumber DESC',
171
    );
172
  } else {
173
    $invoices = SL::DB::Manager::PurchaseInvoice->get_all(
174
      query => [ vendor_id => $cv, ],
175
      sort_by => 'invnumber DESC',
176
    );
177
  }
135 178
  $self->render('customer_vendor_turnover/invoices_statistic', { layout => 0 }, invoices => $invoices);
136 179
}
180

  
181
sub action_get_orders {
182
  my ($self) = @_;
183

  
184
  return $self->render('generic/error', { layout => 0 }, label_error => "list_transactions needs a trans_id") unless $::form->{id};
185

  
186
  my $cv = $::form->{id} || {};
187
  my $orders;
188
  my $type = $::form->{type};
189
  if ( $::form->{db} eq 'customer' ) {
190
    $orders = SL::DB::Manager::Order->get_all(
191
      query => [ customer_id => $cv,
192
                 quotation   => ($type eq 'quotation' ? 'T' : 'F') ],
193
      sort_by => ( $type eq 'order' ? 'ordnumber DESC' : 'quonumber DESC'),
194
    );
195
  } else {
196
    $orders = SL::DB::Manager::Order->get_all(
197
      query => [ vendor_id => $cv,
198
                 quotation   => ($type eq 'quotation' ? 'T' : 'F') ],
199
      sort_by => ( $type eq 'order' ? 'ordnumber DESC' : 'quonumber DESC'),
200
    );
201
  }
202
  if ( $type eq 'order') {
203
    $self->render('customer_vendor_turnover/order_statistic', { layout => 0 }, orders => $orders);
204
  } else {
205
    $self->render('customer_vendor_turnover/quotation_statistic', { layout => 0 }, orders => $orders);
206
  }
207
}
208

  
209
sub _get_open_orders {
210
  my ( $self ) = @_;
211

  
212
  return $self->render('generic/error', { layout => 0 }, label_error => "list_transactions needs a trans_id") unless $::form->{id};
213
  my $open_orders;
214
  my $cv = $::form->{id} || {};
215

  
216
  if ( $::form->{db} eq 'customer' ) {
217
    $open_orders = SL::DB::Manager::Order->get_all(
218
      query => [ customer_id => $cv,
219
                   closed => 'F',
220
               ],
221
               sort_by => 'ordnumber DESC',
222
               );
223
  } else {
224
    $open_orders = SL::DB::Manager::Order->get_all(
225
      query => [ vendor_id => $cv,
226
                   closed => 'F',
227
               ],
228
               sort_by => 'ordnumber DESC',
229
               );
230
  }
231

  
232
  return 0 unless scalar @{$open_orders};
233
  return $self->render('customer_vendor_turnover/_list_open_orders', { output => 0 }, orders => $open_orders, title => $::locale->text('Open Orders') );
234
}
235

  
137 236
sub _list_articles_by_invoice {
138 237
}
139 238
sub _list_count_articles_by_year {
templates/webpages/customer_vendor/form.html
2 2
[%- USE HTML %]
3 3
[%- USE LxERP %]
4 4
[%- USE L %]
5
[%- USE Dumper %]
5 6
<h1>[% FORM.title %] [% IF SELF.cv.id %] - [% HTML.escape(SELF.cv.displayable_name) %][% END %]</h1>
6

  
7 7
[% L.hidden_tag('_cti_enabled', !!LXCONFIG.cti.dial_command) %]
8 8

  
9 9
[% cv_cvars = SELF.cv.cvars_by_config %]
......
36 36
      [% IF SELF.cv.id %]
37 37
        <li><a href="#price_rules">[% 'Price Rules' | $T8 %]</a></li>
38 38
      [% END %]
39
      <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>
39
      <li><a href="[% 'controller.pl?action=CustomerVendorTurnover/list_turnover&id=' _ SELF.cv.id _ '&db=' _ FORM.db %]">[% LxERP.t8('Records') %] [%- IF SELF.open_items > 0 %] <span style="color:red;">&nbsp;$</span>[% END %] [%- IF SELF.open_orders > 0 %] <span style="color:red;">&nbsp;!</span>[% END %]</a></li>
40 40
    </ul>
41 41

  
42 42
    [% PROCESS "customer_vendor/tabs/billing.html" %]
templates/webpages/customer_vendor_turnover/_list_open_items.html
2 2
[%- USE LxERP %]
3 3
[%- USE L %]
4 4
[%- USE HTML %]
5
<div class="listtop">[%- HTML.escape(title) %]</div>
6 5

  
7 6
<div id="sales_report">
8 7
  <table width="100%">
8
    <caption class="listtop">[%- HTML.escape(title) %]</caption>
9 9
    <tbody>
10 10
      <tr>
11 11
        <td class="listheading">[% 'Invoice Number' | $T8 %]</td>
......
36 36
      [% END %]
37 37
    </tbody>
38 38
  </table>
39
</div> 
39
</div>
templates/webpages/customer_vendor_turnover/_list_open_orders.html
1
[%- USE T8 %]
2
[%- USE LxERP %]
3
[%- USE L %]
4
[%- USE HTML %]
5

  
6
<div id="orders_report">
7
  <table width="100%">
8
    <caption class="listtop">[%- HTML.escape(title) %]</caption>
9
    <tbody>
10
      <tr>
11
        <td class="listheading">[% 'Type' | $T8 %]</td>
12
        <td class="listheading">[% 'Order/RFQ Number' | $T8 %]</td>
13
        <td class="listheading">[% 'Date' | $T8 %]</td>
14
        <td class="listheading">[% 'Amount' | $T8 %]</td>
15
        <td class="listheading">[% 'Saleman' | $T8 %]</td>
16
        <td class="listheading">[% 'Transaction description' | $T8 %]</td>
17
      </tr>
18

  
19
      [%- FOREACH row = orders %]
20
      <tr class="listrow[% loop.count % 2 %]">
21
        <td>[% IF row.quotation %]
22
          [% IF FORM.db == 'customer' %][% 'Sales quotation' | $T8 %][% ELSE %][% 'RFQ' | $T8 %][% END %]</td>
23
              [%- IF INSTANCE_CONF.get_feature_experimental -%]
24
                <td>[% IF row.id %]<a href='controller.pl?action=Order/edit&type=[% IF SELF.is_customer %]sales_quotation[% ELSE %]request_quotation[% END %]&id=[% HTML.escape(row.id) %]'>[% END %][% HTML.escape(row.quonumber)   || '&nbsp;' %][% IF row.id %]</a>[% END %]</td>
25
              [%- ELSE -%]
26
                <td>[% IF row.id %]<a href='oe.pl?action=edit&type=[% IF SELF.is_customer %]sales_quotation[% ELSE %]request_quotation[% END %]&vc=customer&id=[% HTML.escape(row.oe_id) %]'>[% END %][% HTML.escape(row.quonumber)   || '&nbsp;' %][% IF row.id %]</a>[% END %]</td>
27
              [%- END -%]
28
            [% ELSE %]
29
            [% IF FORM.db == 'customer' %][% 'Sales Order' | $T8 %][% ELSE %][% 'Purchase Order' | $T8 %][% END %]</td>
30
              [%- IF INSTANCE_CONF.get_feature_experimental -%]
31
                <td>[% IF row.id %]<a href='controller.pl?action=Order/edit&type=[% IF SELF.is_customer %]sales_order[% ELSE %]purchase_order[% END %]&id=[% HTML.escape(row.id) %]'>[% END %][% HTML.escape(row.ordnumber)   || '&nbsp;' %][% IF row.id %]</a>[% END %]</td>
32
              [%- ELSE -%]
33
                <td>[% IF row.id %]<a href='oe.pl?action=edit&type=[% IF SELF.is_customer %]sales_order[% ELSE %]purchase_order[% END %]&vc=customer&id=[% HTML.escape(row.oe_id) %]'>[% END %][% HTML.escape(row.ordnumber)   || '&nbsp;' %][% IF row.id %]</a>[% END %]</td>
34
              [%- END -%]
35
            [% END %]
36
        <td>[% row.transdate.to_kivitendo | html %]</td>
37
        <td>[%- LxERP.format_amount(row.amount, 2) %]</td>
38
        <td>[% row.employee.name | html %]</td>
39
        <td>[% row.transaction_description | html %]</td>
40
      </tr>
41
      [% END %]
42
    </tbody>
43
  </table>
44
</div>
templates/webpages/customer_vendor_turnover/_statistic_tabs.html
7 7
    $ ( "#statistic_tabs" ).tabs();
8 8
  });
9 9
  function get_invoices() {
10
    var url = 'controller.pl?action=CustomerVendorTurnover/get_invoices&id=' + $('#cv_id').val();
10
    var url = 'controller.pl?action=CustomerVendorTurnover/get_invoices&id=' + $('#cv_id').val() + '&db=' + $('#db').val();
11 11
    $('#invoices').load(url);
12 12
  }
13
  function get_sales_quotations() {
14
    var url = 'controller.pl?action=CustomerVendorTurnover/get_orders&id=' + $('#cv_id').val() + '&db=' + $('#db').val() + '&type=quotation';
15
    $('#quotations').load(url);
16
  }
17
  function get_orders() {
18
    var url = 'controller.pl?action=CustomerVendorTurnover/get_orders&id=' + $('#cv_id').val() + '&db=' + $('#db').val() + '&type=order';
19
    $('#orders').load(url);
20
  }
21
  function get_letters() {
22
    var url = 'controller.pl?action=CustomerVendorTurnover/get_letters&id=' + $('#cv_id').val() + '&db=' + $('#db').val();;
23
    $('#letters').load(url);
24
  }
25
  function get_mails() {
26
    var url = 'controller.pl?action=CustomerVendorTurnover/get_mails&id=' + $('#cv_id').val() + '&db=' + $('#db').val();;
27
    $('#mails').load(url);
28
  }
13 29
</script>
14 30
<div class="tabwidget" id="statistic_tabs">
15 31
  <ul>
16 32
    <li><a href="#turnover_stat">[% 'Turnoverstatistic' | $T8 %]</a></li>
17
    <li><a href="#dun_stat">[% 'Dunningstatistic' | $T8 %]</a></li>
33
    [% IF FORM.db == "customer" %]<li><a href="#dun_stat">[% 'Dunningstatistic' | $T8 %]</a></li>[% END %]
34
    <li><a href="#quotations" onclick="get_sales_quotations();">[% IF FORM.db == "customer" %][% 'Sales Quotations' | $T8 %][% ELSE %][% 'Request Quotations' | $T8 %][% END %]</a></li>
35
    <li><a href="#orders" onclick="get_orders();">[% 'Orders' | $T8 %]</a></li>
18 36
    <li><a href="#invoices" onclick="get_invoices();">[% 'Invoices' | $T8 %]</a></li>
37
    <li><a href="#mails" onclick="get_mails();">[% 'Mails' | $T8 %]</a></li>
38
    <li><a href="#letters" onclick="get_letters();">[% 'Letters' | $T8 %]</a></li>
19 39
  </ul>
20 40
  <div id="turnover_stat">[% PROCESS "customer_vendor_turnover/turnover_statistic.html" %]</div>
21 41
  <div id="dun_stat">[% PROCESS "customer_vendor_turnover/dun_statistic.html" %]</div>
42
  <div id="quotations"></div>
43
  <div id="orders"></div>
22 44
  <div id="invoices"></div>
45
  <div id="mails"></div>
46
  <div id="letters"></div>
23 47
</div>
templates/webpages/customer_vendor_turnover/order_statistic.html
1
[%- USE T8 %]
2
[%- USE LxERP %]
3
[%- USE L %]
4
[%- USE HTML %]
5
<div id="invoice_statistic">
6
  <table width="100%">
7
    <tbody>
8
      <tr>
9
        <td class="listheading">[% 'Order Number' | $T8 %]</td>
10
        <td class="listheading">[% 'Order Date' | $T8 %]</td>
11
        <td class="listheading">[% 'Amount' | $T8 %]</td>
12
        <td class="listheading">[% 'Delivery Date' | $T8 %]</td>
13
        <td class="listheading">[% 'Transaction description' | $T8 %]</td>
14
      </tr>
15

  
16
      [%- FOREACH row = orders %]
17
      <tr class="listrow[% loop.count % 2 %]">
18
        [%- IF INSTANCE_CONF.get_feature_experimental -%]
19
          <td>[% IF row.id %]<a href='controller.pl?action=Order/edit&type=[% IF SELF.is_customer %]sales_order[% ELSE %]purchase_order[% END %]&id=[% HTML.escape(row.id) %]'>[% END %][% HTML.escape(row.ordnumber)   || '&nbsp;' %][% IF row.id %]</a>[% END %]</td>
20
        [%- ELSE -%]
21
          <td>[% IF row.id %]<a href='oe.pl?action=edit&type=[% IF SELF.is_customer %]sales_order[% ELSE %]purchase_order[% END %]&vc=customer&id=[% HTML.escape(row.oe_id) %]'>[% END %][% HTML.escape(row.ordnumber)   || '&nbsp;' %][% IF row.id %]</a>[% END %]</td>
22
        [%- END -%]
23
        <td>[% row.transdate.to_kivitendo | html %]</td>
24
        <td>[%- LxERP.format_amount(row.amount, 2) %]</td>
25
        <td>[% row.reqdate.to_kivitendo | html %]</td>
26
        <td>[% row.transaction_description %]</td>
27
      </tr>
28
      [% END %]
29
    </tbody>
30
  </table>
31

  
32

  
33
    </tbody>
34
  </table>
35
</div>
templates/webpages/customer_vendor_turnover/quotation_statistic.html
1
[%- USE T8 %]
2
[%- USE LxERP %]
3
[%- USE L %]
4
[%- USE HTML %]
5
<div id="invoice_statistic">
6
  <table width="100%">
7
    <tbody>
8
      <tr>
9
        <td class="listheading">[% IF FORM.db == 'customer' %][% 'Quotation Number' | $T8 %][% ELSE %][% 'RFQ Number' | $T8 %][% END %]</td>
10
        <td class="listheading">[% IF FORM.db == 'customer' %][% 'Quotation Date' | $T8 %][% ELSE %][% 'RFQ Date' | $T8 %][% END %]</td>
11
        <td class="listheading">[% 'Amount' | $T8 %]</td>
12
        <td class="listheading">[% 'Delivery Date' | $T8 %]</td>
13
        <td class="listheading">[% 'Transaction description' | $T8 %]</td>
14
      </tr>
15

  
16
      [%- FOREACH row = orders %]
17
      <tr class="listrow[% loop.count % 2 %]">
18
        [%- IF INSTANCE_CONF.get_feature_experimental -%]
19
          <td>[% IF row.id %]<a href='controller.pl?action=Order/edit&type=[% IF SELF.is_customer %]sales_quotation[% ELSE %]request_quotation[% END %]&id=[% HTML.escape(row.id) %]'>[% END %][% HTML.escape(row.quonumber)   || '&nbsp;' %][% IF row.id %]</a>[% END %]</td>
20
        [%- ELSE -%]
21
          <td>[% IF row.id %]<a href='oe.pl?action=edit&type=[% IF SELF.is_customer %]sales_quotation[% ELSE %]request_quotation[% END %]&vc=customer&id=[% HTML.escape(row.oe_id) %]'>[% END %][% HTML.escape(row.quonumber)   || '&nbsp;' %][% IF row.id %]</a>[% END %]</td>
22
        [%- END -%]
23
        <td>[% row.transdate.to_kivitendo | html %]</td>
24
        <td>[%- LxERP.format_amount(row.amount, 2) %]</td>
25
        <td>[% row.reqdate.to_kivitendo | html %]</td>
26
        <td>[% row.transaction_description %]</td>
27
      </tr>
28
      [% END %]
29
    </tbody>
30
  </table>
31

  
32

  
33
    </tbody>
34
  </table>
35
</div>
templates/webpages/customer_vendor_turnover/turnover.html
8 8
[% open_items %]
9 9
[% END %]
10 10

  
11
[%- IF open_orders %]
12
[% open_orders %]
13
[% END %]
14

  
11 15
[% PROCESS "customer_vendor_turnover/_statistic_tabs.html" %]
templates/webpages/customer_vendor_turnover/turnover_statistic.html
2 2
[%- USE LxERP %]
3 3
[%- USE L %]
4 4
[%- USE HTML %]
5
<p> 
5
<p>
6 6
[% L.radio_button_tag('period', value='year', label= LxERP.t8('Year'), onclick='show_turnover_stat("y");') %]
7 7

  
8 8
[% L.radio_button_tag('period', value='month', label= LxERP.t8('Month'), onclick='show_turnover_stat("m");') %]
......
10 10
<script type="text/javascript">
11 11
  function show_turnover_stat(period) {
12 12
    if (period === 'y') {
13
      var url = 'controller.pl?action=CustomerVendorTurnover/turnover_by_year&id=' + $('#cv_id').val();
13
      var url = 'controller.pl?action=CustomerVendorTurnover/turnover_by_year&id=' + $('#cv_id').val() + '&db=' + $('#db').val();
14 14
      $('#turnovers').load(url);
15 15
    } else {
16
      var url = 'controller.pl?action=CustomerVendorTurnover/turnover_by_month&id=' + $('#cv_id').val();
16
      var url = 'controller.pl?action=CustomerVendorTurnover/turnover_by_month&id=' + $('#cv_id').val() + '&db=' + $('#db').val();
17 17
      $('#turnovers').load(url);
18 18
    }
19 19
  }

Auch abrufbar als: Unified diff