X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/01b3feeb4e1e5ca3ca01840f650f10343dc4c9cc..bdaa8c2f669c9ddcc2f0c8989fed52559d59be43:/bin/mozilla/ar.pl diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 5b0273eed..90294c146 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -771,6 +771,10 @@ sub form_footer { . $locale->text('Use As Template') . qq|"> |; } + print qq| + + |; } else { if ($transdate > $closedto) { @@ -900,6 +904,36 @@ sub update { $lxdebug->leave_sub(); } +sub post_payment { + $lxdebug->enter_sub(); + for $i (1 .. $form->{paidaccounts}) { + if ($form->{"paid_$i"}) { + $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig); + + $form->isblank("datepaid_$i", $locale->text('Payment date missing!')); + + $form->error($locale->text('Cannot post payment for a closed period!')) + if ($datepaid <= $closedto); + + if ($form->{currency} ne $form->{defaultcurrency}) { + $form->{"exchangerate_$i"} = $form->{exchangerate} + if ($invdate == $datepaid); + $form->isblank("exchangerate_$i", + $locale->text('Exchangerate for payment missing!')); + } + } + } + + ($form->{AR}) = split /--/, $form->{AR}; + ($form->{AR_paid}) = split /--/, $form->{AR_paid}; + $form->redirect($locale->text(' Payment posted!')) + if (AR->post_payment(\%myconfig, \%$form)); + $form->error($locale->text('Cannot post payment!')); + + + $lxdebug->leave_sub(); +} + sub post { $lxdebug->enter_sub();