Revision a3263b66
Von Jan Büren vor fast 3 Jahren hinzugefügt
SL/DB/Helper/Payment.pm | ||
---|---|---|
620 | 620 |
|
621 | 621 |
# add-on: correct tax with one linked gl booking |
622 | 622 |
|
623 |
# no skonto tax correction for dual tax (reverse charge) or rate = 0 |
|
624 |
next if ($tax->rate == 0 || $tax->reverse_charge_chart_id); |
|
623 |
# no skonto tax correction for dual tax (reverse charge) or rate = 0 or taxamount below 0.01
|
|
624 |
next if ($tax->rate == 0 || $tax->reverse_charge_chart_id || $skonto_taxamount_rounded < 0.01);
|
|
625 | 625 |
|
626 | 626 |
my ($credit, $debit); |
627 | 627 |
$credit = SL::DB::Manager::Chart->find_by(id => $chart_id); |
... | ... | |
686 | 686 |
# is fully assigned. |
687 | 687 |
# we simply alter one cent for the first skonto booking entry |
688 | 688 |
# should be correct for most of the cases (no invoices with mixed taxes) |
689 |
if ($total_skonto_rounded - $amount > 0.01) { |
|
690 |
# add one cent |
|
691 |
$skonto_charts[0]->{skonto_amount} -= 0.01; |
|
692 |
} elsif ($amount - $total_skonto_rounded > 0.01) { |
|
689 |
if (_round($total_skonto_rounded - $amount) >= 0.01) { |
|
693 | 690 |
# subtract one cent |
691 |
$skonto_charts[0]->{skonto_amount} -= 0.01; |
|
692 |
} elsif (_round($amount - $total_skonto_rounded) >= 0.01) { |
|
693 |
# add one cent |
|
694 | 694 |
$skonto_charts[0]->{skonto_amount} += 0.01; |
695 | 695 |
} |
696 | 696 |
|
Auch abrufbar als: Unified diff
Payment-Helper Anpassungen aus Testfall
- Keine Skonto Steuerkorrektur falls Steuer-Betrag < 0.01
- Zwei Teile von Netto und Steuer können an der dritten
Nachkommastelle auf 5 (0.005) berechnet werden. Entsprechend
Rundungskorrekturen genauer angepasst