X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Far.pl;h=8b75b2da9122573bc779ef06661572c08bc86413;hb=84da0ba2f48ac09652557a5aca1a912b06fb0b0b;hp=eaa0f2224abe8f7729b062db2a2f053d86fed3e1;hpb=456a81dd3b5ccd8b4a48ea166d465ca2b9fb5b6b;p=kivitendo-erp.git
diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl
index eaa0f2224..8b75b2da9 100644
--- a/bin/mozilla/ar.pl
+++ b/bin/mozilla/ar.pl
@@ -37,6 +37,7 @@ use SL::PE;
use Data::Dumper;
require "$form->{path}/arap.pl";
+require "bin/mozilla/common.pl";
1;
@@ -79,6 +80,7 @@ sub add {
unless $form->{callback};
&create_links;
+ AR->get_transdate(\%myconfig, $form);
&display_form;
$lxdebug->leave_sub();
@@ -111,14 +113,17 @@ sub create_links {
$duedate = $form->{duedate};
$taxincluded = $form->{taxincluded};
-
+ my $id = $form->{id};
IS->get_customer(\%myconfig, \%$form);
+ $form->{taxincluded} = $taxincluded;
+ $form->{id} = $id;
$form->{duedate} = $duedate if $duedate;
$form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
- $form->{rowcount} = 1;
+ $form->{rowcount} = 1;
+
# currencies
- @curr = split /:/, $form->{currencies};
+ @curr = split(/:/, $form->{currencies});
chomp $curr[0];
$form->{defaultcurrency} = $curr[0];
@@ -156,7 +161,7 @@ sub create_links {
map {
$tax .=
- qq|\n";
} else {
$form->{"select$key"} .=
- "\n";
+ "\n";
}
}
@@ -182,7 +187,7 @@ sub create_links {
# if there is a value we have an old entry
my $j = 0;
my $k = 0;
- print(STDERR Dumper($form->{acc_trans}));
+
for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
if ($key eq "AR_paid") {
$j++;
@@ -199,13 +204,14 @@ 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;
$akey =~ s/AR_//;
- if ($key eq "AR_tax") {
+ if ($key eq "AR_tax" || $key eq "AP_tax") {
$form->{"${key}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} =
"$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
$form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} =
@@ -223,11 +229,10 @@ sub create_links {
$form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"};
$withholdingrate +=
$form->{"$form->{acc_trans}{$key}->[$i-1]->{accno}_rate"};
- }
- print(STDERR $form->{acc_trans}{$key}->[$i - 1]->{amount}, " ACC_TRANS\n");
- print(STDERR "$key KEY, $k Zeile\n");
+ }
$index = $form->{acc_trans}{$key}->[$i - 1]->{index};
$form->{"tax_$index"} = $form->{acc_trans}{$key}->[$i - 1]->{amount};
+ $totaltax += $form->{"tax_$index"};
} else {
$k++;
@@ -249,14 +254,14 @@ sub create_links {
"$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}"} =~
- /