X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Farap.pl;h=29cad3977e96440f5811040f9ed7bbb607d3c135;hb=6768ddad54d2a675939e1167536f4943628de2bb;hp=fe5fa2d27634a6a4293f916c9bcab2912b627e07;hpb=dc72886da9000319fb591feb143d25d344bfecec;p=kivitendo-erp.git diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl index fe5fa2d27..29cad3977 100644 --- a/bin/mozilla/arap.pl +++ b/bin/mozilla/arap.pl @@ -30,16 +30,14 @@ # common routines for gl, ar, ap, is, ir, oe # -use SL::Projects; - use strict; # any custom scripts for this one 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; @@ -63,7 +61,7 @@ sub check_name { $name = $name eq "customer" ? "customer" : "vendor"; - my ($new_name, $new_id) = split /--/, $form->{$name}; + my ($new_name,$new_id) = $form->{$name} =~ /^(.*?)--(\d+)$/; my $i = 0; # if we use a selection if ($form->{"select$name"}) { @@ -79,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'); @@ -109,7 +109,7 @@ sub check_name { $form->error($locale->text("More than one #1 found matching, please be more specific.", $locale->text(ucfirst $name))); } else { &select_name($name); - ::end_of_request(); + $::dispatcher->end_request; } } @@ -121,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'); @@ -150,7 +152,7 @@ sub select_name { my $form = $main::form; my $locale = $main::locale; - $main::auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit |' . + $main::auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit | sales_delivery_order_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash'); my ($table) = @_; @@ -171,13 +173,11 @@ sub select_name { my $title = $locale->text('Select from one of the names below'); print qq| +