X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Farap.pl;h=7952922f62735ea361d64c90fd841e61d59f1add;hb=270df90017196116ff80fc2b917bb23aca5ca994;hp=48cb61027c15c80499c1c462c35f268afa9c20ba;hpb=82c784869fbfc8a746a0ee0662947f189f021993;p=kivitendo-erp.git diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl index 48cb61027..7952922f6 100644 --- a/bin/mozilla/arap.pl +++ b/bin/mozilla/arap.pl @@ -31,15 +31,17 @@ # # any custom scripts for this one -if (-f "$form->{path}/custom_arap.pl") { - eval { require "$form->{path}/custom_arap.pl"; }; +if (-f "bin/mozilla/custom_arap.pl") { + eval { require "bin/mozilla/custom_arap.pl"; }; } -if (-f "$form->{path}/$form->{login}_arap.pl") { - eval { require "$form->{path}/$form->{login}_arap.pl"; }; +if (-f "bin/mozilla/$form->{login}_arap.pl") { + eval { require "bin/mozilla/$form->{login}_arap.pl"; }; } 1; +require "bin/mozilla/common.pl"; + # end of main sub check_name { @@ -47,6 +49,8 @@ sub check_name { my ($name) = @_; + $name = $name eq "customer" ? "customer" : "vendor"; + my ($new_name, $new_id) = split /--/, $form->{$name}; my $i = 0; # if we use a selection @@ -101,6 +105,8 @@ sub check_name { } else { # name is not on file + # $locale->text('Customer not on file or locked!') + # $locale->text('Vendor not on file or locked!') $msg = ucfirst $name . " not on file or locked!"; $form->error($locale->text($msg)); } @@ -272,7 +278,7 @@ sub add_transaction { sub check_project { $lxdebug->enter_sub(); - for $i (0 .. $form->{rowcount}) { + for $i (1 .. $form->{rowcount}) { my $suffix = $i ? "_$i" : ""; my $prefix = $i ? "" : "global"; $form->{"${prefix}project_id${suffix}"} = "" unless $form->{"${prefix}projectnumber$suffix"}; @@ -441,7 +447,7 @@ sub project_selected { map { delete $form->{$_} } qw(ndx lastndx nextsub is_global); if ($form->{update}) { - &{ $form->{update} }; + call_sub($form->{"update"}); } else { &update; } @@ -449,7 +455,7 @@ sub project_selected { $lxdebug->leave_sub(); } -sub continue { &{ $form->{nextsub} } } +sub continue { call_sub($form->{"nextsub"}); } sub gl_transaction { &add } sub ar_transaction { &add_transaction('ar') } sub ap_transaction { &add_transaction('ap') }