X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=76d4b3edbca01d284e4667aeba1f39422915d964;hb=844a541e0d8f59644540413f675e8f07cd154cf6;hp=551c1d8692224742846b7a8a587385de239dda65;hpb=ce73964f91267ab5eecb2832765efbb3752c2a59;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 551c1d869..76d4b3edb 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -97,7 +97,7 @@ sub add { $form->{callback} = "$form->{script}?action=add&type=$form->{type}" unless $form->{callback}; - &invoice_links; + invoice_links(is_new => 1); &prepare_invoice; &display_form; @@ -154,6 +154,7 @@ sub invoice_links { # Delay access check to after the invoice's been loaded so that # project-specific invoice rights can be evaluated. + my %params = @_; my $form = $main::form; my %myconfig = %main::myconfig; @@ -172,6 +173,8 @@ sub invoice_links { IS->get_customer(\%myconfig, \%$form); + $form->{billing_address_id} = $form->{default_billing_address_id} if $params{is_new}; + $form->restore_vars(qw(id)); IS->retrieve_invoice(\%myconfig, \%$form); @@ -731,6 +734,7 @@ sub update { $::form->{salesman_id} = SL::DB::Manager::Employee->current->id if exists $::form->{salesman_id}; IS->get_customer(\%myconfig, $form); + $::form->{billing_address_id} = $::form->{default_billing_address_id}; } $form->{taxincluded} ||= $taxincluded;