X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Farap.pl;h=a4e04c0015324924271139bbd31d1aea406c0e9d;hb=863eb4303398caba2ab429475a69e09601919150;hp=fe5fa2d27634a6a4293f916c9bcab2912b627e07;hpb=57ac7b3c45f98e44a8bd8452da70ac7fba182ca4;p=kivitendo-erp.git diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl index fe5fa2d27..a4e04c001 100644 --- a/bin/mozilla/arap.pl +++ b/bin/mozilla/arap.pl @@ -24,22 +24,21 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # 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; @@ -55,7 +54,7 @@ sub check_name { my %myconfig = %main::myconfig; my $locale = $main::locale; - $main::auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit |' . + $main::auth->assert('ar_transactions | ap_transactions | vendor_invoice_edit | sales_order_edit | invoice_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash |' . 'purchase_delivery_order_edit | sales_delivery_order_edit'); @@ -63,7 +62,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 +78,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 +110,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 +122,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 +153,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('ar_transactions| ap_transactions | 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 +174,11 @@ sub select_name { my $title = $locale->text('Select from one of the names below'); print qq| +