<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <tuple>
        <global name="SQL" module="Products.ZSQLMethods.SQL"/>
        <tuple/>
      </tuple>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>_arg</string> </key>
            <value>
              <object>
                <klass>
                  <global name="Args" module="Shared.DC.ZRDB.Aqueduct"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>_data</string> </key>
                        <value>
                          <dictionary>
                            <item>
                                <key> <string>getDestinationFunctionUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getDestinationInventoriatedTotalAssetPrice</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getDestinationPaymentUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getDestinationProjectUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getDestinationSectionUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getDestinationUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getInventoriatedQuantity</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getPortalType</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getResourceUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getSimulationState</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getSourceFunctionUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getSourceInventoriatedTotalAssetPrice</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getSourcePaymentUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getSourceProjectUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getSourceSectionUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getSourceUid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getStartDate</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getStopDate</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getSubVariationText</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>getVariationText</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>isAccountable</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>isInventoryMovement</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>isMovement</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>isCancellationAmount</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                            <item>
                                <key> <string>uid</string> </key>
                                <value>
                                  <dictionary/>
                                </value>
                            </item>
                          </dictionary>
                        </value>
                    </item>
                    <item>
                        <key> <string>_keys</string> </key>
                        <value>
                          <list>
                            <string>uid</string>
                            <string>getResourceUid</string>
                            <string>getInventoriatedQuantity</string>
                            <string>getSourceUid</string>
                            <string>getDestinationUid</string>
                            <string>getSourceSectionUid</string>
                            <string>getDestinationSectionUid</string>
                            <string>isMovement</string>
                            <string>isCancellationAmount</string>
                            <string>isInventoryMovement</string>
                            <string>getSourcePaymentUid</string>
                            <string>getDestinationPaymentUid</string>
                            <string>getSourceFunctionUid</string>
                            <string>getDestinationFunctionUid</string>
                            <string>getSourceProjectUid</string>
                            <string>getDestinationProjectUid</string>
                            <string>getSimulationState</string>
                            <string>getSourceInventoriatedTotalAssetPrice</string>
                            <string>getDestinationInventoriatedTotalAssetPrice</string>
                            <string>getStartDate</string>
                            <string>getStopDate</string>
                            <string>isAccountable</string>
                            <string>getPortalType</string>
                            <string>getVariationText</string>
                            <string>getSubVariationText</string>
                          </list>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>allow_simple_one_argument_traversal</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>arguments_src</string> </key>
            <value> <string>uid\r\n
getResourceUid\r\n
getInventoriatedQuantity\r\n
getSourceUid\r\n
getDestinationUid\r\n
getSourceSectionUid\r\n
getDestinationSectionUid\r\n
isMovement\r\n
isCancellationAmount\r\n
isInventoryMovement\r\n
getSourcePaymentUid\r\n
getDestinationPaymentUid\r\n
getSourceFunctionUid\r\n
getDestinationFunctionUid\r\n
getSourceProjectUid\r\n
getDestinationProjectUid\r\n
getSimulationState\r\n
getSourceInventoriatedTotalAssetPrice\r\n
getDestinationInventoriatedTotalAssetPrice\r\n
getStartDate\r\n
getStopDate\r\n
isAccountable\r\n
getPortalType\r\n
getVariationText\r\n
getSubVariationText</string> </value>
        </item>
        <item>
            <key> <string>cache_time_</string> </key>
            <value> <int>0</int> </value>
        </item>
        <item>
            <key> <string>class_file_</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>class_name_</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>connection_hook</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>connection_id</string> </key>
            <value> <string>erp5_sql_connection</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>z_catalog_stock_list</string> </value>
        </item>
        <item>
            <key> <string>max_cache_</string> </key>
            <value> <int>100</int> </value>
        </item>
        <item>
            <key> <string>max_rows_</string> </key>
            <value> <int>0</int> </value>
        </item>
        <item>
            <key> <string>src</string> </key>
            <value> <string encoding="cdata"><![CDATA[

DELETE FROM\n
  stock\n
WHERE\n
<dtml-in uid>\n
  uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
\n
<dtml-var "\'\\0\'">\n
\n
<dtml-let row_list="[]" uid_dict="{}">\n
  <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
    <dtml-if "not(isInventoryMovement[loop_item]) and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
      <dtml-if "getDestinationUid[loop_item]">\n
        <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
        <dtml-call expr="row_list.append([\n
                    uid[loop_item], \n
                    uid_dict[uid[loop_item]],\n
                    getDestinationUid[loop_item],\n
                    getDestinationSectionUid[loop_item],\n
                    getDestinationPaymentUid[loop_item],\n
                    getDestinationFunctionUid[loop_item],\n
                    getDestinationProjectUid[loop_item], \n
                    getSourceSectionUid[loop_item], \n
                    getSourceUid[loop_item], \n
                    getResourceUid[loop_item],\n
                    getInventoriatedQuantity[loop_item],\n
                    isCancellationAmount[loop_item],\n
                    getStopDate[loop_item], \n
                    getStartDate[loop_item], \n
                    getDestinationInventoriatedTotalAssetPrice[loop_item], \n
                    getPortalType[loop_item], \n
                    getSimulationState[loop_item], \n
                    getVariationText[loop_item],\n
                    getSubVariationText[loop_item]])">\n
      </dtml-if>\n
      <dtml-if "getSourceUid[loop_item]">\n
        <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
        <dtml-call expr="row_list.append([\n
                    uid[loop_item], \n
                    uid_dict[uid[loop_item]],\n
                    getSourceUid[loop_item],\n
                    getSourceSectionUid[loop_item],\n
                    getSourcePaymentUid[loop_item],\n
                    getSourceFunctionUid[loop_item],\n
                    getSourceProjectUid[loop_item], \n
                    getDestinationSectionUid[loop_item], \n
                    getDestinationUid[loop_item], \n
                    getResourceUid[loop_item],\n
                    -(getInventoriatedQuantity[loop_item] or 0), \n
                    isCancellationAmount[loop_item],\n
                    getStartDate[loop_item], \n
                    getStopDate[loop_item],\n
                    getSourceInventoriatedTotalAssetPrice[loop_item], \n
                    getPortalType[loop_item], \n
                    getSimulationState[loop_item], \n
                    getVariationText[loop_item],\n
                    getSubVariationText[loop_item]])">\n
      </dtml-if>\n
    </dtml-if>\n
  </dtml-in>  \n
  \n
  <dtml-if "row_list">\n
