X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fgl.pl;h=87e20d13b1c2ff2efa5d683a7ffb44e57fea0041;hb=9d679693eeb06baf737355f5c07ea7abf33e7dbb;hp=ea47e2a1ceeabeebe0f9c412ef24a6ca240b37a2;hpb=eb9eac742c9a9b8083de9a4f4a5578c4388d69bb;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index ea47e2a1c..87e20d13b 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -82,11 +82,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 +124,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} }; @@ -159,7 +159,7 @@ sub edit { $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 +168,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 +177,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 +293,7 @@ sub search { | . $locale->text('From') . qq| $button1 + | . $locale->text('To (time)') . qq| $button2 @@ -620,15 +621,17 @@ sub generate_report { |; } - $form->{balance} *= $ml; + $form->{balance} *= $ml; foreach $ref (@{ $form->{GL} }) { $form->{balance} *= $ml; + # if item ne sort print subtotal if ($form->{l_subtotal} eq 'Y') { if ($sameitem ne $ref->{ $form->{sort} }) { &gl_subtotal; } } + #foreach $key (sort keys(%{ $ref->{amount} })) { # $form->{balance} += $ref->{amount}{$key}; #} @@ -656,7 +659,7 @@ sub generate_report { $credit .= "" . $form->format_amount(\%myconfig, $ref->{credit}{$key}, 2, 0); } - $form->{balance} = abs($form->{balance}) - abs( $ref->{credit}{$key}); + $form->{balance} = abs($form->{balance}) - abs($ref->{credit}{$key}); } $debittax = ""; @@ -698,9 +701,10 @@ sub generate_report { $debitaccno .= "{debit_accno}{$key}&callback=$callback>$ref->{debit_accno}{$key}"; } - if ($ref->{debit_taxkey}{$key} eq $debittaxkey) { - $ref->{debit_tax_accno}{$key} = $taxaccno; - } + + # if ($ref->{debit_taxkey}{$key} eq $debittaxkey) { + # $ref->{debit_tax_accno}{$key} = $taxaccno; + # } $taxaccno = $ref->{debit_tax_accno}{$key}; $debittaxkey = $ref->{debit_taxkey}{$key}; } @@ -716,9 +720,10 @@ sub generate_report { $creditaccno .= "{credit_accno}{$key}&callback=$callback>$ref->{credit_accno}{$key}"; } - if ($ref->{credit_taxkey}{$key} eq $credittaxkey) { - $ref->{credit_tax_accno}{$key} = $taxaccno; - } + + # if ($ref->{credit_taxkey}{$key} eq $credittaxkey) { + # $ref->{credit_tax_accno}{$key} = $taxaccno; + # } $taxaccno = $ref->{credit_tax_accno}{$key}; $credittaxkey = $ref->{credit_taxkey}{$key}; } @@ -745,16 +750,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"; @@ -776,9 +788,8 @@ sub generate_report { $column_data{gifi_accno} = "{gifi_accno}&callback=$callback>$ref->{gifi_accno} "; $column_data{balance} = - "" - . $form->format_amount(\%myconfig, $form->{balance}, 2, 0) - . ""; + "" + . $form->format_amount(\%myconfig, $form->{balance}, 2, 0) . ""; $i++; $i %= 2; @@ -845,14 +856,7 @@ sub generate_report { |; - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| + . $locale->text('Vendor Invoice') . qq|"> @@ -965,7 +969,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"}) { @@ -1041,24 +1045,25 @@ sub display_rows { for $i (1 .. $form->{rowcount}) { $source = qq| - |; $memo = qq| - |; if ($init) { $accno = qq| - $form->{chartinit}|; $tax = - qq|$form->{taxchart}|; -# if ($form->{selectprojectnumber}) { -# $project = qq| -# $form->{selectprojectnumber}|; -# } + + # if ($form->{selectprojectnumber}) { + # $project = qq| + # $form->{selectprojectnumber}|; + # } $korrektur = qq|$accno|; $tax = $taxchart; @@ -1107,14 +1112,14 @@ sub display_rows { . ($i + 10 + (($i - 1) * 8)) . 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->{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" : ""; @@ -1138,10 +1143,11 @@ sub display_rows { $tax = qq| $taxchart|; -# if ($form->{selectprojectnumber}) { -# $project = qq| -# $form->{selectprojectnumber}|; -# } + + # if ($form->{selectprojectnumber}) { + # $project = qq| + # $form->{selectprojectnumber}|; + # } $korrektur = qq| $accno $fx_transaction - - - $korrektur $tax @@ -1182,9 +1188,10 @@ sub display_rows { } $form->hide_form(qw(rowcount selectaccno)); -# print qq| -# |; + + # print qq| + # |; $lxdebug->leave_sub(); } @@ -1205,7 +1212,7 @@ sub form_header {