X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=da221ae151c22774fcebbe7e355cc5418c08b885;hb=e4d8716c1ae11b6dacf553711848e749ed191d10;hp=d25eb7e308977f6f49a232dfe6d1d4a4949a39af;hpb=9a795b8553bd43a379646bc6244c618e570556e9;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index d25eb7e30..da221ae15 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -31,36 +31,42 @@ # #====================================================================== +use SL::Auth; use SL::AM; use SL::CA; use SL::Form; use SL::User; +use SL::USTVA; +use SL::Iconv; +use SL::TODO; +use CGI::Ajax; +use CGI; use Data::Dumper; 1; - - -require "$form->{path}/common.pl"; +require "bin/mozilla/common.pl"; # end of main -sub add { &{"add_$form->{type}"} } -sub edit { &{"edit_$form->{type}"} } -sub save { &{"save_$form->{type}"} } -sub delete { &{"delete_$form->{type}"} } +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_account { $lxdebug->enter_sub(); + $auth->assert('config'); + $form->{title} = "Add"; $form->{charttype} = "A"; AM->get_account(\%myconfig, \%$form); - $form->{callback} = - "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}" - unless $form->{callback}; + $form->{callback} = "am.pl?action=list_account" unless $form->{callback}; &account_header; &form_footer; @@ -71,6 +77,8 @@ sub add_account { sub edit_account { $lxdebug->enter_sub(); + $auth->assert('config'); + $form->{title} = "Edit"; AM->get_account(\%myconfig, \%$form); @@ -87,131 +95,110 @@ sub edit_account { sub account_header { $lxdebug->enter_sub(); + $auth->assert('config'); + + if ( $form->{action} eq 'edit_account') { + $form->{account_exists} = '1'; + } + $form->{title} = $locale->text("$form->{title} Account"); - $checked{ $form->{charttype} } = "checked"; - $checked{"$form->{category}_"} = "checked"; - $checked{CT_tax} = ($form->{CT_tax}) ? "" : "checked"; + $form->{"$form->{charttype}_checked"} = "checked"; + $form->{"$form->{category}_checked"} = "checked"; - $form->{description} =~ s/\"/"/g; + $form->{select_tax} = ""; + + my @tax_report_pos = USTVA->report_variables({ + myconfig => \%myconfig, + form => $form, + type => '', + attribute => 'position', + calc => '', + }); if (@{ $form->{TAXKEY} }) { - foreach $item (@{ $form->{TAXKEY} }) { - if ($item->{tax} == $form->{tax}) { - $form->{selecttaxkey} .= - ""; + $form->{selectnewaccount} = qq||; } foreach $item (@{ $form->{NEWACCOUNT} }) { if ($item->{id} == $form->{new_chart_id}) { $form->{selectnewaccount} .= - ""; + qq||; } elsif (!$form->{new_chart_valid}) { $form->{selectnewaccount} .= - ""; + qq||; } } } - $newaccount = qq| -
| . $locale->text('Folgekonto') . qq| | -- | | . $locale->text('Gültig ab') . qq| | -- |
---|