From a11d7a85a9b73798acb3a11b6ba4251ba331b19c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 10 Jun 2013 14:58:15 +0200 Subject: [PATCH] =?utf8?q?Implementiert=20Ticket=201897=20Zukunftsbuchunge?= =?utf8?q?n=20vermeiden=20Die=20Pr=C3=BCfungen=20f=C3=BCr=20den=20Zeitraum?= =?utf8?q?=20in=20allen=20Belegmasken=20umgesetzt.=20Zusammen=20mit=20Comm?= =?utf8?q?it=20f552f878c85828a408d7f32afbbc1e714270b85f=20wird=20das=20Tic?= =?utf8?q?ket=201897=20geschlossen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/AM.pm | 8 ++++---- bin/mozilla/ap.pl | 3 +++ bin/mozilla/ar.pl | 3 +++ bin/mozilla/gl.pl | 3 +++ bin/mozilla/ir.pl | 2 ++ bin/mozilla/is.pl | 2 ++ 6 files changed, 17 insertions(+), 4 deletions(-) diff --git a/SL/AM.pm b/SL/AM.pm index 4934d866c..5a9f2365b 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -1313,11 +1313,11 @@ sub closedto { my $dbh = $form->dbconnect($myconfig); - my $query = qq|SELECT closedto, revtrans FROM defaults|; + my $query = qq|SELECT closedto, max_future_booking_interval, revtrans FROM defaults|; my $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); - ($form->{closedto}, $form->{revtrans}) = $sth->fetchrow_array; + ($form->{closedto}, $form->{max_future_booking_interval}, $form->{revtrans}) = $sth->fetchrow_array; $sth->finish; @@ -1339,8 +1339,8 @@ sub closebooks { $query = qq|UPDATE defaults SET closedto = NULL, revtrans = '1'|; } elsif ($form->{closedto}) { - $query = qq|UPDATE defaults SET closedto = ?, revtrans = '0'|; - @values = (conv_date($form->{closedto})); + $query = qq|UPDATE defaults SET closedto = ?, max_future_booking_interval = ?, revtrans = '0'|; + @values = (conv_date($form->{closedto}), conv_date($form->{max_future_booking_interval})); } else { $query = qq|UPDATE defaults SET closedto = NULL, revtrans = '0'|; diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 923e14005..e566ea6f7 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -621,6 +621,9 @@ sub post { my $closedto = $form->datetonum($form->{closedto}, \%myconfig); my $transdate = $form->datetonum($form->{transdate}, \%myconfig); + + $form->error($locale->text('Cannot post transaction above the maximum future booking date!')) + if ($form->date_max_future($form->{"transdate"}, \%myconfig)); $form->error($locale->text('Cannot post transaction for a closed period!')) if ($form->date_closed($form->{"transdate"}, \%myconfig)); my $zero_amount_posting = 1; diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index f5ea6c429..e1b10f63c 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -669,6 +669,9 @@ sub post { my $closedto = $form->datetonum($form->{closedto}, \%myconfig); my $transdate = $form->datetonum($form->{transdate}, \%myconfig); + + $form->error($locale->text('Cannot post transaction above the maximum future booking date!')) + if ($form->date_max_future($transdate, \%myconfig)); $form->error($locale->text('Cannot post transaction for a closed period!')) if ($form->date_closed($form->{"transdate"}, \%myconfig)); $form->error($locale->text('Zero amount posting!')) diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 4c97bd028..c508ff1f7 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -1115,6 +1115,9 @@ sub post_transaction { $form->{taxincluded} = 0 if !$taxtotal; # this is just for the wise guys + + $form->error($locale->text('Cannot post transaction above the maximum future booking date!')) + if ($form->date_max_future($form->{"transdate"}, \%myconfig)); $form->error($locale->text('Cannot post transaction for a closed period!')) if ($form->date_closed($form->{"transdate"}, \%myconfig)); if ($form->round_amount($debit, 2) != $form->round_amount($credit, 2)) { diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 4209fdf6a..b226bb011 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -722,6 +722,8 @@ sub post { my $invdate = $form->datetonum($form->{invdate}, \%myconfig); my $max_datepaid = _max_datepaid(); + $form->error($locale->text('Cannot post transaction above the maximum future booking date!')) + if ($form->date_max_future($invdate, \%myconfig)); $form->error($locale->text('Cannot post invoice for a closed period!')) if $max_datepaid && $form->date_closed($max_datepaid, \%myconfig); $form->isblank("exchangerate", $locale->text('Exchangerate missing!')) diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index cbddde60d..220c993aa 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -716,6 +716,8 @@ sub post { my $closedto = $form->datetonum($form->{closedto}, \%myconfig); my $invdate = $form->datetonum($form->{invdate}, \%myconfig); + $form->error($locale->text('Cannot post transaction above the maximum future booking date!')) + if ($form->date_max_future($invdate, \%myconfig)); $form->error($locale->text('Cannot post invoice for a closed period!')) if ($invdate <= $closedto); -- 2.20.1