X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fap.pl;h=439530ada1f477ab0edbf34a78132d27d7c496fd;hb=da10bf753ae49b8322e79fc1bb9276a092403b9a;hp=b9fcc6fec9735005dfe190523171a64f2b8b47f6;hpb=f037ceed1ec9f885ef3078bac0705a915c88aeda;p=kivitendo-erp.git
diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl
index b9fcc6fec..439530ada 100644
--- a/bin/mozilla/ap.pl
+++ b/bin/mozilla/ap.pl
@@ -36,6 +36,8 @@ use SL::IR;
use SL::PE;
require "$form->{path}/arap.pl";
+require "bin/mozilla/common.pl";
+require "bin/mozilla/drafts.pl";
1;
@@ -72,13 +74,18 @@ require "$form->{path}/arap.pl";
sub add {
$lxdebug->enter_sub();
+ return $lxdebug->leave_sub() if (load_draft_maybe());
+
$form->{title} = "Add";
$form->{callback} =
"$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}"
unless $form->{callback};
+ AP->get_transdate(\%myconfig, $form);
+ $form->{initial_transdate} = $form->{transdate};
&create_links;
+ $form->{transdate} = $form->{initial_transdate};
&display_form;
$lxdebug->leave_sub();
@@ -86,6 +93,9 @@ sub add {
sub edit {
$lxdebug->enter_sub();
+ # show history button
+ $form->{javascript} = qq||;
+ #/show hhistory button
$form->{title} = "Edit";
@@ -112,7 +122,7 @@ sub create_links {
$duedate = $form->{duedate};
IR->get_vendor(\%myconfig, \%$form);
-
+ $form->{taxincluded} = $taxincluded;
$form->{duedate} = $duedate if $duedate;
$form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}";
$form->{rowcount} = 1;
@@ -120,16 +130,11 @@ sub create_links {
# build the popup menus
$form->{taxincluded} = ($form->{id}) ? $form->{taxincluded} : "checked";
- map {
- $tax .=
- qq|\n";
} else {
$form->{"select$key"} .=
- "\n";
+ "\n";
}
}
@@ -191,6 +196,7 @@ sub create_links {
$form->{"forex_$j"} = $form->{"exchangerate_$i"} =
$form->{acc_trans}{$key}->[$i - 1]->{exchangerate};
$form->{"AP_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 {
@@ -208,8 +214,6 @@ sub create_links {
if ($form->{"$form->{acc_trans}{$key}->[$i-1]->{accno}_rate"} > 0) {
$totaltax +=
$form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"};
- $taxrate +=
- $form->{"$form->{acc_trans}{$key}->[$i-1]->{accno}_rate"};
} else {
$totalwithholding +=
$form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"};
@@ -239,15 +243,19 @@ sub create_links {
}
$form->{"${key}_$k"} =
"$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}"} =~
- /