X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/92daa1a66a9ff737c92df86da3c28d663c421032..18c7b9f28c696e7252e9101f98e53d5861f9d8ef:/SL/OE.pm diff --git a/SL/OE.pm b/SL/OE.pm index 888f422be..5dc3128f5 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -787,10 +787,9 @@ sub retrieve { my %oid = ('Pg' => 'oid', 'Oracle' => 'rowid'); - my $transdate = "'$form->{transdate}'"; - if (!$transdate) { - $transdate = "current_date"; - } + my $transdate = + $form->{transdate} ? $dbh->quote($form->{transdate}) : "current_date"; + if(!$form->{taxzone_id}) { $form->{taxzone_id} = 0; } @@ -869,15 +868,9 @@ sub retrieve { # delete orderitems_id in collective orders, so that they get cloned no matter what delete $ref->{orderitems_id} if (@ids); - #set expense_accno=inventory_accno if they are different => bilanz - $vendor_accno = - ($ref->{expense_accno} != $ref->{inventory_accno}) - ? $ref->{inventory_accno} - : $ref->{expense_accno}; - # get tax rates and description $accno_id = - ($form->{vc} eq "customer") ? $ref->{income_accno} : $vendor_accno; + ($form->{vc} eq "customer") ? $ref->{income_accno} : $ref->{expense_accno}; $query = qq|SELECT c.accno, t.taxdescription, t.rate, t.taxnumber FROM tax t LEFT JOIN chart c ON (c.id=t.chart_id) WHERE t.taxkey in (SELECT taxkey_id from chart where accno = '$accno_id')