X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=a8937506f6356b0626e3ad20e142f39ee57b9aff;hb=2dacd2790bb5e0990ec5fe89a9d59370b018c25c;hp=f506cd9cfa22b2922e5bb9d6ba3b768adcdbd6c1;hpb=df682ff9e2bd3ae87bb80654743ef6622efa61ad;p=kivitendo-erp.git
diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl
index f506cd9cf..a8937506f 100644
--- a/bin/mozilla/ar.pl
+++ b/bin/mozilla/ar.pl
@@ -40,20 +40,13 @@ use SL::IS;
use SL::PE;
use SL::ReportGenerator;
-# use strict;
-#use warnings;
-
-# imports
-our ($cgi, $form, $lxdebug, $locale, %myconfig);
-
require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
require "bin/mozilla/drafts.pl";
require "bin/mozilla/reportgenerator.pl";
-1;
-
-# end of main
+use strict;
+#use warnings;
# this is for our long dates
# $locale->text('January')
@@ -83,12 +76,17 @@ require "bin/mozilla/reportgenerator.pl";
# $locale->text('Nov')
# $locale->text('Dec')
+my $totalpaid;
+
sub add {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
- $auth->assert('general_ledger');
+ $main::auth->assert('general_ledger');
- return $lxdebug->leave_sub() if (load_draft_maybe());
+ 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 "")) {
@@ -106,13 +104,15 @@ sub add {
&create_links;
$form->{transdate} = $form->{initial_transdate};
&display_form;
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub edit {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ $main::auth->assert('general_ledger');
- $auth->assert('general_ledger');
+ my $form = $main::form;
# show history button
$form->{javascript} = qq||;
@@ -123,24 +123,29 @@ sub edit {
&create_links;
&display_form;
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub display_form {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
- $auth->assert('general_ledger');
+ $main::auth->assert('general_ledger');
+
+ my $form = $main::form;
&form_header;
&form_footer;
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub create_links {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ $main::auth->assert('general_ledger');
- $auth->assert('general_ledger');
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
my ($duedate, $taxincluded, @curr);
@@ -203,13 +208,18 @@ sub create_links {
($form->datetonum($form->{transdate}, \%myconfig) <=
$form->datetonum($form->{closedto}, \%myconfig));
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub form_header {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
- $auth->assert('general_ledger');
+ $main::auth->assert('general_ledger');
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+ my $cgi = $main::cgi;
my ($title, $readonly, $exchangerate, $rows);
my ($taxincluded, $notes, $department, $customer, $employee, $amount, $project);
@@ -798,13 +808,18 @@ $jsscript
|;
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub form_footer {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ $main::auth->assert('general_ledger');
- $auth->assert('general_ledger');
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+ my $cgi = $main::cgi;
my ($transdate, $closedto);
@@ -849,7 +864,7 @@ $follow_ups_block
# ToDO: - insert a global check for stornos, so that a storno is only possible a limited time after saving it
print qq| |
- if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ar') && !IS->is_storno(\%myconfig, $form, 'ar') && (($total_paid == 0) || ($total_paid eq "")));
+ if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ar') && !IS->is_storno(\%myconfig, $form, 'ar') && (($totalpaid == 0) || ($totalpaid eq "")));
if ($form->{id}) {
if ($form->{radier}) {
@@ -897,27 +912,33 @@ $follow_ups_block