};
if ( $form->{customer} =~ /--/ ) {
- # field data comes from dropdown box
- ($form->{customername}, $form->{customer_id}) = split(/--/, $form->{customer});
- } elsif ($form->{customer}) {
-
- # a value was added in the input box, we only want to filter for one
- # customer, so check that a unique customer can be found
-
- # check_name is executed with no_select => 1, if the result isn't unique
- # quit with an error message, the user has to enter a new name
-
- # Without no_select selecting a customer causes an update which doesn't
- # return anything, which is the reason for this workaround
-
- &check_name('customer', no_select => 1);
-
- # $form->{customer_id} was already set by check_name
- $form->{customername} = $form->{customer};
- };
+ # Felddaten kommen aus Dropdownbox
+ my $dummy;
+ ($dummy, $form->{customer_id}) = split(/--/, $form->{customer});
+ }
# if $form->{customer} is empty nothing further happens here
# test for decimalplaces or set to default of 2
# pass hidden variables for pdf/csv export
# first with l_ to determine which columns to show
# then with the options for headings (such as transdatefrom, partnumber, ...)
- 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),
+ 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),
"$form->{db}number",
map({ "cvar_$_->{name}" } @searchable_custom_variables),
map { "l_$_" } @columns
my @options;
push @options, $locale->text('Description') . " : $form->{description}" if $form->{description};
- push @options, $locale->text('Customer') . " : $form->{customername}" if $form->{customer};
+ push @options, $locale->text('Customer') . " : $form->{customer}" if $form->{customer};
push @options, $locale->text('Customer Number') . " : $form->{customernumber}" if $form->{customernumber};
# TODO: only customer id is passed
push @options, $locale->text('Department') . " : " . (split /--/, $form->{department})[0] if $form->{department};
# stored seperately). However, for fxsellprice this method only works when
# the tax is not included, because otherwise fxsellprice includes the tax
# and there is no simple way to extract the tax rate of the article from
- # the big query.
+ # the big query.
#
# Using fxsellprice is potentially more accurate (certainly for tax
# included), because we can use the same method as is used while the
# sellprice_total_including_tax = qty * fxsellprice * (1-discount) / price_factor * exchangerate
# $ar->{sellprice_total_including_tax} = $form->round_amount( $ar->{qty} * ( $ar->{fxsellprice} * ( 1 - $ar->{discount} ) ) / $ar->{price_factor}, $form->{"decimalplaces"});
- $ar->{sellprice} = $ar->{sellprice} / $ar->{price_factor} / $basefactor;
+ $ar->{sellprice} = $ar->{sellprice} / $ar->{price_factor} / $basefactor;
$ar->{sellprice_total} = $form->round_amount( $ar->{qty} * $ar->{sellprice} / $ar->{price_factor} , $form->{"decimalplaces"});
$ar->{lastcost} = $ar->{lastcost} / $ar->{price_factor} / $basefactor;