X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Far.pl;h=4634cb19d48ffe550a69c89833e23f381c62aa3e;hb=7743b3ab885b485ae317338c55da427b62ab457d;hp=eaa0f2224abe8f7729b062db2a2f053d86fed3e1;hpb=de65162142f6a4341bd56db0ab13645924639f3b;p=kivitendo-erp.git
diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl
index eaa0f2224..4634cb19d 100644
--- a/bin/mozilla/ar.pl
+++ b/bin/mozilla/ar.pl
@@ -79,6 +79,7 @@ sub add {
unless $form->{callback};
&create_links;
+ AR->get_transdate(\%myconfig, $form);
&display_form;
$lxdebug->leave_sub();
@@ -111,14 +112,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 +160,7 @@ sub create_links {
map {
$tax .=
- qq|\n";
} else {
$form->{"select$key"} .=
- "\n";
+ "\n";
}
}
@@ -182,7 +186,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++;
@@ -205,7 +209,7 @@ sub create_links {
$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 +227,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 +252,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}"} =~
- /