X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/0b749d12146e361b25af606af074438d71282954..30b3809896d60dfbf4eb4f3cc5baf8dc2bb61cb0:/bin/mozilla/am.pl diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 306cf6525..e7d7db206 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -40,6 +40,8 @@ use Data::Dumper; 1; +require "$form->{path}/common.pl"; + # end of main sub add { &{"add_$form->{type}"} } @@ -1887,46 +1889,29 @@ sub buchungsgruppe_header { # $locale->text('Buchungsgruppe hinzufügen') # $locale->text('Buchungsgruppe bearbeiten') - $form->{description} =~ s/\"/"/g; + my ($acc_inventory, $acc_income, $acc_expense) = ({}, {}, {}); + my %acc_type_map = ( + "IC" => $acc_inventory, + "IC_income" => $acc_income, + "IC_sale" => $acc_income, + "IC_expense" => $acc_expense, + "IC_cogs" => $acc_expense, + ); - # build the popup menus - $form->{taxaccounts} = ""; - foreach $key (keys %{ $form->{IC_links} }) { + foreach $key (keys(%acc_type_map)) { foreach $ref (@{ $form->{IC_links}{$key} }) { - - # if this is a tax field - if ($key =~ /IC_tax/) { - if ($key =~ /$item/) { - $form->{taxaccounts} .= "$ref->{accno} "; - $form->{"IC_tax_$ref->{accno}_description"} = - "$ref->{accno}--$ref->{description}"; - - if ($form->{id}) { - if ($form->{amount}{ $ref->{accno} }) { - $form->{"IC_tax_$ref->{accno}"} = "checked"; - } - } else { - $form->{"IC_tax_$ref->{accno}"} = "checked"; - } - } - } else { - - $form->{"select$key"} .= - "" } + sort({ $a->{"accno"} cmp $b->{"accno"} } + values(%{$acc_type_map{$type}})))); + } if ($form->{id}) { $form->{selectIC} =~ s/selected//g; @@ -1947,10 +1932,10 @@ sub buchungsgruppe_header { } else { $linkaccounts = qq| {inventory_accno_id}>|; - } + } - $linkaccounts .= qq| + $linkaccounts .= qq| | . $locale->text('Erlöse Inland') . qq| @@ -2025,7 +2010,7 @@ sub buchungsgruppe_header { | . $locale->text('Buchungsgruppe') . qq| - + $linkaccounts