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;
templates/webpages/wh/report_filter.html
153 153
         [% L.yes_no_tag("allrows", 1) %]
154 154
        </td>
155 155
       </tr>
156

  
157 156
      </table>
158 157
     </td>
159 158
    </tr>
......
207 206
        <td align="right"><input name="l_list_price" id="l_list_price" class="checkbox" type="checkbox" value="Y"></td>
208 207
        <td nowrap><label for="l_list_price">[% 'List Price' | $T8 %]</label></td>
209 208
       </tr>
209
       [% IF INCLUDABLE_CVAR_CONFIGS %]
210
         <tr><td colspan="6"><hr noshade height="1"></td></tr>
211
         [% FOREACH cvar_cfg = INCLUDABLE_CVAR_CONFIGS %]
212
         <tr>
213
          <td colspan="2" align="left">
214
           [% name__ = cvar_cfg.name;
215
            L.checkbox_tag("l_cvar_" _ name__, value="1", checked=(cvar_cfg.included_by_default ? 1 : ''), label=cvar_cfg.description) %]
216
          </td>
217
         </tr>
218
         [% END %]
219
       [% END %]
210 220
      </table>
211 221
     </td>
212 222
    </tr>

Auch abrufbar als: Unified diff