X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fap.pl;h=ae5d9d85dea5de722686fcf3103505c43bcbda69;hb=bb800c52769934354b53caa7a81ee52e88e3b4d4;hp=a252f0ec8a4b47819f0637dd6815f9d6e7d6cc26;hpb=9e06d0e40cb328336d6e7604ec06387a0e3b1ea7;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index a252f0ec8..ae5d9d85d 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -46,6 +46,8 @@ require "bin/mozilla/common.pl"; require "bin/mozilla/drafts.pl"; require "bin/mozilla/reportgenerator.pl"; +use strict; + 1; # end of main @@ -79,15 +81,18 @@ require "bin/mozilla/reportgenerator.pl"; # $locale->text('Dec') sub add { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; - $auth->assert('general_ledger'); + $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} = "ap.pl?action=add" unless $form->{callback}; + $form->{callback} = "ap.pl?action=add&DONT_LOAD_DRAFT=1" unless $form->{callback}; AP->get_transdate(\%myconfig, $form); $form->{initial_transdate} = $form->{transdate}; @@ -95,41 +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; - $auth->assert('general_ledger'); + $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(); - $auth->assert('general_ledger'); + 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; - $auth->assert('general_ledger'); + $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; @@ -144,28 +156,26 @@ 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} .= "