Revision cd98d068
Von Niclas Zimmermann vor etwa 12 Jahren hinzugefügt
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; |
Auch abrufbar als: Unified diff
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.