Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision fe6275f8

Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt

  • ID fe6275f8eff9e0bab568cb6eba5ed70662148a88
  • Vorgänger 79c048aa
  • Nachfolger 68610bad

Unnötige Hiddens entfernen
Anzeigekonfiguration von Gewichten
Gewichte in Druckvorlagen

Durch diesen Commit werden
1. unnötige Hidden-Variablen aus html-templates entfernt, die mit
Gewichten zu tun haben.
2. die Anzeige von Gewichten konfigurierbar gemacht.
3. Gewichte in Druckvorlagen zur Verfügung gestellt. Es stehen ein
Zeilengewicht (lineweight), Einzelgewicht des Artikels (weight) und
Gesamtgewicht (totalweight) zur Verfügung, die letzten beiden auch
als unformatierte Variablen (weight_nofmt und totalweight_nofmt).

Unterschiede anzeigen:

bin/mozilla/io.pl
123 123

  
124 124
  my ($stock_in_out, $stock_in_out_title);
125 125

  
126
  my $defaults = AM->get_defaults();
127
  $form->{show_weight} = $defaults->{show_weight};
128
  $form->{weightunit} = $defaults->{weightunit};
129

  
126 130
  my $is_purchase        = (first { $_ eq $form->{type} } qw(request_quotation purchase_order purchase_delivery_order)) || ($form->{script} eq 'ir.pl');
127 131
  my $show_min_order_qty =  first { $_ eq $form->{type} } qw(request_quotation purchase_order);
128 132
  my $is_delivery_order  = $form->{type} =~ /_delivery_order$/;
......
150 154
    {  id => 'qty',           width => 5,     value => $locale->text('Qty'),                  display => 1, },
151 155
    {  id => 'price_factor',  width => 5,     value => $locale->text('Price Factor'),         display => !$is_delivery_order, },
152 156
    {  id => 'unit',          width => 5,     value => $locale->text('Unit'),                 display => 1, },
153
    {  id => 'weight',        width => 5,     value => $locale->text('Weight'),               display => 1, },
157
    {  id => 'weight',        width => 5,     value => $locale->text('Weight'),               display => $defaults->{show_weight}, },
154 158
    {  id => 'serialnr',      width => 10,    value => $locale->text('Serial No.'),           display => 0, },
155 159
    {  id => 'projectnr',     width => 10,    value => $locale->text('Project'),              display => 0, },
156 160
    {  id => 'sellprice',     width => 15,    value => $locale->text('Price'),                display => !$is_delivery_order, },
......
208 212
  _update_custom_variables();
209 213

  
210 214
  my $totalweight = 0;
211
  my $defaults = AM->get_defaults();
212 215

  
213
  $form->{weightunit} = $defaults->{weightunit};
214 216
  # rows
215 217

  
216 218
  my @ROWS;
......
332 334
    $column_data{linetotal}   = $form->format_amount(\%myconfig, $linetotal, 2);
333 335
    $column_data{bin}         = $form->{"bin_$i"};
334 336

  
335
    $column_data{weight}      = $form->format_amount(\%myconfig, $form->{"qty_$i"} * $form->{"weight_$i"}, 3) . ' ' . $defaults->{weightunit};
336
    #To add the hidden variable lineweight:
337
    $form->{"lineweight_$i"}       = $column_data{weight};
337
    $column_data{weight}      = $form->format_amount(\%myconfig, $form->{"qty_$i"} * $form->{"weight_$i"}, 3) . ' ' . $defaults->{weightunit} if $defaults->{show_weight};
338 338

  
339 339
    if ($is_delivery_order) {
340 340
      $column_data{stock_in_out} =  calculate_stock_in_out($i);
......
430 430
          map { ($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } map { $_."_$i" }
431 431
            (qw(orderitems_id bo pricegroup_old price_old id inventory_accno bin partsgroup partnotes
432 432
                income_accno expense_accno listprice assembly taxaccounts ordnumber transdate cusordnumber
433
                longdescription basefactor marge_absolut marge_percent marge_price_factor weight lineweight), @hidden_vars)
433
                longdescription basefactor marge_absolut marge_percent marge_price_factor weight), @hidden_vars)
434 434
    );
435 435

  
436 436
    map { $form->{"${_}_base"} += $linetotal } (split(/ /, $form->{"taxaccounts_$i"}));

Auch abrufbar als: Unified diff