From 4154e390a198a27b50b60e0551949764ddd3f976 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Thu, 28 Jan 2010 16:23:32 +0000
Subject: [PATCH] add the new Invoice Rule.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32070 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../DocumentTemplateItem/InvoiceRule.py       | 153 ++++++++++++++++++
 .../portal_rules/new_invoice_rule.xml         | 139 ++++++++++++++++
 .../portal_rules/new_invoice_rule/1.xml       |  35 ++++
 .../portal_rules/new_invoice_rule/10.xml      |  35 ++++
 .../portal_rules/new_invoice_rule/11.xml      |  35 ++++
 .../portal_rules/new_invoice_rule/12.xml      |  35 ++++
 .../portal_rules/new_invoice_rule/13.xml      |  35 ++++
 .../portal_rules/new_invoice_rule/14.xml      |  35 ++++
 .../portal_rules/new_invoice_rule/15.xml      | 102 ++++++++++++
 .../portal_rules/new_invoice_rule/16.xml      |  39 +++++
 .../portal_rules/new_invoice_rule/17.xml      | 118 ++++++++++++++
 .../portal_rules/new_invoice_rule/18.xml      |  56 +++++++
 .../portal_rules/new_invoice_rule/19.xml      | 134 +++++++++++++++
 .../portal_rules/new_invoice_rule/21.xml      | 130 +++++++++++++++
 .../portal_rules/new_invoice_rule/4.xml       |  97 +++++++++++
 .../portal_rules/new_invoice_rule/5.xml       |  35 ++++
 .../portal_rules/new_invoice_rule/6.xml       |  35 ++++
 .../portal_rules/new_invoice_rule/7.xml       |  35 ++++
 .../portal_rules/new_invoice_rule/8.xml       |  35 ++++
 .../portal_rules/new_invoice_rule/9.xml       |  35 ++++
 .../bt/template_document_id_list              |   1 +
 bt5/erp5_simulation/bt/template_path_list     |   2 +
 22 files changed, 1356 insertions(+)
 create mode 100644 bt5/erp5_simulation/DocumentTemplateItem/InvoiceRule.py
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/1.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/10.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/11.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/12.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/13.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/14.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/15.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/16.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/17.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/18.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/19.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/21.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/4.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/5.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/6.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/7.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/8.xml
 create mode 100644 bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/9.xml

