Commit ce54cba0 authored by Jean-Paul Smets's avatar Jean-Paul Smets

merge in Coramy asset code


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1234 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4351ef8b
...@@ -483,7 +483,7 @@ class SimulationTool (Folder, UniqueObject): ...@@ -483,7 +483,7 @@ class SimulationTool (Folder, UniqueObject):
source_section = path_group.source_section, source_section = path_group.source_section,
destination_section = path_group.destination_section, destination_section = path_group.destination_section,
description = of_description, description = of_description,
title = "Auto Planned" title = new_delivery_id
) )
delivery = delivery_module[new_delivery_id] delivery = delivery_module[new_delivery_id]
# the new delivery is added to the order_list # the new delivery is added to the order_list
...@@ -725,6 +725,8 @@ class SimulationTool (Folder, UniqueObject): ...@@ -725,6 +725,8 @@ class SimulationTool (Folder, UniqueObject):
cell_target_quantity = 0 cell_target_quantity = 0
cell_total_price = 0 cell_total_price = 0
for movement in variant_group.movement_list : for movement in variant_group.movement_list :
LOG('SimulationTool, movement.getPhysicalPath',0,movement.getPhysicalPath())
LOG('SimulationTool, movement.showDict',0,movement.showDict())
cell_target_quantity += movement.getNetConvertedTargetQuantity() cell_target_quantity += movement.getNetConvertedTargetQuantity()
try: try:
cell_total_price += movement.getNetConvertedTargetQuantity()*movement.getPrice() # XXX WARNING - ADD PRICED QUANTITY cell_total_price += movement.getNetConvertedTargetQuantity()*movement.getPrice() # XXX WARNING - ADD PRICED QUANTITY
...@@ -1142,22 +1144,24 @@ class SimulationTool (Folder, UniqueObject): ...@@ -1142,22 +1144,24 @@ class SimulationTool (Folder, UniqueObject):
if m.getSourceSectionValue() is not None and m.getSourceSectionValue().isAcquiredMemberOf(section_category): if m.getSourceSectionValue() is not None and m.getSourceSectionValue().isAcquiredMemberOf(section_category):
# for each movement, source section is member of one and one only accounting category # for each movement, source section is member of one and one only accounting category
# therefore there is only one and one only source asset price # therefore there is only one and one only source asset price
quantity = m.getInventoriatedQuantity() m._setSourceAssetPrice(current_asset_price)
if quantity: #quantity = m.getInventoriatedQuantity()
total_asset_price = - current_asset_price * quantity #if quantity:
m.Movement_zSetSourceTotalAssetPrice(uid=m.getUid(), total_asset_price = total_asset_price) # #total_asset_price = - current_asset_price * quantity
#m._setSourceAssetPrice(current_asset_price) # #m.Movement_zSetSourceTotalAssetPrice(uid=m.getUid(), total_asset_price = total_asset_price)
if m.getDestinationSectionValue() is not None and m.getDestinationSectionValue().isAcquiredMemberOf(section_category): # m._setSourceAssetPrice(current_asset_price)
if m.getDestinationSectionValue() is not None and m.getDestinationSectionValue().isMemberOf(section_category):
# for each movement, destination section is member of one and one only accounting category # for each movement, destination section is member of one and one only accounting category
# therefore there is only one and one only destination asset price # therefore there is only one and one only destination asset price
#m._setDestinationAssetPrice(current_asset_price) m._setDestinationAssetPrice(current_asset_price)
quantity = m.getInventoriatedQuantity() #quantity = m.getInventoriatedQuantity()
if quantity: #if quantity:
total_asset_price = current_asset_price * quantity # total_asset_price = current_asset_price * quantity
m.Movement_zSetDestinationTotalAssetPrice(uid=m.getUid(), total_asset_price = total_asset_price) # m.Movement_zSetDestinationTotalAssetPrice(uid=m.getUid(), total_asset_price = total_asset_price)
# Global reindexing required afterwards in any case: so let us do it now # Global reindexing required afterwards in any case: so let us do it now
# Until we get faster methods (->reindexObject()) # Until we get faster methods (->reindexObject())
#m.immediateReindexObject() #m.immediateReindexObject()
m.reindexObject()
#m.activate(priority=7).immediateReindexObject() # Too slow #m.activate(priority=7).immediateReindexObject() # Too slow
return result return result
......
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