From 6b016d04a237b7ca12bbc3dd7301932cbd30ab94 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Mon, 12 Dec 2005 13:18:09 +0000
Subject: [PATCH] added the price

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4610 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/TransformationRule.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/product/ERP5/Document/TransformationRule.py b/product/ERP5/Document/TransformationRule.py
index deff206b37..11adc9a0f6 100755
--- a/product/ERP5/Document/TransformationRule.py
+++ b/product/ERP5/Document/TransformationRule.py
@@ -284,6 +284,10 @@ class TransformationRule(Rule):
       for amount in amount_list:
         consumed_mvt_id = "%s_%s" % ("cr", amount.getId())
         stop_date = parent_movement.getStartDate()
+        resource_price = amount.getResourcePrice()
+        price = None
+        if resource_price is not None:
+          price = amount.getQuantity() * resource_price
         consumed_movement_dict[consumed_mvt_id] = {
           'start_date': current_supply_link.getStartDate(stop_date),
           'stop_date': stop_date,
@@ -293,6 +297,7 @@ class TransformationRule(Rule):
           "variation_property_dict": \
                         amount.getVariationPropertyDict(),
           "quantity": amount.getQuantity() * parent_movement.getQuantity(),
+          "price": price,
           "quantity_unit": amount.getQuantityUnit(),
           "destination_list": (),
           "destination_section_list": (),
-- 
2.30.9