Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0908bb6e

Von Jan Büren vor mehr als 3 Jahren hinzugefügt

  • ID 0908bb6e1491be258f3bce6de00554860fceff24
  • Vorgänger a17fc4c6
  • Nachfolger 8bed01ea

Lagerbestandsbericht um Anzeige von IC Cvars erweitert

Unterschiede anzeigen:

bin/mozilla/wh.pl
39 39
use SL::User;
40 40

  
41 41
use SL::AM;
42
use SL::CVar;
42 43
use SL::CT;
43 44
use SL::IC;
44 45
use SL::WH;
......
765 766

  
766 767
  show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
767 768

  
769
  my $CVAR_CONFIGS = SL::DB::Manager::CustomVariableConfig->get_all_sorted(where => [ module => 'IC' ]);
770
  my $INCLUDABLE_CVAR_CONFIGS = [ grep { $_->includeable } @{ $CVAR_CONFIGS } ];
771

  
768 772
  $form->{title}   = $locale->text("Report about warehouse contents");
769 773

  
770 774
  setup_wh_report_action_bar();
......
772 776
  $form->header();
773 777
  print $form->parse_html_template("wh/report_filter",
774 778
                                   { "WAREHOUSES" => $form->{WAREHOUSES},
775
                                     "UNITS"      => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)) });
779
                                     "UNITS"      => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)),
780
                                     # "CVAR_CONFIGS"            => $CVAR_CONFIGS, # nyi searchable cvars
781
                                     "INCLUDABLE_CVAR_CONFIGS" => $INCLUDABLE_CVAR_CONFIGS,
782
                                   });
776 783

  
777 784
  $main::lxdebug->leave_sub();
778 785
}
......
786 793
  my %myconfig = %main::myconfig;
787 794
  my $locale   = $main::locale;
788 795

  
796
  my $cvar_configs = CVar->get_configs('module' => 'IC');
797

  
789 798
  $form->{title}   = $locale->text("Report about warehouse contents");
790 799
  $form->{sort}  ||= 'partnumber';
791 800
  my $sort_col     = $form->{sort};
......
883 892

  
884 893
  my $href = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
885 894
  $href .= "&maxrows=".$form->{maxrows};
895
  my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
896
  my %column_defs_cvars            = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables;
897
  push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables;
898
  %column_defs = (%column_defs, %column_defs_cvars);
886 899

  
887 900
  map { $column_defs{$_}->{link} = $href . "&page=".$page."&sort=${_}&order=" . Q($_ eq $sort_col ? 1 - $form->{order} : $form->{order}) } @columns;
888 901

  
......
907 920
                       'attachment_basename'  => strftime($locale->text('warehouse_report_list') . '_%Y%m%d', localtime time));
908 921
  $report->set_options_from_form();
909 922
  $locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
923
  CVar->add_custom_variables_to_report('module'         => 'IC',
924
                                       'trans_id_field' => 'parts_id',
925
                                       'configs'        => $cvar_configs,
926
                                       'column_defs'    => \%column_defs,
927
                                       'data'           => \@contents);
910 928

  
911 929
  my $all_units = AM->retrieve_units(\%myconfig, $form);
912 930
  my $idx       = 0;

Auch abrufbar als: Unified diff