Lot invoicing + Fee
This commit is contained in:
@@ -7914,6 +7914,41 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
self.assertEqual(invoice.report_commission_note_total_display, '24.60')
|
||||
fee.get_amount.assert_not_called()
|
||||
|
||||
def test_sale_provisional_invoice_delete_collects_padding_lots(self):
|
||||
'deleting a draft sale provisional invoice clears its lot padding'
|
||||
Invoice = Pool().get('account.invoice')
|
||||
|
||||
invoice = SimpleNamespace(
|
||||
id=10,
|
||||
type='out',
|
||||
reference='Provisional',
|
||||
number=None,
|
||||
lines=[])
|
||||
provisional_line = SimpleNamespace(invoice=invoice)
|
||||
lot = SimpleNamespace(
|
||||
id=20,
|
||||
sale_invoice_padding=Decimal('2'),
|
||||
sale_invoice_line_prov=provisional_line)
|
||||
invoice.lines = [
|
||||
SimpleNamespace(
|
||||
type='line',
|
||||
description='Pro forma',
|
||||
lot=lot)]
|
||||
|
||||
self.assertEqual(
|
||||
Invoice._sale_padding_lots_to_clear_on_delete([invoice]),
|
||||
[lot])
|
||||
|
||||
def test_lot_invoice_message_mentions_processed_fees(self):
|
||||
'lot invoice success message mentions selected fee invoicing'
|
||||
wizard = lot_module.LotInvoice()
|
||||
wizard._invoiced_fee_count = 2
|
||||
|
||||
self.assertEqual(
|
||||
wizard.default_message(None)['message'],
|
||||
'The invoice has been successfully created. '
|
||||
'2 selected fee invoice(s) have also been processed.')
|
||||
|
||||
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')
|
||||
|
||||
Reference in New Issue
Block a user