X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Farap.pl;h=073b51c72f2db2f3ce7311cd821899f8ce0236ac;hb=82ab26a0d201bf24aba85e058e1cb23928a4b44a;hp=e7e2378a9e80eb4158d554fc4ccdc3461dd88676;hpb=ee072e4f077213bf6f8792ca8f0a1afebbb6282f;p=kivitendo-erp.git diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl index e7e2378a9..073b51c72 100644 --- a/bin/mozilla/arap.pl +++ b/bin/mozilla/arap.pl @@ -49,13 +49,12 @@ sub check_name { my ($new_name, $new_id) = split /--/, $form->{$name}; my $i = 0; - # if we use a selection if ($form->{"select$name"}) { if ($form->{"old$name"} ne $form->{$name}) { # this is needed for is, ir and oe - + $form->{update} = 0; # for credit calculations $form->{oldinvtotal} = 0; $form->{oldtotalpaid} = 0; @@ -76,6 +75,7 @@ sub check_name { if ($form->{"old$name"} ne qq|$form->{$name}--$form->{"${name}_id"}|) { # this is needed for is, ir and oe + $form->{update} = 0; # for credit calculations $form->{oldinvtotal} = 0; @@ -106,6 +106,7 @@ sub check_name { } } } + $form->language_payment(\%myconfig); $lxdebug->leave_sub(); @@ -236,7 +237,7 @@ sub name_selected { # delete all the new_ variables for $i (1 .. $form->{lastndx}) { - map { delete $form->{"new_${_}_$i"} } (id, name); + map { delete $form->{"new_${_}_$i"} } qw(id name); } map { delete $form->{$_} } qw(ndx lastndx nextsub); @@ -272,25 +273,28 @@ sub check_project { $lxdebug->enter_sub(); for $i (1 .. $form->{rowcount}) { - $form->{"project_id_$i"} = "" unless $form->{"projectnumber_$i"}; - if ($form->{"projectnumber_$i"} ne $form->{"oldprojectnumber_$i"}) { - if ($form->{"projectnumber_$i"}) { + my $suffix = $i ? "_$i" : ""; + my $prefix = $i ? "" : "global"; + $form->{"${prefix}project_id${suffix}"} = "" unless $form->{"${prefix}projectnumber$suffix"}; + if ($form->{"${prefix}projectnumber${suffix}"} ne $form->{"old${prefix}projectnumber${suffix}"}) { + if ($form->{"${prefix}projectnumber${suffix}"}) { # get new project - $form->{projectnumber} = $form->{"projectnumber_$i"}; + $form->{projectnumber} = $form->{"${prefix}projectnumber${suffix}"}; if (($rows = PE->projects(\%myconfig, $form)) > 1) { # check form->{project_list} how many there are $form->{rownumber} = $i; - &select_project; + &select_project($i ? undef : 1); exit; } if ($rows == 1) { - $form->{"project_id_$i"} = $form->{project_list}->[0]->{id}; - $form->{"projectnumber_$i"} = + $form->{"${prefix}project_id${suffix}"} = + $form->{project_list}->[0]->{id}; + $form->{"${prefix}projectnumber${suffix}"} = $form->{project_list}->[0]->{projectnumber}; - $form->{"oldprojectnumber_$i"} = + $form->{"old${prefix}projectnumber${suffix}"} = $form->{project_list}->[0]->{projectnumber}; } else { @@ -298,7 +302,7 @@ sub check_project { $form->error($locale->text('Project not on file!')); } } else { - $form->{"oldprojectnumber_$i"} = ""; + $form->{"old${prefix}projectnumber${suffix}"} = ""; } } } @@ -309,6 +313,8 @@ sub check_project { sub select_project { $lxdebug->enter_sub(); + my ($is_global) = @_; + @column_index = qw(ndx projectnumber description); $column_data{ndx} = qq|