Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0e4da157

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

  • ID 0e4da157188830a45e606285bca5d0ea668bbcf5
  • Vorgänger 7e19c216
  • Nachfolger d93709bd

Filtern/Anzeigen von Kunden-/Lieferanten-CVars in VK-Rechnungs-Berichten

Conflicts:

bin/mozilla/ar.pl

Unterschiede anzeigen:

SL/AR.pm
573 573
    }
574 574
  };
575 575

  
576
  my ($cvar_where, @cvar_values) = CVar->build_filter_query('module'         => 'CT',
577
                                                            'trans_id_field' => 'c.id',
578
                                                            'filter'         => $form,
579
                                                           );
580
  if ($cvar_where) {
581
    $where .= qq| AND ($cvar_where)|;
582
    push @values, @cvar_values;
583
  }
584

  
576 585
  my @a = qw(transdate invnumber name);
577 586
  push @a, "employee" if $form->{l_employee};
578 587
  my $sortdir   = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
bin/mozilla/ar.pl
842 842
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
843 843
  $form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0;
844 844

  
845
  $form->{CT_CUSTOM_VARIABLES}                  = CVar->get_configs('module' => 'CT');
846
  ($form->{CT_CUSTOM_VARIABLES_FILTER_CODE},
847
   $form->{CT_CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables'      => $form->{CT_CUSTOM_VARIABLES},
848
                                                                              'include_prefix' => 'l_',
849
                                                                              'include_value'  => 'Y');
850

  
845 851
  # constants and subs for template
846 852
  $form->{vc_keys}   = sub { "$_[0]->{name}--$_[0]->{id}" };
847 853

  
......
898 904
       datepaid due duedate transaction_description notes salesman employee shippingpoint shipvia
899 905
       marge_total marge_percent globalprojectnumber customernumber country ustid taxzone payment_terms charts customertype);
900 906

  
907
  my $ct_cvar_configs                 = CVar->get_configs('module' => 'CT');
908
  my @ct_includeable_custom_variables = grep { $_->{includeable} } @{ $ct_cvar_configs };
909
  my @ct_searchable_custom_variables  = grep { $_->{searchable} }  @{ $ct_cvar_configs };
910

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

  
901 914
  my @hidden_variables = map { "l_${_}" } @columns;
902 915
  push @hidden_variables, "l_subtotal", qw(open closed customer invnumber ordnumber cusordnumber transaction_description notes project_id transdatefrom transdateto employee_id salesman_id business_id);
916
  push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables;
903 917

  
904 918
  $href = build_std_url('action=ar_transactions', grep { $form->{$_} } @hidden_variables);
905 919

  
......
934 948
    'payment_terms'           => { 'text' => $locale->text('Payment Terms'), },
935 949
    'charts'                  => { 'text' => $locale->text('Buchungskonto'), },
936 950
    'customertype'            => { 'text' => $locale->text('Customer type'), },
951
    %column_defs_cvars,
937 952
  );
938 953

  
939 954
  foreach my $name (qw(id transdate duedate invnumber ordnumber cusordnumber name datepaid employee shippingpoint shipvia transaction_description)) {
......
953 968

  
954 969
  $report->set_sort_indicator($form->{sort}, $form->{sortdir});
955 970

  
971
  CVar->add_custom_variables_to_report('module'         => 'CT',
972
                                       'trans_id_field' => 'customer_id',
973
                                       'configs'        => $ct_cvar_configs,
974
                                       'column_defs'    => \%column_defs,
975
                                       'data'           => $form->{AR});
976

  
956 977
  my @options;
957 978
  if ($form->{customer}) {
958 979
    push @options, $locale->text('Customer') . " : $form->{customer}";
templates/webpages/ar/search.html
115 115
      [% L.date_tag('transdateto') %]
116 116
     </td>
117 117
    </tr>
118

  
119
[%- IF CT_CUSTOM_VARIABLES.size %]
120
    <tr>
121
      <td></td>
122
      <td colspan=4 align=left><b>[% 'Custom variables for module' | $T8 %]: [%'Customers and vendors' | $T8 %]</td>
123
    </tr>
124
    [% CT_CUSTOM_VARIABLES_FILTER_CODE %]
125
[%- END %]
126

  
118 127
   <input type=hidden name=sort value=transdate>
119 128
   </table>
120 129
    </td>
......
213 222
           <td align=right><input name="l_ustid" id="l_ustid" class=checkbox type=checkbox value=Y></td>
214 223
           <td nowrap>[% 'USt-IdNr.' | $T8 %]</td>
215 224
          </tr>
225

  
226
          <table>
227
            <tr><td align="right">
228
            [% CT_CUSTOM_VARIABLES_INCLUSION_CODE %]
229
            </td></tr>
230
          </table>
231

  
216 232
         </table>
217 233
        </td>
218 234
       </tr>

Auch abrufbar als: Unified diff