X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=28e50a2c7ccad97785a4f48783004705e68be9ed;hb=3a7079558f44e4b80670327e70b565c8caf52a0e;hp=989a568cb89737793af49e812c3dc705d3540faa;hpb=4247547d2a925ddad7006cae89e5f9f1fda7d469;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 989a568cb..28e50a2c7 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -584,6 +584,17 @@ sub set_standard_title { $::lxdebug->leave_sub; } +sub prepare_global_vars { + my ($self) = @_; + + $self->{AUTH} = $::auth; + $self->{INSTANCE_CONF} = $::instance_conf; + $self->{LOCALE} = $::locale; + $self->{LXCONFIG} = $::lx_office_conf; + $self->{LXDEBUG} = $::lxdebug; + $self->{MYCONFIG} = \%::myconfig; +} + sub _prepare_html_template { $main::lxdebug->enter_sub(); @@ -1301,6 +1312,9 @@ sub generate_attachment_filename { } elsif ($attachment_filename && $self->{"${prefix}number"}) { $attachment_filename .= "_" . $self->{"${prefix}number"} . $self->get_extension_for_format(); + } elsif ($attachment_filename) { + $attachment_filename .= $self->get_extension_for_format(); + } else { $attachment_filename = ""; } @@ -3474,9 +3488,9 @@ sub calculate_arap { if ( $selected_tax ) { if ( $buysell eq 'sell' ) { - $self->{AR_amounts}{"tax_$i"} = $selected_tax->chart->accno unless $selected_tax->taxkey == 0; + $self->{AR_amounts}{"tax_$i"} = $selected_tax->chart->accno if defined $selected_tax->chart; } else { - $self->{AP_amounts}{"tax_$i"} = $selected_tax->chart->accno unless $selected_tax->taxkey == 0; + $self->{AP_amounts}{"tax_$i"} = $selected_tax->chart->accno if defined $selected_tax->chart; }; $self->{"taxkey_$i"} = $selected_tax->taxkey;