Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5ef8b310

Von Kivitendo Admin vor etwa 11 Jahren hinzugefügt

  • ID 5ef8b31028dada9eff3c317fe92c0a9b05ea41a4
  • Vorgänger 880122f8
  • Nachfolger e112111e

Neue Verkaufsberichtvariante mit Umsatz-Sortierung

Es gibt einen neuen Menüeintrag "Verkaufsbericht Top", wo man nach den
gleichen Kategorien wie beim normalen Verkaufsbericht gruppieren kann,
aber wo man das Ergebnis nach Umsatz, Marge, Menge oder Gewicht
vorsortieren kann, was beim Standardverkaufsbericht nicht möglich war.
Dadurch kann man sich z.B. eine nach Umsatz sortierte Liste der Kunden
für einen Zeitraum anzeigen lassen. Es wird weiterhin nur auf Daten aus
"invoice" zurückgegriffen.
Es wird bei dieser Variante auf den gleichen Code zurückgegriffen,
allerdings wurde aus Gründen der Übersicht ein neuer Menüpunkt
eingeführt, in Zukunft könnte man dies vielleicht mit eigenen Reitern
besser machen.

Unterschiede anzeigen:

SL/VK.pm
53 53
  # default usage: always use parts.description for (sub-)totalling and in header and subheader lines
54 54
  # but use invoice.description in article mode
55 55
  # so we extract both versions in our query and later overwrite the description in article mode
56
#    qq| , (SELECT sum(invoice.qty*invoice.sellprice/CASE WHEN price_factor IS NOT NULL THEN price_factor ELSE 1.0 END) FROM invoice where invoice.parts_id = i.parts_id) as "sellpricelinetotal2" | .
56 57

  
57 58
  my $query =
58
    qq|SELECT ct.id as customerid, ct.name as customername,ct.customernumber,ct.country,ar.invnumber,ar.id,ar.transdate,p.partnumber,p.description as description, pg.partsgroup,i.parts_id,i.qty,i.price_factor,i.discount,i.description as invoice_description,i.lastcost,i.sellprice,i.fxsellprice,i.marge_total,i.marge_percent,i.unit,b.description as business,e.name as employee,e2.name as salesman, to_char(ar.transdate,'Month') as month, to_char(ar.transdate, 'YYYYMM') as nummonth, p.unit as parts_unit, p.weight | .
59
    qq|SELECT ct.id as customerid, ct.name as customername,ct.customernumber,ct.country,ar.invnumber,ar.id,ar.transdate,p.partnumber,p.description as description, pg.partsgroup,i.parts_id,i.qty,i.price_factor,i.discount,i.description as invoice_description,i.lastcost,i.sellprice,i.fxsellprice,i.marge_total,i.marge_percent,i.unit,b.description as business,e.name as employee,e2.name as salesman, to_char(ar.transdate,'Month') as month, to_char(ar.transdate, 'YYYYMM') as nummonth, p.unit as parts_unit, p.weight |; 
60

  
61
  # debug modus for comparing linetotal according to database and perl
62
  $query .= qq| , (i.qty*i.sellprice/CASE WHEN price_factor IS NOT NULL THEN i.price_factor ELSE 1.0 END) as sellpricelinetotal | if $form->{"l_sellpricelinetotal"};  
63

  
64
  $query .=
59 65
    qq|FROM invoice i | .
60 66
    qq|JOIN ar on (i.trans_id = ar.id) | .
61 67
    qq|JOIN parts p on (i.parts_id = p.id) | .
bin/mozilla/gl.pl
967 967
  if (GL->delete_transaction(\%myconfig, \%$form)){
968 968
    # saving the history
969 969
      if(!exists $form->{addition} && $form->{id} ne "") {
970
        $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
970
        $form->{snumbers} = qq|glnumber_| . $form->{id};
971 971
        $form->{addition} = "DELETED";
972 972
        $form->save_history;
973 973
      }
......
1139 1139
  }
1140 1140
  undef($form->{callback});
1141 1141
  # saving the history
1142
  
