Commit 40bb53b8 authored by Jérome Perrin's avatar Jérome Perrin

added InventoriatedTotalAsset Credit and Debit helpers method for source and destination


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5576 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dcbd6127
......@@ -302,6 +302,32 @@ class Movement(XMLObject, Amount):
if source_asset_price :
return source_asset_price * - quantity
return None
security.declareProtected( Permissions.AccessContentsInformation,
'getSourceInventoriatedTotalAssetDebit')
def getSourceInventoriatedTotalAssetDebit(self) :
"""
Returns the debit part of inventoriated source total asset price.
"""
result = self.getSourceInventoriatedTotalAssetPrice()
if result is not None :
if result < 0:
return 0.0
else :
return result
security.declareProtected( Permissions.AccessContentsInformation,
'getSourceInventoriatedTotalAssetCredit')
def getSourceInventoriatedTotalAssetCredit(self) :
"""
Returns the credit part of inventoriated source total asset price.
"""
result = self.getSourceInventoriatedTotalAssetPrice()
if result is not None :
if result < 0:
return -result
else :
return 0.0
security.declareProtected( Permissions.AccessContentsInformation,
'getDestinationInventoriatedTotalAssetPrice')
......@@ -323,6 +349,32 @@ class Movement(XMLObject, Amount):
return destination_asset_price * quantity
return None
security.declareProtected( Permissions.AccessContentsInformation,
'getDestinationInventoriatedTotalAssetDebit')
def getDestinationInventoriatedTotalAssetDebit(self) :
"""
Returns the debit part of inventoriated destination total asset price.
"""
result = self.getDestinationInventoriatedTotalAssetPrice()
if result is not None :
if result < 0:
return 0.0
else :
return result
security.declareProtected( Permissions.AccessContentsInformation,
'getDestinationInventoriatedTotalAssetCredit')
def getDestinationInventoriatedTotalAssetCredit(self) :
"""
Returns the credit part of inventoriated destination total asset price.
"""
result = self.getDestinationInventoriatedTotalAssetPrice()
if result is not None :
if result < 0:
return -result
else :
return 0.0
security.declareProtected( Permissions.AccessContentsInformation,
'getSourceAssetPrice')
def getSourceAssetPrice(self):
......
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