X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Farap.pl;h=3b1a443113e2dcc28f59bfa6e715f49db5f24967;hb=6de8e1614fb03b63967d06bd8522b4b46260832e;hp=38308a97b29b539521fce216f8706f9f7cc19343;hpb=8c7e44938a661e035f62840e1e177353240ace5d;p=kivitendo-erp.git
diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl
index 38308a97b..3b1a44311 100644
--- a/bin/mozilla/arap.pl
+++ b/bin/mozilla/arap.pl
@@ -30,12 +30,16 @@
# 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/$form->{login}_arap.pl") {
- eval { require "bin/mozilla/$form->{login}_arap.pl"; };
+if (-f "bin/mozilla/$main::form->{login}_arap.pl") {
+ eval { require "bin/mozilla/$main::form->{login}_arap.pl"; };
}
1;
@@ -45,12 +49,17 @@ require "bin/mozilla/common.pl";
# end of main
sub check_name {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
- $auth->assert('general_ledger | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash');
+ $main::auth->assert('general_ledger | 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');
- my ($name) = @_;
+ my ($name, %params) = @_;
$name = $name eq "customer" ? "customer" : "vendor";
@@ -90,9 +99,17 @@ sub check_name {
$form->{calctax} = 1;
# return one name or a list of names in $form->{name_list}
- if (($i = $form->get_name(\%myconfig, $name)) > 1) {
- &select_name($name);
- exit;
+ $i = $form->get_name(\%myconfig, $name);
+
+ if ($i > 1) {
+ if ($params{no_select}) {
+ # $locale->text('Customer')
+ # $locale->text('Vendor')
+ $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();
+ }
}
if ($i == 1) {
@@ -110,14 +127,14 @@ sub check_name {
# 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!";
+ my $msg = ucfirst $name . " not on file or locked!";
$form->error($locale->text($msg));
}
}
}
$form->language_payment(\%myconfig);
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
return $i;
}
@@ -126,16 +143,20 @@ sub check_name {
# $locale->text('Vendor not on file!')
sub select_name {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my $locale = $main::locale;
- $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 |' .
'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash');
my ($table) = @_;
- @column_index = qw(ndx name address);
+ my @column_index = qw(ndx name address);
- $label = ucfirst $table;
+ my $label = ucfirst $table;
+ my %column_data;
$column_data{ndx} = qq|
|;
$column_data{name} =
qq|
| . $locale->text($label) . qq|
|;
@@ -145,7 +166,7 @@ sub select_name {
# list items with radio button on a form
$form->header;
- $title = $locale->text('Select from one of the names below');
+ my $title = $locale->text('Select from one of the names below');
print qq|
@@ -160,17 +181,18 @@ sub select_name {