INSERT INTO\n
  stock\n
VALUES\n
    <dtml-in prefix="row" expr="row_list">\n
(\n
  <dtml-sqlvar expr="row_item[0]" type="int">,\n
  <dtml-sqlvar expr="row_item[1]" type="int">,\n
  <dtml-sqlvar expr="row_item[2]" type="int">,  \n
  <dtml-sqlvar expr="row_item[3]" type="int" optional>, \n
  <dtml-sqlvar expr="row_item[4]" type="int" optional>, \n
  <dtml-sqlvar expr="row_item[5]" type="int" optional>,\n
  <dtml-sqlvar expr="row_item[6]" type="int" optional>,\n
  <dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
  <dtml-sqlvar expr="row_item[8]" type="int" optional>,\n
  <dtml-sqlvar expr="row_item[9]" type="int">, \n
  <dtml-sqlvar expr="row_item[10]" type="float" optional>,\n
  <dtml-sqlvar expr="row_item[11]" type="int">, \n
  <dtml-sqlvar expr="row_item[12]" type="datetime" optional>,\n
  <dtml-sqlvar expr="row_item[13]" type="datetime" optional>,\n
  <dtml-sqlvar expr="row_item[14]" type="float" optional>,\n
  <dtml-sqlvar expr="row_item[15]" type="string" optional>,\n
  <dtml-sqlvar expr="row_item[16]" type="string" optional>,\n
  <dtml-sqlvar expr="row_item[17]" type="string" optional>,\n
  <dtml-sqlvar expr="row_item[18]" type="string" optional>\n
)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
    </dtml-in>\n
  </dtml-if>\n
