X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=2094ead3ac34c7bce7ca99ec54a91d92392667e0;hb=09fe7f33a735ecc3f4a3112ad716f674983b00cc;hp=8119a8ac2e77774462d013a7058d8876e83008b4;hpb=d7f060429e809653d45e93e86b3c5c8d7129e0a9;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 8119a8ac2..2094ead3a 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -31,18 +31,22 @@ # #====================================================================== +use POSIX qw(strftime); +use List::Util qw(sum first); + use SL::AR; +use SL::FU; use SL::IS; use SL::PE; -use Data::Dumper; +use SL::ReportGenerator; 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') @@ -72,10 +76,17 @@ require "bin/mozilla/drafts.pl"; # $locale->text('Nov') # $locale->text('Dec') +my $totalpaid; + sub add { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); - return $lxdebug->leave_sub() if (load_draft_maybe()); + $main::auth->assert('general_ledger'); + + 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 "")) { @@ -83,23 +94,26 @@ sub add { $form->{addition} = "ADDED"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history - + # /saving the history + $form->{title} = "Add"; - $form->{callback} = - "$form->{script}?action=add&login=$form->{login}&password=$form->{password}" - unless $form->{callback}; + $form->{callback} = "ar.pl?action=add" unless $form->{callback}; AR->get_transdate(\%myconfig, $form); $form->{initial_transdate} = $form->{transdate}; &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'); + + my $form = $main::form; + # show history button $form->{javascript} = qq||; #/show hhistory button @@ -109,20 +123,31 @@ 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'); + + 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'); + + my $form = $main::form; + my %myconfig = %main::myconfig; + + my ($duedate, $taxincluded, @curr); $form->create_links("AR", \%myconfig, "customer"); $duedate = $form->{duedate}; @@ -148,151 +173,60 @@ sub create_links { map { $form->{selectcurrency} .= "