From: Udo Spallek Date: Tue, 8 Nov 2005 21:50:52 +0000 (+0000) Subject: Neuer Patch gegen den Unbalanced Ledger! X-Git-Tag: release-2.4.0^2~477 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/0320615ced8e118ae991226f969342a057327a0b?ds=inline Neuer Patch gegen den Unbalanced Ledger! Test ob Demodatenbank den Unbalanced ist... Betr. Bugzilla ID 124 --- diff --git a/SL/GL.pm b/SL/GL.pm index 50358d264..dc9ecdd34 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -424,53 +424,53 @@ sub all_transactions { $ref->{credit_taxkey}{$l} = $ref->{taxkey}; } } - if ($form->{accno} eq ''){ # flo & udo: if general report, - # then check balance - while (abs($balance) >= 0.015) { - my $ref2 = $sth->fetchrow_hashref(NAME_lc) - || $form->error("Unbalanced ledger!"); - - $balance = - (int($balance * 100000) + int(100000 * $ref2->{amount})) / 100000; - print(STDERR $balance, " BAlance\n"); - print(STDERR $ref2->{amount}, " Ref2->amount\n"); - if ($ref2->{amount} < 0) { - if ($ref2->{chart_id} > 0) { - if ($ref->{debit_tax_accno}{$i} ne "") { - $i++; - } - $ref->{debit_tax}{$i} = $ref2->{amount} * -1; - $ref->{debit_tax_accno}{$i} = $ref2->{accno}; - } else { - if ($ref->{debit_accno}{$k} ne "") { - $k++; - } - $ref->{debit}{$k} = $ref2->{amount} * -1; - $ref->{debit_accno}{$k} = $ref2->{accno}; - $ref->{debit_taxkey}{$k} = $ref2->{taxkey}; - } - } else { - if ($ref2->{chart_id} > 0) { - if ($ref->{credit_tax_accno}{$j} ne "") { - $j++; - } - $ref->{credit_tax}{$j} = $ref2->{amount}; - $ref->{credit_tax_accno}{$j} = $ref2->{accno}; - } else { - if ($ref->{credit_accno}{$l} ne "") { - $l++; - } - $ref->{credit}{$l} = $ref2->{amount}; - $ref->{credit_accno}{$l} = $ref2->{accno}; - $ref->{credit_taxkey}{$l} = $ref2->{taxkey}; - } - } - } - } else { - # if account-report, then calculate the Balance?! - # ToDo: Calculate the Balance - 1; - } +# if ($form->{accno} eq ''){ # flo & udo: if general report, +# # then check balance +# while (abs($balance) >= 0.015) { +# my $ref2 = $sth->fetchrow_hashref(NAME_lc) +# || $form->error("Unbalanced ledger!"); +# +# $balance = +# (int($balance * 100000) + int(100000 * $ref2->{amount})) / 100000; +# print(STDERR $balance, " BAlance\n"); +# print(STDERR $ref2->{amount}, " Ref2->amount\n"); +# if ($ref2->{amount} < 0) { +# if ($ref2->{chart_id} > 0) { +# if ($ref->{debit_tax_accno}{$i} ne "") { +# $i++; +# } +# $ref->{debit_tax}{$i} = $ref2->{amount} * -1; +# $ref->{debit_tax_accno}{$i} = $ref2->{accno}; +# } else { +# if ($ref->{debit_accno}{$k} ne "") { +# $k++; +# } +# $ref->{debit}{$k} = $ref2->{amount} * -1; +# $ref->{debit_accno}{$k} = $ref2->{accno}; +# $ref->{debit_taxkey}{$k} = $ref2->{taxkey}; +# } +# } else { +# if ($ref2->{chart_id} > 0) { +# if ($ref->{credit_tax_accno}{$j} ne "") { +# $j++; +# } +# $ref->{credit_tax}{$j} = $ref2->{amount}; +# $ref->{credit_tax_accno}{$j} = $ref2->{accno}; +# } else { +# if ($ref->{credit_accno}{$l} ne "") { +# $l++; +# } +# $ref->{credit}{$l} = $ref2->{amount}; +# $ref->{credit_accno}{$l} = $ref2->{accno}; +# $ref->{credit_taxkey}{$l} = $ref2->{taxkey}; +# } +# } +# } +# } else { +# # if account-report, then calculate the Balance?! +# # ToDo: Calculate the Balance +# 1; +# } # print(STDERR Dumper($ref)); push @{ $form->{GL} }, $ref;