mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
OrderChangeManager: Fix for change_tax_rule and recalculate_taxes in same transaction (Z#23187299) (#4964)
* Add test case * Do not overwrite tax_rule in PriceOperation
This commit is contained in:
@@ -3243,6 +3243,18 @@ class OrderChangeManagerTests(TestCase):
|
||||
assert nop.tax_rate == Decimal('0.00')
|
||||
assert nop.tax_value == Decimal('0.00')
|
||||
|
||||
@classscope(attr='o')
|
||||
def test_change_taxrate_and_keep_net(self):
|
||||
self.ocm.change_tax_rule(self.op1, self.tr19)
|
||||
self.ocm.recalculate_taxes(keep='net')
|
||||
self.ocm.commit()
|
||||
self.order.refresh_from_db()
|
||||
nop = self.order.positions.first()
|
||||
assert nop.price == Decimal('25.59')
|
||||
assert nop.tax_rule == self.tr19
|
||||
assert nop.tax_rate == Decimal('19.00')
|
||||
assert nop.tax_value == Decimal('4.09')
|
||||
|
||||
@classscope(attr='o')
|
||||
def test_change_taxrate_to_country_specific(self):
|
||||
self.tr19.eu_reverse_charge = True
|
||||
|
||||
Reference in New Issue
Block a user