1142 1143
  if(!exists $form->{addition} && $form->{id} ne "") {
1143
    $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
1144
    $form->{snumbers} = qq|glnumber_| . $form->{id};
1144 1145
    $form->{addition} = "SAVED";
1145 1146
    $form->{what_done} = $locale->text("Buchungsnummer") . " = " . $form->{id};
1146 1147
    $form->save_history;
......
1209 1210

  
1210 1211
  # saving the history
1211 1212
  if(!exists $form->{addition} && $form->{id} ne "") {
1212
    $form->{snumbers} = "ordnumber_$form->{ordnumber}";
1213
    $form->{snumbers} = "glnumber_$form->{id}";
1213 1214
    $form->{addition} = "STORNO";
1214 1215
    $form->save_history;
1215 1216
  }
bin/mozilla/vk.pl
31 31
#
32 32
#======================================================================
33 33

  
34
# TODO
35
# if qty or weight is shown add unit
36

  
34 37
use POSIX qw(strftime);
35 38
use List::Util qw(sum first);
36 39

  
......
90 93
  $main::lxdebug->leave_sub();
91 94
}
92 95

  
96
sub search_invoice_top {
97
  $main::lxdebug->enter_sub();
98
  $main::auth->assert('general_ledger | invoice_edit');
99

  
100
  my $form     = $main::form;
101
  my %myconfig = %main::myconfig;
102
  my $locale   = $main::locale;
103

  
104
  my ($customer, $department);
105

  
106
  # setup customer selection
107
  $form->all_vc(\%myconfig, "customer", "AR");
108

  
109
  $form->{title}    = $locale->text('Sales Report Top');
110

  
111
  $form->get_lists("projects"        => { "key" => "ALL_PROJECTS", "all" => 1 },
112
                   "departments"     => "ALL_DEPARTMENTS",
113
                   "business_types"  => "ALL_BUSINESS_TYPES",
114
                   "salesmen"        => "ALL_SALESMEN",
115
                   'employees'       => 'ALL_EMPLOYEES',
116
                   'partsgroup'      => 'ALL_PARTSGROUPS',
117
                   "customers"       => "ALL_VC");
118
  $form->{CUSTOM_VARIABLES_IC}                  = CVar->get_configs('module' => 'IC');
119
  ($form->{CUSTOM_VARIABLES_FILTER_CODE_IC},
120
   $form->{CUSTOM_VARIABLES_INCLUSION_CODE_IC}) = CVar->render_search_options('variables'      => $form->{CUSTOM_VARIABLES_IC},
121
                                                                           'include_prefix' => 'l_',
122
                                                                           'include_value'  => 'Y');
123

  
124
  $form->{CUSTOM_VARIABLES_CT}                  = CVar->get_configs('module' => 'CT');
125
  ($form->{CUSTOM_VARIABLES_FILTER_CODE_CT},
126
   $form->{CUSTOM_VARIABLES_INCLUSION_CODE_CT}) = CVar->render_search_options('variables'      => $form->{CUSTOM_VARIABLES_CT},
127
                                                                           'include_prefix' => 'l_',
128
                                                                           'include_value'  => 'Y');
129
  $form->{vc_keys}   = sub { "$_[0]->{name}--$_[0]->{id}" };
130
  $form->{employee_labels} = sub { $_[0]->{"name"} || $_[0]->{"login"} };
131
  $form->{salesman_labels} = $form->{employee_labels};
132

  
133
  $form->header;
134
  print $form->parse_html_template('vk/search_invoice_top', { %myconfig });
135

  
136
  $main::lxdebug->leave_sub();
137
}
138

  
93 139
sub invoice_transactions {
94 140
  $main::lxdebug->enter_sub();
95 141

  
......
99 145
  my %myconfig = %main::myconfig;
100 146
  my $locale   = $main::locale;
101 147

  
148
  my @data_to_be_sorted;
149
  # debug mode for finding differences in Umsatz as calculated by database and perl
150
  # set to "Y" to turn on
151
  $form->{"l_sellpricelinetotal"} = "";
152

  
102 153
  my ($callback, $href, @columns);
103 154

  
155
  # sort_by_total mode
156
  if ( $form->{l_sort_by_total} ) {
157
    # uncheck Mainheadings
158
    # check both subheadings
159
    # set subsort = mainsort
160
    $form->{l_headers_mainsort}  = '';
161
    $form->{l_subtotal_mainsort} = "Y";
162
    $form->{l_headers_subsort} = ''; 
163
    $form->{l_subtotal_subsort} = "Y";
164
    $form->{mainsort} = $form->{topsortgroup};
165
    $form->{subsort} = $form->{mainsort};   # trigger subsort = mainsort
166
  };
167

  
104 168
  # can't currently be configured from report, empty line between main sortings
105 169
  my $addemptylines = 1;
106 170

  
......
139 203
  VK->invoice_transactions(\%myconfig, \%$form);
140 204

  
141 205

  
206

  
207

  
142 208
  if ( $form->{mainsort} eq 'month' or $form->{subsort} eq 'month' ) {
143 209

  
144 210
    # Data already comes out of SELECT statement in correct month order, but
......
155 221

  
156 222
  @columns =
157 223
    qw(description invnumber transdate customernumber customername partnumber partsgroup country business transdate qty parts_unit weight sellprice sellprice_total discount lastcost lastcost_total marge_total marge_percent employee salesman);
224
  push(@columns, "sellpricelinetotal") if $form->{"l_sellpricelinetotal"};
225
  
226
# sellpricelinetotal is qty*sellprice as calculated by database
158 227

  
159 228
  my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs_ic }, @{ $cvar_configs_ct };
160 229
  my @searchable_custom_variables  = grep { $_->{searchable} }  @{ $cvar_configs_ic }, @{ $cvar_configs_ct };
......
169 238
  my @hidden_variables  = (qw(l_headers_mainsort l_headers_subsort l_subtotal_mainsort l_subtotal_subsort l_total l_parts l_customername l_customernumber transdatefrom transdateto decimalplaces customer customername customer_id department partnumber partsgroup country business description project_id customernumber salesman employee salesman_id employee_id business_id partsgroup_id mainsort subsort),
170 239
      "$form->{db}number",
171 240
      map({ "cvar_$_->{name}" } @searchable_custom_variables),
172
      map { "l_$_" } @columns
241
      map { "l_$_" } @columns,
173 242
      );
243
  push(@hidden_variables, qw(topsortgroup topsorttype l_sort_by_total));  # hidden variables for top
244

  
174 245
  my @hidden_nondefault = grep({ $form->{$_} } @hidden_variables);
175 246
  # Variablen werden dann als Hidden Variable mitgegeben, z.B.
176 247
  # <input type="hidden" name="report_generator_hidden_transdateto" value="21.05.2010">
......
200 271
    'marge_percent'           => { 'text' => $locale->text('Sales margin %'), },
201 272
    'customernumber'          => { 'text' => $locale->text('Customer Number'), },
202 273
    'customername'            => { 'text' => $locale->text('Customer Name'), },
274
    'sellpricelinetotal'      => { 'text' => $locale->text('sellpricelinetotal'), }, # debug control
203 275
# add 3 more column_defs so we have a translation for top_info_text
204 276
    'customer'                => { 'text' => $locale->text('Customer'), },
205 277
    'part'                    => { 'text' => $locale->text('Part'), },
......
207 279
    %column_defs_cvars,
208 280
  );
