Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 409d5d5f

Von Kivitendo Admin vor etwa 11 Jahren hinzugefügt

  • ID 409d5d5fbf7020d69c7062cdde11040dc755ee38
  • Vorgänger 4ec4e904
  • Nachfolger 3711d95e

Revert "Neue Verkaufsberichtvariante mit Umsatz-Sortierung"

This reverts commit 5ef8b31028dada9eff3c317fe92c0a9b05ea41a4.

Bevor mit das jemand um die Ohren haut, das sollte eigentlich nicht
committed werden. Kommt vielleicht in Zukunft mal rein.

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" | .
57 56

  
58 57
  my $query =
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 .=
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 | .
65 59
    qq|FROM invoice i | .
66 60
    qq|JOIN ar on (i.trans_id = ar.id) | .
67 61
    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|glnumber_| . $form->{id};
970
        $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
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
  
1143 1142
  if(!exists $form->{addition} && $form->{id} ne "") {
1144
    $form->{snumbers} = qq|glnumber_| . $form->{id};
1143
    $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
1145 1144
    $form->{addition} = "SAVED";
1146 1145
    $form->{what_done} = $locale->text("Buchungsnummer") . " = " . $form->{id};
1147 1146
    $form->save_history;
......
1210 1209

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

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

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

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

  
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

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

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

  
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

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

  
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

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

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

  
205 141

  
206

  
207

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

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

  
222 156
  @columns =
223 157
    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
227 158

  
228 159
  my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs_ic }, @{ $cvar_configs_ct };
229 160
  my @searchable_custom_variables  = grep { $_->{searchable} }  @{ $cvar_configs_ic }, @{ $cvar_configs_ct };
......
238 169
  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),
239 170
      "$form->{db}number",
240 171
      map({ "cvar_$_->{name}" } @searchable_custom_variables),
241
      map { "l_$_" } @columns,
172
      map { "l_$_" } @columns
242 173
      );
243
  push(@hidden_variables, qw(topsortgroup topsorttype l_sort_by_total));  # hidden variables for top
244

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

  
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
  };
286

  
287 210
  map { $column_defs{$_}->{visible} = $form->{"l_$_"} eq 'Y' } @columns;
288 211

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

  
290 214

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

  
217
  $form->{"l_description"} = "Y" if not defined $form->{"l_parts"};;
295 218
  map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns;
296 219

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

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

  
320
  if ( not $form->{l_sort_by_total} ) {
321 243
  $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),
322 244
                       'output_format'        => 'HTML',
323 245
                       'title'                => $form->{title},
324 246
                       'attachment_basename'  => $locale->text('Sales Report') . strftime('_%Y%m%d', localtime time),
325 247
    );
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

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

  
......
339 253

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

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

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

  
374
  my @subtotal_columns = qw(qty weight sellprice sellprice_total lastcost lastcost_total marge_total marge_percent discount sellpricelinetotal);
287
  my @subtotal_columns = qw(qty weight sellprice sellprice_total lastcost lastcost_total marge_total marge_percent discount);
375 288
  # Total sum:
376 289
  # sum of sellprice_total, lastcost_total and marge_total
377 290
  # average of 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);
291
  my @total_columns = qw(sellprice_total lastcost_total marge_total marge_percent );
381 292

  
382 293
  my %totals     = map { $_ => 0 } @total_columns;
383 294
  my %subtotals1 = map { $_ => 0 } @subtotal_columns;
......
485 396
    map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 2) } qw(marge_percent qty);
486 397
    map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 3) } qw(weight);
487 398
    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"};
489 399

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

  
507 415
    # hier wird bei l_subtotal nicht differenziert zwischen mainsort und subsort
508 416
    # 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
510 417
    if (   ($form->{l_subtotal_mainsort} eq 'Y')
511 418
        && ($form->{l_subtotal_subsort}  eq 'Y')
512 419
        && (($idx == (scalar @{ $form->{AR} } - 1))   # last element always has a subtotal
......
514 421
          || ($ar->{ $form->{'mainsort'} } ne $form->{AR}->[$idx + 1]->{ $form->{'mainsort'} })
515 422
          )) {   # if value that is sorted by changes, print subtotal
516 423

  
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
    };
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
    }
531 427

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

  
545 441
    $idx++;
546 442
  }
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

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

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

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

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

  
603 477

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

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

  
168 162
[AR--Reports--Dunnings]
169 163
ACCESS=dunning_edit
170 164
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', 'MAILED'];
77
  var defaults = ['SAVED', 'DELETED', 'ADDED', 'PAYMENT POSTED', 'POSTED', 'POSTED AS NEW', 'SAVED FOR DUNNING', 'DUNNING STARTED', 'PRINTED'];
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 %]',
91 90
  };
92 91

  
93 92
  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>[% 'Sales margin total' | $T8 %]</td>
252
            <td align=left><input name="l_marge_total" class=checkbox type=checkbox value=Y checked>[% 'Margetotal' | $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>[% 'Sales margin percent' | $T8 %]</td>
259
            <td align=left><input name="l_marge_percent" class=checkbox type=checkbox value=Y checked>[% 'Margepercent' | $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