[Erp5-report] r30603 - /erp5/trunk/products/ERP5/Document/BudgetCell.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Nov 13 18:10:43 CET 2009


Author: jerome
Date: Fri Nov 13 18:10:40 2009
New Revision: 30603

URL: http://svn.erp5.org?rev=30603&view=rev
Log:
take into account budget line consumption sign for current balance and current
inventory

Modified:
    erp5/trunk/products/ERP5/Document/BudgetCell.py

Modified: erp5/trunk/products/ERP5/Document/BudgetCell.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BudgetCell.py?rev=30603&r1=30602&r2=30603&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BudgetCell.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BudgetCell.py [utf8] Fri Nov 13 18:10:40 2009
@@ -92,14 +92,16 @@
         kw['resource_uid'] = resource.getUid()
       if at_date:
         kw['at_date'] = at_date
-      return self.portal_simulation.getCurrentInventory(**kw)
+      sign = self.getParentValue().BudgetLine_getConsumptionSign()
+      return sign * self.portal_simulation.getCurrentInventory(**kw)
 
     security.declareProtected(Permissions.AccessContentsInformation, 'getCurrentBalance')
     def getCurrentBalance(self, at_date=None):
       """
       Returns current balance
       """
-      return self.getQuantity(0.0) + self.getCurrentInventory(at_date=at_date)
+      sign = self.getParentValue().BudgetLine_getConsumptionSign()
+      return sign * self.getQuantity(0.0) + self.getCurrentInventory(at_date=at_date)
 
     security.declareProtected(Permissions.AccessContentsInformation, 'getConsumedBudget')
     def getConsumedBudget(self, src__=0):




More information about the Erp5-report mailing list