[Erp5-report] r29986 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 23 19:09:39 CEST 2009


Author: kazuhiko
Date: Fri Oct 23 19:09:39 2009
New Revision: 29986

URL: http://svn.erp5.org?rev=29986&view=rev
Log:
support Internal Supply in Movement_getPriceCalculationOperandDict.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.xml?rev=29986&r1=29985&r2=29986&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Movement_getPriceCalculationOperandDict.xml [utf8] Fri Oct 23 19:09:39 2009
@@ -63,6 +63,26 @@
   if a.getDestinationSection():\n
     return -1 # a defines a destination section and wins\n
   return 1 # a defines no destination section and loses\n
+\n
+\n
+def getResourceInternalPriceSortMethod(high_priority_supply_line_list):\n
+  def resourceInternalPriceSortMethod(a, b):\n
+    if a in high_priority_supply_line_list:\n
+      return -1\n
+    elif b in high_priority_supply_line_list:\n
+      return 1\n
+\n
+    if "Internal" in a.getPortalType():\n
+      if "Internal" in b.getPortalType():\n
+        return destinationSectionSortMethod(a, b)\n
+      else:\n
+        return -1\n
+    else:\n
+      if "Internal" in b.getPortalType():\n
+        return 1\n
+      else:\n
+        return sourceSectionSortMethod(a, b)\n
+  return resourceInternalPriceSortMethod\n
 \n
 \n
 def getResourcePurchasePriceSortMethod(high_priority_supply_line_list):\n
@@ -138,7 +158,10 @@
                   checked_permission=\'View\')))\n
 \n
   # XXX FIXME: Hardcoded values\n
-  if "Purchase" in explanation_type:\n
+  if "Internal" in explanation_type:\n
+    kw[\'sort_method\'] = getResourceInternalPriceSortMethod(\n
+                                  high_priority_supply_line_list)\n
+  elif "Purchase" in explanation_type:\n
     kw[\'sort_method\'] = getResourcePurchasePriceSortMethod(\n
                                   high_priority_supply_line_list)\n
   elif "Sale" in explanation_type:\n
@@ -192,6 +215,7 @@
                             <string>kw</string>
                             <string>sourceSectionSortMethod</string>
                             <string>destinationSectionSortMethod</string>
+                            <string>getResourceInternalPriceSortMethod</string>
                             <string>getResourcePurchasePriceSortMethod</string>
                             <string>getResourceSalePriceSortMethod</string>
                             <string>getRelatedTradeConditionList</string>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=29986&r1=29985&r2=29986&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Fri Oct 23 19:09:39 2009
@@ -1,1 +1,1 @@
-1348
+1349




More information about the Erp5-report mailing list