Commit 8304e68e authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

in case of total_quantity==0, the some of delivery_ratio should be specified value.

also cast delivery_ratio to float for safety.
parent 0a394578
......@@ -362,10 +362,10 @@ class FakeMovement:
if total_quantity != 0:
for movement in self.__movement_list:
quantity = movement.getMappedProperty('quantity')
movement.edit(delivery_ratio=quantity*delivery_ratio/total_quantity)
movement.edit(delivery_ratio=quantity*float(delivery_ratio)/total_quantity)
else:
# Distribute equally ratio to all movement
mvt_ratio = 1. / len(self.__movement_list)
mvt_ratio = float(delivery_ratio) / len(self.__movement_list)
for movement in self.__movement_list:
movement.edit(delivery_ratio=mvt_ratio)
......
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