209 281

  
210
  map { $column_defs{$_}->{visible} = $form->{"l_$_"} eq 'Y' } @columns;
282
  if ( not defined $form->{"l_parts"} ) {
283
    # the columns for sellprice, lastcost and marge_percent will be averages in subtotal and total lines
284
    map { $column_defs{$_}->{text} = $locale->text('Average symbol') . " " . $column_defs{$_}->{text} } qw(sellprice lastcost marge_percent);
285
  };
211 286

  
212
  my %column_alignment = map { $_ => 'right' } qw(lastcost sellprice sellprice_total lastcost_total parts_unit discount marge_total marge_percent qty weight);
287
  map { $column_defs{$_}->{visible} = $form->{"l_$_"} eq 'Y' } @columns;
213 288

  
289
  my %column_alignment = map { $_ => 'right' } qw(lastcost sellprice sellprice_total lastcost_total parts_unit discount marge_total marge_percent qty weight sellpricelinetotal );
214 290

  
215 291
  # so now the check-box "Description" is only used as switch for part description in invoice-mode
216 292
  # always fill the column "Description" if we are in Zwischensummenmode
217
  $form->{"l_description"} = "Y" if not defined $form->{"l_parts"};;
293
  $form->{"l_description"} = "Y" if not defined $form->{"l_parts"};
294

  
218 295
  map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns;
219 296

  
220 297
  my @options;
......
240 317

  
241 318
  my $report = SL::ReportGenerator->new(\%myconfig, $form);
242 319

  
320
  if ( not $form->{l_sort_by_total} ) {
243 321
  $report->set_options('top_info_text'        => join("\n", $locale->text('Main sorting') . ' : ' . $column_defs{$form->{mainsort}}->{text} , $locale->text('Secondary sorting') . ' : ' . $column_defs{$form->{'subsort'}}->{text}, @options),
244 322
                       'output_format'        => 'HTML',
245 323
                       'title'                => $form->{title},
246 324
                       'attachment_basename'  => $locale->text('Sales Report') . strftime('_%Y%m%d', localtime time),
247 325
    );
326
  } else {
327
  $report->set_options('top_info_text'        => join("\n", $locale->text('Grouping') . ' : ' . $column_defs{$form->{topsortgroup}}->{text} , $locale->text('Sort By') . ' : ' . $column_defs{$form->{'topsorttype'}}->{text}, @options),
328
                       'output_format'        => 'HTML',
329
                       'title'                => $form->{title},
330
                       'attachment_basename'  => $locale->text('Sales Report') . strftime('_%Y%m%d', localtime time),
331
    );
332
  };
333

  
248 334
  $report->set_options_from_form();
249 335
  $locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
250 336

  
......
253 339

  
254 340
  $report->set_export_options('invoice_transactions', @hidden_variables, qw(mainsort sortdir));
255 341

  
256
  $report->set_sort_indicator($form->{mainsort}, $form->{sortdir});
342
  $report->set_sort_indicator($form->{mainsort}, $form->{sortdir}) unless $form->{"l_sort_by_total"};
343
  
257 344

  
258 345
  CVar->add_custom_variables_to_report('module'         => 'CT',
259 346
      'trans_id_field' => 'customerid',
......
284 371
  # escape callback for href
285 372
  $callback = $form->escape($href);
286 373

  
287
  my @subtotal_columns = qw(qty weight sellprice sellprice_total lastcost lastcost_total marge_total marge_percent discount);
374
  my @subtotal_columns = qw(qty weight sellprice sellprice_total lastcost lastcost_total marge_total marge_percent discount sellpricelinetotal);
288 375
  # Total sum:
289 376
  # sum of sellprice_total, lastcost_total and marge_total
290 377
  # average of marge_percent
291
  my @total_columns = qw(sellprice_total lastcost_total marge_total marge_percent );
378
# absolutes: qty, weight, sellprice_total, lastcost_total, marge_total
379
# averages: sellprice, lastcost, marge_percent
380
  my @total_columns = qw(sellprice_total lastcost_total marge_total marge_percent sellpricelinetotal);
292 381

  
293 382
  my %totals     = map { $_ => 0 } @total_columns;
294 383
  my %subtotals1 = map { $_ => 0 } @subtotal_columns;
......
396 485
    map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 2) } qw(marge_percent qty);
397 486
    map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 3) } qw(weight);
398 487
    map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, $form->{"decimalplaces"} )} qw(lastcost sellprice sellprice_total lastcost_total marge_total);
488
    map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, $form->{"decimalplaces"} )} qw(sellpricelinetotal) if $form->{"l_sellpricelinetotal"};
399 489

  
400 490
    # Einzelzeilen nur zeigen wenn l_parts gesetzt ist, nützlich, wenn man nur
401 491
    # Subtotals und Totals sehen möchte
492
    # these lines are only added to report in individual mode
493
    
402 494
    if ($form->{l_parts}) {
403 495
      my %row = (
404 496
        map { ($_ => { data => $ar->{$_}, align => $column_alignment{$_} }) } @columns
......
414 506

  
415 507
    # hier wird bei l_subtotal nicht differenziert zwischen mainsort und subsort
416 508
    # macht man l_subtotal_mainsort aus wird l_subtotal_subsort auch nicht ausgeführt
509
    # create a subtotal line if we are at the last element or either the subsort or mainsort element has changed
417 510
    if (   ($form->{l_subtotal_mainsort} eq 'Y')
418 511
        && ($form->{l_subtotal_subsort}  eq 'Y')
419 512
        && (($idx == (scalar @{ $form->{AR} } - 1))   # last element always has a subtotal
......
421 514
          || ($ar->{ $form->{'mainsort'} } ne $form->{AR}->[$idx + 1]->{ $form->{'mainsort'} })
422 515
          )) {   # if value that is sorted by changes, print subtotal
423 516

  
424
      $report->add_data(create_subtotal_row_invoice(\%subtotals2, \@columns, \%column_alignment, \@subtotal_columns, $form->{l_parts} ? 'listsubtotal' : undef, $ar->{ $form->{'subsort'} }));
425
      $report->add_data({ %empty_row }) if $form->{l_parts} and $addemptylines;
426
    }
517

  
518
      # stick subtotal_row_invoice in temporary variable
519
      # if TOP mode store it in @data_to_be_sorted so we can sort the lines after all lines have been added
520
      # otherwise just add to $report to be shown in defualt
521
      my $tmpobject = create_subtotal_row_invoice(\%subtotals2, \@columns, \%column_alignment, \@subtotal_columns, $form->{l_parts} ? 'listsubtotal' : undef, $ar->{ $form->{'subsort'} }); 
522
      if ( $form->{l_sort_by_total} and not $form->{l_parts} ) {
523
        # add subtotal data to temporary array that can later be sorted
524
        push(@data_to_be_sorted, $tmpobject);
525
      } else {
526
        $report->add_data( $tmpobject);
527
      };
528
     $report->add_data({ %empty_row }) if $form->{l_parts} and $addemptylines;
529
   
530
    };
427 531

  
428 532
    # if last mainsort is reached or mainsort has changed, add mainsort subtotal and empty row
429 533
    if (   ($form->{l_subtotal_mainsort} eq 'Y')
......
440 544

  
441 545
    $idx++;
442 546
  }
547

  
548

  
549
  if ( $form->{l_sort_by_total} ) {
550
    # filter allowed parameters for sorttype
551
    my @allowed_fields = qw(sellprice_total marge_total qty weight);
552
    my ($sorttype) = grep { /^$form->{topsorttype}$/ } @allowed_fields;
553
    die "illegal parameter for topsorttype" unless $sorttype;
554
  
555
    # add marker to column being sorted
556
    $report->set_sort_indicator($sorttype);
557
  
558
    # add subtotal lines to report in numerical order of sorttype
559
    @data_to_be_sorted = reverse sort { $a->{$sorttype}{unformatted} <=> $b->{$sorttype}{unformatted} } @data_to_be_sorted;
560
    foreach( @data_to_be_sorted ) {
561
      # to limit output, e.g. top 100, one could add a counter here
562
      # that only adds a certain number of entries
563
      # the total at the end would still be over all entries though 
564
      $report->add_data( $_ );
565
    };
566
  };
567

  
443 568
  if ( $form->{l_total} eq "Y" ) {
444 569
    $report->add_separator();
445 570
    $report->add_data(create_subtotal_row_invoice(\%totals, \@columns, \%column_alignment, \@total_columns, 'listtotal', 'l_total'))
446 571
  };
447

  
572
  
448 573
  $report->generate_with_headers();
574

  
449 575
  $main::lxdebug->leave_sub();
450 576
}
451 577

  
......
470 596
    $row->{description}->{data} = $locale->text('Total') . ' ' . $name;
