X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=7f670582c958dd88a3d19a7a7207b3d8f7f6ef2c;hb=a751b16cead5e56b62e18ee616e04323919f5fe1;hp=1e5aa98f26379b2dfee3846d90f97ad23c5cd842;hpb=590f737f0418ac7672e22efdf424265bf970f2c7;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 1e5aa98f2..7f670582c 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -38,6 +38,7 @@ use Data::Dumper; require "$form->{path}/arap.pl"; require "bin/mozilla/common.pl"; +require "bin/mozilla/drafts.pl"; 1; @@ -73,7 +74,9 @@ require "bin/mozilla/common.pl"; sub add { $lxdebug->enter_sub(); - + + return $lxdebug->leave_sub() if (load_draft_maybe()); + # saving the history if(!exists $form->{addition} && ($form->{id} ne "")) { $form->{addition} = "ADDED"; @@ -86,8 +89,10 @@ sub add { "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; - &create_links; AR->get_transdate(\%myconfig, $form); + $form->{initial_transdate} = $form->{transdate}; + &create_links; + $form->{transdate} = $form->{initial_transdate}; &display_form; $lxdebug->leave_sub(); } @@ -131,6 +136,9 @@ sub create_links { $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}"; $form->{rowcount} = 1; + # notes + $form->{notes} = $form->{intnotes} unless $form->{notes}; + # currencies @curr = split(/:/, $form->{currencies}); chomp $curr[0]; @@ -168,31 +176,10 @@ sub create_links { # build the popup menus $form->{taxincluded} = ($form->{id}) ? $form->{taxincluded} : "checked"; - map { - $tax .= - qq|\n"; - } else { - $form->{"select$key"} .= - "\n"; - } - } - - $form->{$key} = $form->{"select$key"}; - # if there is a value we have an old entry my $j = 0; my $k = 0; @@ -200,8 +187,7 @@ sub create_links { for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) { if ($key eq "AR_paid") { $j++; - $form->{"AR_paid_$j"} = - "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}"; + $form->{"AR_paid_$j"} = $form->{acc_trans}{$key}->[$i-1]->{accno}; # reverse paid $form->{"paid_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{amount} * -1; @@ -212,9 +198,9 @@ sub create_links { $form->{"forex_$j"} = $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{exchangerate}; - $form->{"AR_paid_$j"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}"; $form->{"paid_project_id_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{project_id}; $form->{paidaccounts}++; + } else { $akey = $key; @@ -259,19 +245,17 @@ sub create_links { $form->{"project_id_$k"} = "$form->{acc_trans}{$key}->[$i-1]->{project_id}"; } - $form->{"${key}_$k"} = - "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}"; $form->{"${key}_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}"; - my $q_description = quotemeta($form->{acc_trans}{$key}->[$i-1]->{description}); - $form->{"select${key}"} =~ - /