</dtml-let>\n


]]></string> </value>
        </item>
        <item>
            <key> <string>template</string> </key>
            <value>
              <object>
                <klass>
                  <global name="__newobj__" module="copy_reg"/>
                </klass>
                <tuple>
                  <global name="SQL" module="Shared.DC.ZRDB.DA"/>
                </tuple>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>__name__</string> </key>
                        <value> <string encoding="cdata"><![CDATA[

<string>

]]></string> </value>
                    </item>
                    <item>
                        <key> <string>_vars</string> </key>
                        <value>
                          <dictionary/>
                        </value>
                    </item>
                    <item>
                        <key> <string>globals</string> </key>
                        <value>
                          <dictionary/>
                        </value>
                    </item>
                    <item>
                        <key> <string>raw</string> </key>
                        <value> <string encoding="cdata"><![CDATA[

DELETE FROM\n
  stock\n
WHERE\n
<dtml-in uid>\n
  uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>\n
</dtml-in>\n
;\n
\n
<dtml-var "\'\\0\'">\n
\n
<dtml-let row_list="[]" uid_dict="{}">\n
  <dtml-in prefix="loop" expr="_.range(_.len(uid))">\n
    <dtml-if "not(isInventoryMovement[loop_item]) and isMovement[loop_item] and isAccountable[loop_item] and getResourceUid[loop_item]">\n
      <dtml-if "getDestinationUid[loop_item]">\n
        <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
        <dtml-call expr="row_list.append([\n
                    uid[loop_item], \n
                    uid_dict[uid[loop_item]],\n
                    getDestinationUid[loop_item],\n
                    getDestinationSectionUid[loop_item],\n
                    getDestinationPaymentUid[loop_item],\n
                    getDestinationFunctionUid[loop_item],\n
                    getDestinationProjectUid[loop_item], \n
                    getSourceSectionUid[loop_item], \n
                    getSourceUid[loop_item], \n
                    getResourceUid[loop_item],\n
                    getInventoriatedQuantity[loop_item],\n
                    isCancellationAmount[loop_item],\n
                    getStopDate[loop_item], \n
                    getStartDate[loop_item], \n
                    getDestinationInventoriatedTotalAssetPrice[loop_item], \n
                    getPortalType[loop_item], \n
                    getSimulationState[loop_item], \n
                    getVariationText[loop_item],\n
                    getSubVariationText[loop_item]])">\n
      </dtml-if>\n
      <dtml-if "getSourceUid[loop_item]">\n
        <dtml-call expr="uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})">\n
        <dtml-call expr="row_list.append([\n
                    uid[loop_item], \n
                    uid_dict[uid[loop_item]],\n
                    getSourceUid[loop_item],\n
                    getSourceSectionUid[loop_item],\n
                    getSourcePaymentUid[loop_item],\n
                    getSourceFunctionUid[loop_item],\n
                    getSourceProjectUid[loop_item], \n
                    getDestinationSectionUid[loop_item], \n
                    getDestinationUid[loop_item], \n
                    getResourceUid[loop_item],\n
                    -(getInventoriatedQuantity[loop_item] or 0), \n
                    isCancellationAmount[loop_item],\n
                    getStartDate[loop_item], \n
                    getStopDate[loop_item],\n
                    getSourceInventoriatedTotalAssetPrice[loop_item], \n
                    getPortalType[loop_item], \n
                    getSimulationState[loop_item], \n
                    getVariationText[loop_item],\n
                    getSubVariationText[loop_item]])">\n
      </dtml-if>\n
    </dtml-if>\n
  </dtml-in>  \n
  \n
  <dtml-if "row_list">\n
INSERT INTO\n
  stock\n
VALUES\n
    <dtml-in prefix="row" expr="row_list">\n
(\n
  <dtml-sqlvar expr="row_item[0]" type="int">,\n
  <dtml-sqlvar expr="row_item[1]" type="int">,\n
  <dtml-sqlvar expr="row_item[2]" type="int">,  \n
  <dtml-sqlvar expr="row_item[3]" type="int" optional>, \n
  <dtml-sqlvar expr="row_item[4]" type="int" optional>, \n
  <dtml-sqlvar expr="row_item[5]" type="int" optional>,\n
  <dtml-sqlvar expr="row_item[6]" type="int" optional>,\n
  <dtml-sqlvar expr="row_item[7]" type="int" optional>,\n
  <dtml-sqlvar expr="row_item[8]" type="int" optional>,\n
  <dtml-sqlvar expr="row_item[9]" type="int">, \n
  <dtml-sqlvar expr="row_item[10]" type="float" optional>,\n
  <dtml-sqlvar expr="row_item[11]" type="int">, \n
  <dtml-sqlvar expr="row_item[12]" type="datetime" optional>,\n
  <dtml-sqlvar expr="row_item[13]" type="datetime" optional>,\n
  <dtml-sqlvar expr="row_item[14]" type="float" optional>,\n
  <dtml-sqlvar expr="row_item[15]" type="string" optional>,\n
  <dtml-sqlvar expr="row_item[16]" type="string" optional>,\n
  <dtml-sqlvar expr="row_item[17]" type="string" optional>,\n
  <dtml-sqlvar expr="row_item[18]" type="string" optional>\n
)\n
<dtml-if sequence-end><dtml-else>,</dtml-if>\n
    </dtml-in>\n
  </dtml-if>\n
</dtml-let>\n


]]></string> </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>title</string> </key>
            <value> <string></string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
