Demurrage
This commit is contained in:
@@ -1457,6 +1457,35 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
sof._applied_compensation_amount(), Decimal('-12000.00'))
|
||||
self.assertEqual(sof.compensation_type, 'demurrage')
|
||||
|
||||
@with_transaction()
|
||||
def test_sof_available_conditions_include_shipment_contracts(self):
|
||||
'sof applied condition choices include owner, purchase and sale terms'
|
||||
Sof = Pool().get('sof.statement')
|
||||
sof = Sof()
|
||||
sof.charter_party = None
|
||||
sof.shipment = Mock(
|
||||
get_owner_charter_conditions=Mock(return_value=[1]),
|
||||
get_purchase_charter_conditions=Mock(return_value=[2]),
|
||||
get_sale_charter_conditions=Mock(return_value=[3]))
|
||||
|
||||
self.assertEqual(sof.get_applied_conditions(), [1, 2, 3])
|
||||
|
||||
@with_transaction()
|
||||
def test_sof_default_applied_condition_can_use_purchase_terms(self):
|
||||
'sof default applied condition can come from purchase without charter'
|
||||
Sof = Pool().get('sof.statement')
|
||||
sof = Sof()
|
||||
sof.charter_party = None
|
||||
sof.shipment = Mock(
|
||||
charter_party=None,
|
||||
get_owner_charter_conditions=Mock(return_value=[]),
|
||||
get_purchase_charter_conditions=Mock(return_value=[12]),
|
||||
get_sale_charter_conditions=Mock(return_value=[]))
|
||||
|
||||
sof.on_change_shipment()
|
||||
|
||||
self.assertEqual(sof.applied_condition, 12)
|
||||
|
||||
@with_transaction()
|
||||
def test_sof_laytime_start_reads_structured_condition_rule(self):
|
||||
'sof laytime start reads the structured event and offset'
|
||||
|
||||
Reference in New Issue
Block a user