Merge branch 'gewicht'
authorNiclas Zimmermann <niclas@kivitendo-premium.de>
Mon, 3 Jun 2013 11:49:40 +0000 (13:49 +0200)
committerNiclas Zimmermann <niclas@kivitendo-premium.de>
Mon, 3 Jun 2013 11:49:40 +0000 (13:49 +0200)
Conflicts:
SL/Controller/ClientConfig.pm
SL/DB/MetaSetup/Default.pm

1  2 
SL/Controller/ClientConfig.pm
SL/DB/Helper/FlattenToForm.pm
SL/DB/MetaSetup/Default.pm
SL/DO.pm
SL/IS.pm
SL/OE.pm
locale/de/all
templates/webpages/client_config/form.html

@@@ -43,18 -43,8 +43,21 @@@ sub action_edit 
  
    map { $self->{$_} = SL::DB::Default->get->$_ } qw(sales_order_show_delete purchase_order_show_delete sales_delivery_order_show_delete purchase_delivery_order_show_delete);
  
 +  map { $self->{$_} = SL::DB::Default->get->$_ } qw(warehouse_id bin_id);
 +  $::form->get_lists('warehouses' => { 'key'    => 'WAREHOUSES',
 +                                       'bins'   => 'BINS', });
 +  $self->{WAREHOUSES} = $::form->{WAREHOUSES};
 +  # leerer lagerplatz mit id 0
 +  my $no_default_bin_entry = { 'id' => '0', description => '--', 'BINS' => [ { id => '0', description => ''} ] };
 +  push @ { $self->{WAREHOUSES} }, $no_default_bin_entry;
 +
 +  if (my $max = scalar @{ $self->{WAREHOUSES} }) {
 +    $self->{warehouse_id} ||= $self->{WAREHOUSES}->[$max -1]->{id};
 +    $self->{bin_id}       ||= $self->{WAREHOUSES}->[$max -1]->{BINS}->[0]->{id};
 +  }
++
+   $self->{show_weight} = SL::DB::Default->get->show_weight;
    $self->render('client_config/form', title => $::locale->text('Client Configuration'));
  }
  
@@@ -76,12 -66,7 +79,16 @@@ sub action_save 
  
    map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(sales_order_show_delete purchase_order_show_delete sales_delivery_order_show_delete purchase_delivery_order_show_delete);
  
++<<<<<<< HEAD
 +  # undef warehouse_id if the empty value is selected
 +  if ( ($::form->{warehouse_id} == 0) && ($::form->{bin_id} == 0) ) {
 +    undef $::form->{warehouse_id};
 +    undef $::form->{bin_id};
 +  }
 +  map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(warehouse_id bin_id);
++=======
+   SL::DB::Default->get->update_attributes('show_weight'     => $::form->{show_weight});
++>>>>>>> gewicht
  
    flash_later('info', $::locale->text('Client Configuration saved!'));
  
@@@ -14,11 -14,11 +14,11 @@@ sub flatten_to_form 
  
    my $vc = $self->can('customer_id') && $self->customer_id ? 'customer' : 'vendor';
  
 -  _copy($self, $form, '', '', 0, qw(id type taxzone_id ordnumber quonumber invnumber donumber cusordnumber taxincluded shippingpoint shipvia notes intnotes curr cp_id
 +  _copy($self, $form, '', '', 0, qw(id type taxzone_id ordnumber quonumber invnumber donumber cusordnumber taxincluded shippingpoint shipvia notes intnotes cp_id
                                      employee_id salesman_id closed department_id language_id payment_id delivery_customer_id delivery_vendor_id shipto_id proforma
                                      globalproject_id delivered transaction_description container_type accepted_by_customer invoice terms storno storno_id dunning_config_id
                                      orddate quodate reqdate gldate duedate deliverydate datepaid transdate));
 -  $form->{currency} = $form->{curr}; # curr is called currency in almost all forms
 +  $form->{currency} = $form->{curr} = $self->currency_id ? $self->currency->name || '' : '';
  
    if (_has($self, 'transdate')) {
      my $transdate_idx = ref($self) eq 'SL::DB::Order'   ? ($self->quotation ? 'quodate' : 'orddate')
@@@ -59,6 -59,7 +59,7 @@@
  
      $form->{"id_${idx}"}         = $item->parts_id;
      $form->{"partnumber_${idx}"} = $item->part->partnumber;
+     $form->{"weight_${idx}"}     = $item->part->weight;
      _copy($item,          $form, '',        "_${idx}", 0,               qw(description project_id ship serialnumber pricegroup_id ordnumber cusordnumber unit
                                                                             subtotal longdescription price_factor_id marge_price_factor approved_sellprice reqdate transdate));
      _copy($item,          $form, '',        "_${idx}", $format_amounts, qw(qty sellprice marge_total marge_percent lastcost));
@@@ -20,6 -20,7 +20,6 @@@ __PACKAGE__->meta->setup
      weightunit                          => { type => 'varchar', length => 5 },
      businessnumber                      => { type => 'text' },
      version                             => { type => 'varchar', length => 8 },
 -    curr                                => { type => 'text' },
      closedto                            => { type => 'date' },
      revtrans                            => { type => 'boolean', default => 'false' },
      ponumber                            => { type => 'text' },
      ar_show_mark_as_paid                => { type => 'boolean', default => 'true' },
      ap_show_mark_as_paid                => { type => 'boolean', default => 'true' },
      assemblynumber                      => { type => 'text' },
 +    warehouse_id                        => { type => 'integer' },
 +    bin_id                              => { type => 'integer' },
 +    currency_id                         => { type => 'integer', not_null => 1 },
+     show_weight                         => { type => 'boolean', default => 'false', not_null => 1 },
    ],
  
    primary_key_columns => [ 'id' ],
 +
 +  allow_inline_column_values => 1,
 +
 +  foreign_keys => [
 +    bin => {
 +      class       => 'SL::DB::Bin',
 +      key_columns => { bin_id => 'id' },
 +    },
 +
 +    warehouse => {
 +      class       => 'SL::DB::Warehouse',
 +      key_columns => { warehouse_id => 'id' },
 +    },
 +    currency => {
 +      class       => 'SL::DB::Currency',
 +      key_columns => { currency_id => 'id' },
 +    },
 +  ],
  );
  
  1;
diff --combined SL/DO.pm
+++ b/SL/DO.pm
@@@ -229,7 -229,7 +229,7 @@@ sub save 
      $query = qq|SELECT nextval('id')|;
      ($form->{id}) = selectrow_query($form, $dbh, $query);
  
 -    $query = qq|INSERT INTO delivery_orders (id, donumber, employee_id) VALUES (?, '', ?)|;
 +    $query = qq|INSERT INTO delivery_orders (id, donumber, employee_id, currency_id) VALUES (?, '', ?, (SELECT currency_id FROM defaults LIMIT 1))|;
      do_query($form, $dbh, $query, $form->{id}, conv_i($form->{employee_id}));
    }
  
           shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, closed = ?,
           delivered = ?, department_id = ?, language_id = ?, shipto_id = ?,
           globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?,
 -         is_sales = ?, taxzone_id = ?, taxincluded = ?, terms = ?, curr = ?
 +         is_sales = ?, taxzone_id = ?, taxincluded = ?, terms = ?, currency_id = (SELECT id FROM currencies WHERE name = ?)
         WHERE id = ?|;
  
    @values = ($form->{donumber}, $form->{ordnumber},
               conv_i($form->{salesman_id}), conv_i($form->{cp_id}),
               $form->{transaction_description},
               $form->{type} =~ /^sales/ ? 't' : 'f',
 -             conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), substr($form->{currency}, 0, 3),
 +             conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), $form->{currency},
               conv_i($form->{id}));
    do_query($form, $dbh, $query, @values);
  
