X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=185e2a5878dae3bb1ac58ed8ba54c552a0b41f64;hb=bfa7bf60b133969eb754d4506485c7132711f43f;hp=e38796c75eb8fcca74b9104db0cca8dc3731164c;hpb=09f6472492fd33fbca181838c48b4c83136172b1;p=kivitendo-erp.git
diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl
index e38796c75..185e2a587 100644
--- a/bin/mozilla/gl.pl
+++ b/bin/mozilla/gl.pl
@@ -780,17 +780,6 @@ sub display_rows {
$form->{totaldebit} = 0;
$form->{totalcredit} = 0;
- my @old_project_ids = ();
- map({ push(@old_project_ids, $form->{"project_id_$_"})
- if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
-
- $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
- "all" => 0,
- "old_id" => \@old_project_ids },
- "charts" => { "key" => "ALL_CHARTS",
- "transdate" => $form->{transdate} },
- "taxcharts" => "ALL_TAXCHARTS");
-
my %project_labels = ();
my @project_values = ("");
foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
@@ -804,7 +793,7 @@ sub display_rows {
my $taxchart_init;
foreach my $item (@{ $form->{ALL_CHARTS} }) {
my $key = $item->{accno} . "--" . $item->{tax_id};
- $taxchart_init = $item->{taxkey_id} unless (@chart_values);
+ $taxchart_init = $item->{tax_id} unless (@chart_values);
push(@chart_values, $key);
$chart_labels{$key} = $item->{accno} . "--" . $item->{description};
$charts{$item->{accno}} = $item;
@@ -815,14 +804,13 @@ sub display_rows {
my %taxcharts = ();
foreach my $item (@{ $form->{ALL_TAXCHARTS} }) {
my $key = $item->{id} . "--" . $item->{rate};
- $taxchart_init = $key if ($taxchart_init eq $item->{taxkey});
+ $taxchart_init = $key if ($taxchart_init == $item->{id});
push(@taxchart_values, $key);
$taxchart_labels{$key} = $item->{taxdescription} . " " . $item->{rate} * 100 . ' %';
$taxcharts{$item->{id}} = $item;
}
for $i (1 .. $form->{rowcount}) {
-
if ($form->{show_details}) {
$source = qq|
| |;
@@ -851,13 +839,13 @@ sub display_rows {
$selected_taxchart = "$item->{id}--$item->{rate}";
}
- $selected_accno = '' if ($init);
- $selected_taxchart = $taxchart_init unless ($selected_taxchart ne "");
+ $selected_accno = '' if ($init);
+ $selected_taxchart ||= $taxchart_init;
$accno = qq|| .
NTI($cgi->popup_menu('-name' => "accno_$i",
'-id' => "accno_$i",
- '-onChange' => "setTaxkey(this, $i)",
+ '-onChange' => "setTaxkey($i)",
'-style' => 'width:200px',
'-values' => \@chart_values,
'-labels' => \%chart_labels,
@@ -939,6 +927,7 @@ sub display_rows {
print qq| |
$accno
+ |
$fx_transaction
|
|
@@ -971,6 +960,19 @@ sub form_header {
$auth->assert('general_ledger');
+ my @old_project_ids = ();
+ map({ push(@old_project_ids, $form->{"project_id_$_"})
+ if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
+
+ $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
+ "all" => 0,
+ "old_id" => \@old_project_ids },
+ "charts" => { "key" => "ALL_CHARTS",
+ "transdate" => $form->{transdate} },
+ "taxcharts" => "ALL_TAXCHARTS");
+
+ GL->get_chart_balances('charts' => $form->{ALL_CHARTS});
+
$title = $form->{title};
$form->{title} = $locale->text("$title General Ledger Transaction");
$readonly = ($form->{id}) ? "readonly" : "";
@@ -988,7 +990,8 @@ sub form_header {
$form->{javascript} = qq||;
- $form->{javascript} .= qq||;
+
+
+
+|;
$form->{selectdepartment} =~ s/ selected//;
$form->{selectdepartment} =~
@@ -1069,6 +1073,8 @@ sub form_header {
$form->{previous_id} ||= "--";
$form->{previous_gldate} ||= "--";
+ $jsscript .= $form->parse_html_template('gl/form_header_chart_balances_js');
+
$form->header;
print qq|
@@ -1194,6 +1200,7 @@ sub form_header {
|
. $locale->text('Account') . qq| |
+ | . $locale->text('Chart balance') . qq| |
|
. $locale->text('Debit') . qq| |
|
@@ -1246,8 +1253,7 @@ sub form_footer {
print qq|
|
- |
- $form->{totaldebit} |
+ $form->{totaldebit} |
$form->{totalcredit} |
|
@@ -1286,7 +1292,7 @@ $follow_ups_block
. qq|"> |;
} else {
- print qq|
+ print qq|
|;
}