epic-ts
[kivitendo-erp.git] / bin / mozilla / arap.pl
index 67b1c48..75764a4 100644 (file)
@@ -36,8 +36,8 @@ use strict;
 if (-f "bin/mozilla/custom_arap.pl") {
   eval { require "bin/mozilla/custom_arap.pl"; };
 }
-if (-f "bin/mozilla/$main::form->{login}_arap.pl") {
-  eval { require "bin/mozilla/$main::form->{login}_arap.pl"; };
+if (-f "bin/mozilla/$::myconfig{login}_arap.pl") {
+  eval { require "bin/mozilla/$::myconfig{login}_arap.pl"; };
 }
 
 1;
@@ -77,6 +77,8 @@ sub check_name {
       $form->{"${name}_id"} = $new_id;
 
       _reset_salesman_id();
+      delete @{ $form }{qw(payment_id)};
+
       IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer');
       IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor');
 
@@ -119,6 +121,8 @@ sub check_name {
         $form->{"old$name"}   = qq|$form->{$name}--$form->{"${name}_id"}|;
 
         _reset_salesman_id();
+        delete @{ $form }{qw(payment_id)};
+
         IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer');
         IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor');