X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fam.pl;h=77d8878ffdb1e7390b41a6e548830a8468eabded;hb=b5157f97d47413e5f33cced1d0de527979ff3d61;hp=20f1ad8d37cfa67c1dce7cb70425b3ee68f6e4a1;hpb=ee072e4f077213bf6f8792ca8f0a1afebbb6282f;p=kivitendo-erp.git
diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl
index 20f1ad8d3..77d8878ff 100644
--- a/bin/mozilla/am.pl
+++ b/bin/mozilla/am.pl
@@ -35,15 +35,24 @@ use SL::AM;
use SL::CA;
use SL::Form;
use SL::User;
+use SL::USTVA;
+use SL::Iconv;
+use CGI::Ajax;
+use CGI;
+
+use Data::Dumper;
1;
+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 add_account {
$lxdebug->enter_sub();
@@ -53,7 +62,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;
@@ -81,61 +90,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} }) {
- $form->{selecttaxkey} = "|;
}
+ foreach $item (@{ $form->{NEWACCOUNT} }) {
+ if ($item->{id} == $form->{new_chart_id}) {
+ $form->{selectnewaccount} .=
+ qq||;
+ } elsif (!$form->{new_chart_valid}) {
+ $form->{selectnewaccount} .=
+ qq||;
+ }
+ }
}
- $ustva = qq|
-
- | . $locale->text('Umsatzsteuervoranmeldung') . qq| |
- |
-
-
|;
-
- $form->{selecteur} = "\n|;
%eur = (1 => "Umsatzerlöse",
2 => "sonstige Erlöse",
3 => "Privatanteile",
@@ -168,22 +224,16 @@ sub account_header {
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}));
if ($item == $form->{pos_eur}) {
- $form->{selecteur} .= "\n|;
} else {
- $form->{selecteur} .= "\n|;
}
}
- $eur = qq|
-
- | . $locale->text('EÜR') . qq| |
- |
-
-
|;
-
- $form->{selectbwa} = "\n|;
%bwapos = (1 => 'Umsatzerlöse',
2 => 'Best.Verdg.FE/UE',
@@ -208,202 +258,89 @@ sub account_header {
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}));
if ($item == $form->{pos_bwa}) {
- $form->{selectbwa} .= "\n|;
foreach $item ((1, 2, 3, 4)) {
if ($item == $form->{pos_bilanz}) {
- $form->{selectbilanz} .= "\n|;
+
+ %category = (
+ 'A' => $locale->text('Asset'),
+ 'L' => $locale->text('Liability'),
+ 'Q' => $locale->text('Equity'),
+ 'I' => $locale->text('Revenue'),
+ 'E' => $locale->text('Expense'),
+ 'C' => $locale->text('Costs'),
+ );
+ foreach $item ( sort({ $a <=> $b } keys %category) ) {
+ if ($item eq $form->{category}) {
+ $select_category .= qq|