X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=9fdf2bc8ca433a128cef1812eb8d95fa6b64d54c;hb=b2945bf61775161f9ce9be9bdbd106ad44247a14;hp=c41068046edafedcf49eaa7422e4dc60fa9a46f3;hpb=8f8ad003294a3a8277500ca7ec436f9f92999de2;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index c41068046..9fdf2bc8c 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,21 +76,26 @@ 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 "")) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; - $form->{addition} = "ADDED"; - $form->save_history($form->dbconnect(\%myconfig)); + $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,26 +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'); - $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(); - $auth->assert('general_ledger'); + $main::auth->assert('general_ledger'); - my ($duedate, $taxincluded, @curr); + my $form = $main::form; + my %myconfig = %main::myconfig; + + my ($duedate, $taxincluded); $form->create_links("AR", \%myconfig, "customer"); $duedate = $form->{duedate}; @@ -161,37 +166,35 @@ sub create_links { $form->{notes} = $form->{intnotes} unless $form->{notes}; # currencies - @curr = split(/:/, $form->{currencies}); - chomp $curr[0]; - $form->{defaultcurrency} = $curr[0]; + $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); - map { $form->{selectcurrency} .= "