X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=c4f2a291d7f321f908f3a82d8634382ca0b71c30;hb=63024c9f98f172ec904324fd0b6f9cc819ce7600;hp=5b6b16b0b1494cc9cc7f309e4a2bc1cbbed3e86c;hpb=a731cd269130cd68f9c3fb5b8a2c26dc20afe82e;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 5b6b16b0b..c4f2a291d 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -35,43 +35,23 @@ use SL::AM; use SL::CA; use SL::Form; use SL::User; +use SL::USTVA; +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 delete { &{"delete_$form->{type}"} } - -sub display { - if ($form->{display_nextsub}) { - &{ $form->{display_nextsub} }(); - } else { - &{ $form->{nextsub} }(); - } -} - -sub save { - if ($form->{save_nextsub}) { - &{ $form->{save_nextsub} }(); - } else { - &{ $form->{nextsub} }(); - } -} - -sub edit { - if ($form->{edit_nextsub}) { - &{ $form->{edit_nextsub} }(); - } else { - &{ "edit_$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 add_account { $lxdebug->enter_sub(); @@ -81,7 +61,7 @@ sub add_account { AM->get_account(\%myconfig, \%$form); $form->{callback} = - "$form->{script}?action=list_account&path=$form->{path}&login=$form->{login}&password=$form->{password}" + "$form->{script}?action=list_account&login=$form->{login}&password=$form->{password}" unless $form->{callback}; &account_header; @@ -109,134 +89,108 @@ sub edit_account { sub account_header { $lxdebug->enter_sub(); + 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 my $item (@{ $form->{TAXKEY} }) { - $item->{rate} = $item->{rate} * 100 . '%'; + } - 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|
- - |; - - $form->{selectustva} = "\n|; %eur = (1 => "Umsatzerlöse", 2 => "sonstige Erlöse", 3 => "Privatanteile", @@ -270,21 +224,14 @@ sub account_header { 31 => "Betriebliche Steuern"); foreach $item (sort({ $a <=> $b } keys(%eur))) { if ($item == $form->{pos_eur}) { - $form->{selecteur} .= "\n|; } else { - $form->{selecteur} .= "\n|; } } - $eur = qq| - - | . $locale->text('EUER') . qq| - - - |; - - $form->{selectbwa} = "\n|; %bwapos = (1 => 'Umsatzerlöse', 2 => 'Best.Verdg.FE/UE', @@ -310,193 +257,87 @@ sub account_header { 35 => 'Steuern Eink.u.Ertr.'); foreach $item (sort({ $a <=> $b } keys %bwapos)) { if ($item == $form->{pos_bwa}) { - $form->{selectbwa} .= "\n|; + foreach $item ((1, 2, 3, 4)) { + if ($item == $form->{pos_bilanz}) { + $select_bilanz .= qq|