X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=27b18e400fc77f1111e30112c5679d57d4fc7e6c;hb=e2b9e1737230c4e4209904784808dcaec723f730;hp=8f380aa20238e34b61d311c3e4fafd3ed32d2aba;hpb=3eefb02ff31b84dab46ce3ae391e9de1b3fa25f1;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 8f380aa20..27b18e400 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -44,23 +44,28 @@ use CGI; use Data::Dumper; -1; - require "bin/mozilla/common.pl"; +use strict; + +1; + # end of main -sub add { call_sub("add_$form->{type}"); } -sub delete { call_sub("delete_$form->{type}"); } -sub save { call_sub("save_$form->{type}"); } -sub edit { call_sub("edit_$form->{type}"); } -sub continue { call_sub($form->{"nextsub"}); } -sub save_as_new { call_sub("save_as_new_$form->{type}"); } +sub add { call_sub("add_$main::form->{type}"); } +sub delete { call_sub("delete_$main::form->{type}"); } +sub save { call_sub("save_$main::form->{type}"); } +sub edit { call_sub("edit_$main::form->{type}"); } +sub continue { call_sub($main::form->{"nextsub"}); } +sub save_as_new { call_sub("save_as_new_$main::form->{type}"); } sub add_account { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; - $auth->assert('config'); + $main::auth->assert('config'); $form->{title} = "Add"; $form->{charttype} = "A"; @@ -71,13 +76,16 @@ sub add_account { &account_header; &form_footer; - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } sub edit_account { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; - $auth->assert('config'); + $main::auth->assert('config'); $form->{title} = "Edit"; AM->get_account(\%myconfig, \%$form); @@ -89,13 +97,17 @@ sub edit_account { &account_header; &form_footer; - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } sub account_header { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); - $auth->assert('config'); + my $form = $main::form; + my %myconfig = %main::myconfig; + my $locale = $main::locale; + + $main::auth->assert('config'); if ( $form->{action} eq 'edit_account') { $form->{account_exists} = '1'; @@ -122,7 +134,7 @@ sub account_header { } # Fill in empty row for new Taxkey - $newtaxkey_ref = { + my $newtaxkey_ref = { id => '', chart_id => '', accno => '', @@ -182,11 +194,11 @@ sub account_header { } # Newaccount Folgekonto - if (@{ $form->{NEWACCOUNT} }) { + if (@{ $form->{NEWACCOUNT} || [] }) { if (!$form->{new_chart_valid}) { $form->{selectnewaccount} = qq||; } - foreach $item (@{ $form->{NEWACCOUNT} }) { + foreach my $item (@{ $form->{NEWACCOUNT} }) { if ($item->{id} == $form->{new_chart_id}) { $form->{selectnewaccount} .= qq||; @@ -198,8 +210,9 @@ sub account_header { } } - $select_eur = q|\n|; - %eur = (1 => "Umsatzerlöse", + my $select_eur = q|\n|; + my %eur = ( + 1 => "Umsatzerlöse", 2 => "sonstige Erlöse", 3 => "Privatanteile", 4 => "Zinserträge", @@ -230,8 +243,8 @@ sub account_header { 29 => "Zinsaufwand", 30 => "Ausserordentlicher Aufwand", 31 => "Betriebliche Steuern"); - foreach $item (sort({ $a <=> $b } keys(%eur))) { - my $text = H(SL::Iconv::convert("ISO-8859-15", $dbcharset, $eur{$item})); + foreach my $item (sort({ $a <=> $b } keys(%eur))) { + my $text = H(SL::Iconv::convert("ISO-8859-15", $main::dbcharset, $eur{$item})); if ($item == $form->{pos_eur}) { $select_eur .= qq|\n|; } else { @@ -240,9 +253,10 @@ sub account_header { } - $select_bwa = q|\n|; + my $select_bwa = q|\n|; - %bwapos = (1 => 'Umsatzerlöse', + my %bwapos = ( + 1 => 'Umsatzerlöse', 2 => 'Best.Verdg.FE/UE', 3 => 'Aktiv.Eigenleistung', 4 => 'Mat./Wareneinkauf', @@ -264,8 +278,8 @@ sub account_header { 33 => 'Sonst.neutr.Ertrag', 34 => 'Verr.kalk.Kosten', 35 => 'Steuern Eink.u.Ertr.'); - foreach $item (sort({ $a <=> $b } keys %bwapos)) { - my $text = H(SL::Iconv::convert("ISO-8859-15", $dbcharset, $bwapos{$item})); + foreach my $item (sort({ $a <=> $b } keys %bwapos)) { + my $text = H(SL::Iconv::convert("ISO-8859-15", $main::dbcharset, $bwapos{$item})); if ($item == $form->{pos_bwa}) { $select_bwa .= qq|\n|; - foreach $item ((1, 2, 3, 4)) { + my $select_bilanz = q|\n|; + foreach my $item ((1, 2, 3, 4)) { if ($item == $form->{pos_bilanz}) { $select_bilanz .= qq|\n|; + my $select_category = q|\n|; - %category = ( + my %category = ( 'A' => $locale->text('Asset'), 'L' => $locale->text('Liability'), 'Q' => $locale->text('Equity'), @@ -303,7 +317,7 @@ sub account_header { 'E' => $locale->text('Expense'), 'C' => $locale->text('Costs'), ); - foreach $item ( sort({ $a <=> $b } keys %category) ) { + foreach my $item ( sort({ $a <=> $b } keys %category) ) { if ($item eq $form->{category}) { $select_category .= qq|