Commit bfc50ad0 authored by Klaus Wölfel's avatar Klaus Wölfel

WOELFEL TEMP erp5_core undefined price as 0 until decide how to do in generic erp5

parent 940b9250
......@@ -128,12 +128,12 @@ SELECT
GREATEST(0, quantity-@unbalanced_output)
) AS running_quantity,
(@running_total_asset_price:=@running_total_asset_price +
GREATEST(0, (quantity-@unbalanced_output) * total_price/quantity)
GREATEST(0, (quantity-@unbalanced_output) * IFNULL(total_price,0)/quantity)
) AS running_total_asset_price,
(@unbalanced_output:=GREATEST(0, @unbalanced_output-quantity)) as dummy,
<dtml-if "lowest_value_test">
(@total_asset_price:=LEAST(@running_total_asset_price,
@running_quantity * total_price/quantity)) as total_asset_price
@running_quantity * IFNULL(total_price,0)/quantity)) as total_asset_price
<dtml-else>
(@total_asset_price:= @running_total_asset_price) as total_asset_price
</dtml-if>
......
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