X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/03c310de8edb970a56ba51d0969979d0fe63f1b8..913fe3398532666f18ec4856470fdfec53b1d388:/bin/mozilla/gl.pl diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 2d8d31d3a..a20554d7f 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -81,24 +81,14 @@ sub add { # we use this only to set a default date GL->transaction(\%myconfig, \%$form); - map { - $chart .= - "" - } @{ $form->{chart} }; map { $tax .= qq|" - } @{ $form->{chart} }; map { $tax .= @@ -134,10 +120,6 @@ sub edit { . ($_->{rate} * 100) . qq| %| } @{ $form->{TAX} }; - $form->{chart} = $chart; - - $form->{taxchart} = $tax; - $form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2); # departments @@ -1081,10 +1063,6 @@ sub display_rows { $form->{totaldebit} = 0; $form->{totalcredit} = 0; - my $chart = $form->{chart}; - $chart = $form->unquote($chart); - $form->{taxchart} = $form->unquote($form->{taxchart}); - $taxchart = $form->{taxchart}; my @old_project_ids = (); map({ push(@old_project_ids, $form->{"project_id_$_"}) @@ -1092,7 +1070,10 @@ sub display_rows { $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 0, - "old_id" => \@old_project_ids }); + "old_id" => \@old_project_ids }, + "charts" => { "key" => "ALL_CHARTS", + "transdate" => $form->{transdate} }, + "taxcharts" => "ALL_TAXCHARTS"); my %project_labels = (); my @project_values = (""); @@ -1101,6 +1082,26 @@ sub display_rows { $project_labels{$item->{"id"}} = $item->{"projectnumber"}; } + my %chart_labels = (); + my @chart_values = (); + my $taxchart_init; + foreach my $item (@{ $form->{ALL_CHARTS} }) { + my $key = Q($item->{accno}) . "--" . Q($item->{tax_id}); + $taxchart_init = $item->{taxkey_id} unless (@chart_values); + push(@chart_values, $key); + $chart_labels{$key} = H($item->{accno}) . "--" . H($item->{description}); + } + + my %taxchart_labels = (); + my @taxchart_values = (); + foreach my $item (@{ $form->{ALL_TAXCHARTS} }) { + my $key = Q($item->{id}) . "--" . Q($item->{rate}); + $taxchart_init = $key if ($taxchart_init eq $item->{taxkey}); + push(@taxchart_values, $key); + $taxchart_labels{$key} = H($item->{taxdescription}) . " " . + H($item->{rate} * 100) . ' %'; + } + for $i (1 .. $form->{rowcount}) { $source = qq| @@ -1110,15 +1111,25 @@ sub display_rows { |; - if ($init) { - $accno = qq| - |; - $tax = - qq||; + $accno = qq|| . + $cgi->popup_menu('-name' => "accno_$i", + '-onChange' => "setTaxkey(this, $i)", + '-style' => 'width:200px', + '-tabindex' => ($i + 5 + (($i - 1) * 8)), + '-values' => \@chart_values, + '-labels' => \%chart_labels, + '-default' => $init ? '' : $form->{"accno_$i"}) + . qq||; + $tax = qq|| . + $cgi->popup_menu('-name' => "taxchart_$i", + '-style' => 'width:200px', + '-tabindex' => ($i + 10 + (($i - 1) * 8)), + '-values' => \@taxchart_values, + '-labels' => \%taxchart_labels, + '-default' => $init ? $taxchart_init : $form->{"taxchart_$i"}) + . qq||; + if ($init) { $korrektur = qq|{rowcount}) { - - $accno = $chart; - $chart_selected = $form->{"accno_$i"}; - $accno =~ - s/value=\"$chart_selected\"/value=\"$chart_selected\" selected/; - $accno = - qq||; - $tax = $taxchart; - $tax_selected = $form->{"taxchart_$i"}; - $tax =~ s/value=\"$tax_selected\"/value=\"$tax_selected\" selected/; - $tax = - qq||; - if ($form->{transfer}) { $checked = ($form->{"fx_transaction_$i"}) ? "1" : ""; $x = ($checked) ? "x" : ""; @@ -1182,14 +1176,6 @@ sub display_rows { $form->hide_form("accno_$i"); } else { - - $accno = qq| - |; - $tax = qq| - |; - $korrektur = qq|{closedto}> {locked}> - - @@ -1532,7 +1516,7 @@ sub delete { {script}> |; - map { $form->{$_} =~ s/\"/"/g } qw(reference description chart taxchart); + map { $form->{$_} =~ s/\"/"/g } qw(reference description); delete $form->{header};