X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=2094ead3ac34c7bce7ca99ec54a91d92392667e0;hb=09fe7f33a735ecc3f4a3112ad716f674983b00cc;hp=77c83f21283236795394968c695586e72dd2991d;hpb=2dc09cf507b099b014a405001a6d67aa58cd124d;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 77c83f212..2094ead3a 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -32,7 +32,7 @@ #====================================================================== use POSIX qw(strftime); -use List::Util qw(sum); +use List::Util qw(sum first); use SL::AR; use SL::FU; @@ -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(); + + $main::auth->assert('general_ledger'); - $auth->assert('general_ledger'); + my $form = $main::form; + my %myconfig = %main::myconfig; - return $lxdebug->leave_sub() if (load_draft_maybe()); + return $main::lxdebug->leave_sub() if (load_draft_maybe()); # saving the history if(!exists $form->{addition} && ($form->{id} ne "")) { @@ -96,8 +94,8 @@ sub add { $form->{addition} = "ADDED"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history - + # /saving the history + $form->{title} = "Add"; $form->{callback} = "ar.pl?action=add" unless $form->{callback}; @@ -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(); - $auth->assert('general_ledger'); + $main::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(); + + $main::auth->assert('general_ledger'); - $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); @@ -168,30 +173,30 @@ sub create_links { map { $form->{selectcurrency} .= "