X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Farap.pl;h=a4e04c0015324924271139bbd31d1aea406c0e9d;hb=94f556855ab8e7ccdfcdcd7c3e2a6bf722041ebc;hp=03dd6e895d51b8e491358233763c89a12d94d298;hpb=b2945bf61775161f9ce9be9bdbd106ad44247a14;p=kivitendo-erp.git diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl index 03dd6e895..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"}) { @@ -78,6 +77,9 @@ 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'); @@ -108,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; } } @@ -119,6 +121,9 @@ sub check_name { $form->{$name} = $form->{name_list}[0]->{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'); @@ -148,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) = @_; @@ -169,15 +174,11 @@ sub select_name { my $title = $locale->text('Select from one of the names below'); print qq| -
+