X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FController%2FCustomerVendor.pm;h=2fabe1433bee39a88a78911a55323526d7bc6b12;hb=88abef92ceaa2f2f297eb0b2a9a64418bed97ba7;hp=23c903687cae5200f139ca323821766f677aa496;hpb=e72ecdf83cabbb6f630ec33efd15e7615b69a676;p=kivitendo-erp.git diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index 23c903687..2fabe1433 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -146,7 +146,21 @@ sub action_save { $self->_save(); - $self->redirect_to(action => 'edit', id => $self->{cv}->id, db => $self->is_vendor() ? 'vendor' : 'customer'); + my @redirect_params = ( + action => 'edit', + id => $self->{cv}->id, + db => ($self->is_vendor() ? 'vendor' : 'customer'), + ); + + if ( $self->{contact}->cp_id ) { + push(@redirect_params, contact_id => $self->{contact}->cp_id); + } + + if ( $self->{shipto}->shipto_id ) { + push(@redirect_params, shipto_id => $self->{shipto}->shipto_id); + } + + $self->redirect_to(@redirect_params); } sub action_save_and_close { @@ -577,6 +591,11 @@ sub _instantiate_args { } $self->{cv}->assign_attributes(%{$::form->{cv}}); + if ( $self->is_customer() && $::form->{cv}->{taxincluded_checked} eq '' ) { + $self->{cv}->taxincluded_checked(undef); + } + + foreach my $cvar (@{$self->{cv}->cvars_by_config()}) { my $value = $::form->{cv_cvars}->{$cvar->config->name};