CVar: Dokumentation um Lieferadressen-CVars ergänzt
[kivitendo-erp.git] / bin / mozilla / wh.pl
index 15f58fc..fbc645e 100644 (file)
@@ -455,7 +455,7 @@ sub create_assembly {
   # Anm. jb 18.3. vielleicht auch nur meine unwissenheit in perl-datenstrukturen
   my %TRANSFER = (
     'transfer_type'    => 'assembly',
-    'login'            => $form->{login},
+    'login'            => $::myconfig{login},
     'dst_warehouse_id' => $form->{warehouse_id},
     'dst_bin_id'       => $form->{bin_id},
     'chargenumber'     => $form->{chargenumber},
@@ -833,15 +833,19 @@ sub generate_report {
   my @options;
   # dispatch all options
   my $dispatch_options = {
-   partnumber     => sub { push @options, $locale->text('Partnumber') . " : $form->{partnumber}"},
-   description    => sub { push @options, $locale->text('Description') . " : $form->{description}"},
-   chargenumber   => sub { push @options, $locale->text('Charge Number') . " : $form->{chargenumber}"},
-   bestbefore     => sub { push @options, $locale->text('Best Before') . " : $form->{bestbefore}"},
-   date           => sub { push @options, $locale->text('Date') . " : $form->{date}"},
+   warehouse_id   => sub { push @options, $locale->text('Warehouse') . " : " .
+                                            SL::DB::Manager::Warehouse->find_by(id => $form->{warehouse_id})->description},
+   bin_id         => sub { push @options, $locale->text('Bin') . " : " .
+                                            SL::DB::Manager::Bin->find_by(id => $form->{bin_id})->description},
+   partnumber     => sub { push @options, $locale->text('Partnumber')     . " : $form->{partnumber}"},
+   description    => sub { push @options, $locale->text('Description')    . " : $form->{description}"},
+   chargenumber   => sub { push @options, $locale->text('Charge Number')  . " : $form->{chargenumber}"},
+   bestbefore     => sub { push @options, $locale->text('Best Before')    . " : $form->{bestbefore}"},
+   date           => sub { push @options, $locale->text('Date')           . " : $form->{date}"},
    include_invalid_warehouses    => sub { push @options, $locale->text('Include invalid warehouses ')},
   };
   foreach (keys %filter) {
-    defined $dispatch_options->{$_}  && $dispatch_options->{$_}->();
+   $dispatch_options->{$_}->() if $dispatch_options->{$_};
   }
   # / end show filter stuff also in report
 
@@ -968,7 +972,7 @@ sub show_no_warehouses_error {
 
   my $msg = $locale->text('No warehouse has been created yet or the quantity of the bins is not configured yet.') . ' ';
 
-  if ($main::auth->check_right($form->{login}, 'config')) {
+  if ($main::auth->check_right($::myconfig{login}, 'config')) {
     $msg .= $locale->text('You can create warehouses and bins via the menu "System -> Warehouses".');
   } else {
     $msg .= $locale->text('Please ask your administrator to create warehouses and bins.');