X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=8b32585a0bce450a465ad0749e1f0d9a091b3148;hb=2bc081d8f636bf558b7f3eb8bb9e4e99d45e6ca1;hp=c815dd0f1f04af621f946e6cd7def34a744d765f;hpb=e6ffa928b78feb3cf0fa2c38da388144543a76dd;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index c815dd0f1..8b32585a0 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -972,6 +972,8 @@ sub post_payment { $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); + my $invdate = $form->datetonum($form->{transdate}, \%myconfig); + for my $i (1 .. $form->{paidaccounts}) { if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) { my $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig); @@ -983,7 +985,7 @@ sub post_payment { if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) { $form->{"exchangerate_$i"} = $form->{exchangerate} - if ($form->{transdate} == $datepaid); + if ($invdate == $datepaid); $form->isblank("exchangerate_$i", $locale->text('Exchangerate for payment missing!')); } @@ -1079,7 +1081,7 @@ sub post { if(!exists $form->{addition} && $form->{id} ne "") { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "POSTED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history remove_draft() if $form->{remove_draft}; @@ -1105,7 +1107,7 @@ sub post_as_new { if(!exists $form->{addition} && $form->{id} ne "") { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "POSTED AS NEW"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history &post; @@ -1188,7 +1190,7 @@ sub yes { if(!exists $form->{addition}) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "DELETED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history $form->redirect($locale->text('Transaction deleted!')); @@ -1431,7 +1433,7 @@ sub storno { if(!exists $form->{addition} && $form->{id} ne "") { $form->{snumbers} = "ordnumber_$form->{ordnumber}"; $form->{addition} = "STORNO"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history