X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FAR.pm;h=5fc6032a96a63b240c8e047024c46fc80e36151f;hb=56e52e62aa29100c6369274dcf805d5cb99bf315;hp=96547c566fd2f77ec5ffa9ef3190881d02098df1;hpb=0a02b827a5c14cdd46a1faa13cb7fdda832a6aa2;p=kivitendo-erp.git diff --git a/SL/AR.pm b/SL/AR.pm index 96547c566..5fc6032a9 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -411,7 +411,8 @@ sub ar_transactions { qq|SELECT a.id, a.invnumber, a.ordnumber, a.transdate, | . qq| a.duedate, a.netamount, a.amount, a.paid, | . qq| a.invoice, a.datepaid, a.terms, a.notes, a.shipvia, | . - qq| a.shippingpoint, a.storno, a.globalproject_id, | . + qq| a.shippingpoint, a.storno, a.storno_id, a.globalproject_id, | . + qq| a.marge_total, a.marge_percent, | . qq| a.transaction_description, | . qq| pr.projectnumber AS globalprojectnumber, | . qq| c.name, | . @@ -634,7 +635,7 @@ sub storno { $storno_row->{invnumber} = 'Storno-' . $storno_row->{invnumber}; $storno_row->{amount} *= -1; $storno_row->{netamount} *= -1; - $storno_row->{paid} = $storno_amount->{amount}; + $storno_row->{paid} = $storno_row->{amount}; delete @$storno_row{qw(itime mtime)}; @@ -645,7 +646,7 @@ sub storno { do_query($form, $dbh, $query, $id); # now copy acc_trans entries - $query = qq|SELECT a.*, c.link FROM acc_trans a LEFT JOIN chart c ON a.chart_id = c.id WHERE a.trans_id = ?|; + $query = qq|SELECT a.*, c.link FROM acc_trans a LEFT JOIN chart c ON a.chart_id = c.id WHERE a.trans_id = ? ORDER BY a.oid|; my $rowref = selectall_hashref_query($form, $dbh, $query, $id); # kill all entries containing payments, which are the last 2n rows, of which the last has link =~ /paid/