Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision cd98d068

Von Niclas Zimmermann vor mehr als 12 Jahren hinzugefügt

  • ID cd98d068d97cb6a981d931898c5a230cd8efc0a2
  • Vorgänger 7d026c7c
  • Nachfolger ffac4820

Filterung nach Kundennummer in Zahlungseingang

Im Zahlungsverkehr-Zahlungseingang ist jetzt eine neue Filteroption
Kundennummer vorhanden. Bei Eingabe der Kundennummer wird die
Filterung für das Dropdown ausgeschaltet. Es funktioniert dann nur
noch die Filterung von Rechnungsnummer und Kundennummer.

Unterschiede anzeigen:

SL/AR.pm
472 472
    qq|LEFT JOIN department d ON (d.id = a.department_id)|;
473 473

  
474 474
  my $where = "1 = 1";
475
  if ($form->{customernumber}) {
476
    $where .= " AND c.customernumber = ?";
477
    push(@values, $form->{customernumber});
478
  }
475 479
  if ($form->{customer_id}) {
476 480
    $where .= " AND a.customer_id = ?";
477 481
    push(@values, $form->{customer_id});
bin/mozilla/cp.pl
36 36
use SL::IR;
37 37
use SL::AR;
38 38
use SL::AP;
39
use Data::Dumper;
39 40
use strict;
40 41
#use warnings;
41 42

  
......
71 72
  # für bugfix 1771 (doppelte Leerzeichen werden nicht 'gepostet')
72 73
  $form->{"select$form->{vc}"} = "";
73 74

  
75
  $form->{selectcustomer} .= "<option value=\"\"></option>\n" if $form->{vc} eq "customer";
76

  
74 77
  if ($form->{"all_$form->{vc}"}) {
75 78
    # s.o. jb 12.10.2010
76 79
    $form->{"$form->{vc}_id"} = $form->{"all_$form->{vc}"}->[0]->{id};
77 80
    map { $form->{"select$form->{vc}"} .= "<option value=\"$_->{name}--$_->{id}\">$_->{name}--$_->{id}</option>\n" }
78 81
      @{ $form->{"all_$form->{vc}"} };
79 82
  }
80

  
81 83
  CP->paymentaccounts(\%myconfig, \%$form);
82 84

  
83 85
  # Standard Konto für Umlaufvermögen
......
135 137
  if ($form->{ $form->{vc} } eq "") {
136 138
    map { $form->{"addr$_"} = "" } (1 .. 4);
137 139
  }
140

  
141
  # sometimes it happens that values in customer arrive without the signs '--'
142
  # but in order to select the right option field we need values with '--'
143
  if ($form->{vc} eq "customer"){
144
    my ($customername) = split /--/, $form->{ $form->{vc} };
145
    $form->{ $form->{vc} } = $customername . "--" . $form->{customer_id};
146
  }
138 147
  # bugfix 1771
139 148
  # geändert von <option>asdf--2929
140 149
  # nach:
......
252 261
    }
253 262
  }
254 263

  
264
  # search by customernumber
265
  # the customernumber has to be correct otherwise nothing is found
266
  if ($form->{vc} eq 'customer' and $form->{customernumber} and $form->{ARAP} eq 'AR') {
267
    $form->{open} ='Y'; # only open invoices
268
    # ar_transactions automatically searches by $form->{customer_id} or else
269
    # $form->{customer} if available, and these variables will always be set
270
    # so we have to empty these values first
271
    $form->{customer_id} = '';
272
    $form->{customer} = '';
273
    AR->ar_transactions(\%myconfig, \%$form);
274

  
275
    # Here we just take the first returned value even if the custumernumber
276
    # may not be unique
277
    $form->{customer} = $form->{AR}[0]{name};
278
    $form->{customer_id} = $form->{AR}[0]{customer_id};
279
  }
280

  
255 281
  # search by invoicenumber, 
256 282
  if ($form->{invnumber}) { 
257
    $form->{open} ='Y'; # nur die offenen rechnungen
283
    $form->{open} ='Y'; # only open invoices
258 284
    if ($form->{ARAP} eq 'AR'){
259

  
260 285
      # ar_transactions automatically searches by $form->{customer_id} or else
261 286
      # $form->{customer} if available, and these variables will always be set
262
      # when we have a dropdown field rather than an input field, so we have to
263
      # empty these values first
287
      # so we have to empty these values first
264 288
      $form->{customer_id} = '';
265 289
      $form->{customer} = '';
266 290
      AR->ar_transactions(\%myconfig, \%$form);
......
296 320
  }
297 321

  
298 322
  # determine customer/vendor
299
  if ( $form->{customer_id} and $form->{invnumber} ) {
323
  if ( $form->{customer_id} and ($form->{invnumber} or $form->{customernumber}) ) {
300 324
    # we already know the exact customer_id, so fill $form with customer data
301 325
    IS->get_customer(\%myconfig, \%$form);
302 326
    $updated = 1;
templates/webpages/cp/form_header.html
25 25
        <tr>
26 26
          <th align=right>[% is_customer ? LxERP.t8('Customer') : LxERP.t8('Vendor') %]</th>
27 27
          <td>[% vccontent %]</td>
28
          [% IF vc == 'customer' %]
28
         [% IF vc == 'customer' %]
29 29
           [% L.hidden_tag('selectcustomer', selectcustomer) %]
30 30
           [% L.hidden_tag('customer_id', customer_id) %]
31 31
           [% L.hidden_tag('oldcustomer', oldcustomer) %]
......
35 35
           [% L.hidden_tag('oldvendor', oldvendor) %]
36 36
          [% END %]
37 37
        </tr>
38
        [% IF vc == 'customer' %]
39
        <tr>
40
          <th align=right>[% 'Customer Number' | $T8 %]</th>
41
          <td><input name="customernumber" size="35"</td>
42
        </tr>
43
        [% END %]
38 44
        <tr>
39 45
          <th align=right>[% 'Invoice Number' | $T8 %]</th>
40 46
          <td><input name="invnumber" size="35"</td>

Auch abrufbar als: Unified diff