Commit ed4aaf36 authored by Jérome Perrin's avatar Jérome Perrin

Do not convert automatically the price, this should be done by the user.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5282 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4cae47c3
......@@ -134,7 +134,7 @@ class AccountingTransactionLine(DeliveryLine):
self._setSource(kw['source'])
elif kw.has_key('destination') :
self._setDestination(kw['destination'])
DeliveryLine._edit(self, REQUEST=REQUEST, force_update = force_update, **kw)
DeliveryLine._edit(self, REQUEST=REQUEST, force_update=force_update, **kw)
security.declareProtected(Permissions.AccessContentsInformation,
'getInventoriatedQuantity')
......@@ -166,40 +166,33 @@ class AccountingTransactionLine(DeliveryLine):
security.declareProtected(Permissions.AccessContentsInformation, 'getPrice')
def getPrice(self, context=None):
"""
The inventoriated quantity converted in a default unit
For assortments, returns the inventoriated quantity in terms of
number of items in the assortemnt.
For accounting, returns the quantity converted in a default unit
On accounting transaction lines, the price is always set to 1.
We use the `quantity` property for the default quantity, and the
converted value for source in getSourceInventoriatedTotalAssetPrice
and getDestinationInventoriatedTotalAssetPrice for destination.
"""
result = self.getInventoriatedQuantity()
resource = self.getResourceValue()
source_section = self.getSourceSectionValue()
if source_section is not None and \
resource is not None and \
hasattr(resource, 'convertCurrency') :
return resource.convertCurrency(result,
source_section.getPriceCurrencyValue())
return None
return 1.0
security.declareProtected(Permissions.AccessContentsInformation, 'getSourceAssetPrice')
security.declareProtected(Permissions.AccessContentsInformation,
'getSourceAssetPrice')
def getSourceAssetPrice(self):
"""
The price is set to 1.0 because we do not want to implement automatic currency
conversion in accounting. Users must define the conversion manually in accounting.
This is required by accounting law. One can not account USD (in a EUR based company)
without defining the equivalent in EUR.
The price is set to 1.0 because we do not want to implement
automatic currency conversion in accounting. Users must define the
conversion manually in accounting. This is required by accounting
law. One can not account USD (in a EUR based company) without
defining the equivalent in EUR.
"""
return 1.0
security.declareProtected(Permissions.AccessContentsInformation, 'getDestinationAssetPrice')
security.declareProtected(Permissions.AccessContentsInformation,
'getDestinationAssetPrice')
def getDestinationAssetPrice(self):
"""
The price is set to 1.0 because we do not want to implement automatic currency
conversion in accounting. Users must define the conversion manually in accounting.
This is required by accounting law. One can not account USD (in a EUR based company)
without defining the equivalent in EUR.
The price is set to 1.0 because we do not want to implement
automatic currency conversion in accounting. Users must define the
conversion manually in accounting. This is required by accounting
law. One can not account USD (in a EUR based company) without
defining the equivalent in EUR.
"""
return 1.0
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