Commit 1a5d8425 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Titouan Soulard

Movement: Add getSource(Destination)AssetPriceCurrency

parent 94c2ef41
...@@ -529,6 +529,28 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin): ...@@ -529,6 +529,28 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
return exchange_rate * price return exchange_rate * price
return price return price
security.declareProtected( Permissions.AccessContentsInformation,
'getSourceAssetPriceCurrency')
def getSourceAssetPriceCurrency(self):
"""
Returns the price currency of the source section
"""
type_based_script = self._getTypeBasedMethod('getSourceAssetPriceCurrency')
if type_based_script:
return type_based_script()
return self.getPriceCurrency()
security.declareProtected( Permissions.AccessContentsInformation,
'getDestinationAssetPriceCurrency')
def getDestinationAssetPriceCurrency(self):
"""
Returns the price currency of the destination section
"""
type_based_script = self._getTypeBasedMethod('getDestinationAssetPriceCurrency')
if type_based_script:
return type_based_script()
return self.getPriceCurrency()
# Causality computation # Causality computation
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'isConvergent') 'isConvergent')
......
...@@ -65,6 +65,20 @@ class IAssetMovement(IAmount): ...@@ -65,6 +65,20 @@ class IAssetMovement(IAmount):
the same company. the same company.
""" """
def getSourceAssetPriceCurrency():
"""
Return the asset price currency of the source section,
usually the currency of the movement. It is also possible for
a movement to have 'None' source asset price currency.
"""
def getDestinationAssetPriceCurrency():
"""
Return the asset price currency of the destination section,
usually the currency of the movement. It is also possible for
a movement to have 'None' destination asset price currency.
"""
def getSourceInventoriatedTotalAssetPrice(): def getSourceInventoriatedTotalAssetPrice():
""" """
Returns the total asset price for the source section, either Returns the total asset price for the source section, either
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment