Commit 86e02a8f authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

Movement: Add getSource(Destination)AssetPriceCurrency

parent 185b0949
......@@ -529,6 +529,28 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
return exchange_rate * 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
security.declareProtected( Permissions.AccessContentsInformation,
'isConvergent')
......
......@@ -65,6 +65,20 @@ class IAssetMovement(IAmount):
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():
"""
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