@@@ -618,7 -618,7 +618,7 @@@ sub retrieve 
           d.description AS department, dord.language_id,
           dord.shipto_id,
           dord.globalproject_id, dord.delivered, dord.transaction_description,
 -         dord.taxzone_id, dord.taxincluded, dord.terms, dord.curr AS currency
 +         dord.taxzone_id, dord.taxincluded, dord.terms, (SELECT cu.name FROM currencies cu WHERE cu.id=dord.currency_id) AS currency
         FROM delivery_orders dord
         JOIN ${vc} cv ON (dord.${vc}_id = cv.id)
         LEFT JOIN employee e ON (dord.employee_id = e.id)
    }
    $sth->finish();
  
 -  # remove any trailing whitespace
 -  $form->{currency} =~ s/\s*$//;
 -
    $form->{donumber_array} =~ s/\s*$//g;
  
    $form->{saved_donumber} = $form->{donumber};
    $query =
      qq|SELECT doi.id AS delivery_order_items_id,
           p.partnumber, p.assembly, p.listprice, doi.description, doi.qty,
 -         doi.sellprice, doi.parts_id AS id, doi.unit, doi.discount, p.bin, p.notes AS partnotes,
 +         doi.sellprice, doi.parts_id AS id, doi.unit, doi.discount, p.notes AS partnotes,
           doi.reqdate, doi.project_id, doi.serialnumber, doi.lastcost,
           doi.ordnumber, doi.transdate, doi.cusordnumber, doi.longdescription,
           doi.price_factor_id, doi.price_factor, doi.marge_price_factor, doi.pricegroup_id,
@@@ -810,7 -813,7 +810,7 @@@ sub order_details 
      qw(runningnumber number description longdescription qty unit
         partnotes serialnumber reqdate projectnumber projectdescription
         si_runningnumber si_number si_description
-        si_warehouse si_bin si_chargenumber si_bestbefore si_qty si_unit);
+        si_warehouse si_bin si_chargenumber si_bestbefore si_qty si_unit weight lineweight);
  
    map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays);
  
    $form->get_lists('price_factors' => 'ALL_PRICE_FACTORS');
    my %price_factors = map { $_->{id} => $_->{factor} } @{ $form->{ALL_PRICE_FACTORS} };
  
+   my $totalweight = 0;
    my $sameitem = "";
    foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) {
      $i = $item->[0];
      push @{ $form->{TEMPLATE_ARRAYS}{projectdescription} },
        $projectdescriptions{$form->{"project_id_$i"}};
  
+     my $lineweight = $form->{"qty_$i"} * $form->{"weight_$i"};
+     $totalweight += $lineweight;
+     push @{ $form->{TEMPLATE_ARRAYS}->{weight} },            $form->format_amount($myconfig, $form->{"weight_$i"}, 3);
+     push @{ $form->{TEMPLATE_ARRAYS}->{weight_nofmt} },      $form->{"weight_$i"};
+     push @{ $form->{TEMPLATE_ARRAYS}->{lineweight} },        $form->format_amount($myconfig, $lineweight, 3);
+     push @{ $form->{TEMPLATE_ARRAYS}->{lineweight_nofmt} },  $lineweight;
      if ($form->{"assembly_$i"}) {
        $sameitem = "";
  
          for @{ $ic_cvar_configs };
    }
  
+   $form->{totalweight}       = $form->format_amount($myconfig, $totalweight, 3);
+   $form->{totalweight_nofmt} = $totalweight;
+   my $defaults = AM->get_defaults();
+   $form->{weightunit}        = $defaults->{weightunit};
    $h_pg->finish();
    $h_bin_wh->finish();
  
diff --combined SL/IS.pm
+++ b/SL/IS.pm
@@@ -154,7 -154,7 +154,7 @@@ sub invoice_details 
         partnotes serialnumber reqdate sellprice listprice netprice
         discount p_discount discount_sub nodiscount_sub
         linetotal  nodiscount_linetotal tax_rate projectnumber projectdescription
-        price_factor price_factor_name partsgroup);
+        price_factor price_factor_name partsgroup weight lineweight);
  
    push @arrays, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
  
  
    map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays, @tax_arrays, @payment_arrays);
  
+   my $totalweight = 0;
    foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) {
      $i = $item->[0];
  
        push(@{ $form->{TEMPLATE_ARRAYS}->{projectnumber} },              $projectnumbers{$form->{"project_id_$i"}});
        push(@{ $form->{TEMPLATE_ARRAYS}->{projectdescription} },         $projectdescriptions{$form->{"project_id_$i"}});
  
+       my $lineweight = $form->{"qty_$i"} * $form->{"weight_$i"};
+       $totalweight += $lineweight;
+       push @{ $form->{TEMPLATE_ARRAYS}->{weight} },            $form->format_amount($myconfig, $form->{"weight_$i"}, 3);
+       push @{ $form->{TEMPLATE_ARRAYS}->{weight_nofmt} },      $form->{"weight_$i"};
+       push @{ $form->{TEMPLATE_ARRAYS}->{lineweight} },        $form->format_amount($myconfig, $lineweight, 3);
+       push @{ $form->{TEMPLATE_ARRAYS}->{lineweight_nofmt} },  $lineweight;
        @taxaccounts = split(/ /, $form->{"taxaccounts_$i"});
        $taxrate     = 0;
        $taxdiff     = 0;
      }
    }
  
