net gross
This commit is contained in:
@@ -1189,11 +1189,26 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
|
||||
mt = Mock(id=1, rec_name='MT')
|
||||
kg = Mock(id=2, rec_name='KILOGRAM')
|
||||
current_type = Mock(id=100)
|
||||
previous_type = Mock(id=200)
|
||||
shared_lot = Mock(id=10, lot_type='physic', lot_unit_line=kg)
|
||||
shared_lot.lot_state = current_type
|
||||
shared_lot.get_hist_quantity.return_value = (
|
||||
Decimal('999995'),
|
||||
Decimal('999995'),
|
||||
Decimal('999992'),
|
||||
)
|
||||
shared_lot.lot_hist = [
|
||||
Mock(
|
||||
quantity_type=previous_type,
|
||||
quantity=Decimal('999995'),
|
||||
gross_quantity=Decimal('999998'),
|
||||
),
|
||||
Mock(
|
||||
quantity_type=current_type,
|
||||
quantity=Decimal('999990'),
|
||||
gross_quantity=Decimal('999992'),
|
||||
),
|
||||
]
|
||||
|
||||
negative = Mock(
|
||||
type='line',
|
||||
@@ -1233,6 +1248,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
PoolMock.return_value.get.return_value = uom_model
|
||||
|
||||
self.assertEqual(invoice.report_net, Decimal('-5.000'))
|
||||
self.assertEqual(invoice.report_gross, Decimal('-6'))
|
||||
self.assertEqual(
|
||||
invoice.report_quantity_lines.splitlines(),
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user