Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3193bd4a

Von Bernd Bleßmann vor etwa 3 Jahren hinzugefügt

  • ID 3193bd4a57817d4ad38397f3cf4c84647cf16051
  • Vorgänger 9cb34cff
  • Nachfolger 5d2ede53

Waren-CVars für Lagerbuchungsbericht

Übernahme aus Kundenprojekt

Unterschiede anzeigen:

SL/WH.pm
355 355
  # take all the requested ones from the first hash and overwrite them from the out/in hashes if present.
356 356
  for my $i ('trans', 'out', 'in') {
357 357
    $select{$i} = join ', ', map { +/^l_/; ($select_tokens{$i}{"$'"} || $select_tokens{'trans'}{"$'"}) . " AS r_$'" }
358
          ( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_qty l_partunit l_shippingdate) );
358
          ( grep( { !/qty$/ and !/^l_cvar/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_qty l_partunit l_shippingdate) );
359 359
  }
360 360

  
361 361
  my $group_clause = join ", ", map { +/^l_/; "r_$'" }
362
        ( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_partunit l_shippingdate l_itime) );
362
        ( grep( { !/qty$/ and !/^l_cvar/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_partunit l_shippingdate l_itime) );
363 363

  
364 364
  $where_clause = defined($where_clause) ? $where_clause : '';
365 365

  
bin/mozilla/wh.pl
574 574

  
575 575
  show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
576 576

  
577
  my $cvar_configs                           = CVar->get_configs('module' => 'IC');
578
  (undef,
579
   $form->{CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables'      => $cvar_configs,
580
                                                                           'include_prefix' => 'l_',
581
                                                                           'include_value'  => 'Y');
582

  
577 583
  setup_wh_journal_action_bar();
578 584

  
579 585
  $form->header();
......
641 647

  
642 648
  my $report = SL::ReportGenerator->new(\%myconfig, $form);
643 649

  
650
  my $cvar_configs                 = CVar->get_configs('module' => 'IC');
651
  my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
652
  push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables;
653

  
644 654
  my @hidden_variables = map { "l_${_}" } @columns;
645 655
  push @hidden_variables, qw(warehouse_id bin_id partnumber description chargenumber bestbefore qty_op qty qty_unit unit partunit fromdate todate transtype_ids comment projectnumber);
646 656
  push @hidden_variables, qw(classification_id);
......
669 679
    'oe_id'           => { 'text' => $locale->text('Document'), },
670 680
  );
671 681

  
682
  my %column_defs_cvars = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables;
683
  %column_defs          = (%column_defs, %column_defs_cvars);
684

  
672 685
  if ($form->{transtype_ids} && 'ARRAY' eq ref $form->{transtype_ids}) {
673 686
    for (my $i = 0; $i < scalar(@{ $form->{transtype_ids} }); $i++) {
674 687
      delete $form->{transtype_ids}[$i] if $form->{transtype_ids}[$i] eq '';
......
679 692
  my $href = build_std_url('action=generate_journal', grep { $form->{$_} } @hidden_variables);
680 693
  $href .= "&maxrows=".$form->{maxrows};
681 694

  
682
  map { $column_defs{$_}->{link} = $href ."&page=".$page. "&sort=${_}&order=" . Q($_ eq $form->{sort} ? 1 - $form->{order} : $form->{order}) } @columns;
695
  map { $column_defs{$_}->{link} = $href ."&page=".$page. "&sort=${_}&order=" . Q($_ eq $form->{sort} ? 1 - $form->{order} : $form->{order}) } grep {!/^cvar/} @columns;
683 696

  
684 697
  my %column_alignment = map { $_ => 'right' } qw(qty);
685 698

  
......
704 717

  
705 718
  my $all_units = AM->retrieve_units(\%myconfig, $form);
706 719

  
720
  CVar->add_custom_variables_to_report('module'         => 'IC',
721
                                       'trans_id_field' => 'parts_id',
722
                                       'configs'        => $cvar_configs,
723
                                       'column_defs'    => \%column_defs,
724
                                       'data'           => \@contents);
725

  
726

  
707 727
  my %doc_types = ( 'sales_quotation'         => { script => 'oe', title => $locale->text('Sales quotation') },
708 728
                    'sales_order'             => { script => 'oe', title => $locale->text('Sales Order') },
709 729
                    'request_quotation'       => { script => 'oe', title => $locale->text('Request quotation') },
templates/webpages/wh/journal_filter.html
200 200
        <td nowrap><label for="l_projectnumber">[% 'Project Number' | $T8 %]</label></td>
201 201
       </tr>
202 202
      </table>
203
      <table>
204
       [% CUSTOM_VARIABLES_INCLUSION_CODE %]
205
      </table>
203 206
     </td>
204 207
    </tr>
205 208
   </table>

Auch abrufbar als: Unified diff