Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7e19c216

Von Bernd Bleßmann vor mehr als 9 Jahren hinzugefügt

  • ID 7e19c2165ee3b934f4e685b256bb3a261d59a915
  • Vorgänger 52b6788d
  • Nachfolger 0e4da157

Filtern/Anzeigen von Kunden-/Lieferanten-CVars in Angebots/Auftrags-Berichten

Conflicts:

SL/OE.pm
bin/mozilla/oe.pl
templates/webpages/oe/search.html

Unterschiede anzeigen:

SL/OE.pm
281 281
    push @values, conv_date($form->{expected_billing_date_to});
282 282
  }
283 283

  
284
  my ($cvar_where, @cvar_values) = CVar->build_filter_query('module'         => 'CT',
285
                                                            'trans_id_field' => 'ct.id',
286
                                                            'filter'         => $form,
287
                                                           );
288
  if ($cvar_where) {
289
    $query .= qq| AND ($cvar_where)|;
290
    push @values, @cvar_values;
291
  }
292

  
284 293
  my $sortdir   = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
285 294
  my $sortorder = join(', ', map { "${_} ${sortdir} " } ("o.id", $form->sort_columns("transdate", $ordnumber, "name"), "o.itime"));
286 295
  my %allowed_sort_columns = (
bin/mozilla/oe.pl
774 774
                   "business_types" => "ALL_BUSINESS_TYPES",);
775 775
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
776 776

  
777
  $form->{CT_CUSTOM_VARIABLES}                  = CVar->get_configs('module' => 'CT');
778
  ($form->{CT_CUSTOM_VARIABLES_FILTER_CODE},
779
   $form->{CT_CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables'      => $form->{CT_CUSTOM_VARIABLES},
780
                                                                              'include_prefix' => 'l_',
781
                                                                              'include_value'  => 'Y');
782

  
777 783
  # constants and subs for template
778 784
  $form->{vc_keys}         = sub { "$_[0]->{name}--$_[0]->{id}" };
779 785

  
......
883 889

  
884 890
  my $report = SL::ReportGenerator->new(\%myconfig, $form);
885 891

  
892
  my $ct_cvar_configs = CVar->get_configs('module' => 'CT');
893
  my @ct_includeable_custom_variables = grep { $_->{includeable} } @{ $ct_cvar_configs };
894
  my @ct_searchable_custom_variables  = grep { $_->{searchable} }  @{ $ct_cvar_configs };
895

  
896
  my %column_defs_cvars            = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @ct_includeable_custom_variables;
897
  push @columns, map { "cvar_$_->{name}" } @ct_includeable_custom_variables;
898

  
886 899
  my @hidden_variables = map { "l_${_}" } @columns;
887 900
  push @hidden_variables, "l_subtotal", $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered ordnumber quonumber cusordnumber
888 901
                                                        transaction_description transdatefrom transdateto type vc employee_id salesman_id
889 902
                                                        reqdatefrom reqdateto projectnumber project_id periodic_invoices_active periodic_invoices_inactive
890 903
                                                        business_id shippingpoint taxzone_id reqdate_unset_or_old insertdatefrom insertdateto
891 904
                                                        order_probability_op order_probability_value expected_billing_date_from expected_billing_date_to);
905
  push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables;
892 906

  
893 907
  my   @keys_for_url = grep { $form->{$_} } @hidden_variables;
894 908
  push @keys_for_url, 'taxzone_id' if $form->{taxzone_id} ne ''; # taxzone_id could be 0
......
930 944
    'order_probability'       => { 'text' => $locale->text('Order probability'), },
931 945
    'expected_billing_date'   => { 'text' => $locale->text('Exp. bill. date'), },
932 946
    'expected_netamount'      => { 'text' => $locale->text('Exp. netamount'), },
947
    %column_defs_cvars,
933 948
  );
934 949

  
935 950
  foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone insertdate)) {
......
948 963
  $report->set_export_options('orders', @hidden_variables, qw(sort sortdir));
949 964
  $report->set_sort_indicator($form->{sort}, $form->{sortdir});
950 965

  
966
  CVar->add_custom_variables_to_report('module'         => 'CT',
967
                                       'trans_id_field' => "$form->{vc}_id",
968
                                       'configs'        => $ct_cvar_configs,
969
                                       'column_defs'    => \%column_defs,
970
                                       'data'           => $form->{OE});
971

  
951 972
  my @options;
952 973
  my ($department) = split m/--/, $form->{department};
953 974

  
templates/webpages/oe/search.html
159 159
     </td>
160 160
    </tr>
161 161
[%- END %]
162

  
163
[%- IF CT_CUSTOM_VARIABLES.size %]
164
    <tr>
165
      <td></td>
166
      <td colspan=4 align=left><b>[% 'Custom variables for module' | $T8 %]: [%'Customers and vendors' | $T8 %]</td>
167
    </tr>
168
    [% CT_CUSTOM_VARIABLES_FILTER_CODE %]
169
[%- END %]
170

  
162 171
    <tr>
163 172
     <th align="right">[% 'Include in Report' | $T8 %]</th>
164 173
     <td colspan="5">
......
328 337
         <label for="l_ustid">[% 'USt-IdNr.' | $T8 %]</label>
329 338
        </td>
330 339
       </tr>
340

  
341
      [% CT_CUSTOM_VARIABLES_INCLUSION_CODE %]
342

  
331 343
[%- IF type == 'sales_order' %]
332 344
       <tr><td colspan="3"><hr></td></tr>
333 345
[%- END %]

Auch abrufbar als: Unified diff