X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/d05e1443a5514d24bf0cfc6833c6f06d2adf6df7..fbbfd3ce7bdc893ac30638cce1427938276b659b:/bin/mozilla/ar.pl diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 444f7f92a..059bfc415 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -45,7 +45,6 @@ use SL::ReportGenerator; require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; -require "bin/mozilla/drafts.pl"; require "bin/mozilla/reportgenerator.pl"; use strict; @@ -87,8 +86,6 @@ sub add { my $form = $main::form; my %myconfig = %main::myconfig; - return $main::lxdebug->leave_sub() if (load_draft_maybe()); - # saving the history if(!exists $form->{addition} && ($form->{id} ne "")) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; @@ -98,7 +95,7 @@ sub add { # /saving the history $form->{title} = "Add"; - $form->{callback} = "ar.pl?action=add&DONT_LOAD_DRAFT=1" unless $form->{callback}; + $form->{callback} = "ar.pl?action=add" unless $form->{callback}; AR->get_transdate(\%myconfig, $form); $form->{initial_transdate} = $form->{transdate}; @@ -332,7 +329,8 @@ sub form_header { $form->{javascript} .= qq|| . - qq||; + qq|| . + qq||; # $amount = $locale->text('Amount'); # $project = $locale->text('Project'); @@ -437,6 +435,11 @@ sub form_header { : SL::DB::Default->get->payments_changeable == 2 ? $payment->{gldate} eq '' || $payment->{gldate} eq $now : 1; + #deaktivieren von gebuchten Zahlungen ausserhalb der Bücherkontrolle, vorher prüfen ob heute eingegeben + if ($form->date_closed($payment->{"gldate_$i"})) { + $payment->{changeable} = 0; + } + push @payments, $payment; } @@ -563,8 +566,6 @@ sub update { $form->{invdate} = $form->{transdate}; - $form->{invdate} = $form->{transdate}; - my %saved_variables = map +( $_ => $form->{$_} ), qw(AR AR_amount_1 taxchart_1 customer_id notes); &check_name("customer"); @@ -628,7 +629,13 @@ sub post_payment { $form->isblank("datepaid_$i", $locale->text('Payment date missing!')); - $form->error($locale->text('Cannot post payment for a closed period!')) if ($form->date_closed($form->{"datepaid_$i"}, \%myconfig)); + $form->error($locale->text('Cannot post transaction above the maximum future booking date!')) + if ($form->date_max_future($form->{"datepaid_$i"}, \%myconfig)); + + #Zusätzlich noch das Buchungsdatum in die Bücherkontrolle einbeziehen + # (Dient zur Prüfung ob ZE oder ZA geprüft werden soll) + $form->error($locale->text('Cannot post payment for a closed period!')) + if ($form->date_closed($form->{"datepaid_$i"}) && !$form->date_closed($form->{"gldate_$i"}, \%myconfig)); if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) { # $form->{"exchangerate_$i"} = $form->{exchangerate} if ($invdate == $datepaid); @@ -693,6 +700,7 @@ sub post { $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!')) @@ -709,8 +717,13 @@ sub post { $form->isblank("datepaid_$i", $locale->text('Payment date missing!')); + $form->error($locale->text('Cannot post transaction above the maximum future booking date!')) + if ($form->date_max_future($form->{"datepaid_$i"}, \%myconfig)); + + #Zusätzlich noch das Buchungsdatum in die Bücherkontrolle einbeziehen + # (Dient zur Prüfung ob ZE oder ZA geprüft werden soll) $form->error($locale->text('Cannot post payment for a closed period!')) - if ($form->date_closed($form->{"datepaid_$i"}, \%myconfig)); + if ($form->date_closed($form->{"datepaid_$i"}) && !$form->date_closed($form->{"gldate_$i"}, \%myconfig)); if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) { $form->{"exchangerate_$i"} = $form->{exchangerate} if ($transdate == $datepaid); @@ -723,7 +736,7 @@ sub post { my ($customer) = split /--/, $form->{customer}; if ($form->{oldcustomer} ne "$customer--$form->{customer_id}") { update(); - ::end_of_request(); + $::dispatcher->end_request; } $form->{AR}{receivables} = $form->{ARselected}; @@ -740,7 +753,6 @@ sub post { $form->save_history; } # /saving the history - remove_draft() if $form->{remove_draft}; $form->redirect($locale->text('Transaction posted!')) unless $inline;