X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/844a541e0d8f59644540413f675e8f07cd154cf6..00177fae5986f1de25515c7103d10fc36a38cefd:/SL/Form.pm diff --git a/SL/Form.pm b/SL/Form.pm index a95f4e0db..2e9458956 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -59,6 +59,7 @@ use SL::CVar; use SL::DB; use SL::DBConnect; use SL::DBUtils; +use SL::DB::AdditionalBillingAddress; use SL::DB::Customer; use SL::DB::Default; use SL::DB::PaymentTerm; @@ -3154,6 +3155,8 @@ sub prepare_for_printing { IS->invoice_details(\%::myconfig, $self, $::locale); } + $self->set_addition_billing_address_print_variables; + # Chose extension & set source file name my $extension = 'html'; if ($self->{format} eq 'postscript') { @@ -3221,6 +3224,17 @@ sub prepare_for_printing { return $self; } +sub set_addition_billing_address_print_variables { + my ($self) = @_; + + return if !$self->{billing_address_id}; + + my $address = SL::DB::Manager::AdditionalBillingAddress->find_by(id => $self->{billing_address_id}); + return if !$address; + + $self->{"billing_address_${_}"} = $address->$_ for map { $_->name } @{ $address->meta->columns }; +} + sub substitute_placeholders_in_template_arrays { my ($self, @fields) = @_;