Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision aff48c95

Von Bernd Bleßmann vor fast 11 Jahren hinzugefügt

  • ID aff48c9512cb1cf6568654f7819c16638af0eac8
  • Vorgänger 24007946
  • Nachfolger 7f387728

Kundenfilter im Verkaufsbericht nicht mit check_name implementieren.

Sondern einfach nach dem Teilstring in der Abfarge suchen. Oder nach
der id, wenn der Name aus der Drop-Down-Box kommt.
Hintergrund: check_name überschreibt einige form-Variablen (z.B.
country und salesman_id) und dann ist der Bericht falsch.

Behebt #2468.

Unterschiede anzeigen:

SL/VK.pm
110 110
  if ($form->{customer_id}) {
111 111
    $where .= " AND ar.customer_id = ?";
112 112
    push(@values, $form->{customer_id});
113
  };
113
  } elsif ($form->{customer}) {
114
    $where .= " AND ct.name ILIKE ?";
115
    push(@values, $form->like($form->{customer}));
116
  }
114 117
  if ($form->{customernumber}) {
115 118
    $where .= qq| AND ct.customernumber = ? |;
116 119
    push(@values, $form->{customernumber});
bin/mozilla/vk.pl
110 110
  };
111 111

  
112 112
  if ( $form->{customer} =~ /--/ ) {
113
    # field data comes from dropdown box
114
    ($form->{customername}, $form->{customer_id}) = split(/--/, $form->{customer});
115
  } elsif ($form->{customer}) {
116

  
117
    # a value was added in the input box, we only want to filter for one
118
    # customer, so check that a unique customer can be found
119

  
120
    # check_name is executed with no_select => 1, if the result isn't unique
121
    # quit with an error message, the user has to enter a new name
122

  
123
    # Without no_select selecting a customer causes an update which doesn't
124
    # return anything, which is the reason for this workaround
125

  
126
    &check_name('customer', no_select => 1);
127

  
128
    # $form->{customer_id} was already set by check_name
129
    $form->{customername} = $form->{customer};
130
  };
113
    # Felddaten kommen aus Dropdownbox
114
    my $dummy;
115
    ($dummy, $form->{customer_id}) = split(/--/, $form->{customer});
116
  }
131 117
  # if $form->{customer} is empty nothing further happens here
132 118

  
133 119
  # test for decimalplaces or set to default of 2
......
168 154
  # pass hidden variables for pdf/csv export
169 155
  # first with l_ to determine which columns to show
170 156
  # then with the options for headings (such as transdatefrom, partnumber, ...)
171
  my @hidden_variables  = (qw(l_headers_mainsort l_headers_subsort l_subtotal_mainsort l_subtotal_subsort l_total l_parts l_customername l_customernumber transdatefrom transdateto decimalplaces customer customername customer_id department partnumber partsgroup country business description project_id customernumber salesman employee salesman_id employee_id business_id partsgroup_id mainsort subsort),
157
  my @hidden_variables  = (qw(l_headers_mainsort l_headers_subsort l_subtotal_mainsort l_subtotal_subsort l_total l_parts l_customername l_customernumber transdatefrom transdateto decimalplaces customer customer_id department partnumber partsgroup country business description project_id customernumber salesman employee salesman_id employee_id business_id partsgroup_id mainsort subsort),
172 158
      "$form->{db}number",
173 159
      map({ "cvar_$_->{name}" } @searchable_custom_variables),
174 160
      map { "l_$_" } @columns
......
222 208
  my @options;
223 209

  
224 210
  push @options, $locale->text('Description')             . " : $form->{description}"                                                       if $form->{description};
225
  push @options, $locale->text('Customer')                . " : $form->{customername}"                                                      if $form->{customer};
211
  push @options, $locale->text('Customer')                . " : $form->{customer}"                                                          if $form->{customer};
226 212
  push @options, $locale->text('Customer Number')         . " : $form->{customernumber}"                                                    if $form->{customernumber};
227 213
  # TODO: only customer id is passed
228 214
  push @options, $locale->text('Department')              . " : " . (split /--/, $form->{department})[0]                                    if $form->{department};

Auch abrufbar als: Unified diff