+   $form->{totalweight}       = $form->format_amount($myconfig, $totalweight, 3);
+   $form->{totalweight_nofmt} = $totalweight;
+   my $defaults = AM->get_defaults();
+   $form->{weightunit}        = $defaults->{weightunit};
    foreach my $item (sort keys %taxaccounts) {
      $tax += $taxamount = $form->round_amount($taxaccounts{$item}, 2);
  
@@@ -458,10 -471,9 +471,10 @@@ sub customer_details 
    my $query =
      qq|SELECT ct.*, cp.*, ct.notes as customernotes,
           ct.phone AS customerphone, ct.fax AS customerfax, ct.email AS customeremail,
 -         ct.curr AS currency
 +         cu.name AS currency
         FROM customer ct
         LEFT JOIN contacts cp on ct.id = cp.cp_cv_id
 +       LEFT JOIN currencies cu ON (ct.currency_id = cu.id)
         WHERE (ct.id = ?) $where
         ORDER BY cp.cp_id
         LIMIT 1|;
  
    map { $form->{$_} = $ref->{$_} } keys %$ref;
  
 -  # remove any trailing whitespace
 -  $form->{currency} =~ s/\s*$// if ($form->{currency});
 -
    if ($form->{delivery_customer_id}) {
      $query =
        qq|SELECT *, notes as customernotes
@@@ -534,8 -549,6 +547,8 @@@ sub post_invoice 
    }
  
    $form->{defaultcurrency} = $form->get_default_currency($myconfig);
 +  my $defaultcurrency = $form->{defaultcurrency};
 +
    # Seit neuestem wird die department_id schon übergeben UND $form->department nicht mehr
    # korrekt zusammengebaut. Sehr wahrscheinlich beim Umstieg auf T8 kaputt gegangen
    # Ich lass den Code von 2005 erstmal noch stehen ;-) jb 03-2011
        $query = qq|SELECT nextval('glid')|;
        ($form->{"id"}) = selectrow_query($form, $dbh, $query);
  
 -      $query = qq|INSERT INTO ar (id, invnumber) VALUES (?, ?)|;
 -      do_query($form, $dbh, $query, $form->{"id"}, $form->{"id"});
 +      $query = qq|INSERT INTO ar (id, invnumber, currency_id) VALUES (?, ?, (SELECT id FROM currencies WHERE name=?))|;
 +      do_query($form, $dbh, $query, $form->{"id"}, $form->{"id"}, $form->{currency});
  
        if (!$form->{invnumber}) {
          $form->{invnumber} =
    my ($netamount, $invoicediff) = (0, 0);
    my ($amount, $linetotal, $lastincomeaccno);
  
 -  my ($currencies)    = selectfirst_array_query($form, $dbh, qq|SELECT curr FROM defaults|);
 -  my $defaultcurrency = (split m/:/, $currencies)[0];
 -
    if ($form->{currency} eq $defaultcurrency) {
      $form->{exchangerate} = 1;
    } else {
                  amount      = ?, netamount     = ?, paid          = ?,
                  duedate     = ?, deliverydate  = ?, invoice       = ?, shippingpoint = ?,
                  shipvia     = ?, terms         = ?, notes         = ?, intnotes      = ?,
 -                curr        = ?, department_id = ?, payment_id    = ?, taxincluded   = ?,
 +                currency_id = (SELECT id FROM currencies WHERE name = ?),
 +                department_id = ?, payment_id    = ?, taxincluded   = ?,
                  type        = ?, language_id   = ?, taxzone_id    = ?, shipto_id     = ?,
                  employee_id = ?, salesman_id   = ?, storno_id     = ?, storno        = ?,
                  cp_id       = ?, marge_total   = ?, marge_percent = ?,
@@@ -1557,7 -1572,8 +1570,7 @@@ sub retrieve_invoice 
           (SELECT c.accno FROM chart c WHERE d.income_accno_id = c.id)    AS income_accno,
           (SELECT c.accno FROM chart c WHERE d.expense_accno_id = c.id)   AS expense_accno,
           (SELECT c.accno FROM chart c WHERE d.fxgain_accno_id = c.id)    AS fxgain_accno,
 -         (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id)    AS fxloss_accno,
 -         d.curr AS currencies
 +         (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id)    AS fxloss_accno
           ${query_transdate}
         FROM defaults d|;
  
             a.orddate, a.quodate, a.globalproject_id,
             a.transdate AS invdate, a.deliverydate, a.paid, a.storno, a.gldate,
             a.shippingpoint, a.shipvia, a.terms, a.notes, a.intnotes, a.taxzone_id,
 -           a.duedate, a.taxincluded, a.curr AS currency, a.shipto_id, a.cp_id,
 +           a.duedate, a.taxincluded, (SELECT cu.name FROM currencies cu WHERE cu.id=a.currency_id) AS currency, a.shipto_id, a.cp_id,
             a.employee_id, a.salesman_id, a.payment_id,
             a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type,
             a.transaction_description, a.donumber, a.invnumber_for_credit_note,
      $ref = selectfirst_hashref_query($form, $dbh, $query, $id);
      map { $form->{$_} = $ref->{$_} } keys %{ $ref };
  
 -    # remove any trailing whitespace
 -    $form->{currency} =~ s/\s*$//;
 -
      $form->{exchangerate} = $form->get_exchangerate($dbh, $form->{currency}, $form->{invdate}, "buy");
  
      # get shipto
             i.description, i.longdescription, i.qty, i.fxsellprice AS sellprice, i.discount, i.parts_id AS id, i.unit, i.deliverydate AS reqdate,
             i.project_id, i.serialnumber, i.id AS invoice_pos, i.pricegroup_id, i.ordnumber, i.transdate, i.cusordnumber, i.subtotal, i.lastcost,
             i.price_factor_id, i.price_factor, i.marge_price_factor,
 -           p.partnumber, p.assembly, p.bin, p.notes AS partnotes, p.inventory_accno_id AS part_inventory_accno_id, p.formel, p.listprice,
 +           p.partnumber, p.assembly, p.notes AS partnotes, p.inventory_accno_id AS part_inventory_accno_id, p.formel, p.listprice,
             pr.projectnumber, pg.partsgroup, prg.pricegroup
  
           FROM invoice i
@@@ -1752,14 -1771,13 +1765,14 @@@ sub get_customer 
           c.id AS customer_id, c.name AS customer, c.discount as customer_discount, c.creditlimit, c.terms,
           c.email, c.cc, c.bcc, c.language_id, c.payment_id,
           c.street, c.zipcode, c.city, c.country,
 -         c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, c.curr,
 +         c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, cu.name AS curr,
           c.taxincluded_checked, c.direct_debit,
           $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
           b.discount AS tradediscount, b.description AS business
         FROM customer c
         LEFT JOIN business b ON (b.id = c.business_id)
         LEFT JOIN payment_terms pt ON ($payment_id (c.payment_id = pt.id))
 +       LEFT JOIN currencies cu ON (c.currency_id=cu.id)
         WHERE c.id = ?|;
    push @values, $cid;
    $ref = selectfirst_hashref_query($form, $dbh, $query, @values);
  
    map { $form->{$_} = $ref->{$_} } keys %$ref;
  
 -  # remove any trailing whitespace
 -  $form->{curr} =~ s/\s*$//;
 -
 -  # use customer currency if not empty
 -  $form->{currency} = $form->{curr} if $form->{curr};
 +  # use customer currency
 +  $form->{currency} = $form->{curr};
  
    $query =
      qq|SELECT sum(amount - paid) AS dunning_amount
    $query =
      qq|SELECT o.amount,
           (SELECT e.buy FROM exchangerate e
 -          WHERE e.curr = o.curr
 +          WHERE e.currency_id = o.currency_id
              AND e.transdate = o.transdate)
         FROM oe o
         WHERE o.customer_id = ?
@@@ -1938,10 -1959,10 +1951,10 @@@ sub retrieve_item 
           c3.new_chart_id AS expense_new_chart,
           date($transdate) - c3.valid_from AS expense_valid,
  
 -         p.unit, p.assembly, p.bin, p.onhand,
 +         p.unit, p.assembly, p.onhand,
           p.notes AS partnotes, p.notes AS longdescription,
           p.not_discountable, p.formel, p.payment_id AS part_payment_id,
-          p.price_factor_id,
+          p.price_factor_id, p.weight,
  
           pfac.factor AS price_factor,
  
diff --combined SL/OE.pm
+++ b/SL/OE.pm
@@@ -91,7 -91,7 +91,7 @@@ sub transactions 
      qq|JOIN $vc ct ON (o.${vc}_id = ct.id) | .
      qq|LEFT JOIN employee e ON (o.employee_id = e.id) | .
      qq|LEFT JOIN employee s ON (o.salesman_id = s.id) | .
 -    qq|LEFT JOIN exchangerate ex ON (ex.curr = o.curr | .
 +    qq|LEFT JOIN exchangerate ex ON (ex.currency_id = o.currency_id | .
      qq|  AND ex.transdate = o.transdate) | .
      qq|LEFT JOIN project pr ON (o.globalproject_id = pr.id) | .
      qq|$periodic_invoices_joins | .
@@@ -311,7 -311,7 +311,7 @@@ sub save 
      $query = qq|SELECT nextval('id')|;
      ($form->{id}) = selectrow_query($form, $dbh, $query);
  
 -    $query = qq|INSERT INTO oe (id, ordnumber, employee_id) VALUES (?, '', ?)|;
 +    $query = qq|INSERT INTO oe (id, ordnumber, employee_id, currency_id) VALUES (?, '', ?, (SELECT currency_id FROM defaults))|;
      do_query($form, $dbh, $query, $form->{id}, $form->{employee_id});
    }
  
      qq|UPDATE oe SET
           ordnumber = ?, quonumber = ?, cusordnumber = ?, transdate = ?, vendor_id = ?,
           customer_id = ?, amount = ?, netamount = ?, reqdate = ?, taxincluded = ?,
 -         shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, curr = ?, closed = ?,
 +         shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, currency_id = (SELECT id FROM currencies WHERE name=?), closed = ?,
           delivered = ?, proforma = ?, quotation = ?, department_id = ?, language_id = ?,
           taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?,
           globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?, marge_total = ?, marge_percent = ?
               $amount, $netamount, conv_date($reqdate),
               $form->{taxincluded} ? 't' : 'f', $form->{shippingpoint},
               $form->{shipvia}, $form->{notes}, $form->{intnotes},
 -             substr($form->{currency}, 0, 3), $form->{closed} ? 't' : 'f',
 +             $form->{currency}, $form->{closed} ? 't' : 'f',
               $form->{delivered} ? "t" : "f", $form->{proforma} ? 't' : 'f',
               $quotation, conv_i($form->{department_id}),
               conv_i($form->{language_id}), conv_i($form->{taxzone_id}),
@@@ -759,13 -759,14 +759,13 @@@ sub retrieve 
                       (SELECT c.accno FROM chart c WHERE d.income_accno_id    = c.id) AS income_accno,
                       (SELECT c.accno FROM chart c WHERE d.expense_accno_id   = c.id) AS expense_accno,
                       (SELECT c.accno FROM chart c WHERE d.fxgain_accno_id    = c.id) AS fxgain_accno,
 -                     (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id    = c.id) AS fxloss_accno,
 -              d.curr AS currencies
 +                     (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id    = c.id) AS fxloss_accno
                $query_add
                FROM defaults d|;
    my $ref = selectfirst_hashref_query($form, $dbh, $query);
    map { $form->{$_} = $ref->{$_} } keys %$ref;
  
 -  ($form->{currency}) = split(/:/, $form->{currencies}) unless ($form->{currency});
 +  $form->{currency} = $form->get_default_currency($myconfig);
  
    # set reqdate if this is an invoice->order conversion. If someone knows a better check to ensure
    # we come from invoices, feel free.
      $query =
        qq|SELECT o.cp_id, o.ordnumber, o.transdate, o.reqdate,
             o.taxincluded, o.shippingpoint, o.shipvia, o.notes, o.intnotes,
 -           o.curr AS currency, e.name AS employee, o.employee_id, o.salesman_id,
 +           (SELECT cu.name FROM currencies cu WHERE cu.id=o.currency_id) AS currency, e.name AS employee, o.employee_id, o.salesman_id,
             o.${vc}_id, cv.name AS ${vc}, o.amount AS invtotal,
             o.closed, o.reqdate, o.quonumber, o.department_id, o.cusordnumber,
             d.description AS department, o.payment_id, o.language_id, o.taxzone_id,
      if ($ref) {
        map { $form->{$_} = $ref->{$_} } keys %$ref;
  
 -      # remove any trailing whitespace
 -      $form->{currency} =~ s/\s*$//;
 -
        $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber"};
  
        # set all entries for multiple ids blank that yield different information
             c3.accno AS expense_accno,   c3.new_chart_id AS expense_new_chart,   date($transdate) - c3.valid_from as expense_valid,
             oe.ordnumber AS ordnumber_oe, oe.transdate AS transdate_oe, oe.cusordnumber AS cusordnumber_oe,
             p.partnumber, p.assembly, p.listprice, o.description, o.qty,
 -           o.sellprice, o.parts_id AS id, o.unit, o.discount, p.bin, p.notes AS partnotes, p.inventory_accno_id AS part_inventory_accno_id,
 +           o.sellprice, o.parts_id AS id, o.unit, o.discount, p.notes AS partnotes, p.inventory_accno_id AS part_inventory_accno_id,
             o.reqdate, o.project_id, o.serialnumber, o.ship, o.lastcost,
             o.ordnumber, o.transdate, o.cusordnumber, o.subtotal, o.longdescription,
             o.price_factor_id, o.price_factor, o.marge_price_factor,
@@@ -1116,7 -1120,7 +1116,7 @@@ sub order_details 
         partnotes serialnumber reqdate sellprice listprice netprice
         discount p_discount discount_sub nodiscount_sub
         linetotal  nodiscount_linetotal tax_rate projectnumber projectdescription
-        price_factor price_factor_name partsgroup);
+        price_factor price_factor_name partsgroup weight lineweight);
  
    push @arrays, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
  
  
    map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays, @tax_arrays);
  
+   my $totalweight = 0;
    my $sameitem = "";
    foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) {
      $i = $item->[0];
        push(@{ $form->{TEMPLATE_ARRAYS}->{projectnumber} },              $projectnumbers{$form->{"project_id_$i"}});
        push(@{ $form->{TEMPLATE_ARRAYS}->{projectdescription} },         $projectdescriptions{$form->{"project_id_$i"}});
  
+       my $lineweight = $form->{"qty_$i"} * $form->{"weight_$i"};
+       $totalweight += $lineweight;
+       push @{ $form->{TEMPLATE_ARRAYS}->{weight} },            $form->format_amount($myconfig, $form->{"weight_$i"}, 3);
+       push @{ $form->{TEMPLATE_ARRAYS}->{weight_nofmt} },      $form->{"weight_$i"};
+       push @{ $form->{TEMPLATE_ARRAYS}->{lineweight} },        $form->format_amount($myconfig, $lineweight, 3);
+       push @{ $form->{TEMPLATE_ARRAYS}->{lineweight_nofmt} },  $lineweight;
        my ($taxamount, $taxbase);
        my $taxrate = 0;
  
      }
    }
  
