X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIR.pm;h=f87cdf8d104e4d3f86045f92d6c2817060aa7ba2;hb=cb25314000db992f8b413d10a0d20f0e80b4b677;hp=86b1323fdd432710b23db8a64fe5db1cd45c7471;hpb=bfd0d5d3e231909c396be894778670df3118ccf4;p=kivitendo-erp.git diff --git a/SL/IR.pm b/SL/IR.pm index 86b1323fd..f87cdf8d1 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -158,7 +158,7 @@ sub post_invoice { $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"} / $price_factor, 2); if ($form->{taxincluded}) { - + $taxamount = $linetotal * ($taxrate / (1 + $taxrate)); $form->{"sellprice_$i"} = $form->{"sellprice_$i"} * (1 / (1 + $taxrate)); @@ -388,7 +388,7 @@ sub post_invoice { # income accounts, it is enough to add the total rounding error to one of # the income accounts, with the one assigned to the last row being used # (lastinventoryaccno) - + # in the purchase invoice case rounding errors may be split between # inventory accounts and expense accounts. After rounding, an error of 1 # cent is introduced if the total rounding error exceeds 0.005. The total @@ -1067,6 +1067,11 @@ sub retrieve_item { push @values, $form->{"partnumber_$i"}; } + if ($form->{"id_${i}"}) { + $where .= qq| AND p.id = ?|; + push @values, $form->{"id_${i}"}; + } + if ($form->{"description_$i"}) { $where .= " ORDER BY p.description"; } else {