471 597
  };
472 598

  
599
  map { $row->{$_}->{unformatted} = $totals->{$_} } qw(sellprice_total lastcost_total marge_total qty weight);
473 600
  map { $row->{$_}->{data} = $form->format_amount(\%myconfig, $totals->{$_}, 2) } qw(marge_total marge_percent qty);
474 601
  map { $row->{$_}->{data} = $form->format_amount(\%myconfig, $totals->{$_}, 3) } qw(weight);
475
  map { $row->{$_}->{data} = $form->format_amount(\%myconfig, $totals->{$_}, $form->{decimalplaces}) } qw(lastcost sellprice sellprice_total lastcost_total);
476

  
602
  map { $row->{$_}->{data} = $form->format_amount(\%myconfig, $totals->{$_}, $form->{decimalplaces}) } qw(lastcost sellprice sellprice_total lastcost_total sellpricelinetotal);
477 603

  
478 604
  map { $totals->{$_} = 0 } @{ $subtotal_columns };
479 605

  
locale/de/all
255 255
  'Automatically created invoice for fee and interest for dunning %s' => 'Automatisch erzeugte Rechnung für Gebühren und Zinsen zu Mahnung %s',
256 256
  'Available'                   => 'Verfügbar',
257 257
  'Available qty'               => 'Lagerbestand',
258
  'Average symbol'              => 'Ø',
259
  'Averaged values'             => 'Gemittelte Werte',
258 260
  'BALANCE SHEET'               => 'BILANZ',
259 261
  'BIC'                         => 'BIC',
260 262
  'BOM'                         => 'Stückliste',
......
546 548
  'Credit Tax Account'          => 'Umsatzsteuerkonto',
547 549
  'Credit note (one letter abbreviation)' => 'G',
548 550
  'Cumulated or averaged values' => 'Kumulierte oder gemittelte Werte',
551
  'Cumulated values'            => 'Kumulierte Werte',
549 552
  'Curr'                        => 'Währung',
550 553
  'Currencies'                  => 'W&auml;hrungen',
551 554
  'Currency'                    => 'Währung',
......
999 1002
  'Group membership'            => 'Gruppenzugehörigkeit',
1000 1003
  'Group missing!'              => 'Warengruppe fehlt!',
1001 1004
  'Group saved!'                => 'Warengruppe gespeichert!',
1005
  'Grouping'                    => 'Gruppierung',
1002 1006
  'Groups'                      => 'Warengruppen',
1003 1007
  'Groups that are valid for this client for access rights' => 'Gruppen, die für diesen Mandanten gültig sind',
1004 1008
  'Groups this user is a member in' => 'Gruppen, in denen Benutzer Mitglied ist',
......
1726 1730
  'Sales Price information'     => 'Verkaufspreisinformation',
1727 1731
  'Sales Quotations'            => 'Angebote',
1728 1732
  'Sales Report'                => 'Verkaufsbericht',
1733
  'Sales Report Top'            => 'Verkaufsbericht Top',
1729 1734
  'Sales and purchase invoices with inventory transactions with taxkeys' => 'Einkaufs- und Verkaufsrechnungen mit Warenbestandsbuchungen mit Steuerschlüsseln',
1730 1735
  'Sales delivery order'        => 'Lieferschein (Verkauf)',
1731 1736
  'Sales invoice number'        => 'Ausgangsrechnungsnummer',
......
1733 1738
  'Sales invoices changeable'   => 'Änderbarkeit von Verkaufsrechnungen',
1734 1739
  'Sales margin'                => 'Marge',
1735 1740
  'Sales margin %'              => 'Marge prozentual',
1741
  'Sales margin percent'        => 'Verkaufsmarge prozentual',
1742
  'Sales margin total'          => 'Verkaufsmarge gesamt',
1736 1743
  'Sales net amount'            => 'VK-Betrag',
1737 1744
  'Sales price'                 => 'VK-Preis',
1738 1745
  'Sales price total'           => 'VK-Betrag',
......
2256 2263
  'Top Level Designation only'  => 'Nur Hauptartikelbezeichnung',
2257 2264
  'Total'                       => 'Summe',
2258 2265
  'Total Fees'                  => 'Kumulierte Gebühren',
2266
  'Total revenue'               => 'Gesamtumsatz',
2259 2267
  'Total stock value'           => 'Gesamter Bestandswert',
2260 2268
  'Total sum'                   => 'Gesamtsumme',
2261 2269
  'Total weight'                => 'Gesamtgewicht',
......
2646 2654
  'saved'                       => 'gespeichert',
2647 2655
  'saved!'                      => 'gespeichert',
2648 2656
  'saving data'                 => 'Speichere Daten',
2657
  'sellpricelinetotal'          => 'sellpricelinetotal',
2649 2658
  'sent'                        => 'gesendet',
2650 2659
  'sent to printer'             => 'an Drucker geschickt',
2651 2660
  'service'                     => 'Dienstleistung',
menus/erp.ini
159 159
action=search_invoice
160 160
nextsub=invoice_transactions
161 161

  
162
[AR--Reports--Sales Report Top]
163
ACCESS=invoice_edit
164
module=vk.pl
165
action=search_invoice_top
166
nextsub=invoice_transactions
167

  
162 168
[AR--Reports--Dunnings]
163 169
ACCESS=dunning_edit
164 170
module=dn.pl
templates/webpages/common/search_history.html
74 74

  
75 75
<script type="text/javascript">
76 76
  <!--
77
  var defaults = ['SAVED', 'DELETED', 'ADDED', 'PAYMENT POSTED', 'POSTED', 'POSTED AS NEW', 'SAVED FOR DUNNING', 'DUNNING STARTED', 'PRINTED'];
77
  var defaults = ['SAVED', 'DELETED', 'ADDED', 'PAYMENT POSTED', 'POSTED', 'POSTED AS NEW', 'SAVED FOR DUNNING', 'DUNNING STARTED', 'PRINTED', 'MAILED'];
78 78
  var available;
79 79
  var selected;
80 80
  var translated = {
......
87 87
    'SAVED FOR DUNNING' : '[% 'SAVED FOR DUNNING' | $T8 %]',
88 88
    'DUNNING STARTED'   : '[% 'DUNNING STARTED' | $T8 %]',
89 89
    'PRINTED'           : '[% 'PRINTED' | $T8 %]',
90
    'MAILED'            : '[% 'MAILED' | $T8 %]',
90 91
  };