+   $form->{totalweight}       = $form->format_amount($myconfig, $totalweight, 3);
+   $form->{totalweight_nofmt} = $totalweight;
+   my $defaults = AM->get_defaults();
+   $form->{weightunit}        = $defaults->{weightunit};
    my $tax = 0;
    foreach $item (sort keys %taxaccounts) {
      $tax += $taxamount = $form->round_amount($taxaccounts{$item}, 2);
diff --combined locale/de/all
@@@ -18,7 -18,6 +18,7 @@@ $self->{texts} = 
    '#1 h'                        => '#1 h',
    '#1 of #2 importable objects were imported.' => '#1 von #2 importierbaren Objekten wurden importiert.',
    '#1 prices were updated.'     => '#1 Preise wurden aktualisiert.',
 +  '(recommended) Insert the used currencies in the system. You can simply change the name of the currencies by editing the textfields above. Do not use a name of a currency that is already in use.' => '(empfohlen) Fügen Sie die verwaisten Währungen in Ihr System ein. Sie können den Namen der Währung einfach ändern, indem Sie die Felder oben bearbeiten. Benutzen Sie keine Namen von Währungen, die Sie bereits benutzen.',
    '* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode"  in' => ' für die Bestandsmethode gibt es Einschränkungen, siehe Kapitel "Bemerkungen zu Bestandsmethode"  in',
    '*) Since version 2.7 these parameters ares set in the client database and not in the configuration file, details in chapter:' => '*) Seit 2.7 werden Gewinnermittlungsart, Versteuerungsart und Warenbuchungsmethode in der Mandanten-DB gesteuert und nicht mehr in der Konfigurationsdatei, Umstellungs-Details:',
    '*/'                          => '*/',
    '2. Quarter'                  => '2. Quartal',
    '3. Quarter'                  => '3. Quartal',
    '4. Quarter'                  => '4. Quartal',
 +  '<b> I DO CARE!</b> Please check create warehouse and bins and define a name for the warehouse (Bins will be created automatically) and then continue' => '<b>ICH KÜMMER MICH</b> Bitte haken Sie Lager und Lagerplätze erzeugen an (Automatisches Zuweisen der Lagerplätze) und vergeben einen Namen für dieses Lager (Lagerplätze werden automatisch übernommen). Danach auf weiter.',
 +  '<b> I DO CARE!</b> Please click back and cancel the update and come back after there has been at least one warehouse defined with bin(s).:' => '<b>ICH KÜMMER MICH</b> Brechen Sie das Update ab und legen selber mindestens ein Lager mit Lagerplätzen unter dem Menü System / Lager an.',
 +  '<b> I DO NOT CARE</b> Please click continue and the following data (see list) will be deleted:' => '<b>IST MIR EGAL</b> Mit einem Klick auf Weiter (rot) werden keine Daten übernommen, bzw. migriert und die folgende Information in der untenstehenden Liste wird gelöscht.',
 +  '<b>Automatically create new bins</b> in the following new warehouse ' => '<b>Automatisches Zuweisen der Lagerplätze</b> im folgenden neuem Lager:',
 +  '<b>Automatically create new bins</b> in the following warehouse if not selected in the list above' => '<b>Automatisches Zuweisen der Lagerplätze</b> im folgenden Lager, falls keine andere Zuweisung oben ausgewählt ist. ',
 +  '<b>Default Bins Migration !READ CAREFULLY!</b>' => 'Standardlagerplatz Migraition !AUFMERKSAM LESEN!',
    '<b>What</b> do you want to look for?' => '<b>Wonach</b> wollen Sie suchen?',
    'A Buchungsgruppe consists of a descriptive name and the account numbers for the income and expense accounts for those four tax zones as well as the inventory account number.' => 'Eine Buchungsgruppe besteht aus einem deskriptiven Namen, den Erl&ouml;s- und Aufwandskonten f&uuml;r diese vier Steuerzonen sowie aus einem Inventarkonto.',
    'A digit is required.'        => 'Eine Ziffer ist vorgeschrieben.',
@@@ -72,7 -65,6 +72,7 @@@
    'ASSETS'                      => 'AKTIVA',
    'ATTENTION! If you enabled this feature you can not simply turn it off again without taking care that best_before fields are emptied in the database.' => 'ACHTUNG! Wenn Sie diese Einstellung aktivieren, dann können Sie sie später nicht ohne Weiteres deaktivieren, ohne dafür zu sorgen, dass die Felder der Mindeshaltbarkeitsdaten in der Datenbank leer gemacht werden.',
    'ATTENTION! You can not simply change it from periodic to perpetual once you started posting.' => 'ACHTUNG! Es kann nicht ohne Weiteres im laufenden Betrieb von der Aufwandsmethode zur Bestandsmethode gewechselt werden.',
 +  'AUTOMATICALLY MATCH BINS'    => 'LAGERPLÄTZE AUTOMATISCH ZUWEISEN',
    'Abort'                       => 'Abbrechen',
    'Abrechnungsnummer'           => 'Abrechnungsnummer',
    'Abteilung'                   => 'Abteilung',
    'Batch Printing'              => 'Druck',
    'Bcc'                         => 'Bcc',
    'Bcc E-mail'                  => 'BCC (E-Mail)',
 -  'Because the useability gets worth if one partnumber is used for several parts (for example if you are searching a position for an invoice), partnumbers should be unique.' => 'Da die Benutzerfreundlichkeit durch doppelte Artikelnummern erheblich verschlechtert wird (zum Beispiel, wenn man einen Artikel für eine Rechnung sucht), sollten Artikelnummern eindeutig vergeben sein.',
 +  'Because the useability gets worse if one partnumber is used for several parts (for example if you are searching a position for an invoice), partnumbers should be unique.' => 'Da die Benutzerfreundlichkeit durch doppelte Artikelnummern erheblich verschlechtert wird (zum Beispiel, wenn man einen Artikel für eine Rechnung sucht), sollten Artikelnummern eindeutig vergeben sein.',
    'Belegnummer'                 => 'Buchungsnummer',
    'Beratername'                 => 'Beratername',
    'Beraternummer'               => 'Beraternummer',
    'Both'                        => 'Beide',
    'Bottom'                      => 'Unten',
    'Bought'                      => 'Gekauft',
 +  'Break up the update and contact a service provider.' => 'Diese Option bricht das Update ab. Bitte kontaktieren Sie Ihren Administrator oder beauftragen einen Dienstleister.',
    'Buchungsdatum'               => 'Buchungsdatum',
    'Buchungsgruppe'              => 'Buchungsgruppe',
    'Buchungsgruppe (database ID)' => 'Buchungsgruppe (Datenbank-ID)',
    'Cash'                        => 'Zahlungsverkehr',
    'Cc'                          => 'Cc',
    'Cc E-mail'                   => 'CC (E-Mail)',
 +  'Change default bin for this parts' => 'Standardlagerplatz für diese Waren ändern',
    'Change kivitendo installation settings (all menu entries beneath \'System\')' => 'Ver&auml;ndern der kivitendo-Installationseinstellungen (Men&uuml;punkte unterhalb von \'System\')',
    'Change representative to'    => 'Vertreter ändern in',
    'Changes in this block are only sensible if the account is NOT a summary account AND there exists one valid taxkey. To select both Receivables and Payables only make sense for Payment / Receipt (i.e. account cash).' => 'Es ist nur sinnvoll Änderungen vorzunehmen, wenn das Konto KEIN Sammelkonto ist und wenn ein gültiger Steuerschlüssel für das Konto existiert. Gleichzeitig Haken bei Forderungen und Verbindlichkeiten zu setzen, macht auch NUR für den Zahlungsein- und Ausgang (bspw. Bank oder Kasse) Sinn.',
    'Curr'                        => 'Währung',
    'Currencies'                  => 'W&auml;hrungen',
    'Currency'                    => 'Währung',
 +  'Currency (database ID)'      => 'Währung (Datenbank-ID)',
    'Current / Next Level'        => 'Aktuelles / Nächstes Mahnlevel',
    'Current Earnings'            => 'Gewinn',
    'Current assets account'      => 'Konto für Umlaufvermögen',
    'Decrease'                    => 'Verringern',
    'Default (no language selected)' => 'Standard (keine Sprache ausgewählt)',
    'Default Accounts'            => 'Standardkonten',
 +  'Default Bin'                 => 'Standard-Lagerplatz',
 +  'Default Customer/Vendor Language' => 'Standard-Kunden-/Lieferantensprache',
 +  'Default Warehouse'           => 'Standard-Lager',
    'Default Customer/Vendor Language' => 'Standard-Kunden-/Lieferantensprache',
    'Default buchungsgruppe'      => 'Standardbuchungsgruppe',
 +  'Default currency'            => 'Standardwährung',
 +  'Default currency missing!'   => 'Standardwährung fehlt!',
    'Default output medium'       => 'Standardausgabekanal',
    'Default printer'             => 'Standarddrucker',
    'Default template format'     => 'Standardvorlagenformat',
    'End date'                    => 'Enddatum',
    'Enter a description for this new draft.' => 'Geben Sie eine Beschreibung f&uuml;r diesen Entwurf ein.',
    'Enter longdescription'       => 'Langtext eingeben',
 -  'Enter the abbreviations separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Geben Sie Ihre und weitere Währungen als Abkürzungen durch Doppelpunkte getrennt ein (z.B. EUR:USD:CAD)',
    'Enter the requested execution date or leave empty for the quickest possible execution:' => 'Geben Sie das jeweils gewünschte Ausführungsdatum an, oder lassen Sie das Feld leer für die schnellstmögliche Ausführung:',
    'Entries for which automatic conversion failed:' => 'Einträge, für die die automatische Umstellung fehlschlug:',
    'Entries for which automatic conversion succeeded:' => 'Einträge, für die die automatische Umstellung erfolgreich war:',
    'Error: Customer/vendor not found' => 'Fehler: Kunde/Lieferant nicht gefunden',
    'Error: Gender (cp_gender) missing or invalid' => 'Fehler: Geschlecht (cp_gender) fehlt oder ungültig',
    'Error: Invalid business'     => 'Fehler: Kunden-/Lieferantentyp ungültig',
 +  'Error: Invalid currency'     => 'Fehler: ungültige Währung',
    'Error: Invalid language'     => 'Fehler: Sprache ungültig',
    'Error: Invalid part type'    => 'Fehler: Artikeltyp ungültig',
    'Error: Invalid parts group'  => 'Fehler: Warengruppe ungültig',
    'From'                        => 'Von',
    'From Date'                   => 'Von',
    'From this version on a new feature is available.' => 'Ab dieser Version ist ein neues Feature verfügbar.',
 +  'From this version on it is necessary to name a default value.' => 'Ab dieser Version benötigt kivitendo eine Standardwährung.',
    'From this version on the partnumber of services, articles and assemblies have to be unique.' => 'Ab dieser Version müssen Artikelnummern eindeutig vergeben werden.',
    'From this version on the taxkey 0 must have a tax rate of 0 (for DATEV compatibility).' => 'Ab dieser Version muss der Steuerschlüssel 0 einen Steuersatz von 0% haben (auf Grund der DATEV-Kompatibilität).',
    'Full Access'                 => 'Vollzugriff',
    'ID-Nummer'                   => 'ID-Nummer (intern)',
    'II'                          => 'II',
    'III'                         => 'III',
 -  'IMPORTANT NOTE: You cannot safely change currencies, IF you have already booking entries!' => 'WICHTIGER HINWEIS: Falls schon Buchungen im Mandanten vorhanden sind, kann man nicht mehr UNKRITISCH neue oder andere Währungen konfigurieren!',
    'IV'                          => 'IV',
    'If checked the taxkey will not be exported in the DATEV Export, but only IF chart taxkeys differ from general ledger taxkeys' => 'Falls angehakt wird der DATEV-Steuerschlüssel bei Buchungen auf dieses Konto nicht beim DATEV-Export mitexportiert, allerdings nur wenn zusätzlich der Konto-Steuerschlüssel vom Buchungs (Hauptbuch) Steuerschlüssel abweicht',
    'If the article type is set to \'mixed\' then a column called \'type\' must be present.' => 'Falls der Artikeltyp auf \'gemischt\' gestellt wird, muss eine Spalte namens \'type\' vorhanden sein.',
    'If you want to change any of these parameters then press the &quot;Back&quot; button, edit the file &quot;config/kivitendo.conf&quot; and login into the admin module again.' => 'Wenn Sie einen der Parameter &auml;ndern wollen, so dr&uuml;cken Sie auf den &quot;Zur&uuml;ck&quot;-Button, bearbeiten Sie die Datei &quot;config/kivitendo.conf&quot;, und melden Sie sich erneut im Administrationsbereich an.',
    'If you want to delete such a dataset you have to edit the user(s) that are using the dataset in question and have them use another dataset.' => 'Wenn Sie eine solche Datenbank l&ouml;schen wollen, so m&uuml;ssen Sie zuerst die Benutzer bearbeiten, die die fragliche Datenbank benutzen, und sie so &auml;ndern, dass sie eine andere Datenbank benutzen.',
    'If you want to set up the authentication database yourself then log in to the administration panel. kivitendo will then create the database and tables for you.' => 'Wenn Sie die Authentifizierungs-Datenbank selber einrichten wollen, so melden Sie sich im Administrationsbereich an. kivitendo wird dann die Datenbank und die erforderlichen Tabellen für Sie anlegen.',
 +  'If your old bins match exactly Bins in the Warehouse CLICK on <b>AUTOMATICALLY MATCH BINS</b>.' => 'Falls die alte Lagerplatz-Beschreibung in Stammdaten genau mit einem Lagerplatz in einem vorhandenem Lager übereinstimmt, KLICK auf <b>LAGERPLÄTZE AUTOMATISCH ZUORDNEN</b>',
    'Illegal characters have been removed from the following fields: #1' => 'Ungültige Zeichen wurden aus den folgenden Feldern entfernt: #1',
    'Image'                       => 'Grafik',
    'Import'                      => 'Import',
    'Invoices, Credit Notes & AR Transactions' => 'Rechnungen, Gutschriften & Debitorenbuchungen',
    'Is Searchable'               => 'Durchsuchbar',
    'Is this a summary account to record' => 'Sammelkonto für',
 +  'It is not allowed that a summary account occurs in a drop-down menu!' => 'Ein Sammelkonto darf nicht in Aufklappmenüs aufgenommen werden!',
    'It is possible that even after such a correction there is something wrong with this transaction (e.g. taxes that don\'t match the selected taxkey). Therefore you should re-run the general ledger analysis.' => 'Auch nach einer Korrektur kann es mit dieser Buchung noch weitere Probleme geben (z.B. nicht zum Steuerschlüssel passende Steuern), weshalb ein erneutes Ausführen der Hauptbuchanalyse empfohlen wird.',
    'It is possible to do this automatically for some Buchungsgruppen, but not for all.' => 'Es ist m&ouml;glich, dies f&uuml;r einige, aber nicht f&uuml;r alle Buchungsgruppen automatisch zu erledigen.',
    'It is possible to do this automatically for some units, but for others the user has to chose the new unit.' => 'Das ist f&uuml;r einige Einheiten automatisch m&ouml;glich, aber bei anderen muss der Benutzer die neue Einheit ausw&auml;hlen.',
    'Marked as paid'              => 'Als bezahlt markiert',
    'Marked entries printed!'     => 'Markierte Einträge wurden gedruckt!',
    'Master Data'                 => 'Stammdaten',
 +  'Master Data Bin Text Deleted' => 'Gelöschte Stammdaten Freitext-Lagerplätze',
    'Max. Dunning Level'          => 'höchste Mahnstufe',
    'May'                         => 'Mai',
    'May '                        => 'Mai',
    'No data was found.'          => 'Es wurden keine Daten gefunden.',
    'No databases have been found on this server.' => 'Auf diesem Server wurden keine Datenbanken gefunden.',
    'No datasets have been selected.' => 'Es wurden keine Datenbanken ausgew&auml;hlt.',
 +  'No default currency'         => 'Keine Standardwährung',
    'No department has been created yet.' => 'Es wurde noch keine Abteilung erfasst.',
    'No dunnings have been selected for printing.' => 'Es wurden keine Mahnungen zum Drucken ausgew&auml;hlt.',
    'No entries were found which had no unit assigned to them.' => 'Es wurden keine Eintr&auml;ge gefunden, denen keine Einheit zugeordnet war.',
    'No problems were recognized.' => 'Es wurden keine Probleme gefunden.',
    'No report with id #1'        => 'Es gibt keinen Report mit der Id #1',
    'No shipto selected to delete' => 'Keine Lieferadresse zum Löschen ausgewählt',
 +  'No summary account'          => 'Kein Sammelkonto',
    'No transaction selected!'    => 'Keine Transaktion ausgewählt',
    'No transfers were executed in this export.' => 'In diesem SEPA-Export wurden keine Überweisungen ausgeführt.',
    'No unknown units where found.' => 'Es wurden keine unbekannten Einheiten gefunden.',
    'Orders / Delivery Orders deleteable' => 'Aufträge / Lieferscheine löschbar',
    'Orientation'                 => 'Seitenformat',
    'Orphaned'                    => 'Nie benutzt',
 +  'Orphaned currencies'         => 'Verwaiste Währungen',
    'Other users\' follow-ups'    => 'Wiedervorlagen anderer Benutzer',
    'Other values are ignored.'   => 'Andere Eingaben werden ignoriert.',
    'Others'                      => 'Andere',
    'Otherwise all users will only have access to their own settings.' => 'Andernfalls haben alle Benutzer nur Zugriff auf ihre Einstellungen.',
    'Otherwise the variable is only available for printing.' => 'Andernfalls steht die Variable nur beim Ausdruck zur Verfügung.',
 +  'Otherwise you can simply check create warehouse and bins and define a name for the warehouse (Bins will be created automatically) and then continue' => 'Andernfalls einfach Lager und Lagerplätze erschaffen anhaken und einen Namen für das Lager vergeben (Lagerplätze werden dann automatisch hinzugefügt) danach auf weiter',
    'Out of balance transaction!' => 'Buchung ist nicht ausgeglichen!',
    'Out of balance!'             => 'Summen stimmen nicht berein!',
    'Output Number Format'        => 'Zahlenformat (Ausgabe)',
    'Please contact your administrator.' => 'Bitte wenden Sie sich an Ihren Administrator.',
    'Please define a taxkey for the following taxes and run the update again:' => 'Bitte definieren Sie einen Steuerschlüssel für die folgenden Steuern und starten Sie dann das Update erneut:',
    'Please enter a profile name.' => 'Bitte geben Sie einen Profilnamen an.',
 +  'Please enter the currency you are working with.' => 'Bitte geben Sie die Währung an, mit der Sie arbeiten.',
    'Please enter the login for the new user.' => 'Bitte geben Sie das Login für den neuen Benutzer ein.',
    'Please enter the name of the database that will be used as the template for the new database:' => 'Bitte geben Sie den Namen der Datenbank an, die als Vorlage f&uuml;r die neue Datenbank benutzt wird:',
    'Please enter the name of the dataset you want to restore the backup in.' => 'Bitte geben Sie den Namen der Datenbank ein, in der Sie die Sicherung wiederherstellen wollen.',
    'Removed spoolfiles!'         => 'Druckdateien entfernt!',
    'Removing marked entries from queue ...' => 'Markierte Einträge werden von der Warteschlange entfernt ...',
    'Rename the group'            => 'Gruppe umbenennen',
 +  'Replace the orphaned currencies by other not orphaned currencies. To do so, please delete the currency in the textfields above and replace it by another currency. You could loose or change unintentionally exchangerates. Go on very carefully since you could destroy transactions.' => 'Ersetze die Währungen durch andere gültige Währungen. Wenn Sie sich hierfür entscheiden, ersetzen Sie bitte alle Währungen, die oben angegeben sind, durch Währungen, die in Ihrem System ordnungsgemäß eingetragen sind. Alle eingetragenen Wechselkurse für die verwaiste Währung werden dabei gelöscht. Bitte gehen Sie sehr vorsichtig vor, denn die betroffenen Buchungen können unter Umständen kaputt gehen.',
    'Report Positions'            => 'Berichte',
    'Report about warehouse contents' => 'Lagerbestand anzeigen',
    'Report about warehouse transactions' => 'Lagerbuchungen anzeigen',
    'Show old dunnings'           => 'Alte Mahnungen anzeigen',
    'Show overdue sales quotations and requests for quotations...' => 'Überfällige Angebote und Preisanfragen anzeigen...',
    'Show settings'               => 'Einstellungen anzeigen',
+   'Show the weights of articles and the total weight in orders, invoices and delivery notes?' => 'Sollen Warengewichte und Gesamtgewicht in Aufträgen, Rechnungen und Lieferscheinen angezeigt werden?',
+   'Show weights'                => 'Gewichte anzeigen',
    'Show your TODO list after loggin in' => 'Aufgabenliste nach dem Anmelden anzeigen',
    'Signature'                   => 'Unterschrift',
    '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.',
    'Text variables: \'MAXLENGTH=n\' sets the maximum entry length to \'n\'.' => 'Textzeilen: \'MAXLENGTH=n\' setzt eine Maximall&auml;nge von n Zeichen.',
    'Text, text field and number variables: The default value will be used as-is.' => 'Textzeilen, Textfelder und Zahlenvariablen: Der Standardwert wird so wie er ist &uuml;bernommen.',
    'That export does not exist.' => 'Dieser Export existiert nicht.',
 +  'That is why kivitendo could not find a default currency.' => 'Daher konnte kivitendo keine Standardwährung finden.',
    'The \'tag\' field must only consist of alphanumeric characters or the carachters - _ ( )' => 'Das Feld \'tag\' darf nur aus alphanumerischen Zeichen und den Zeichen - _ ( ) bestehen.',
    'The AP transaction #1 has been deleted.' => 'Die Kreditorenbuchung #1 wurde gelöscht.',
    'The AR transaction #1 has been deleted.' => 'Die Debitorenbuchung #1 wurde gelöscht.',
 +  'The Bins in Inventory were only a information text field.' => 'Die Lagerplätze unter Stammdaten/Waren, sind nur ein informatives Textfeld.',
 +  'The Bins in master data were only a information text field.' => 'Die Lagerplätze unter Stammdaten/Waren, sind nur ein informatives Textfeld.',
    'The GL transaction #1 has been deleted.' => 'Die Dialogbuchung #1 wurde gelöscht.',
    'The LDAP server "#1:#2" is unreachable. Please check config/kivitendo.conf.' => 'Der LDAP-Server "#1:#2" ist nicht erreichbar. Bitte &uuml;berpr&uuml;fen Sie die Angaben in config/kivitendo.conf.',
    'The SEPA export has been created.' => 'Der SEPA-Export wurde erstellt',
    'The follow-up date is missing.' => 'Das Wiedervorlagedatum fehlt.',
    'The following Buchungsgruppen have already been created:' => 'Die folgenden Buchungsgruppen wurden bereits angelegt:',
    'The following Datasets need to be updated' => 'Folgende Datenbanken müssen aktualisiert werden',
 +  'The following currencies have been used, but they are not defined:' => 'Die folgenden Währungen wurden benutzt, sind aber nicht ordnungsgemäß in der Datenbank eingetragen:',
    'The following drafts have been saved and can be loaded.' => 'Die folgenden Entw&uuml;rfe wurden gespeichert und k&ouml;nnen geladen werden.',
    'The following old files whose settings have to be merged manually into the new configuration file "config/kivitendo.conf" still exist:' => 'Es existieren noch die folgenden alten Dateien, deren Einstellungen manuell in die neue Konfiguratsdatei "config/kivitendo.conf" migriert werden müssen:',
    'The following transaction contains wrong taxes:' => 'Die folgende Buchung enthält falsche Steuern:',
    'There are #1 more open invoices for this customer with other currencies.' => 'Es gibt #1 weitere offene Rechnungen für diesen Kunden, die in anderen Währungen ausgestellt wurden.',
    'There are #1 more open invoices from this vendor with other currencies.' => 'Es gibt #1 weitere offene Rechnungen von diesem Lieferanten, die in anderen Währungen ausgestellt wurden.',
    'There are #1 unfinished follow-ups of which #2 are due.' => 'Es gibt #1 Wiedervorlage(n), von denen #2 fällig ist/sind.',
 +  'There are Bins defined in your Inventory.' => 'Unter Stammdaten/Waren sind Lagerplätze defininert',
 +  'There are Bins defined in your master data.' => 'Unter Stammdaten/Waren sind Lagerplätze defininert',
    'There are bookings to the account 3803 after 01.01.2007. If you didn\'t change this account manually to 19% the bookings are probably incorrect.' => 'Das Konto 3803 wurde nach dem 01.01.2007 bebucht. Falls Sie dieses Konto nicht manuell auf 19% gestellt haben sind die Buchungen wahrscheinlich mit falscher Umsatzsteuer gebucht worden.',
    'There are double partnumbers in your database.' => 'In ihrer Datenbank befinden sich mehrfach vergebene Artikelnummern.',
    'There are entries in tax where taxkey is NULL.' => 'In der Datenbank sind Steuern ohne Steuerschlüssel vorhanden (in der Tabelle tax Spalte taxkey).',
    'There are no entries in the background job history.' => 'Es gibt keine Einträge im Hintergrund-Job-Verlauf.',
    'There are no items in stock.' => 'Dieser Artikel ist nicht eingelagert.',
    'There are no items on your TODO list at the moment.' => 'Ihre Aufgabenliste enth&auml;lt momentan keine Eintr&auml;ge.',
 +  'There are several options you can handle this problem, please select one:' => 'Bitte wählen Sie eine der folgenden Optionen, um mit dem Problem umzugehen:',
    'There are still entries in the database for which no unit has been assigned.' => 'Es gibt noch Eintr&auml;ge in der Datenbank, f&uuml;r die keine Einheit zugeordnet ist.',
    'There are still transfers not matching the qty of the delivery order. Stock operations can not be changed later. Do you really want to proceed?' => 'Einige der Lagerbewegungen sind nicht vollständig und Lagerbewegungen können nachträglich nicht mehr verändert werden. Wollen Sie wirklich fortfahren?',
 +  'There are undefined currencies in your system.' => 'In Ihrer Datenbank wurden Währungen benutzt, die nicht ordnungsgemäß in den Währungen eingetragen wurden.',
    'There are usually three ways to install Perl modules.' => 'Es gibt normalerweise drei Arten, ein Perlmodul zu installieren.',
    'There is already a taxkey 0 with tax rate not 0.' => 'Es existiert bereits ein Steuerschlüssel mit Steuersatz ungleich 0%.',
    'There is an inconsistancy in your database.' => 'In Ihrer Datenbank sind Unstimmigkeiten vorhanden.',
    'This customer number is already in use.' => 'Diese Kundennummer wird bereits verwendet.',
    'This feature especially prevents mistakes by mixing up prior tax and sales tax.' => 'Dieses Feature vermeidet insbesondere Verwechslungen von Umsatz- und Vorsteuer.',
    'This group will be called &quot;Full Access&quot;.' => 'Diese Gruppe wird &quot;Vollzugriff&quot; genannt.',
 +  'This has been changed in this version, therefore please change the "old" bins to some real warehouse bins.' => 'Das wurde in dieser Version umgestellt, bitte ändern Sie die Freitext-Lagerplätze auf wirkliche Lagerplätze.',
 +  'This has been changed in this version.' => 'Ab dieser Version ist dies nicht mehr so.',
    'This installation uses an unknown chart of accounts (&quot;#1&quot;). This database upgrade cannot create standard buchungsgruppen automatically.' => 'Diese Installation benutzt einen unbekannten Kontenrahmen (&quot;#1&quot;). Dieses Datenbankupgrade kann die Standardbuchungsgruppen nicht automatisch anlegen.',
    'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'In diesem Schritt werden bestehende Datenbanken gesucht. Es werden noch keine &Auml;nderungen vorgenommen!',
    'This is a very critical problem.' => 'Dieses Problem ist sehr schwerwiegend.',
 +  'This is the default bin for parts' => 'Standard-Lagerplatz für Stammdaten/Waren',
    'This list is capped at 15 items to keep it fast. If you need a full list, please use reports.' => 'Diese Liste ist auf 15 Zeilen begrenzt. Wenn Sie eine vollständige Liste benötigen, erstellen Sie bitte einen Bericht.',
    'This means that the user has created an AP transaction and chosen a taxkey for sales taxes, or that he has created an AR transaction and chosen a taxkey for input taxes.' => 'Das bedeutet, dass ein Benutzer eine Kreditorenbuchung angelegt und in ihr einen Umsatzsteuer-Steuerschlüssel verwendet oder eine Debitorenbuchung mit Vorsteuer-Steuerschlüssel angelegt hat.',
    'This module can help you identify and correct such entries by analyzing the general ledger and presenting you likely solutions but also allowing you to fix problems yourself.' => 'Dieses Modul kann Ihnen helfen, problematische Einträge im Hauptbuch zu identifizieren und teilweise zu beheben. Dabei werden je nach Problem mögliche Lösungen aufgezeigt, wobei Sie die entscheiden können, welche Probleme automatisch gelöst werden sollen.',
    'This upgrade script tries to map all existing parts in the database to the newly created Buchungsgruppen.' => 'Dieses Upgradescript versucht, bei allen bestehenden Artikeln neu erstellte Buchungsgruppen zuzuordnen.',
    'This upgrade script tries to map all existing units in the database to the newly created units.' => 'Dieses Update-Script versucht, alle bestehenden Einheiten automatisch in die neuen Einheiten umzuwandeln.',
    'This vendor number is already in use.' => 'Diese Lieferantennummer wird bereits verwendet.',
 +  'Three Options:'              => 'Drei Optionen:',
    'Time period for the analysis:' => 'Analysezeitraum:',
    'Timestamp'                   => 'Uhrzeit',
    'Title'                       => 'Titel',
    'Total Fees'                  => 'Kumulierte Gebühren',
    'Total stock value'           => 'Gesamter Bestandswert',
    'Total sum'                   => 'Gesamtsumme',
+   'Total weight'                => 'Gesamtgewicht',
    'Totals'                      => 'Summen',
    'Trade Discount'              => 'Rabatt',
    'Trans Id'                    => 'Trans-ID',
    'Unbalanced Ledger'           => 'Bilanzfehler',
    'Unchecked custom variables will not appear in orders and invoices.' => 'Unmarkierte Variablen werden für diesen Artikel nicht in Aufträgen und Rechnungen angezeigt.',
    'Unfinished follow-ups'       => 'Nicht erledigte Wiedervorlagen',
 +  'Unfortunately you have no warehouse defined.' => 'Leider, gibt es kein Lager in diesem Mandanten.',
    'Unit'                        => 'Einheit',
    'Unit (if missing or empty default unit will be used)' => 'Einheit (falls nicht vorhanden oder leer wird die Standardeinheit benutzt)',
    'Unit missing.'               => 'Die Einheit fehlt.',
    'You cannot create an invoice for delivery orders from different vendors.' => 'Sie können keine Rechnung aus Lieferscheinen von verschiedenen Lieferanten erstellen.',
    'You do not have the permissions to access this function.' => 'Sie verf&uuml;gen nicht &uuml;ber die notwendigen Rechte, um auf diese Funktion zuzugreifen.',
    'You have entered or selected the following shipping address for this customer:' => 'Sie haben die folgende Lieferadresse eingegeben oder ausgew&auml;hlt:',
 +  'You have never worked with currencies.' => 'Sie haben noch nie  mit Währungen gearbeitet.',
    'You have not added bank accounts yet.' => 'Sie haben noch keine Bankkonten angelegt.',
    'You have not selected any delivery order.' => 'Sie haben keinen Lieferschein ausgewählt.',
    'You have not selected any export.' => 'Sie haben keinen Export ausgewählt.',
@@@ -1,6 -1,5 +1,6 @@@
  [%- USE T8 %][%- USE L %][% USE LxERP %]
  
 +[% PROCESS 'common/select_warehouse_bin.html'  WAREHOUSES=SELF.WAREHOUSES warehouse_id=SELF.warehouse_id bin_id=SELF.bin_id %]
  <h1>[% title | html %]</h1>
  
  [% PROCESS 'common/flash.html' %]
       [% 'Any stock contents containing a best before date will be impossible to stock out otherwise.' | $T8 %]
     </td>
   </tr>
 + <tr> </tr>
 + <tr> </tr>
 + <tr>
 +  <th align="right" nowrap="true">[% 'Default Warehouse' | $T8 %]</th>
 +  <td>
 +   <select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
 +    [%- FOREACH warehouse = SELF.WAREHOUSES %]
 +      <option value="[% HTML.escape(warehouse.id) %]"[% IF SELF.warehouse_id == warehouse.id %] selected[% END %]>[% warehouse.description %]</option>
 +    [%- END %]
 +   </select>
 + </td>
 +  <td>
 +     [% 'This is the default bin for parts' | $T8 %]<br>
 +  </td>
 + </tr>
 + <tr>
 +  <th align="right" nowrap="true">[% 'Default Bin' | $T8 %]</th>
 +  <td><select id="bin_id" name="bin_id"></select></td>
 + </tr>
 +
  
+  <tr class='listheading'>
+    <th colspan="3">[% 'Weight' | $T8 %]</th>
+  </tr>
+  <tr>
+    <td align="right">[% 'Show weights' | $T8 %]</td>
+    <td>
+      [% L.yes_no_tag('show_weight', SELF.show_weight) %]
+    </td>
+    <td>
+      [% 'Show the weights of articles and the total weight in orders, invoices and delivery notes?' | $T8 %]<br>
+    </td>
+  </tr>
  </table>
  
  <br>