Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a521b29b

Von G. Richardson vor mehr als 12 Jahren hinzugefügt

  • ID a521b29b7f07b940afb392ccbd22f6373dfa0b7e
  • Vorgänger ff641432
  • Nachfolger 44c040d3

Verkaufsberichtsortierung um Land, Warengruppen, Kundentyp, Verkäufer und Monat erweitert

Hauptsortierung und Untersortierung sind jetzt nicht mehr auf Ware und Kunde
begrenzt, sondern man kann eine Kombinationen erstellen aus:

  • Kunde
  • Ware
  • Land
  • Warengruppe
  • Kundentyp
  • Verkäufer
  • Monat

Es kann jetzt auch nach benutzerdefinierten Variablen gefiltert werden.

Der Verkaufsbericht spaltet sich mit seinen Optionen langsam in zwei
unterschiedliche Bereiche auf, den Artikelmodus, wo die einzelnen Zeilen aus
invoice angezeigt werden, und den Rechnungsmodus, wo nur die Zeilen der
Zwischensummen und Summen angezeigt werden, und die Detailinformationen
aus invoice nur stören.

Default ist Rechnungsmodus, den Artikelmodus kann man per Häkchen auswählen.

Je nachdem auf welcher Ebene man sich befindet machen dann auch Informationen
wie "Durchschnittsverkaufspreis" keinen Sinn mehr.

Bei Zuordnungen wo die Sortierung keinen Wert hat (z.B. Sortierung nach Land,
aber beim Kunden ist kein Land hinterlegt), erscheint als Überschrift "leer",
und alle leeren Werte werden als eine Gruppe zusammengefasst.

Unterschiede anzeigen:

SL/VK.pm
51 51
  my @values;
52 52

  
53 53
  my $query =
54
    qq|SELECT cus.name,cus.customernumber,ar.invnumber,ar.id,ar.transdate,p.partnumber,i.parts_id,i.qty,i.price_factor,i.discount,i.description,i.lastcost,i.sellprice,i.fxsellprice,i.marge_total,i.marge_percent,i.unit | .
54
    qq|SELECT ct.id as customerid, ct.name as customername,ct.customernumber,ct.country,ar.invnumber,ar.id,ar.transdate,p.partnumber,pg.partsgroup,i.parts_id,i.qty,i.price_factor,i.discount,i.description as description,i.lastcost,i.sellprice,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 | .
55 55
    qq|FROM invoice i | .  
56
    qq|join ar on (i.trans_id = ar.id) | .
57
    qq|join parts p on (i.parts_id = p.id) | .
58
    qq|join customer cus on (cus.id = ar.customer_id) |;
56
    qq|JOIN ar on (i.trans_id = ar.id) | .
57
    qq|JOIN parts p on (i.parts_id = p.id) | .
58
    qq|LEFT JOIN partsgroup pg on (p.partsgroup_id = pg.id) | .
59
    qq|LEFT JOIN customer ct on (ct.id = ar.customer_id) | .
60
    qq|LEFT JOIN business b on (ct.business_id = b.id) | .
61
    qq|LEFT JOIN employee e ON (ar.employee_id = e.id) | .
62
    qq|LEFT JOIN employee e2 ON (ar.salesman_id = e2.id) |;
59 63

  
60 64
  my $where = "1 = 1";
61 65

  
66
  # if employee can only see his own invoices, make sure this also holds for sales report
67
  # limits by employees (Bearbeiter), not salesmen!
68
  if (!$main::auth->assert('sales_all_edit', 1)) {
69
    $where .= " AND ar.employee_id = (select id from employee where login= ?)";
70
    push (@values, $form->{login});
71
  }
72

  
62 73
  # Stornierte Rechnungen und Stornorechnungen in invoice rausfiltern
74
  # was ist mit Gutschriften?
63 75
  $where .= " AND ar.storno is not true ";
64 76

  
65 77
  # Bestandteile von Erzeugnissen herausfiltern
66 78
  $where .= " AND i.assemblyitem is not true ";
67 79

  
68
  my $sortorder = "cus.name,i.parts_id,ar.transdate";
69
  if ($form->{sortby} eq 'artikelsort') {
70
    $sortorder = "i.parts_id,cus.name,ar.transdate";
80
  my $sortorder;
81
  # sorting by month is a special case:
82
  # Sorting by month, using salesman as an example:
83
  # Sorting with month as mainsort: ORDER BY month,salesman,ar.transdate,ar.invnumber
84
  # Sorting with month as subsort:  ORDER BY salesman,ar.transdate,month,ar.invnumber
85
  if ($form->{mainsort} eq 'month') {
86
    $sortorder .= "ar.transdate,month,"
87
  } else {
88
    $sortorder .= $form->{mainsort} . ",";
71 89
  };
90
  if ($form->{subsort} eq 'month') {
91
    $sortorder .= "ar.transdate,month,"
92
  } else {
93
    $sortorder .= $form->{subsort} . ",";
94
  };
95
  $sortorder .= 'ar.transdate,' unless $form->{subsort} eq 'month';
96
  $sortorder .= 'ar.invnumber';
97

  
98
#  $sortorder =~ s/month/ar.transdate/;
72 99

  
73 100
  if ($form->{customer_id}) {
74 101
    $where .= " AND ar.customer_id = ?";
75 102
    push(@values, $form->{customer_id});
76 103
  };
77 104
  if ($form->{customernumber}) {
78
    $where .= qq| AND cus.customernumber = ? |;
105
    $where .= qq| AND ct.customernumber = ? |;
79 106
    push(@values, $form->{customernumber});
80 107
  }
81 108
  if ($form->{partnumber}) {
82 109
    $where .= qq| AND (p.partnumber ILIKE ?)|;
83 110
    push(@values, '%' . $form->{partnumber} . '%');
84 111
  }
112
  if ($form->{partsgroup_id}) {
113
    $where .= qq| AND (pg.id = ?)|;
114
    push(@values, $form->{partsgroup_id});
115
  }
116
  if ($form->{country}) {
117
    $where .= qq| AND (ct.country ILIKE ?)|;
118
    push(@values, '%' . $form->{country} . '%');
119
  }
85 120
  # nimmt man description am Besten aus invoice oder parts?
86 121
  if ($form->{description}) {
87 122
    $where .= qq| AND (i.description ILIKE ?)|;
......
100 135
    $where .= " AND ar.department_id = ?";
101 136
    push(@values, $department_id);
102 137
  }
138
  if ($form->{employee_id}) {
139
    $where .= " AND ar.employee_id = ?";
140
    push @values, conv_i($form->{employee_id});
141
  }
142

  
143
  if ($form->{salesman_id}) {
144
    $where .= " AND ar.salesman_id = ?";
145
    push @values, conv_i($form->{salesman_id});
146
  }
103 147
  if ($form->{project_id}) {
104 148
    $where .=
105 149
      qq|AND ((ar.globalproject_id = ?) OR EXISTS | .
......
107 151
      qq|   WHERE i.project_id = ? AND i.trans_id = ar.id))|;
108 152
    push(@values, $form->{"project_id"}, $form->{"project_id"});
109 153
  }
