Commit 94e1a114 authored by Jérome Perrin's avatar Jérome Perrin

Make sure asset calculation methods returns 0 rather than None


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5839 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 16fd2364
...@@ -311,10 +311,9 @@ class Movement(XMLObject, Amount): ...@@ -311,10 +311,9 @@ class Movement(XMLObject, Amount):
""" """
result = self.getSourceInventoriatedTotalAssetPrice() result = self.getSourceInventoriatedTotalAssetPrice()
if result is not None : if result is not None :
if result < 0: if result > 0:
return 0.0
else :
return result return result
return 0.0
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'getSourceInventoriatedTotalAssetCredit') 'getSourceInventoriatedTotalAssetCredit')
...@@ -326,8 +325,7 @@ class Movement(XMLObject, Amount): ...@@ -326,8 +325,7 @@ class Movement(XMLObject, Amount):
if result is not None : if result is not None :
if result < 0: if result < 0:
return -result return -result
else : return 0.0
return 0.0
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'getDestinationInventoriatedTotalAssetPrice') 'getDestinationInventoriatedTotalAssetPrice')
...@@ -357,10 +355,9 @@ class Movement(XMLObject, Amount): ...@@ -357,10 +355,9 @@ class Movement(XMLObject, Amount):
""" """
result = self.getDestinationInventoriatedTotalAssetPrice() result = self.getDestinationInventoriatedTotalAssetPrice()
if result is not None : if result is not None :
if result < 0: if result > 0:
return 0.0
else :
return result return result
return 0.0
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'getDestinationInventoriatedTotalAssetCredit') 'getDestinationInventoriatedTotalAssetCredit')
...@@ -372,8 +369,7 @@ class Movement(XMLObject, Amount): ...@@ -372,8 +369,7 @@ class Movement(XMLObject, Amount):
if result is not None : if result is not None :
if result < 0: if result < 0:
return -result return -result
else : return 0.0
return 0.0
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'getSourceAssetPrice') 'getSourceAssetPrice')
......
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