diff --git a/bt5/erp5_simulation/DocumentTemplateItem/InvoiceRule.py b/bt5/erp5_simulation/DocumentTemplateItem/InvoiceRule.py
new file mode 100644
index 0000000000..17ff266d07
--- /dev/null
+++ b/bt5/erp5_simulation/DocumentTemplateItem/InvoiceRule.py
@@ -0,0 +1,153 @@
+##############################################################################
+#
+# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# guarantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+##############################################################################
+"""
+XXX This file is experimental for new simulation implementation, and
+will replace InvoiceRule.
+"""
+
+import zope.interface
+from AccessControl import ClassSecurityInfo
+from Products.ERP5Type import Permissions, PropertySheet, interfaces
+from Products.ERP5.Document.Predicate import Predicate
+from Products.ERP5.mixin.rule import RuleMixin
+from Products.ERP5.mixin.movement_collection_updater import \
+     MovementCollectionUpdaterMixin
+from Products.ERP5.mixin.movement_generator import MovementGeneratorMixin
+
+class InvoiceRule(RuleMixin, MovementCollectionUpdaterMixin, Predicate):
+  """
+  InvoiceRule and DeliveryRule seems to be identical. Keep it for
+  compatibility only.
+  """
+  # CMF Type Definition
+  meta_type = 'ERP5 Invoice Rule'
+  portal_type = 'Invoice Rule'
+
+  # Declarative security
+  security = ClassSecurityInfo()
+  security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+  # Declarative interfaces
+  zope.interface.implements(interfaces.IRule,
+                            interfaces.IDivergenceController,
+                            interfaces.IMovementCollectionUpdater,)
+
+  # Default Properties
+  property_sheets = (
+    PropertySheet.Base,
+    PropertySheet.XMLObject,
+    PropertySheet.CategoryCore,
+    PropertySheet.DublinCore,
+    PropertySheet.Task,
+    PropertySheet.Predicate,
+    PropertySheet.Reference,
+    PropertySheet.Version,
+    PropertySheet.Rule
+    )
+
+  def _getMovementGenerator(self):
+    """
+    Return the movement generator to use in the expand process
+    """
+    return InvoiceRuleMovementGenerator()
+
+  def _getMovementGeneratorContext(self, context):
+    """
+    Return the movement generator context to use for expand
+    """
+    return context
+
+  def _getMovementGeneratorMovementList(self):
+    """
+    Return the movement lists to provide to the movement generator
+    """
+    return []
+
+  def _isProfitAndLossMovement(self, movement):
+    # For a kind of trade rule, a profit and loss movement lacks source
+    # or destination.
+    return (movement.getSource() is None or movement.getDestination() is None)
+
+class InvoiceRuleMovementGenerator(MovementGeneratorMixin):
+  def getGeneratedMovementList(self, context, movement_list=None,
+                                rounding=False):
+    """
+    Input movement list comes from delivery
+    """
+    ret = []
+    for input_movement, business_path in self \
+            ._getInputMovementAndPathTupleList(context):
+      kw = self._getPropertyAndCategoryList(input_movement, business_path)
+      simulation_movement = context.newContent(
+        portal_type=RuleMixin.movement_type,
+        temp_object=True,
+        order_value=input_movement,
+        delivery_value=input_movement,
+        **kw)
+      ret.append(simulation_movement)
+    return ret
+
+  def _getInputMovementList(self, context):
+    """Input movement list comes from delivery"""
+    delivery = context.getDefaultCausalityValue()
+    if delivery is None:
+      return []
+    else:
+      ret = []
+      existing_movement_list = context.objectValues()
+      for movement in delivery.getMovementList(
+        portal_type=(delivery.getPortalInvoiceMovementTypeList() + \
+                     delivery.getPortalTaxMovementTypeList())):
+        simulation_movement = self._getDeliveryRelatedSimulationMovement(movement)
+        if simulation_movement is None or \
+               simulation_movement in existing_movement_list:
+          ret.append(movement)
+      return ret
+
+  def _getDeliveryRelatedSimulationMovement(self, delivery_movement):
+    """Helper method to get the delivery related simulation movement.
+    This method is more robust than simply calling getDeliveryRelatedValue
+    which will not work if simulation movements are not indexed.
+    """
+    simulation_movement = delivery_movement.getDeliveryRelatedValue()
+    if simulation_movement is not None:
+      return simulation_movement
+    # simulation movement was not found, maybe simply because it's not indexed
+    # yet. We'll look in the simulation tree and try to find it anyway before
+    # creating another simulation movement.
+    # Try to find the one from trade model rule, which is the most common case
+    # where we may expand again before indexation of simulation movements is
+    # finished.
+    delivery = delivery_movement.getExplanationValue()
+    for movement in delivery.getMovementList():
+      related_simulation_movement = movement.getDeliveryRelatedValue()
+      if related_simulation_movement is not None:
+        for applied_rule in related_simulation_movement.contentValues():
+          for simulation_movement in applied_rule.contentValues():
+            if simulation_movement.getDeliveryValue() == delivery_movement:
+              return simulation_movement
+    return None
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule.xml
new file mode 100644
index 0000000000..68031c24ac
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="InvoiceRule" module="Products.ERP5Type.Document.InvoiceRule"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_count</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_identity_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_mt_index</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_range_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_tree</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_reference</string> </key>
+            <value> <string>default_invoice_rule</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>new_invoice_rule</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Invoice Rule</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>New Invoice Rule</string> </value>
+        </item>
+        <item>
+            <key> <string>version</string> </key>
+            <value> <string>2</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="Length" module="BTrees.Length"/>
+    </pickle>
+    <pickle> <int>0</int> </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <global name="OOBTree" module="BTrees._OOBTree"/>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+  <record id="5" aka="AAAAAAAAAAU=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>start_date</string> </key>
+                    <value>
+                      <tuple>
+                        <none/>
+                        <none/>
+                      </tuple>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="6" aka="AAAAAAAAAAY=">
+    <pickle>
+      <global name="OOBTree" module="BTrees._OOBTree"/>
+    </pickle>
+    <pickle>
+      <none/>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/1.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/1.xml
new file mode 100644
index 0000000000..aa38f209e8
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/1.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>1</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>aggregate</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>aggregate divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/10.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/10.xml
new file mode 100644
index 0000000000..ea363c7036
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/10.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>10</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>source</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>source divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/11.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/11.xml
new file mode 100644
index 0000000000..c5d12ecf9b
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/11.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>11</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>source_account</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>source_account divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/12.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/12.xml
new file mode 100644
index 0000000000..54a763bd76
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/12.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>12</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>source_function</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>source_function divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/13.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/13.xml
new file mode 100644
index 0000000000..643fa46f3d
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/13.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>13</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>source_project</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>source_project divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/14.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/14.xml
new file mode 100644
index 0000000000..2c3c8d4610
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/14.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>14</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>source_section</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>source_section divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/15.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/15.xml
new file mode 100644
index 0000000000..b7b347a86a
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/15.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_identity_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_range_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>solver/portal_types/Resource Adoption Solver</string>
+                <string>solver/portal_types/Resource Replacement Solver</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>15</string> </value>
+        </item>
+        <item>
+            <key> <string>matching_provider</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>resource</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>resource divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/16.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/16.xml
new file mode 100644
index 0000000000..c8bcb34aa7
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/16.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="VariationDivergenceTester" module="Products.ERP5Type.Document.VariationDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>16</string> </value>
+        </item>
+        <item>
+            <key> <string>matching_provider</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Variation Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>variation_property_dict</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>variation_property_dict divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/17.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/17.xml
new file mode 100644
index 0000000000..eef1e34267
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/17.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="DateTimeDivergenceTester" module="Products.ERP5Type.Document.DateTimeDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_identity_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_local_properties</string> </key>
+            <value>
+              <tuple>
+                <dictionary>
+                  <item>
+                      <key> <string>id</string> </key>
+                      <value> <string>quantity</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>type</string> </key>
+                      <value> <string>int</string> </value>
+                  </item>
+                </dictionary>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_range_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>solver/portal_types/Start Date Replacement Solver</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>17</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>DateTime Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>quantity</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>start_date</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>start_date divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/18.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/18.xml
new file mode 100644
index 0000000000..80c005f38a
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/18.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="DateTimeDivergenceTester" module="Products.ERP5Type.Document.DateTimeDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_local_properties</string> </key>
+            <value>
+              <tuple>
+                <dictionary>
+                  <item>
+                      <key> <string>id</string> </key>
+                      <value> <string>quantity</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>type</string> </key>
+                      <value> <string>int</string> </value>
+                  </item>
+                </dictionary>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>18</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>DateTime Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>quantity</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>stop_date</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>stop_date divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/19.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/19.xml
new file mode 100644
index 0000000000..952442b891
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/19.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="NetConvertedQuantityDivergenceTester" module="Products.ERP5Type.Document.NetConvertedQuantityDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_identity_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_local_properties</string> </key>
+            <value>
+              <tuple>
+                <dictionary>
+                  <item>
+                      <key> <string>id</string> </key>
+                      <value> <string>quantity</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>type</string> </key>
+                      <value> <string>int</string> </value>
+                  </item>
+                </dictionary>
+                <dictionary>
+                  <item>
+                      <key> <string>id</string> </key>
+                      <value> <string>use_delivery_ratio</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>type</string> </key>
+                      <value> <string>int</string> </value>
+                  </item>
+                </dictionary>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_range_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>solver/portal_types/Quantity Accept Solver</string>
+                <string>solver/portal_types/Quantity Adoption Solver</string>
+                <string>solver/portal_types/Quantity Split Solver</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>19</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Net Converted Quantity Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>quantity</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>quantity</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>quantity divergence tester</string> </value>
+        </item>
+        <item>
+            <key> <string>use_delivery_ratio</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/21.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/21.xml
new file mode 100644
index 0000000000..98cce85b31
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/21.xml
@@ -0,0 +1,130 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="FloatDivergenceTester" module="Products.ERP5Type.Document.FloatDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_identity_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_local_properties</string> </key>
+            <value>
+              <tuple>
+                <dictionary>
+                  <item>
+                      <key> <string>id</string> </key>
+                      <value> <string>quantity</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>type</string> </key>
+                      <value> <string>int</string> </value>
+                  </item>
+                </dictionary>
+                <dictionary>
+                  <item>
+                      <key> <string>id</string> </key>
+                      <value> <string>use_delivery_ratio</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>type</string> </key>
+                      <value> <string>int</string> </value>
+                  </item>
+                </dictionary>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_range_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>21</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Float Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>quantity</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>price</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>price divergence tester</string> </value>
+        </item>
+        <item>
+            <key> <string>use_delivery_ratio</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/4.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/4.xml
new file mode 100644
index 0000000000..edba143b39
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/4.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_identity_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>_range_criterion</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>solver/portal_types/Destination Replacement Solver</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>4</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>destination</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>destination divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/5.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/5.xml
new file mode 100644
index 0000000000..6bd643bd1e
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/5.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>5</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>destination_account</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>destination_account divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/6.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/6.xml
new file mode 100644
index 0000000000..5be6e509e5
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/6.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>6</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>destination_function</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>destination_function divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/7.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/7.xml
new file mode 100644
index 0000000000..ceebd4b00e
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/7.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>7</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>destination_project</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>destination_project divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/8.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/8.xml
new file mode 100644
index 0000000000..6f9b6105d1
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/8.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>8</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>destination_section</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>destination_section divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/9.xml b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/9.xml
new file mode 100644
index 0000000000..cfb689ed5f
--- /dev/null
+++ b/bt5/erp5_simulation/PathTemplateItem/portal_rules/new_invoice_rule/9.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="CategoryMembershipDivergenceTester" module="Products.ERP5Type.Document.CategoryMembershipDivergenceTester"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>9</string> </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Category Membership Divergence Tester</string> </value>
+        </item>
+        <item>
+            <key> <string>tested_property</string> </key>
+            <value>
+              <tuple>
+                <string>price_currency</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>price_currency divergence tester</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_simulation/bt/template_document_id_list b/bt5/erp5_simulation/bt/template_document_id_list
index ac50f95404..b782aceb29 100644
--- a/bt5/erp5_simulation/bt/template_document_id_list
+++ b/bt5/erp5_simulation/bt/template_document_id_list
@@ -1,4 +1,5 @@
 DeliveryRule
+InvoiceRule
 InvoiceTransactionRule
 InvoicingRule
 OrderRule
diff --git a/bt5/erp5_simulation/bt/template_path_list b/bt5/erp5_simulation/bt/template_path_list
index b9276ff38d..98f9b093b1 100644
--- a/bt5/erp5_simulation/bt/template_path_list
+++ b/bt5/erp5_simulation/bt/template_path_list
@@ -2,6 +2,8 @@ portal_rules/default_invoicing_rule
 portal_rules/default_invoicing_rule/3
 portal_rules/new_delivery_rule
 portal_rules/new_delivery_rule/**
+portal_rules/new_invoice_rule
+portal_rules/new_invoice_rule/**
 portal_rules/new_invoice_transaction_rule
 portal_rules/new_invoice_transaction_rule/**
 portal_rules/new_invoicing_rule
-- 
2.30.9