154
  if ($form->{business_id}) {
155
    $where .= qq| AND ct.business_id = ? |; 
156
    push(@values, $form->{"business_id"});
157
  }
158

  
159
  my ($cvar_where_ct, @cvar_values_ct) = CVar->build_filter_query('module'    => 'CT',
160
                                                                  'trans_id_field' => 'ct.id',
161
                                                                  'filter'         => $form);
162

  
163
  if ($cvar_where_ct) {
164
    $where .= qq| AND ($cvar_where_ct)|;
165
    push @values, @cvar_values_ct;
166
  }
167

  
110 168

  
111
  $query .= " WHERE $where ORDER BY $sortorder";
169
  my ($cvar_where_ic, @cvar_values_ic) = CVar->build_filter_query('module'         => 'IC',
170
                                                                  'trans_id_field' => 'p.id',
171
                                                                  'filter'         => $form);
172

  
173
  if ($cvar_where_ic) {
174
    $where .= qq| AND ($cvar_where_ic)|;
175
    push @values, @cvar_values_ic;
176
  }
177
  
178
  $query .= " WHERE $where ORDER BY $sortorder "; # LIMIT 5000";
112 179

  
113 180
  my @result = selectall_hashref_query($form, $dbh, $query, @values);
114 181

  
bin/mozilla/vk.pl
46 46

  
47 47
use strict;
48 48

  
49

  
50 49
sub search_invoice {
51 50
  $main::lxdebug->enter_sub();
52 51
  $main::auth->assert('general_ledger | invoice_edit');
......
63 62
  $form->{title}    = $locale->text('Sales Report');
64 63
  $form->{jsscript} = 1;
65 64

  
66
  $form->get_lists("projects"     => { "key" => "ALL_PROJECTS", "all" => 1 },
67
                   "departments"  => "ALL_DEPARTMENTS",
68
                   "customers"    => "ALL_VC");
69

  
65
  $form->get_lists("projects"        => { "key" => "ALL_PROJECTS", "all" => 1 },
66
                   "departments"     => "ALL_DEPARTMENTS",
67
                   "business_types"  => "ALL_BUSINESS_TYPES",
68
                   "salesmen"        => "ALL_SALESMEN",
69
                   'employees'       => 'ALL_EMPLOYEES',
70
                   'partsgroup'      => 'ALL_PARTSGROUPS',
71
                   "customers"       => "ALL_VC");
72
  $form->{CUSTOM_VARIABLES_IC}                  = CVar->get_configs('module' => 'IC');
73
  ($form->{CUSTOM_VARIABLES_FILTER_CODE_IC},
74
   $form->{CUSTOM_VARIABLES_INCLUSION_CODE_IC}) = CVar->render_search_options('variables'      => $form->{CUSTOM_VARIABLES_IC},
75
                                                                           'include_prefix' => 'l_',
76
                                                                           'include_value'  => 'Y');
77

  
78
  $form->{CUSTOM_VARIABLES_CT}                  = CVar->get_configs('module' => 'CT');
79
  ($form->{CUSTOM_VARIABLES_FILTER_CODE_CT},
80
   $form->{CUSTOM_VARIABLES_INCLUSION_CODE_CT}) = CVar->render_search_options('variables'      => $form->{CUSTOM_VARIABLES_CT},
81
                                                                           'include_prefix' => 'l_',
82
                                                                           'include_value'  => 'Y');
70 83
  $form->{vc_keys}   = sub { "$_[0]->{name}--$_[0]->{id}" };
84
  $form->{employee_labels} = sub { $_[0]->{"name"} || $_[0]->{"login"} };
85
  $form->{salesman_labels} = $form->{employee_labels};
71 86

  
72 87
  $form->header;
73 88
  print $form->parse_html_template('vk/search_invoice', { %myconfig });
......
86 101

  
87 102
  my ($callback, $href, @columns);
88 103

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

  
89 107
  if ( $form->{customer} =~ /--/ ) {
90 108
    # Felddaten kommen aus Dropdownbox
91 109
    ($form->{customername}, $form->{customer_id}) = split(/--/, $form->{customer});
......
108 126
  # decimalplaces überprüfen oder auf Default 2 setzen
109 127
  $form->{decimalplaces} = 2 unless $form->{decimalplaces} > 0 && $form->{decimalplaces} < 6;
110 128

  
129
  my $cvar_configs_ct = CVar->get_configs('module' => 'CT');
130
  my $cvar_configs_ic = CVar->get_configs('module' => 'IC');
131

  
111 132
#  report_generator_set_default_sort('transdate', 1);
112 133

  
113 134
  VK->invoice_transactions(\%myconfig, \%$form);
114 135

  
115
  # anhand von radio button die Sortierreihenfolge festlegen
116
  if ($form->{sortby} eq 'artikelsort') {
117
    $form->{'mainsort'} = 'parts_id';
118
    $form->{'subsort'}  = 'name';
119
  } else {
120
    $form->{'mainsort'} = 'name';
121
    $form->{'subsort'}  = 'parts_id';
136
  
137
  if ( $form->{mainsort} eq 'month' or $form->{subsort} eq 'month' ) {
138

  
139
    # Data already comes out of SELECT statement in correct month order, but
140
    # remove whitespaces (month names are padded) and translate them as early
141
    # as possible
142

  
143
    foreach (@{ $form->{AR} }) {
144
      $_->{month} =~ s/\s//g;
145
      $_->{month} = $locale->text($_->{month});
146
    };
122 147
  };
123 148

  
124 149
  $form->{title} = $locale->text('Sales Report');
125 150

  
126 151
  @columns =
127
    qw(description invnumber transdate customernumber partnumber transdate qty unit sellprice sellprice_total discount lastcost lastcost_total marge_total marge_percent);
152
    qw(description invnumber transdate customernumber customername partnumber partsgroup country business transdate qty unit sellprice sellprice_total discount lastcost lastcost_total marge_total marge_percent employee salesman);
153

  
154
  my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs_ic }, @{ $cvar_configs_ct };
155
  my @searchable_custom_variables  = grep { $_->{searchable} }  @{ $cvar_configs_ic }, @{ $cvar_configs_ct };
156
  my %column_defs_cvars            = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables;
157

  
158
  push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables;
159

  
128 160

  
129 161
  # hidden variables für pdf/csv export übergeben
130 162
  # einmal mit l_ um zu bestimmen welche Spalten ausgegeben werden sollen
131 163
  # einmal optionen für die Überschrift (z.B. transdatefrom, partnumber, ...)
132
  my @hidden_variables  = (qw(l_headers l_subtotal l_total l_customernumber transdatefrom transdateto decimalplaces customer customername customer_id department partnumber description project_id customernumber), "$form->{db}number", map { "l_$_" } @columns);
164
  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), 
165
      "$form->{db}number", 
166
      map({ "cvar_$_->{name}" } @searchable_custom_variables),
167
      map { "l_$_" } @columns
168
      );
133 169
  my @hidden_nondefault = grep({ $form->{$_} } @hidden_variables);
134 170
  # Variablen werden dann als Hidden Variable mitgegeben, z.B.
135 171
  # <input type="hidden" name="report_generator_hidden_transdateto" value="21.05.2010">
......
140 176
  my %column_defs = (
141 177
    'description'             => { 'text' => $locale->text('Description'), },
142 178
    'partnumber'              => { 'text' => $locale->text('Part Number'), },
179
    'partsgroup'              => { 'text' => $locale->text('Group'), },
180
    'country'                 => { 'text' => $locale->text('Country'), },
181
    'business'                => { 'text' => $locale->text('Customer type'), },
182
    'employee'                => { 'text' => $locale->text('Employee'), },
183
    'salesman'                => { 'text' => $locale->text('Salesperson'), },
143 184
    'invnumber'               => { 'text' => $locale->text('Invoice Number'), },
144 185
    'transdate'               => { 'text' => $locale->text('Invoice Date'), },
145 186
    'qty'                     => { 'text' => $locale->text('Quantity'), },
......
152 193
    'marge_total'             => { 'text' => $locale->text('Sales margin'), },
153 194
    'marge_percent'           => { 'text' => $locale->text('Sales margin %'), },
154 195
    'customernumber'          => { 'text' => $locale->text('Customer Number'), },
196
    'customername'            => { 'text' => $locale->text('Customer Name'), },
197
# add 3 more column_defs so we have a translation for top_info_text
198
    'customer'                => { 'text' => $locale->text('Customer'), },
199
    'part'                    => { 'text' => $locale->text('Part'), },
200
    'month'                   => { 'text' => $locale->text('Month'), },
201
    %column_defs_cvars,
155 202
  );
156 203

  
204
  map { $column_defs{$_}->{visible} = $form->{"l_$_"} eq 'Y' } @columns;
205

  
157 206
  my %column_alignment = map { $_ => 'right' } qw(lastcost sellprice sellprice_total lastcost_total unit discount marge_total marge_percent qty);
158 207

  
159
  $form->{"l_type"} = "Y";
208
  
209
  # so now the check-box "Description" is only used as switch for part description in invoice-mode
210
  # always fill the column "Description" if we are in Zwischensummenmode
211
  if (not defined $form->{"l_parts"}) {
212
    $form->{"l_description"} = "Y";
213
  };
160 214
  map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns;
161 215

  
162

  
163 216
  my @options;
217

  
164 218
  if ($form->{description}) {
165 219
    push @options, $locale->text('Description') . " : $form->{description}";
166 220
  }
......
170 224
  if ($form->{customernumber}) {
171 225
    push @options, $locale->text('Customer Number') . " : $form->{customernumber}";
172 226
  }
227
# TODO: es wird nur id übergeben
173 228
  if ($form->{department}) {
174 229
    my ($department) = split /--/, $form->{department};
175 230
    push @options, $locale->text('Department') . " : $department";
......
183 238
  if ($form->{partnumber}) {
184 239
    push @options, $locale->text('Part Number') . " : $form->{partnumber}";
185 240
  }
241
  if ($form->{partsgroup_id}) {
242
    my $partsgroup = SL::DB::PartsGroup->new(id => $form->{partsgroup_id})->load;
243
    push @options, $locale->text('Group') . " : $partsgroup->{partsgroup}";
244
  }
245
  if ($form->{country}) {
246
    push @options, $locale->text('Country') . " : $form->{country}";
247
  }
248
  if ($form->{employee_id}) {
249
    my $employee = SL::DB::Employee->new(id => $form->{employee_id})->load;
250
    push @options, $locale->text('Employee') . ' : ' . $employee->name;
251
  }
252
  if ($form->{salesman_id}) {
253
    my $salesman = SL::DB::Employee->new(id => $form->{salesman_id})->load;
254
    push @options, $locale->text('Salesman') . ' : ' . $salesman->name;
255
  }
256
  if ($form->{business_id}) {
257
    my $business = SL::DB::Business->new(id => $form->{business_id})->load;
258
    push @options, $locale->text('Customer type') . ' : ' . $business->description;
259
  }
186 260
  if ($form->{ordnumber}) {
187 261
    push @options, $locale->text('Order Number') . " : $form->{ordnumber}";
188 262
  }
......
201 275

  
202 276
  my $report = SL::ReportGenerator->new(\%myconfig, $form);
203 277

  
204
  $report->set_options('top_info_text'        => join("\n", @options),
278
  $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),
205 279
                       'output_format'        => 'HTML',
206 280
                       'title'                => $form->{title},
207 281
                       'attachment_basename'  => $locale->text('Sales Report') . strftime('_%Y%m%d', localtime time),
......
216 290

  
217 291
  $report->set_sort_indicator($form->{mainsort}, $form->{sortdir});
218 292

  
293
  CVar->add_custom_variables_to_report('module'         => 'CT',
294
      'trans_id_field' => 'customerid',
295
      'configs'        => $cvar_configs_ct,
296
      'column_defs'    => \%column_defs,
297
      'data'           => $form->{AR}
298
  );
299

  
300
  CVar->add_custom_variables_to_report('module'         => 'IC',
301
      'trans_id_field' => 'parts_id',
302
      'configs'        => $cvar_configs_ic,
303
      'column_defs'    => \%column_defs,
304
      'data'           => $form->{AR}
305
  );
306

  
219 307
  # add sort and escape callback, this one we use for the add sub
220 308
  $form->{callback} = $href .= "&sort=$form->{mainsort}";
221 309

  
......
241 329
    # discount was already accounted for in db sellprice
242 330
    $ar->{sellprice} = $ar->{sellprice} / $ar->{price_factor};
243 331
    $ar->{lastcost} = $ar->{lastcost} / $ar->{price_factor};
244
    $ar->{sellprice_total} = $ar->{qty} * ( $ar->{fxsellprice} * ( 1 - $ar->{discount} ) ) ;
332
    $ar->{sellprice_total} = $ar->{qty} * $ar->{sellprice};
245 333
    $ar->{lastcost_total}  = $ar->{qty} * $ar->{lastcost};
246 334
    # marge_percent wird neu berechnet, da Wert in invoice leer ist (Bug)
247
    $ar->{marge_percent} = $ar->{sellprice_total} ? (($ar->{sellprice_total}-$ar->{lastcost_total}) / $ar->{sellprice_total}) : 0;
335
    $ar->{marge_percent} = $ar->{sellprice_total} ? (($ar->{sellprice_total}-$ar->{lastcost_total}) / $ar->{sellprice_total} * 100) : 0;
248 336
    # marge_total neu berechnen
249 337
    $ar->{marge_total} = $ar->{sellprice_total} ? $ar->{sellprice_total}-$ar->{lastcost_total}  : 0;
250 338
    $ar->{discount} *= 100;  # für Ausgabe formatieren, 10% stored as 0.1 in db
251 339

  
252 340
    # Anfangshauptüberschrift
253
    if ( $form->{l_headers} eq "Y" && ( $idx == 0 or $ar->{ $form->{'mainsort'} } ne $form->{AR}->[$idx - 1]->{ $form->{'mainsort'} } )) {
254
      my $name;
341
    if ( $form->{l_headers_mainsort} eq "Y" && ( $idx == 0 or $ar->{ $form->{'mainsort'} } ne $form->{AR}->[$idx - 1]->{ $form->{'mainsort'} } )) {
255 342
      my $headerrow;
256
      if ( $form->{mainsort} eq 'parts_id' ) {
257
        $headerrow->{description}->{data} = "$ar->{description}";
343

  
344
      # use $emptyname for mainsort header if mainsort is empty
345
      if ( $ar->{$form->{'mainsort'}} ) {
346
        $headerrow->{description}->{data} = $ar->{$form->{'mainsort'}};
258 347
      } else {
259
        $headerrow->{description}->{data} = "$ar->{name}";
348
        $headerrow->{description}->{data} = $locale->text('empty');
260 349
      };
350

  
261 351
      $headerrow->{description}->{class} = "listmainsortheader";
262 352
      my $headerrow_set = [ $headerrow ];
263 353
      $report->add_data($headerrow_set);
......
275 365
      or $ar->{ $form->{'mainsort'} } ne $form->{AR}->[$idx - 1]->{ $form->{'mainsort'} }
276 366
    ) {
277 367
      my $headerrow;
278
      my $name;
279
      if ( $form->{subsort} eq 'parts_id' ) {
280
        $name = 'description';
281
        $headerrow->{description}->{data} = "$ar->{$name}";
368

  
369
      # if subsort name is defined, use that name in header, otherwise use $emptyname
370
      if ( $ar->{$form->{'subsort'}} ) {
371
        $headerrow->{description}->{data} = $ar->{$form->{'subsort'}};
282 372
      } else {
283
        $name = 'name';
284
        $headerrow->{description}->{data} = "$ar->{$name}";
373
        $headerrow->{description}->{data} = $locale->text('empty');
285 374
      };
286 375
      $headerrow->{description}->{class} = "listsubsortheader";
287 376
      my $headerrow_set = [ $headerrow ];
288
      $report->add_data($headerrow_set) if $form->{l_headers} eq "Y";
377
      # special case: subsort headers only makes (aesthetical) sense if we show individual parts
378
      $report->add_data($headerrow_set) if $form->{l_headers_subsort} eq "Y" and $form->{l_parts};
289 379
    };
290 380

  
291 381
    map { $subtotals1{$_} += $ar->{$_};
......
318 408
    };
319 409

  
320 410
    # Ertrag prozentual in den Summen: (summe VK - summe Ertrag) / summe VK
321
    $subtotals1{marge_percent} = $subtotals1{sellprice_total} ? (($subtotals1{sellprice_total} - $subtotals1{lastcost_total}) / $subtotals1{sellprice_total}) : 0;
322
    $subtotals2{marge_percent} = $subtotals2{sellprice_total} ? (($subtotals2{sellprice_total} - $subtotals2{lastcost_total}) / $subtotals2{sellprice_total}) : 0;
411
    $subtotals1{marge_percent} = $subtotals1{sellprice_total} ? (($subtotals1{sellprice_total} - $subtotals1{lastcost_total}) / $subtotals1{sellprice_total}) * 100 : 0;
412
    $subtotals2{marge_percent} = $subtotals2{sellprice_total} ? (($subtotals2{sellprice_total} - $subtotals2{lastcost_total}) / $subtotals2{sellprice_total}) *100 : 0;
323 413

  
324 414
    # Ertrag prozentual:  (Summe VK betrag - Summe EK betrag) / Summe VK betrag
325 415
    # wird laufend bei jeder Position neu berechnet
326
    $totals{marge_percent}    = $totals{sellprice_total}    ? ( ($totals{sellprice_total} - $totals{lastcost_total}) / $totals{sellprice_total}   ) : 0;
416
    $totals{marge_percent}    = $totals{sellprice_total}    ? ( ($totals{sellprice_total} - $totals{lastcost_total}) / $totals{sellprice_total}   ) * 100 : 0;
327 417

  
328 418
    map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 2) } qw(marge_total marge_percent);
329 419
    map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, $form->{"decimalplaces"} )} qw(lastcost sellprice sellprice_total lastcost_total);
