<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </value>
        </item>
        <item>
            <key> <string>_bind_names</string> </key>
            <value>
              <object>
                <klass>
                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>_asgns</string> </key>
                        <value>
                          <dictionary>
                            <item>
                                <key> <string>name_container</string> </key>
                                <value> <string>container</string> </value>
                            </item>
                            <item>
                                <key> <string>name_context</string> </key>
                                <value> <string>context</string> </value>
                            </item>
                            <item>
                                <key> <string>name_m_self</string> </key>
                                <value> <string>script</string> </value>
                            </item>
                            <item>
                                <key> <string>name_subpath</string> </key>
                                <value> <string>traverse_subpath</string> </value>
                            </item>
                          </dictionary>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>_body</string> </key>
            <value> <string encoding="cdata"><![CDATA[

""" \n
This script generate a usage report test sample for one or two partitions\n
"""\n
\n
# First we check the number of partition to invoice\n
if number in [1, 2]:\n
\n
  # We build movements\n
  movement = """\n
    <movement>\n
      <resource>%s</resource>\n
      <title>%s</title>\n
      <reference>%s</reference>       \n
      <quantity>%s</quantity>\n
      <price>0.00</price>        \n
      <VAT>None</VAT>\n
      <category>None</category>\n
    </movement>"""\n
\n
  # Then, we create two movements for each partition, one for the CPU consumption, and the other for the memory\n
  movements = ""\n
  for nb in range(number):\n
    if nb == 0:\n
      movements += movement % (\'CPU Consumption\', \'Title Sale Packing List Line 1\', \'slappart0\', \'42.42\')\n
      movements += movement % (\'Memory Consumption\', \'Title Sale Packing List Line 2\', \'slappart0\', \'42.42\')\n
    else:\n
      movements += movement % (\'CPU Consumption\', \'Title Sale Packing List Line 1\', \'slappart1\', \'46.46\')\n
      movements += movement % (\'Memory Consumption\', \'Title Sale Packing List Line 2\', \'slappart1\', \'46.46\')\n
\n
  # Finally, we build the XML usage report\n
  xml = """<?xml version=\'1.0\' encoding=\'utf-8\'?>\n
  <journal>\n
    <transaction type="Sale Packing List">\n
      <title>Resource consumptions</title>\n
      <start_date></start_date>\n
      <stop_date></stop_date>\n
      <reference></reference>\n
      <currency></currency>\n
      <payment_mode></payment_mode>\n
      <category></category>\n
      <arrow type="Administration">\n
        <source></source>\n
        <destination></destination>\n
      </arrow>""" + movements + """\n
    </transaction>\n
  </journal>"""\n
\n
  return xml\n
\n
else:\n
  return \'This script can generate movements for one or two partitions maximum\'\n


]]></string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>number</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>ERP5Site_getUsageReportTestSample</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