91 92

  
92 93
  function addForm(index) {
templates/webpages/vk/search_invoice.html
249 249
          <tr>
250 250
            <td align=left><input name="l_sellprice_total" class=checkbox type=checkbox value=Y checked>[% 'Sales price total' | $T8 %]</td>
251 251
            <td align=left><input name="l_lastcost_total" class=checkbox type=checkbox value=Y checked>[% 'Purchase price total' | $T8 %]</td>
252
            <td align=left><input name="l_marge_total" class=checkbox type=checkbox value=Y checked>[% 'Margetotal' | $T8 %]</td>
252
            <td align=left><input name="l_marge_total" class=checkbox type=checkbox value=Y checked>[% 'Sales margin total' | $T8 %]</td>
253 253
            <td colspan="4"> ([% 'Single values in item mode, cumulated values in invoice mode' | $T8 %])
254 254
          </tr>
255 255

  
256 256
          <tr>
257 257
            <td align=left><input name="l_sellprice" class=checkbox type=checkbox value=Y checked>[% 'Sales price' | $T8 %]</td>
258 258
            <td align=left><input name="l_lastcost" class=checkbox type=checkbox value=Y checked>[% 'Purchase price' | $T8 %]</td>
259
            <td align=left><input name="l_marge_percent" class=checkbox type=checkbox value=Y checked>[% 'Margepercent' | $T8 %]</td>
259
            <td align=left><input name="l_marge_percent" class=checkbox type=checkbox value=Y checked>[% 'Sales margin percent' | $T8 %]</td>
260 260
            <td colspan="4">([% 'averaged values, in invoice mode only useful when filtered by a part' | $T8 %])</td>
261 261
          </tr>
262 262

  
templates/webpages/vk/search_invoice_top.html
1
[%- USE T8 %]
2
[%- USE L %]
3

  
4
<form method=post name="search_invoice_top" action=[% script %]>
5
  <input type="hidden" name="sort" value="transdate">
6
  <input type="hidden" name="l_sort_by_total" value="Y">
7
  <input type=hidden name=nextsub value=[% nextsub %]>
8

  
9
  <div class="listtop">[% title %]</div>
10

  
11

  
12
  <table>
13

  
14
    <tr>
15
      <td align="right">[% 'Main sorting' | $T8 %]</td>
16
      <td>
17
        <select name="topsortmain" id="topsortmain">
18
          <option value="description">[% 'Part' | $T8 %]</option>
19
          <option value="customername" selected="selected">[% 'Customer' | $T8 %]</option>
20
          <option value="country">[% 'Country' | $T8 %]</option>
21
          <option value="partsgroup">[% 'Group' | $T8 %]</option>
22
          <option value="business">[% 'Customer type' | $T8 %]</option>
23
          <option value="salesman">[% 'Salesman' | $T8 %]</option>
24
          <option value="month">[% 'Month' | $T8 %]</option>
25
        </select>
26
    </tr>
27
    <tr>
28
      <td align="right">[% 'Sort By' | $T8 %]</td>
29
      <td>
30
        <select name="topsorttype" id="topsorttype">
31
          <option value="sellprice_total" selected="selected">[% 'Total revenue' | $T8 %]</option>
32
          <option value="marge_total">[% 'Sales margin' | $T8 %]</option>
33
          <option value="qty">[% 'Quantity' | $T8 %]</option>
34
          <option value="weight">[% 'Weight' | $T8 %]</option>
35
        </select>
36
      </td>
37
      </td>
38
    </tr>
39

  
40
    <tr>
41
      <th align="right">[% 'Total sum' | $T8 %]</th>
42
      <td colspan="1" align=left><input name="l_total" class=checkbox type=checkbox value=Y checked></td>
43
      <td align="right" nowrap>[% 'Decimalplaces' | $T8 %]: </td>
44
      <td colspan="2"><input name="decimalplaces" size="2" value="2"></td>
45
    </tr>
46

  
47

  
48
    <tr>
49
      <td></td>
50
      <td colspan="7">
51
        <hr size="1" noshade="">
52
      </td>
53
    <tr>
54

  
55
    <tr>
56
      <th align=right>[% 'Customer' | $T8 %]</th>
57
      <td>
58
        [%- INCLUDE 'generic/multibox.html'
59
          name          = 'customer',
60
          default       = oldcustomer,
61
          style         = 'width: 250px',
62
          DATA          = ALL_VC,
63
          id_sub        = 'vc_keys',
64
          label_key     = 'name',
65
          select        = vc_select,
66
          limit         = vclimit,
67
          show_empty    = 1,
68
          allow_textbox = 1,
69
          class         = 'initial_focus',
70
        -%]
71
      </td>
72

  
73
      <th align="right" nowrap>[% 'Customer Number' | $T8 %]</th>
74
      <td>
75
        <input name="customernumber" size="20">
76
      </td>
77
    </tr>
78

  
79
    <tr>
80
      <th align=right nowrap>[% 'Department' | $T8 %]</th>
81
      <td>
82
        [%- INCLUDE 'generic/multibox.html'
83
          name          = 'department',
84
          style         = 'width: 250px',
85
          DATA          = ALL_DEPARTMENTS,
86
          id_key        = 'id',
87
          label_key     = 'description',
88
          show_empty    = 1,
89
          allow_textbox = 0,
90
        -%]
91
      </td>
92

  
93
      <th align="right">[% 'Project Number' | $T8 %]</th>
94
      <td>
95
        [%- INCLUDE 'generic/multibox.html'
96
          name          =  'project_id',
97
          style         = "width: 250px",
98
          DATA          =  ALL_PROJECTS,
99
          id_key        = 'id',
100
          label_key     = 'projectnumber',
101
          limit         = vclimit,
102
          show_empty    = 1,
103
          allow_textbox = 0,
104
        -%]
105
      </td>
106
    </tr>
107

  
108
    <tr>
109
      <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
110
      <td><input name="partnumber" size="20"></td>
111
    </tr>
112

  
113
    <tr>
114
      <th align="right" nowrap>[% 'Part Description' | $T8 %]</th>
115
      <td>
116
        <input name="description" size="40">
117
      </td>
118
    </tr>
119

  
120
    <tr>
121
      <th align="right">[% 'Group' | $T8 %]</th>
122
      <td>
123
        [%- INCLUDE 'generic/multibox.html'
124
          name          = 'partsgroup_id',
125
          style         = 'width: 250px',
126
          DATA          =  ALL_PARTSGROUPS,
127
          id_key        = 'id',
128
          label_key     = 'partsgroup',
129
          show_empty    = 1,
130
          allow_textbox = 0,
131
        -%]
132
      </td>
133

  
134
      <td align="right" nowrap>[% 'Country' | $T8 %]</td>
135
      <td><input name="country" size="20"></td>
136
    </tr>
137

  
138
    <tr>
139
      <th align="right">[% 'Employee' | $T8 %]</th>
140
      <td>
141
        [%- INCLUDE 'generic/multibox.html'
142
          name          = 'employee_id',
143
          style         = 'width: 250px',
144
          DATA          =  ALL_EMPLOYEES,
145
          id_key        = 'id',
146
          label_sub     = 'employee_labels',
147
          limit         = vclimit,
148
          show_empty    = 1,
149
          allow_textbox = 0,
150
          default       = ' ',
151
        -%]
152
      </td>
153

  
154
      <th align="right">[% 'Salesman' | $T8 %]</th>
155
      <td>
156
        [%- INCLUDE 'generic/multibox.html'
157
          name          = 'salesman_id',
158
          style         = 'width: 250px',
159
          DATA          =  ALL_SALESMEN,
160
          id_key        = 'id',
161
          label_sub     = 'salesman_labels',
162
          limit         = vclimit,
163
          show_empty    = 1,
164
          allow_textbox = 0,
165
        -%]
166
      </td>
167
    </tr>
168

  
169
    <tr>
170
      <th align="right">[% 'Customer type' | $T8 %]</th>
171
      <td>
172
        [%- INCLUDE 'generic/multibox.html'
173
           name          =  'business_id',
174
           style         = "width: 250px",
175
           DATA          =  ALL_BUSINESS_TYPES,
176
           id_key        = 'id',
177
           label_key     = 'description',
178
           limit         = vclimit,
179
           show_empty    = 1,
180
           allow_textbox = 0,
181
        -%]
182
      </td>
183
    </tr>
184

  
185
    <tr>
186
      <th align=right nowrap>[% 'Invoice Date' | $T8 %] [% 'From' | $T8 %]</th>
187
      <td>
188
        [% L.date_tag('transdatefrom') %]
189
      </td>
190

  
191
      <th align=right>[% 'Bis' | $T8 %]</th>
192

  
193
      <td>
194
        [% L.date_tag('transdateto') %]
195
      </td>
196
    </tr>
197

  
198

  
199
    <tr>
200
      <td></td>
201
      <th colspan="4" align="left">
202
        [% 'Filter for customer variables' | $T8 %]
203
      </th>
204
    </tr>
205
    [% CUSTOM_VARIABLES_FILTER_CODE_CT %]
206

  
207

  
208
    <tr>
209
      <td></td>
210
      <th colspan="4" align="left">
211
        [% 'Filter for item variables' | $T8 %]
212
      </th>
213
    </tr>
214
    [% CUSTOM_VARIABLES_FILTER_CODE_IC %]
215

  
216

  
217

  
218
    <tr>
219
      <td></td>
220
      <td colspan="7">
221
        <hr size="1" noshade="">
222
      </td>
223
    <tr>
224

  
225

  
226

  
227
    <tr>
228
      <th align=right nowrap>[% 'Include in Report' | $T8 %]</th>
229

  
230
      <td colspan="3">
231
        <table>
232
          <tr>
233
            <td align=left><input name="l_qty" class=checkbox type=checkbox value=Y checked>[% 'Quantity' | $T8 %]</td>
234
            <td align=left><input name="l_sellprice_total" class=checkbox type=checkbox value=Y checked>[% 'Sales price total' | $T8 %]</td>
235
            <td align=left><input name="l_lastcost_total" class=checkbox type=checkbox value=Y>[% 'Purchase price total' | $T8 %]</td>
236
            <td align=left><input name="l_marge_total" class=checkbox type=checkbox value=Y>[% 'Margetotal' | $T8 %]</td>
237
            <td colspan="1"> ([% 'Cumulated values' | $T8 %])
238
          </tr>
239

  
240
          <tr>
241
            <td align=left><input name="l_discount" class=checkbox type=checkbox value=Y>[% 'Discount' | $T8 %]</td>
242
            <td align=left><input name="l_sellprice" class=checkbox type=checkbox value=Y>[% 'Sales price' | $T8 %]</td>
243
            <td align=left><input name="l_lastcost" class=checkbox type=checkbox value=Y>[% 'Purchase price' | $T8 %]</td>
244
            <td align=left><input name="l_marge_percent" class=checkbox type=checkbox value=Y>[% 'Margepercent' | $T8 %]</td>
245
            <td colspan="1">([% 'Averaged values' | $T8 %])</td>
246
          </tr>
247

  
248
          <tr>
249
            <td align=left><input name="l_weight" class=checkbox type=checkbox value=Y>[% 'Weight' | $T8 %]</td>
250
            <td></td>
251
            <td></td>
252
            <td></td>
253
            <td>([% 'Averaged values' | $T8 %])</td>
254
          </tr>
255

  
256
          <tr>
257
            <td colspan="7">&nbsp;</td>
258
          </tr>
259

  
260
        </table>
261
      </td>
262
    </tr>
263

  
264
  </table>
265

  
266
  <hr size="3" noshade="">
267

  
268
  <input class=submit type=submit name=action value="[% 'Continue' | $T8 %]">
269

  
270
  <br><br>
271

  
272
</form>
273

  
274
<script type="text/javascript">
275
<!--
276
$(document).ready(function(){
277
  $('customer').focus();
278
})
279
//-->
280
</script>

Auch abrufbar als: Unified diff