......
342 432
    $row->{invnumber}->{link} = build_std_url("script=is.pl", 'action=edit')
343 433
      . "&id=" . E($ar->{id}) . "&callback=${callback}";
344 434

  
345
    my $row_set = [ $row ];
435
    # Einzelzeilen nur zeigen wenn l_parts gesetzt ist, nützlich, wenn man nur
436
    # Subtotals und Totals sehen möchte
437
    my $row_set = $form->{l_parts} ? [ $row ] : [ ];
346 438

  
347
    if (($form->{l_subtotal} eq 'Y')
439
    # hier wird bei l_subtotal nicht differenziert zwischen mainsort und subsort
440
    # macht man l_subtotal_mainsort aus wird l_subtotal_subsort auch nicht ausgeführt
441
    if (($form->{l_subtotal_mainsort} eq 'Y')
348 442
        && (($idx == (scalar @{ $form->{AR} } - 1))   # last element always has a subtotal
349 443
          || ($ar->{ $form->{'subsort'} } ne $form->{AR}->[$idx + 1]->{ $form->{'subsort'}   })
350 444
          || ($ar->{ $form->{'mainsort'} } ne $form->{AR}->[$idx + 1]->{ $form->{'mainsort'} })
351 445
          )) {   # if value that is sorted by changes, print subtotal
352
      my $name;
353
      if ( $form->{subsort} eq 'parts_id' ) {
354
        $name = 'description';
355
      } else {
356
        $name = 'name';
357
      };
358 446

  
359
      if ($form->{l_subtotal} eq 'Y') {
360
        push @{ $row_set }, create_subtotal_row_invoice(\%subtotals2, \@columns, \%column_alignment, \@subtotal_columns, 'listsubsortsubtotal', $ar->{$name}) ;
361
        push @{ $row_set }, insert_empty_row();
447
      if ($form->{l_subtotal_subsort} eq 'Y') {
448
        push @{ $row_set }, create_subtotal_row_invoice(\%subtotals2, \@columns, \%column_alignment, \@subtotal_columns, 'listsubsortsubtotal', $ar->{ $form->{'subsort'} }) ;
449
        push @{ $row_set }, insert_empty_row() if $form->{l_parts} and $addemptylines;
362 450
      };
363 451
    }
364 452

  
365
    # if mainsort has changed, add mainsort subtotal and empty row
366
    if (($form->{l_subtotal} eq 'Y')
453
    # if last mainsort is reached or mainsort has changed, add mainsort subtotal and empty row
454
    if (($form->{l_subtotal_mainsort} eq 'Y')
367 455
        && (($idx == (scalar @{ $form->{AR} } - 1))   # last element always has a subtotal
368 456
            || ($ar->{ $form->{'mainsort'} } ne $form->{AR}->[$idx + 1]->{ $form->{'mainsort'} })
369 457
            )) {   # if value that is sorted by changes, print subtotal
370
      my $name;
371
      if ( $form->{mainsort} eq 'parts_id' ) {
372
        $name = 'description';
373
      } else {
374
        $name = 'name';
375
      };
376
      if ($form->{l_subtotal} eq 'Y' ) {
377
        push @{ $row_set }, create_subtotal_row_invoice(\%subtotals1, \@columns, \%column_alignment, \@subtotal_columns, 'listmainsortsubtotal', $ar->{$name});
378
        push @{ $row_set }, insert_empty_row();
458
      if ($form->{l_subtotal_mainsort} eq 'Y' and $form->{mainsort} ne $form->{subsort} ) {
459
        # subtotal is overriden if mainsort and subsort are equal, don't print
460
        # subtotal line even if it is selected
461
        push @{ $row_set }, create_subtotal_row_invoice(\%subtotals1, \@columns, \%column_alignment, \@subtotal_columns, 'listmainsortsubtotal', $ar->{$form->{mainsort}});
462
        push @{ $row_set }, insert_empty_row() if $addemptylines; # insert empty row after mainsort
379 463
      };
380 464
    }
381 465

  
......
385 469
  }
386 470
  if ( $form->{l_total} eq "Y" ) {
387 471
    $report->add_separator();
388
    $report->add_data(create_subtotal_row_invoice(\%totals, \@columns, \%column_alignment, \@total_columns, 'listtotal'))
472
    $report->add_data(create_subtotal_row_invoice(\%totals, \@columns, \%column_alignment, \@total_columns, 'listtotal', 'l_total'))
389 473
  };
390 474

  
391 475
  $report->generate_with_headers();
......
409 493

  
410 494
  my $form     = $main::form;
411 495
  my %myconfig = %main::myconfig;
496
  my $locale   = $main::locale;
412 497

  
413 498
  my $row = { map { $_ => { 'data' => '', 'class' => $class, 'align' => $column_alignment->{$_}, } } @{ $columns } };
414 499

  
415
  $row->{description}->{data} = "Summe " . $name;
500
  # set name as "empty" if no value is given, except if we are dealing with the
501
  # absolute total, then just write "Total sum"
502
  # here we assume that no name will be called 'l_total'
503
  $name = $locale->text('empty') unless $name;
504
  if ( $name eq 'l_total' ) {
505
    $row->{description}->{data} = $locale->text('Total sum');
506
  } else {
507
    $row->{description}->{data} = $locale->text('Total') . ' ' . $name;
508
  };
416 509

  
417 510
  map { $row->{$_}->{data} = $form->format_amount(\%myconfig, $totals->{$_}, 2) } qw(marge_total marge_percent);
418 511
  map { $row->{$_}->{data} = $form->format_amount(\%myconfig, $totals->{$_}, 0) } qw(qty);
locale/de/all
488 488
  'Credit Tax'                  => 'Umsatzsteuer',
489 489
  'Credit Tax Account'          => 'Umsatzsteuerkonto',
490 490
  'Credit note (one letter abbreviation)' => 'G',
491
  'Cumulated or averaged values' => 'Kumulierte oder gemittelte Werte',
491 492
  'Curr'                        => 'Währung',
492 493
  'Currencies'                  => 'W&auml;hrungen',
493 494
  'Currency'                    => 'Währung',
......
511 512
  'Customer not on file!'       => 'Kunde ist nicht in der Datenbank!',
512 513
  'Customer saved!'             => 'Kunde gespeichert!',
513 514
  'Customer type'               => 'Kundentyp',
515
  'Customer variables'          => 'Kundenvariablen',
514 516
  'Customer/Vendor'             => 'Kunde/Lieferant',
515 517
  'Customer/Vendor (database ID)' => 'Kunde/Lieferant (Datenbank-ID)',
516 518
  'Customer/Vendor Name'        => 'Kunde/Lieferant',
......
839 841
  'Files created by kivitendo\'s &quot;Backup Dataset&quot; function are such files.' => 'Dateien, die von kivitendo\'s Funktion &quot;Datenbank sichern&quot; erstellt wurden, erf&uuml;llen diese Kriterien.',
840 842
  'Filter'                      => 'Filter',
841 843
  'Filter date by'              => 'Datum filtern nach',
844
  'Filter for customer variables' => 'Filter für benutzerdefinierte Kundenvariablen',
845
  'Filter for item variables'   => 'Filter für benutzerdefinierte Artikelvariablen',
842 846
  'Finish'                      => 'Abschlie&szlig;en',
843 847
  'Fix transaction'             => 'Buchung korrigieren',
844 848
  'Fix transactions'            => 'Buchungen korrigieren',
......
1012 1016
  'It may optionally be compressed with &quot;gzip&quot;.' => 'Sie darf optional mit &quot;gzip&quot; komprimiert sein.',
1013 1017
  'It will simply set the taxkey to 0 (meaning "no taxes") which is the correct value for such inventory transactions.' => 'Es wird einfach die Steuerschlüssel auf  0 setzen, was "keine Steuer" bedeutet und für solche Warenbestandsbuchungen der richtige Wert ist.',
1014 1018
  'Item deleted!'               => 'Artikel gelöscht!',
1019
  'Item mode'                   => 'Artikelmodus',
1015 1020
  'Item not on file!'           => 'Dieser Artikel ist nicht in der Datenbank!',
1021
  'Item values'                 => 'Artikelwerte',
1022
  'Item variables'              => 'Artikelvariablen',
1016 1023
  'Jahresverkehrszahlen neu'    => 'Jahresverkehrszahlen neu',
1017 1024
  'Jan'                         => 'Jan',
1018 1025
  'January'                     => 'Januar',
......
1154 1161
  'Module home page'            => 'Modul-Webseite',
1155 1162
  'Module name'                 => 'Modulname',
1156 1163
  'Monat'                       => 'Monat',
1164
  'Month'                       => 'Monat',
1157 1165
  'Monthly'                     => 'monatlich',
1158 1166
  'More than one #1 found matching, please be more specific.' => 'Mehr als ein #1 wurde gefunden, bitte geben Sie den Namen genauer an.',
1159 1167
  'More than one control file with the tag \'%s\' exist.' => 'Es gibt mehr als eine Kontrolldatei mit dem Tag \'%s\'.',
......
1261 1269
  'On Order'                    => 'Ist bestellt',
1262 1270
  'One or more Perl modules missing' => 'Ein oder mehr Perl-Module fehlen',
1263 1271
  'Only due follow-ups'         => 'Nur f&auml;llige Wiedervorlagen',
1272
  'Only shown in item mode'     => 'werden nur im Artikelmodus angezeigt',
1264 1273
  'Oops. No valid action found to dispatch. Please report this case to the Lx-Office team.' => 'Ups. Es wurde keine gültige Funktion zum Aufrufen gefunden. Bitte berichten Sie diesen Fall den Lx-Office-Entwicklern.',
1265 1274
  'Open'                        => 'Offen',
1266 1275
  'Open Amount'                 => 'Offener Betrag',
......
1587 1596
  'Search contacts'             => 'Ansprechpartnersuche',
1588 1597
  'Search term'                 => 'Suchbegriff',
1589 1598
  'Searchable'                  => 'Durchsuchbar',
1599
  'Secondary sorting'           => 'Untersortierung',
1590 1600
  'Select'                      => 'auswählen',
1591 1601
  'Select a Customer'           => 'Endkunde auswählen',
1592 1602
  'Select a customer'           => 'Einen Kunden ausw&auml;hlen',
......
1649 1659
  'Show details'                => 'Detailsanzeige',
1650 1660
  'Show follow ups...'          => 'Zeige Wiedervorlagen...',
1651 1661
  'Show help text'              => 'Hilfetext anzeigen',
1662
  'Show items from invoices individually' => 'Artikel aus Rechnungen anzeigen',
1652 1663
  'Show old dunnings'           => 'Alte Mahnungen anzeigen',
1653 1664
  'Show overdue sales quotations and requests for quotations...' => 'Überfällige Angebote und Preisanfragen anzeigen...',
1654 1665
  'Show your TODO list after loggin in' => 'Aufgabenliste nach dem Anmelden anzeigen',
1655 1666
  'Signature'                   => 'Unterschrift',
1656 1667
  'Since bin is not enforced in the parts data, please specify a bin where goods without a specified bin will be put.' => 'Da Lagerpl&auml;tze kein Pflichtfeld sind, geben Sie bitte einen Lagerplatz an, in dem Waren ohne spezifizierten Lagerplatz eingelagert werden sollen.',
1657 1668
  'Single quotes'               => 'Einfache Anführungszeichen',
1669
  'Single values in item mode, cumulated values in invoice mode' => 'Einzelwerte im Artikelmodus, kumulierte Werte im Rechnungsmodus',
1658 1670
  'Skip'                        => 'Überspringen',
1659 1671
  'Skonto'                      => 'Skonto',
1660 1672
  'Skonto Terms'                => 'Zahlungsziel Skonto',
......
1962 1974
  'Total'                       => 'Summe',
1963 1975
  'Total Fees'                  => 'Kumulierte Gebühren',
1964 1976
  'Total stock value'           => 'Gesamter Bestandswert',
1977
  'Total sum'                   => 'Gesamtsumme',
1965 1978
  'Totals'                      => 'Summen',
1966 1979
  'Trade Discount'              => 'Rabatt',
1967 1980
  'Trans Id'                    => 'Trans-ID',
......
2173 2186
  'ar_aging_list'               => 'liste_offene_forderungen',
2174 2187
  'as at'                       => 'zum Stand',
2175 2188
  'assembly_list'               => 'erzeugnisliste',
2189
  'averaged values, in invoice mode only useful when filtered by a part' => 'gemittelte Werte, im Rechnungsmodus nur sinnvoll wenn nach Artikel gefiltert wird',
2176 2190
  'back'                        => 'zurück',
2177 2191
  'balance'                     => 'Betriebsvermögensvergleich/Bilanzierung',
2178 2192
  'bank_collection_payment_list_#1' => 'bankeinzugszahlungsliste_#1',
......
2216 2230
  'eMail?'                      => 'eMail?',
2217 2231
  'ea'                          => 'St.',
2218 2232
  'emailed to'                  => 'gemailt an',
2233
  'empty'                       => 'leer',
2219 2234
  'executed'                    => 'ausgeführt',
2220 2235
  'female'                      => 'weiblich',
2221 2236
  'follow_up_list'              => 'wiedervorlageliste',
......
2229 2244
  'inactive'                    => 'inaktiv',
2230 2245
  'income'                      => 'Einnahmen-Überschuß-Rechnung',
2231 2246
  'invoice'                     => 'Rechnung',
2247
  'invoice mode or item mode'   => 'Rechnungsmodus oder Artikelmodus',
2232 2248
  'invoice_list'                => 'debitorenbuchungsliste',
2233 2249
  'kivitendo'                   => 'kivitendo',
2234 2250
  'kivitendo Homepage'          => 'Infos zu kivitendo',
templates/webpages/vk/search_invoice.html
3 3

  
4 4
 <form method=post name="search_invoice" action=[% script %]>
5 5

  
6
  <table width=100%>
6
  <table width=100% border="0">
7 7
  <tr><th class=listtop>[% title %]</th></tr>
8 8
  <tr height="5"></tr>
9 9
  <tr>
10 10
   <td>
11
    <table>
11
    <table border="0">
12 12
     <tr>
13
       <td>[% 'Main sorting' | $T8 %]</td>
14
       <td colspan="3">
15
        <input name="sortby" id="artikelsort" class="radio" type="radio" value="artikelsort" checked>
16
        <label for="artikelsort">[% 'Parts' | $T8 %]</label>
17
        <input name="sortby" id="customersort" class="radio" type="radio" value="customersort">
18
        <label for="customersort">[% 'Customer' | $T8 %]</label>
19
       </td>
13
     <td>
14
      <table border="1">
15
       <tr>
16
        <th align=left nowrap>[% 'Configuration' | $T8 %]</th>
17
        <td>
18
         <table border="0">
19
           <tr>
20
             <td align="right">[% 'Main sorting' | $T8 %]</td>
21
             <td>
22
               <select name="mainsort" id="mainsort">
23
               <option value="description">[% 'Part' | $T8 %]</option>
24
               <option value="customername">[% 'Customer' | $T8 %]</option>
25
               <option value="country">[% 'Country' | $T8 %]</option>
26
               <option value="partsgroup">[% 'Group' | $T8 %]</option>
27
               <option value="business">[% 'Customer type' | $T8 %]</option>
28
               <option value="salesman" selected="selected">[% 'Salesman' | $T8 %]</option>
29
               <option value="month">[% 'Month' | $T8 %]</option>
30
               </select>
31
             </td>
32
             <td align=left><input name="l_headers_mainsort" class=checkbox type=checkbox value="Y" checked> [% 'Heading' | $T8 %]</td>
33
             <td align=left><input name="l_subtotal_mainsort" class=checkbox type=checkbox value="Y" checked> [% 'Subtotal' | $T8 %]</td>
34
             </tr>
35
             <tr>
36
               <td align="right">[% 'Secondary sorting' | $T8 %]</td>
37
               <td>
38
                 <select name="subsort" id="subsort">
39
                 <option value="description">[% 'Part' | $T8 %]</option>
40
                 <option value="customername">[% 'Customer' | $T8 %]</option>
41
                 <option value="country">[% 'Country' | $T8 %]</option>
42
                 <option value="partsgroup">[% 'Group' | $T8 %]</option>
43
                 <option value="business">[% 'Customer type' | $T8 %]</option>
44
                 <option value="salesman">[% 'Salesman' | $T8 %]</option>
45
                 <option value="month" selected="selected">[% 'Month' | $T8 %]</option>
46
                 </select>
47
                 </td>
48
               <td align=left><input name="l_headers_subsort" class=checkbox type=checkbox value=Y checked> [% 'Heading' | $T8 %]</td>
49
               <td align=left><input name="l_subtotal_subsort" class=checkbox type=checkbox value=Y checked> [% 'Subtotal' | $T8 %]</td>
50
             </tr>
51
           <tr>
52
           <th align="right">[% 'Item mode' | $T8 %]</th>
53
           <td colspan="3" align=left><input name="l_parts" class=checkbox type=checkbox value="Y"> ([%'Show items from invoices individually' | $T8 %]) </td>
54
          </tr>
55
          <tr> 
56
           <th align="right">
57
             [% 'Total sum' | $T8 %]
58
           </th>
59
           <td colspan="1" align=left><input name="l_total" class=checkbox type=checkbox value="Y" checked></td>
60
            <td align="right" nowrap>[% 'Decimalplaces' | $T8 %]: </td>
61
            <td colspan="2"><input name="decimalplaces" size="2" value="2"></td>
62
          </tr>
63
    </table>
64
    </td>
65
       <tr>
66
        <th align=left nowrap>[% 'Filter' | $T8 %]</th>
67
        <td>
68
         <table border="0">
69
           <tr>
70
      <tr>
71
        <th align=left colspan="4"><br>[% 'Filter' | $T8 %]:</br></th>
20 72
      </tr>
21

  
22

  
23

  
24 73
     <tr>
25 74
      <th align=right>[% 'Customer' | $T8 %]</th>
26 75
      <td colspan=3>
......
40 89
     </tr>
41 90
      <tr>
42 91
       <th align="right" nowrap>[% 'Customer Number' | $T8 %]</th>
43
       <td><input name="customernumber" size="20"></td>
92
       <td colspan="3"><input name="customernumber" size="20"></td>
44 93
      </tr>
45 94
     <tr>
46 95
      <th align=right nowrap>[% 'Department' | $T8 %]</th>
47
      <td>
96
      <td colspan="3">
48 97
            [%- INCLUDE 'generic/multibox.html'
49 98
                 name          = 'department',
50 99
                 style         = 'width: 250px',
......
73 122
     </tr>
74 123
      <tr>
75 124
       <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
76
       <td><input name="partnumber" size="20"></td>
125
       <td colspan="3"><input name="partnumber" size="20"></td>
77 126
      </tr>
78 127
      <tr>
79 128
       <th align="right" nowrap>[% 'Part Description' | $T8 %]</th>
80 129
       <td colspan="3"><input name="description" size="40"></td>
81 130
      </tr>
82 131
     <tr>
83
      <th align=right nowrap>[% 'From' | $T8 %]</th>
132
      <th align="right">[% 'Group' | $T8 %]</th>
133
      <td>
134
             [%- INCLUDE 'generic/multibox.html'
135
                  name          = 'partsgroup_id',
136
                  style         = 'width: 250px',
137
                  DATA          =  ALL_PARTSGROUPS,
138
                  id_key        = 'id',
139
                  label_key     = 'partsgroup',
140
                  show_empty    = 1,
141
                  allow_textbox = 0,
142
             -%]
143
      </td>
144
     </tr>
145
      <tr>
146
       <td align="right" nowrap>[% 'Country' | $T8 %]</td>
147
       <td colspan="3"><input name="country" size="20"></td>
148
      </tr>
149
     <tr>
150
      <th align="right">[% 'Employee' | $T8 %]</th>
151
      <td>
152
             [%- INCLUDE 'generic/multibox.html'
153
                  name          = 'employee_id',
154
                  style         = 'width: 250px',
155
                  DATA          =  ALL_EMPLOYEES,
156
                  id_key        = 'id',
157
                  label_sub     = 'employee_labels',
158
                  limit         = vclimit,
159
                  show_empty    = 1,
160
                  allow_textbox = 0,
161
                  default       = ' ',
162
             -%]
163
      </td>
164
     </tr>
165
    <tr>
166
     <th align="right">[% 'Salesman' | $T8 %]</th>
167
     <td>
168
            [%- INCLUDE 'generic/multibox.html'
169
                 name          = 'salesman_id',
170
                 style         = 'width: 250px',
171
                 DATA          =  ALL_SALESMEN,
172
                 id_key        = 'id',
173
                 label_sub     = 'salesman_labels',
174
                 limit         = vclimit,
175
                 show_empty    = 1,
176
                 allow_textbox = 0,
177
            -%]
178
     </td>
179
     </tr>
180
     <tr>
181
      <th align="right">[% 'Customer type' | $T8 %]</th>
182
      <td colspan="3">
183
            [%- INCLUDE 'generic/multibox.html'
184
                 name          =  'business_id',
185
                 style         = "width: 250px",
186
                 DATA          =  ALL_BUSINESS_TYPES,
187
                 id_key        = 'id',
188
                 label_key     = 'description',
189
                 limit         = vclimit,
190
                 show_empty    = 1,
191
                 allow_textbox = 0,
192
            -%]
193
      </td>
194
     </tr>
195
     <tr>
196
      <th align=right nowrap>[% 'Invoice Date' | $T8 %] [% 'From' | $T8 %]</th>
84 197
      <td>
85 198
       <input name=transdatefrom id=transdatefrom size=11 title="[% dateformat | html %]" onBlur="check_right_date_format(this)">
86 199
       <input type=button name=transdatefrom id="trigger1" value=[% 'button' | $T8 %]>
......
91 204
      <input type=button name=transdateto name=transdateto id="trigger2" value=[% 'button' | $T8 %]>
92 205
     </td>
93 206
    </tr>
207
    <tr>
208
        <th align=left colspan="4"><br>[% 'Filter for customer variables' | $T8 %]:</br></th>
209
    </tr>
210
   [% CUSTOM_VARIABLES_FILTER_CODE_CT %]
211
    <tr>
212
        <th align=left colspan="4"><br>[% 'Filter for item variables' | $T8 %]:</br></th>
213
    </tr>
214
   [% CUSTOM_VARIABLES_FILTER_CODE_IC %]
94 215
   <input type=hidden name=sort value=transdate>
95 216
   </table>
217

  
96 218
    </td>
97
    </tr>
98
    <tr>
99
     <td>
100
      <table>
101
       <tr>
219
      <tr>
102 220
        <th align=right nowrap>[% 'Include in Report' | $T8 %]</th>
103 221
        <td>
104
         <table width=100%>
222
         <table border="0">
223
          <td colspan="4">
224
            [% 'Cumulated or averaged values' | $T8 %] ([% 'invoice mode or item mode' | $T8 %]):
225
          </td>
105 226
          <tr>
106
           <td align=right><input name="l_description" class=checkbox type=checkbox value=Y checked></td>
107
           <td nowrap>[% 'Description' | $T8 %]</td>
108
           <td align=right><input name="l_partnumber" class=checkbox type=checkbox value=Y></td>
109
           <td nowrap>[% 'Part Number' | $T8 %]</td>
110
           <td align=right><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
111
           <td nowrap>[% 'Invnumber' | $T8 %]</td>
112
           <td align=right><input name="l_transdate" class=checkbox type=checkbox value="Y" checked></td>
113
           <td nowrap>[% 'Invdate' | $T8 %]</td>
227
           <td align=left><input name="l_sellprice_total" class=checkbox type=checkbox value=Y checked>[% 'Sales price total' | $T8 %]</td>
228
           <td align=left><input name="l_lastcost_total" class=checkbox type=checkbox value=Y checked>[% 'Purchase price total' | $T8 %]</td>
229
           <td align=left><input name="l_marge_total" class=checkbox type=checkbox value=Y checked>[% 'Margetotal' | $T8 %]</td>
230
           <td colspan="4"> ([% 'Single values in item mode, cumulated values in invoice mode' | $T8 %])
231
           
114 232
          </tr>
115 233
          <tr>
116
           <td align=right><input name="l_qty" class=checkbox type=checkbox value="Y" checked></td>
117
           <td nowrap>[% 'Quantity' | $T8 %]</td>
118
           <td align=right><input name="l_discount" class=checkbox type=checkbox value="Y"></td>
119
           <td nowrap>[% 'Discount' | $T8 %]</td>
120
           <td align=right><input name="l_unit" class=checkbox type=checkbox value="Y"></td>
121
           <td nowrap>[% 'Unit' | $T8 %]</td>
234
           <td align=left><input name="l_sellprice" class=checkbox type=checkbox value=Y checked>[% 'Sales price' | $T8 %]</td>
235
           <td align=left><input name="l_lastcost" class=checkbox type=checkbox value=Y checked>[% 'Purchase price' | $T8 %]</td>
236
           <td align=left><input name="l_marge_percent" class=checkbox type=checkbox value=Y checked>[% 'Margepercent' | $T8 %]</td>
237
           <td colspan="4">([% 'averaged values, in invoice mode only useful when filtered by a part' | $T8 %])</td>
122 238
          </tr>
123 239
          <tr>
124
           <td align=right><input name="l_sellprice" class=checkbox type=checkbox value=Y checked></td>
125
           <td nowrap>[% 'Sales price' | $T8 %]</td>
126
           <td align=right><input name="l_sellprice_total" class=checkbox type=checkbox value=Y checked></td>
127
           <td nowrap>[% 'Sales price total' | $T8 %]</td>
128
           <td align=right><input name="l_lastcost" class=checkbox type=checkbox value=Y checked></td>
129
           <td nowrap>[% 'Purchase price' | $T8 %]</td>
130
           <td align=right><input name="l_lastcost_total" class=checkbox type=checkbox value=Y checked></td>
131
           <td nowrap>[% 'Purchase price total' | $T8 %]</td>
240
           <td align=left><input name="l_qty" class=checkbox type=checkbox value="Y" checked>[% 'Quantity' | $T8 %]</td>
241
           <td align=left><input name="l_discount" class=checkbox type=checkbox value="Y">[% 'Discount' | $T8 %]</td>
242
           <td></td>
243
           <td colspan="4">([% 'averaged values, in invoice mode only useful when filtered by a part' | $T8 %])</td>
132 244
          </tr>
245
          <tr><td colspan="7">&nbsp;</td></tr>
246
          <td colspan="4" align="left">
247
          [% 'Item values' | $T8 %] ([% 'Only shown in item mode' | $T8 %])
248
          </td>
133 249
          <tr>
134
           <td align=right><input name="l_marge_total" class=checkbox type=checkbox value=Y checked></td>
135
           <td nowrap>[% 'Margetotal' | $T8 %]</td>
136
           <td align=right><input name="l_marge_percent" class=checkbox type=checkbox value=Y checked></td>
137
           <td nowrap>[% 'Margepercent' | $T8 %]</td>
250
           <td align=left><input name="l_description" class=checkbox type=checkbox value=Y checked>[% 'Description' | $T8 %]</td>
251
           <td align=left><input name="l_partnumber" class=checkbox type=checkbox value=Y>[% 'Part Number' | $T8 %]</td>
252
           <td align=left><input name="l_invnumber" class=checkbox type=checkbox value=Y>[% 'Invnumber' | $T8 %]</td>
253
           <td align=left><input name="l_transdate" class=checkbox type=checkbox value="Y">[% 'Invdate' | $T8 %]</td>
138 254
          </tr>
139 255
          <tr>
140
           <td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y checked></td>
141
           <td nowrap>[% 'Subtotal' | $T8 %]</td>
142
           <td align=right><input name="l_total" class=checkbox type=checkbox value="Y" checked></td>
143
           <td nowrap>[% 'Total' | $T8 %]</td>
144
           <td align=right><input name="l_headers" class=checkbox type=checkbox value="Y" checked></td>
145
           <td nowrap>[% 'Headings' | $T8 %]</td>
256
           <td align=left><input name="l_unit" class=checkbox type=checkbox value="Y">[% 'Unit' | $T8 %]</td>
257
           <td align=left><input name="l_partsgroup" class=checkbox type=checkbox value=Y>[% 'Group' | $T8 %]</td>
258
           <td align=left><input name="l_salesman" class=checkbox type=checkbox value=Y>[% 'Salesperson' | $T8 %]</td>
259
           <td align=left><input name="l_employee" class=checkbox type=checkbox value=Y>[% 'Employee' | $T8 %]</td>
146 260
          </tr>
147 261
          <tr>
148
           <td align=right><input name="l_customernumber" class=checkbox type=checkbox value=Y checked></td>
149
           <td nowrap>[% 'Customer Number' | $T8 %]</td>
262
           <td align=left><input name="l_customernumber" class=checkbox type=checkbox value=Y>[% 'Customer Number' | $T8 %]</td>
263
           <td align=left><input name="l_customername" class=checkbox type=checkbox value=Y>[% 'Customer Name' | $T8 %]</td>
264
           <td align=left><input name="l_country" class=checkbox type=checkbox value=Y>[% 'Country' | $T8 %]</td>
265
           <td align=left><input name="l_business" class=checkbox type=checkbox value=Y>[% 'Customer type' | $T8 %]</td>
150 266
          </tr>
151 267
          <tr>
152
            <th align="right" nowrap>[% 'Decimalplaces' | $T8 %]</th>
153
            <td colspan="4"><input name="decimalplaces" size="2" value="2"></td>
154 268
          </tr>
269
     <tr><td colspan="7">&nbsp;</td></tr>
270
    <tr>
271
    <th colspan="4" align="left">
272
    [% 'Customer variables' | $T8 %] ([% 'Only shown in item mode' | $T8 %])
273
    </th>
274
    </tr>
275
        [% CUSTOM_VARIABLES_INCLUSION_CODE_CT %]
276
 
277
     <tr><td colspan="7">&nbsp;</td></tr>
278
    <tr>
279
    <th colspan="4" align="left">
280
    [% 'Item variables' | $T8 %] ([% 'Only shown in item mode' | $T8 %])
281
    </th>
282
    </tr>
283
      [% CUSTOM_VARIABLES_INCLUSION_CODE_IC %]
155 284
         </table>
156 285
        </td>
157 286
       </tr>
......
159 288
     </td>
160 289
    </tr>
161 290
    <tr>
162
     <td><hr size=3 noshade></td>
163 291
    </tr>
164 292
   </table>
165 293
   <input type=hidden name=nextsub value=[% nextsub %]>

Auch abrufbar als: Unified diff