X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/134ecd713fae927536c69259fbd3489f0925fc3f..6df2a3e3cccf01db1c3590c91f9b3fefb85f5dfd:/SL/GL.pm diff --git a/SL/GL.pm b/SL/GL.pm index 43b4c53d6..0164836a2 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -75,9 +75,6 @@ sub post_transaction { # check if debit and credit balances if ($form->{storno}) { - $debit = $debit * -1; - $credit = $credit * -1; - $tax = $tax * -1; $form->{reference} = "Storno-" . $form->{reference}; $form->{description} = "Storno-" . $form->{description}; } @@ -418,7 +415,7 @@ sub all_transactions { AND ac.chart_id = c.id AND a.vendor_id = ct.id AND a.id = ac.trans_id - ORDER BY $sortorder transdate,acoid, trans_id, taxkey DESC|; + ORDER BY $sortorder transdate, trans_id, acoid, taxkey DESC|; # Show all $query in Debuglevel LXDebug::QUERY $callingdetails = (caller (0))[3]; @@ -503,13 +500,13 @@ sub all_transactions { $ref->{debit}{$k} = $ref->{amount} * -1; $ref->{debit_accno}{$k} = $ref->{accno}; $ref->{debit_taxkey}{$k} = $ref->{taxkey}; - $ref->{transdate}{$k} = $ref->{transdate}; + $ref->{ac_transdate}{$k} = $ref->{transdate}; } else { $ref->{credit}{$l} = $ref->{amount} * 1; $ref->{credit_accno}{$l} = $ref->{accno}; $ref->{credit_taxkey}{$l} = $ref->{taxkey}; - $ref->{transdate}{$l} = $ref->{transdate}; + $ref->{ac_transdate}{$l} = $ref->{transdate}; } @@ -566,7 +563,7 @@ sub all_transactions { $ref->{debit}{$k} = $ref2->{amount} * - 1; $ref->{debit_accno}{$k} = $ref2->{accno}; $ref->{debit_taxkey}{$k} = $ref2->{taxkey}; - $ref->{transdate}{$k} = $ref2->{transdate}; + $ref->{ac_transdate}{$k} = $ref2->{transdate}; } else { if ($ref->{credit_accno}{$l} ne "") { $l++; @@ -574,7 +571,7 @@ sub all_transactions { $ref->{credit}{$l} = $ref2->{amount}; $ref->{credit_accno}{$l} = $ref2->{accno}; $ref->{credit_taxkey}{$l} = $ref2->{taxkey}; - $ref->{transdate}{$l} = $ref2->{transdate}; + $ref->{ac_transdate}{$l} = $ref2->{transdate}; } } } @@ -638,8 +635,8 @@ sub transaction { # retrieve individual rows $query = qq|SELECT c.accno, t.taxkey AS accnotaxkey, a.amount, a.memo, - a.transdate, a.cleared, a.project_id, p.projectnumber,(SELECT p.projectnumber FROM project p - WHERE a.project_id = p.id) AS projectnumber, a.taxkey, t.rate AS taxrate, t.id, (SELECT c1.accno FROM chart c1, tax t1 WHERE t1.id=t.id AND c1.id=t.chart_id) AS taxaccno, (SELECT tk.tax_id FROM taxkeys tk WHERE tk.chart_id =a.chart_id AND tk.startdate<=a.transdate ORDER BY tk.startdate desc LIMIT 1) AS tax_id + a.transdate, a.cleared, a.project_id, p.projectnumber, + a.taxkey, t.rate AS taxrate, t.id, (SELECT c1.accno FROM chart c1, tax t1 WHERE t1.id=t.id AND c1.id=t.chart_id) AS taxaccno, (SELECT tk.tax_id FROM taxkeys tk WHERE tk.chart_id =a.chart_id AND tk.startdate<=a.transdate ORDER BY tk.startdate desc LIMIT 1) AS tax_id FROM acc_trans a JOIN chart c ON (c.id = a.chart_id) LEFT JOIN project p ON (p.id = a.project_id)