X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=89febc2080061cfffe17b3f3eee985d9dd7c5b10;hb=0437033e3e747a77b8999ae13a599e3c614be817;hp=521bb07d24f90f5ad2470d33d836855f0694e490;hpb=5c8321315d8ec81490e0769ddfb7d248981ffcca;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 521bb07d2..89febc208 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -35,6 +35,7 @@ use SL::GL; use SL::PE; require "$form->{path}/arap.pl"; +require "bin/mozilla/common.pl"; 1; @@ -82,11 +83,11 @@ sub add { map { $chart .= - "{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}" + "{accno}--$_->{tax_id}\">$_->{accno}--$_->{description}" } @{ $form->{chart} }; map { $tax .= - qq|$_->{taxdescription} | + qq|$_->{taxdescription} | . ($_->{rate} * 100) . qq| %| } @{ $form->{TAX} }; @@ -124,12 +125,12 @@ sub edit { GL->transaction(\%myconfig, \%$form); map { $chart .= - "{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}" + "{accno}--$_->{tax_id}\">$_->{accno}--$_->{description}" } @{ $form->{chart} }; map { $tax .= - qq|$_->{taxdescription} | + qq|$_->{taxdescription} | . ($_->{rate} * 100) . qq| %| } @{ $form->{TAX} }; @@ -154,12 +155,10 @@ sub edit { my $tax = 0; my $taxaccno = ""; foreach $ref (@{ $form->{GL} }) { - $form->{"projectnumber_$i"} = "$ref->{projectnumber}--$ref->{project_id}"; - $j = $i - 1; if ($tax && ($ref->{accno} eq $taxaccno)) { $form->{"tax_$j"} = abs($ref->{amount}); - $form->{"taxchart_$j"} = $ref->{taxkey} . "--" . $ref->{taxrate}; + $form->{"taxchart_$j"} = $ref->{id} . "--" . $ref->{taxrate}; if ($form->{taxincluded}) { if ($ref->{amount} < 0) { $form->{"debit_$j"} += $form->{"tax_$j"}; @@ -168,7 +167,7 @@ sub edit { } } } else { - $form->{"accno_$i"} = "$ref->{accno}--$ref->{accnotaxkey}"; + $form->{"accno_$i"} = "$ref->{accno}--$ref->{tax_id}"; for (qw(fx_transaction source memo)) { $form->{"${_}_$i"} = $ref->{$_} } if ($ref->{amount} < 0) { $form->{totaldebit} -= $ref->{amount}; @@ -177,7 +176,7 @@ sub edit { $form->{totalcredit} += $ref->{amount}; $form->{"credit_$i"} = $ref->{amount}; } - $form->{"taxchart_$i"} = "0--"; + $form->{"taxchart_$i"} = "0--0.00"; $i++; } if ($ref->{taxaccno} && !$tax) { @@ -293,6 +292,7 @@ sub search { | . $locale->text('From') . qq| $button1 + | . $locale->text('To (time)') . qq| $button2 @@ -749,16 +749,23 @@ sub generate_report { } } + $transdate = ""; + foreach $key (sort keys(%{ $ref->{transdate} })) { + if ($key == 0) { + $transdate = "$ref->{transdate}{$key}"; + } else { + $transdate .= "$ref->{transdate}{$key}"; + } + } + # $ref->{debit} = $form->format_amount(\%myconfig, $ref->{debit}, 2, " "); # $ref->{credit} = $form->format_amount(\%myconfig, $ref->{credit}, 2, " "); $column_data{id} = " $ref->{id} "; - $column_data{transdate} = - " $ref->{transdate} "; + $column_data{transdate} = "$transdate"; $column_data{reference} = "{module}.pl?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{reference}"; - $column_data{description} = - "$ref->{description} "; + $column_data{description} = "$ref->{description} "; $column_data{source} = "$ref->{source} "; $column_data{notes} = "$ref->{notes} "; $column_data{debit} = "$debit"; @@ -848,14 +855,7 @@ sub generate_report { |; - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| + . $locale->text('Vendor Invoice') . qq|"> @@ -894,21 +894,7 @@ sub gl_subtotal { sub update { $lxdebug->enter_sub(); - if ($form->{transdate} ne $form->{oldtransdate}) { - if ($form->{selectprojectnumber}) { - $form->all_projects(\%myconfig, undef, $form->{transdate}); - if (@{ $form->{all_project} }) { - $form->{selectprojectnumber} = "\n"; - for (@{ $form->{all_project} }) { - $form->{selectprojectnumber} .= - qq|$_->{projectnumber}\n|; - } - $form->{selectprojectnumber} = - $form->escape($form->{selectprojectnumber}, 1); - } - } - $form->{oldtransdate} = $form->{transdate}; - } + $form->{oldtransdate} = $form->{transdate}; my @a = (); my $count = 0; @@ -968,7 +954,7 @@ sub update { : $form->{"debit_$i"}; $j = $#a; if (($debitcredit && $credittax) || (!$debitcredit && $debittax)) { - $form->{"taxchart_$i"} = "0--"; + $form->{"taxchart_$i"} = "0--0.00"; $form->{"tax_$i"} = 0; } if (!$form->{"korrektur_$i"}) { @@ -1032,15 +1018,28 @@ sub display_rows { my ($init) = @_; $lxdebug->enter_sub(); - $form->{selectprojectnumber} = $form->unescape($form->{selectprojectnumber}) - if $form->{selectprojectnumber}; - $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_$_"}) + if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"})); + + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 0, + "old_id" => \@old_project_ids }); + + my %project_labels = (); + my @project_values = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@project_values, $item->{"id"}); + $project_labels{$item->{"id"}} = $item->{"projectnumber"}; + } + for $i (1 .. $form->{rowcount}) { $source = qq| @@ -1059,10 +1058,6 @@ sub display_rows { . ($i + 10 + (($i - 1) * 8)) . qq|>$form->{taxchart}|; - # if ($form->{selectprojectnumber}) { - # $project = qq| - # $form->{selectprojectnumber}|; - # } $korrektur = qq|$tax|; - # if ($form->{selectprojectnumber}) { - # $form->{"projectnumber_$i"} = "" - # if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/; - # - # $project = $form->{"projectnumber_$i"}; - # $project =~ s/--.*//; - # $project = qq|$project|; - # } - if ($form->{transfer}) { $checked = ($form->{"fx_transaction_$i"}) ? "1" : ""; $x = ($checked) ? "x" : ""; @@ -1143,10 +1129,6 @@ sub display_rows { $taxchart|; - # if ($form->{selectprojectnumber}) { - # $project = qq| - # $form->{selectprojectnumber}|; - # } $korrektur = qq|popup_menu('-name' => "project_id_$i", + '-values' => \@project_values, + '-labels' => \%project_labels, + '-default' => $form->{"project_id_$i"} )); + print qq| $accno $fx_transaction @@ -1181,6 +1169,7 @@ sub display_rows { $tax $source $memo + $projectnumber |; @@ -1188,9 +1177,6 @@ sub display_rows { $form->hide_form(qw(rowcount selectaccno)); - # print qq| - # |; $lxdebug->leave_sub(); } @@ -1211,7 +1197,7 @@ sub form_header {