02.04.26
This commit is contained in:
@@ -310,5 +310,28 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
'USC 8.3000 PER POUND (EIGHT USC AND THIRTY CENTS) ON ICE Cotton #2 MARCH 2026',
|
||||
)])
|
||||
|
||||
def test_invoice_report_note_title_uses_total_amount_sign(self):
|
||||
'final invoice title switches between credit and debit note'
|
||||
Invoice = Pool().get('account.invoice')
|
||||
|
||||
credit = Invoice()
|
||||
credit.total_amount = Decimal('10')
|
||||
self.assertEqual(credit.report_note_title, 'Credit Note')
|
||||
|
||||
debit = Invoice()
|
||||
debit.total_amount = Decimal('-10')
|
||||
self.assertEqual(debit.report_note_title, 'Debit Note')
|
||||
|
||||
def test_invoice_report_net_sums_signed_invoice_lines(self):
|
||||
'invoice report net uses the signed differential from invoice lines'
|
||||
Invoice = Pool().get('account.invoice')
|
||||
|
||||
line_a = Mock(type='line', quantity=Decimal('1000'))
|
||||
line_b = Mock(type='line', quantity=Decimal('-200'))
|
||||
invoice = Invoice()
|
||||
invoice.lines = [line_a, line_b]
|
||||
|
||||
self.assertEqual(invoice.report_net, Decimal('800'))
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
|
||||
Reference in New Issue
Block a user