Lot invoicing + Fee padding

This commit is contained in:
2026-06-23 15:28:11 +02:00
parent 2998d8d570
commit cf7aa7f5b5
2 changed files with 35 additions and 5 deletions

View File

@@ -3402,6 +3402,25 @@ class PurchaseTradeTestCase(ModuleTestCase):
self.assertEqual(fee_line.fee_quantity, Decimal('5'))
self.assertEqual(fee_line.fee_amount, Decimal('10.00'))
def test_lot_invoice_default_final_fee_display_ignores_padding(self):
'initial final fee display reads amount without padding'
class FeeStub:
state = 'invoiced'
add_padding = True
@property
def amount(self):
if Transaction().context.get(
'_purchase_trade_ignore_fee_padding'):
return Decimal('14970')
return Decimal('14985')
fee = FeeStub()
self.assertEqual(
lot_module.LotInvoice._fee_display_amount(fee, 'final'),
Decimal('14970'))
def test_fee_get_non_cog_returns_zero_without_move_lines(self):
'fee non-cog amount is zero before any accounting move line exists'
fee = fee_module.Fee()