X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=a6d5cdc5c1073cfbf6c21b9e956e7101fe66fa8d;hb=6d169764351ba6f5bbf2a90f9d7a260617ab4070;hp=5fa77109e93d4d3beea042e9e9891f3284c513fc;hpb=91ea86b4c90a12c046c6eb37e0ca9f5b9672b81f;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 5fa77109e..a6d5cdc5c 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -31,14 +31,22 @@ # #====================================================================== +use POSIX qw(strftime); +use List::Util qw(sum); + use SL::AP; +use SL::FU; use SL::IR; use SL::IS; use SL::PE; +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; 1; @@ -73,15 +81,18 @@ require "bin/mozilla/drafts.pl"; # $locale->text('Dec') sub add { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; + + $main::auth->assert('general_ledger'); - return $lxdebug->leave_sub() if (load_draft_maybe()); + return $main::lxdebug->leave_sub() if (load_draft_maybe()); $form->{title} = "Add"; - $form->{callback} = - "$form->{script}?action=add&login=$form->{login}&password=$form->{password}" - unless $form->{callback}; + $form->{callback} = "ap.pl?action=add" unless $form->{callback}; AP->get_transdate(\%myconfig, $form); $form->{initial_transdate} = $form->{transdate}; @@ -89,35 +100,48 @@ sub add { $form->{transdate} = $form->{initial_transdate}; &display_form; - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } sub edit { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + my $form = $main::form; + + $main::auth->assert('general_ledger'); $form->{title} = "Edit"; &create_links; &display_form; - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } sub display_form { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + my $form = $main::form; + + $main::auth->assert('general_ledger'); &form_header; &form_footer; - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } sub create_links { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; + + $main::auth->assert('general_ledger'); $form->create_links("AP", \%myconfig, "vendor"); - $taxincluded = $form->{taxincluded}; - $duedate = $form->{duedate}; + my $taxincluded = $form->{taxincluded}; + my $duedate = $form->{duedate}; IR->get_vendor(\%myconfig, \%$form); $form->{taxincluded} = $taxincluded; @@ -132,28 +156,28 @@ sub create_links { $form->{notes} = $form->{intnotes} unless $form->{notes}; # currencies - @curr = split(/:/, $form->{currencies}); + my @curr = split(/:/, $form->{currencies}); chomp $curr[0]; $form->{defaultcurrency} = $curr[0]; map { $form->{selectcurrency} .= "