text:
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
    <description>Product Component Services</description>
    <vendor>OFBiz</vendor>
    <version>1.0</version>

    <!-- Permission Services -->
    <service name="facilityGenericPermission" engine="simple"
        location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="facilityGenericPermission">
        <implements service="permissionInterface"/>
    </service>
    <service name="checkProductFacilityRelatedPermission" engine="simple"
            location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="checkProductFacilityRelatedPermission">
        <description>ProductFacility Permission Checking Logic</description>
        <implements service="permissionInterface"/>
    </service>
    <!-- Product Inventory Services -->
    <service name="createInventoryItem" default-entity-name="InventoryItem" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryItem" auth="true">
        <description>Create an InventoryItem</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="OUT" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true">
            <exclude field-name="availableToPromiseTotal"/>
            <exclude field-name="quantityOnHandTotal"/>
        </auto-attributes>
        <attribute name="isReturned" mode="IN" type="String" default-value="N" />
        <override name="inventoryItemTypeId" optional="false"/>
        <override name="productId" optional="false"/>
        <override name="facilityId" optional="false"/>
    </service>

    <service name="createInventoryItemCheckSetAtpQoh" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryItemCheckSetAtpQoh" auth="false">
        <description>
        </description>
        <attribute name="inventoryItemId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.inventoryItemId"/>
            </type-validate>
        </attribute>
        <attribute name="availableToPromiseTotal" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="IN" optional="true"/>
    </service>

    <service name="updateInventoryItem" default-entity-name="InventoryItem" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="updateInventoryItem" auth="true">
        <description>Update an InventoryItem</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true">
            <exclude field-name="availableToPromiseTotal"/>
            <exclude field-name="quantityOnHandTotal"/>
        </auto-attributes>
        <attribute name="oldOwnerPartyId" mode="OUT" optional="true" type="String"/>
        <attribute name="oldProductId" mode="OUT" optional="true" type="String"/>
        <attribute name="oldStatusId" mode="OUT" optional="true" type="String"/>
    </service>
    <service name="changeOwnerUponIssuance" engine="simple"  auth="true"
        location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="changeOwnerUponIssuance">
        <description>If product store setOwnerUponIssuance is Y or empty, set the inventory item owner upon issuance.</description>
        <attribute name="itemIssuanceId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.itemIssuanceId"/>
        </type-validate>
        </attribute>

    </service>
    <service name="createInventoryItemStatus" engine="simple" default-entity-name="InventoryItemStatus"
            location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryItemStatus">
        <description>Create an inventory item status record</description>
        <auto-attributes mode="IN" include="all" optional="true"/>
        <override name="inventoryItemId" optional="false"/>
        <override name="statusId" optional="false"/>
    </service>

    <service name="checkProductInventoryDiscontinuation" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="checkProductInventoryDiscontinuation" auth="false">
        <description>Check Product Inventory Discontinuation</description>
        <attribute name="productId" mode="IN" optional="false" type="String">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>

    </service>
    <service name="inventoryItemCheckSetDefaultValues" default-entity-name="InventoryItem" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="inventoryItemCheckSetDefaultValues" auth="false">
        <description>Check and, if empty, fills with default values ownerPartyId, currencyUomId, unitCost</description>
        <attribute name="inventoryItemId" type="String" mode="IN" optional="true"/>
        <attribute name="inventoryItem" type="Map" mode="IN" optional="true"/>
    </service>
    <service name="createInventoryItemDetail" default-entity-name="InventoryItemDetail" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryItemDetail" auth="true">
        <description>Create an createInventoryItemDetail - note that the quantityOnHand and availableToPromise are relative (positive or negative) and will be added to the corresponding value on the given InventoryItem</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true">
            <exclude field-name="effectiveDate"/>
        </auto-attributes>
        <override name="inventoryItemDetailSeqId" mode="OUT"/>
    </service>
    <service name="updateInventoryItemFromDetail" default-entity-name="InventoryItemDetail" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="updateInventoryItemFromDetail" auth="false">
        <description>
            Sums all availableToPromiseDiff and quantityOnHandDiff elements for the inventoryItemId and sets the availableToPromise and quantityOnHand fields on the corresponding InventoryItem.
            Meant to be run as an Entity ECA triggered on any modify operation on the InventoryItemDetail entity.
        </description>
        <attribute name="inventoryItemId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.inventoryItemId"/>
        </type-validate>
        </attribute>
    </service>
    <service name="updateSerializedInventoryTotals" default-entity-name="InventoryItem" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="updateSerializedInventoryTotals" auth="false">
        <description>Sets the ATP/QOH totals for serialized inventory items</description>
        <attribute name="inventoryItemId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.inventoryItemId"/>
        </type-validate>
        </attribute>
    </service>

    <service name="createInventoryItemVariance" default-entity-name="InventoryItemVariance" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryItemVariance" auth="true">
        <description>Create an InventoryItemVariance - note that the quantityOnHand and availableToPromise are relative and will be added to the corresponding value on the given InventoryItem</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="createPhysicalInventory" default-entity-name="PhysicalInventory" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createPhysicalInventory" auth="true">
        <description>Create an PhysicalInventory</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="OUT" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="createPhysicalInventoryAndVariance" engine="simple" auth="true" transaction-timeout="600"
            location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createPhysicalInventoryAndVariance">
        <description>Create a PhysicalInventory and an InventoryItemVariance</description>
        <auto-attributes entity-name="InventoryItemVariance" include="pk" mode="IN" optional="false"/>
        <auto-attributes entity-name="PhysicalInventory" include="nonpk" mode="IN" optional="true"/>
        <auto-attributes entity-name="InventoryItemVariance" include="nonpk" mode="IN" optional="true"/>
        <override name="physicalInventoryId" mode="OUT"/>
    </service>

    <service name="getMktgPackagesAvailable" engine="simple" hideResultInLog="true" log="quiet" log-eca="quiet"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="getMktgPackagesAvailable" auth="false" use-transaction="false">
        <description>Get Marketing Packages Available From Components In Inventory</description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>

        <attribute name="facilityId" type="String" mode="IN" optional="true"/>
        <attribute name="statusId" type="String" mode="IN" optional="true"/>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="availableToPromiseTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="useEntityCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, entity cache when looking up records, where possible (SCIPIO)</description>
        </attribute>
        <attribute name="useInventoryCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, use ProductFacility.lastInventoryCount or other inventory cache. Current default: false; legacy default: false (SCIPIO)
                WARNING: statusId cannot be used to calculate cache and if set no caching will occur</description>
        </attribute>
    </service>
    <service name="getProductInventoryAvailable" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="getProductInventoryAvailable" auth="false" use-transaction="false">
        <description>Get Inventory Availability for a Product</description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="IN" optional="true"/>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="availableToPromiseTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="useCache" type="Boolean" mode="IN" optional="true">
            <description>Same as useEntityCache (SCIPIO)</description>
        </attribute>
        <attribute name="useEntityCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, entity cache when looking up records, where possible (SCIPIO)</description>
        </attribute>
        <attribute name="useInventoryCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, use ProductFacility.lastInventoryCount or other inventory cache. Current default: false; legacy default: false (SCIPIO)
                WARNING: statusId cannot be used to calculate cache and if set no caching will occur</description>
        </attribute>
    </service>
    <service name="getInventoryAvailableByFacility" engine="simple" hideResultInLog="true" log="quiet" log-eca="quiet"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="getProductInventoryAvailable" auth="false" use-transaction="false">
        <description>Get Inventory Availability for a Product constrained by a facilityId</description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
        </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="IN" optional="true"/>
        <attribute name="lotId" mode="IN" type="String" optional="true"/>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="availableToPromiseTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="useCache" type="Boolean" mode="IN" optional="true">
            <description>Same as useEntityCache</description>
        </attribute>
        <attribute name="useEntityCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, entity cache when looking up records, where possible (SCIPIO)</description>
        </attribute>
        <attribute name="useInventoryCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, use ProductFacility.lastInventoryCount or other inventory cache. Current default: false; legacy default: false (SCIPIO)
                WARNING: statusId/lotId cannot be used to calculate cache and if set no caching will occur</description>
        </attribute>
    </service>
    <service name="getInventoryAvailableByLocation" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="getProductInventoryAvailable" auth="false">
        <description>Get Inventory Availability for a Product constrained by a facility and location</description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
        </type-validate>
        </attribute>
        <attribute name="locationSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.locationSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="IN" optional="true"/>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="availableToPromiseTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="useCache" type="Boolean" mode="IN" optional="true">
            <description>Same as useEntityCache</description>
        </attribute>
        <attribute name="useEntityCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, entity cache when looking up records, where possible (SCIPIO)</description>
        </attribute>
        <!-- not supported due to locationSeqId
        <attribute name="useInventoryCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, use ProductFacility.lastInventoryCount or other inventory cache. Current default: false; legacy default: false (SCIPIO)
                WARNING: statusId and lotId are ignored if true</description>
        </attribute>-->
    </service>
    <service name="getInventoryAvailableByContainer" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="getProductInventoryAvailable" auth="false" use-transaction="false">
        <description>Get Inventory Availability for a Product constrained by a containerId</description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="containerId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.containerId"/>
        </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="IN" optional="true"/>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="availableToPromiseTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="useCache" type="Boolean" mode="IN" optional="true">
            <description>Same as useEntityCache</description>
        </attribute>
        <attribute name="useEntityCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, entity cache when looking up records, where possible (SCIPIO)</description>
        </attribute>
        <!-- not supported due to containerId
        <attribute name="useInventoryCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, use ProductFacility.lastInventoryCount or other inventory cache. Current default: false; legacy default: false (SCIPIO)
                WARNING: statusId and lotId are ignored if true</description>
        </attribute>-->
    </service>
    <service name="getInventoryAvailableByItem" engine="simple"
             location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="getProductInventoryAvailable" auth="false" use-transaction="false">
        <description>Get Inventory Availability for an InventoryItem</description>
        <attribute name="inventoryItemId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.inventoryItemId"/>
        </type-validate>
        </attribute>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="availableToPromiseTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="useCache" type="Boolean" mode="IN" optional="true">
            <description>Same as useEntityCache</description>
        </attribute>
        <attribute name="useEntityCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, entity cache when looking up records, where possible (SCIPIO)</description>
        </attribute>
        <!-- not supported due to containerId
        <attribute name="useInventoryCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, use ProductFacility.lastInventoryCount or other inventory cache. Current default: false; legacy default: false (SCIPIO)
                WARNING: statusId and lotId are ignored if true</description>
        </attribute>-->
    </service>
    <service name="getProductInventoryAvailableFromAssocProducts" engine="java"
             location="org.ofbiz.product.inventory.InventoryServices" invoke="getProductInventoryAvailableFromAssocProducts" auth="false" use-transaction="false">
        <description>
            Get Inventory Availability for a product based on List of associated products,
            usually marketing package components.
        </description>
        <attribute name="facilityId" type="String" mode="IN" optional="true"/>
        <attribute name="assocProducts" type="List" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.assocProducts"/>
        </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="IN" optional="true"/>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="availableToPromiseTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="useEntityCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, entity cache when looking up records, where possible (SCIPIO)</description>
        </attribute>
        <attribute name="useInventoryCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, use ProductFacility.lastInventoryCount or other inventory cache. Current default: false; legacy default: false (SCIPIO)
                WARNING: statusId/lotId cannot be used to calculate cache and if set no caching will occur</description>
        </attribute>
    </service>
    <service name="getProductInventoryAvailableBySupplier" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="getProductInventoryAvailable" auth="false" use-transaction="false">
        <description>Get Inventory Availability for a Product by a Supplier</description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="partyId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.partyId"/>
        </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="IN" optional="true"/>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="availableToPromiseTotal" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="useCache" type="Boolean" mode="IN" optional="true">
            <description>Same as useEntityCache</description>
        </attribute>
        <attribute name="useEntityCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, entity cache when looking up records, where possible (SCIPIO)</description>
        </attribute>
        <!-- not supported due to partyId
        <attribute name="useInventoryCache" type="Boolean" mode="IN" optional="true" default-value="false">
            <description>If true, use ProductFacility.lastInventoryCount or other inventory cache. Current default: false; legacy default: false (SCIPIO)
                WARNING: statusId and lotId are ignored if true</description>
        </attribute>-->
    </service>
    <service name="countProductInventoryOnHand" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="countProductInventoryOnHand" auth="true" use-transaction="false">
        <description>Count Inventory On Hand for a Product constrained by a facilityId at a given date.</description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
        </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="IN" optional="true">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.statusId"/>
        </type-validate>
        </attribute>
        <attribute name="inventoryCountDate" type="Timestamp" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.inventoryCountDate"/>
        </type-validate>
        </attribute>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="OUT" optional="true"/>
    </service>
    <service name="countProductInventoryShippedForSales" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="countProductInventoryShippedForSales" auth="true" use-transaction="false">
        <description>Count Inventory Shipped for Sales Orders for a Product constrained by a facilityId in a given date range.</description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
        </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="IN" optional="true"/>
        <attribute name="fromDate" type="Timestamp" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.fromDate"/>
        </type-validate>
        </attribute>
        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="quantityOnHandTotal" type="BigDecimal" mode="OUT" optional="true"/>
    </service>
    <service name="getProductInventorySummaryForItems" engine="java"
                location="org.ofbiz.product.inventory.InventoryServices" invoke="getProductInventorySummaryForItems" auth="false" use-transaction="false">
        <description>Get ATP/QOH Availability for a list of OrderItems by summing over all facilities.  If the item is a MARKETING_PKG_AUTO/PICK, then put its quantity available from components
            in the mktgPkgATPMap and mktgPkgQOHMap.</description>
        <attribute name="orderItems" type="List" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderItems"/>
        </type-validate>
        </attribute>
        <attribute name="facilityId" type="String" mode="IN" optional="true"/>
        <attribute name="quantityOnHandMap" type="Map" mode="OUT" optional="false"/>
        <attribute name="availableToPromiseMap" type="Map" mode="OUT" optional="false"/>
        <attribute name="mktgPkgQOHMap" type="Map" mode="OUT" optional="false"/>
        <attribute name="mktgPkgATPMap" type="Map" mode="OUT" optional="false"/>
    </service>
    <service name="getProductInventoryAndFacilitySummary" engine="java"
                location="org.ofbiz.product.inventory.InventoryServices" invoke="getProductInventoryAndFacilitySummary" auth="false" use-transaction="false">
        <description>Get ATP/QOH Availability for a list of OrderItems by summing over all facilities.  If the item is a MARKETING_PKG_AUTO/PICK, then put its quantity available from components
            in the mktgPkgATPMap and mktgPkgQOHMap.</description>
        <attribute name="checkTime" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
        </type-validate>
        </attribute>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="minimumStock" mode="IN" type="BigDecimal" optional="true"/>
        <attribute name="statusId" type="String" mode="IN" optional="true"/>
        <attribute name="quantityUomId" type="String" mode="OUT" optional="true"/>
        <attribute name="totalQuantityOnHand" mode="OUT" type="BigDecimal" optional="true"/>
        <attribute name="totalAvailableToPromise" mode="OUT" type="BigDecimal" optional="true"/>
        <attribute name="quantityOnOrder" mode="OUT" type="BigDecimal" optional="true"/>
        <attribute name="offsetQOHQtyAvailable" mode="OUT" type="BigDecimal" optional="true"/>
        <attribute name="offsetATPQtyAvailable" mode="OUT" type="BigDecimal" optional="true"/>
        <attribute name="defaultPrice" mode="OUT" type="BigDecimal" optional="true"/>
        <attribute name="listPrice" mode="OUT" type="BigDecimal" optional="true"/>
        <attribute name="wholeSalePrice" mode="OUT" type="BigDecimal" optional="true"/>
        <attribute name="usageQuantity" mode="OUT" type="BigDecimal" optional="true"/>
    </service>

    <service name="checkInventoryAvailability" engine="java"
            location="org.ofbiz.product.inventory.InventoryServices" invoke="checkInventoryAvailability">
        <description>Batch service for checking and sending backorder notifications.  Will also set an autoCancelDate for sales orders to 30 days (hard coded)
            beyond the OISGIR's promisedDatetime, which is in turn set by reserveProductInventory service using ProductFacility.daysToShip or 30 days by default.</description>
        <!-- this service has no parameters IN or OUT -->
    </service>

    <service name="balanceInventoryItems" engine="simple" transaction-timeout="600"
            location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="balanceInventoryItems" auth="true">
        <description>Balance inventory items based on the new item specified which will have available inventory that back-order (negative ATP) reservations can be reassigned to.</description>
        <attribute name="inventoryItemId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.inventoryItemId"/>
        </type-validate>
        </attribute>
        <attribute name="priorityOrderId" type="String" mode="IN" optional="true"/>
        <attribute name="priorityOrderItemSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="noLongerOnBackOrderIdSet" type="Set" mode="OUT" optional="true"/>
    </service>

    <service name="reassignInventoryReservations" engine="simple" transaction-timeout="600"
            location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="reassignInventoryReservations" auth="true">
        <description>Balance inventory reservations for a given product/facility, considering all the reservations with promised date greater than fromDate.</description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
        </type-validate>
        </attribute>
        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="noLongerOnBackOrderIdSet" type="Set" mode="OUT" optional="true"/>
        <attribute name="priority" type="String" mode="IN"  optional="true"/>
    </service>
    <service name="balanceOrderItemsWithNegativeReservations" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="balanceOrderItemsWithNegativeReservations">
        <description>For each product with a negative reservation in the order, calls reassignInventoryReservations</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderId"/>
        </type-validate>
        </attribute>
    </service>

    <service name="reserveAnInventoryItem" engine="simple"
            location="component://product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="reserveAnInventoryItem" auth="true">
        <description></description>
        <attribute name="inventoryItemId" type="String" mode="INOUT" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.inventoryItemId"/>
            </type-validate>
        </attribute>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="orderId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderId"/>
        </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderItemSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.shipGroupSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.quantity"/>
        </type-validate>
        </attribute>
        <attribute name="reservedDatetime" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="requireInventory" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.requireInventory"/>
        </type-validate>
        </attribute>
        <attribute name="serialNumber" type="String" mode="IN" optional="true"/>
        <attribute name="sequenceId" type="Long" mode="IN" optional="true"/>
        <attribute name="promisedDatetime" type="Timestamp" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.promisedDatetime"/>
        </type-validate>
        </attribute>
        <attribute name="priority" type="String" mode="IN" optional="true"/>
    </service>

    <service name="reserveProductInventory" engine="simple"
            location="component://product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="reserveProductInventory" auth="true">
        <description>Reserve Inventory for a Product.
            If requireInventory is Y the quantity not reserved is returned, if N then a negative
            availableToPromise will be used to track quantity ordered beyond what is in stock.
        </description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="orderId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderId"/>
        </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderItemSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.shipGroupSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.quantity"/>
        </type-validate>
        </attribute>
        <attribute name="reservedDatetime" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="requireInventory" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.requireInventory"/>
        </type-validate>
        </attribute>
        <attribute name="reserveOrderEnumId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.reserveOrderEnumId"/>
        </type-validate>
        </attribute>
        <attribute name="sequenceId" type="Long" mode="IN" optional="true"/>
        <attribute name="lotId" mode="IN" type="String" optional="true" />
        <attribute name="priority" type="String" mode="IN" optional="true"/>
        <attribute name="quantityNotReserved" type="BigDecimal" mode="OUT" optional="false"/>
    </service>
    <service name="reserveProductInventoryByFacility" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="reserveProductInventory" auth="true">
        <description>Reserve Inventory for a Product By Facility
            If requireInventory is Y the quantity not reserved is returned, if N then a negative
            availableToPromise will be used to track quantity ordered beyond what is in stock.
        </description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
        </type-validate>
        </attribute>
        <attribute name="orderId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderId"/>
        </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderItemSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.shipGroupSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.quantity"/>
        </type-validate>
        </attribute>
        <attribute name="reservedDatetime" type="Timestamp" mode="IN" optional="true">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.reservedDatetime"/>
        </type-validate>
        </attribute>
        <attribute name="requireInventory" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.requireInventory"/>
        </type-validate>
        </attribute>
        <attribute name="reserveOrderEnumId" type="String" mode="IN" optional="true"/>
        <attribute name="sequenceId" type="Long" mode="IN" optional="true"/>
        <attribute name="quantityNotReserved" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="priority" type="String" mode="IN"  optional="true"/>
        <attribute name="lotId" type="String" mode="IN" optional="true" />
    </service>
    <service name="reserveProductInventoryByContainer" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="reserveProductInventory" auth="true">
        <description>Reserve Inventory for a Product By Container
            If requireInventory is Y the quantity not reserved is returned, if N then a negative
            availableToPromise will be used to track quantity ordered beyond what is in stock.
        </description>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="containerId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.containerId"/>
        </type-validate>
        </attribute>
        <attribute name="orderId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderId"/>
        </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderItemSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.shipGroupSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.quantity"/>
        </type-validate>
        </attribute>
        <attribute name="reservedDatetime" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="requireInventory" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.requireInventory"/>
        </type-validate>
        </attribute>
        <attribute name="reserveOrderEnumId" type="String" mode="IN" optional="true"/>
        <attribute name="sequenceId" type="Long" mode="IN" optional="true"/>
        <attribute name="quantityNotReserved" type="BigDecimal" mode="OUT" optional="false"/>
    </service>
    <service name="reserveOrderItemInventory" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="reserveOrderItemInventory" auth="true">
        <description>Create OrderItemShipGrpInvRes or increment existing reserved quantity.</description>
        <auto-attributes mode="IN" entity-name="OrderItemShipGrpInvRes" include="pk" optional="false"/>
        <auto-attributes mode="IN" entity-name="OrderItemShipGrpInvRes" include="nonpk" optional="true">
            <exclude field-name="createdDatetime"/>
        </auto-attributes>
        <attribute name="priority" type="String" mode="IN"  optional="true"/>
        <override name="quantity" optional="false"/>
    </service>
    <service name="cancelOrderInventoryReservation" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="cancelOrderInventoryReservation" auth="true">
        <description>
            Iterates through each OrderItemShipGrpInvRes on each OrderItem for the order
            with the given orderId and cancels the reservation by changing the status
            of the OrderItemShipGrpInvRes and incrementing the corresponding non-serialized
            inventoryItem's availableToPromise quantity, or setting the status of the
            corresponding serialized inventoryItem to available.
        </description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderId"/>
        </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="true"/>
    </service>
    <service name="cancelOrderItemInvResQty" engine="simple"
            location="component://product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="cancelOrderItemInvResQty" auth="true">
        <description>Cancel a specific quantity for an order item</description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderId"/>
        </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderItemSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="cancelQuantity" type="BigDecimal" mode="IN" optional="true"/>
    </service>
    <service name="cancelOrderItemShipGrpInvRes" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="cancelOrderItemShipGrpInvRes" auth="true">
        <description>Cancels an inventory reservation</description>
        <auto-attributes entity-name="OrderItemShipGrpInvRes" include="pk" mode="IN" optional="false"/>
        <attribute name="cancelQuantity" type="BigDecimal" mode="IN" optional="true"/>
    </service>

    <service name="interfaceInventoryTransfer" engine="interface" location="" invoke="">
        <description>Inventory Transfer Interface</description>
        <attribute name="inventoryItemId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.inventoryItemId"/>
        </type-validate>
        </attribute>
        <attribute name="statusId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.statusId"/>
        </type-validate>
        </attribute>
        <attribute name="facilityId" type="String" mode="IN" optional="true"/>
        <attribute name="locationSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="containerId" type="String" mode="IN" optional="true"/>
        <attribute name="facilityIdTo" type="String" mode="IN" optional="true"/>
        <attribute name="locationSeqIdTo" type="String" mode="IN" optional="true"/>
        <attribute name="containerIdTo" type="String" mode="IN" optional="true"/>
        <attribute name="itemIssuanceId" type="String" mode="IN" optional="true"/>
        <attribute name="sendDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="receiveDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="comments" type="String" mode="IN" optional="true"/>
    </service>
    <service name="createInventoryTransfer" engine="simple"
            location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryTransfer" auth="true">
        <description>Create an inventory transfer.  Uses the prepareInventoryTransfer service; see comments there about transfer quantities and inventory items.</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <implements service="interfaceInventoryTransfer"/>
        <attribute name="xferQty" type="BigDecimal" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.xferQty"/>
        </type-validate>
        </attribute>
        <attribute name="inventoryTransferId" type="String" mode="OUT" optional="false"/>
    </service>
    <service name="updateInventoryTransfer" engine="simple"
            location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="updateInventoryTransfer" auth="true">
        <description>Update an inventory transfer record</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <implements service="interfaceInventoryTransfer"/>
        <attribute name="inventoryTransferId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.inventoryTransferId"/>
        </type-validate>
        </attribute>
    </service>
    <service name="prepareInventoryTransfer" engine="java"
            location="org.ofbiz.product.inventory.InventoryServices" invoke="prepareInventoryTransfer">
        <description>Prepares inventory item for transfer.  If the xferQty is less than quantityOnHandTotal of the inventory item, then the inventory
                item is "split," and an new inventory item will be created with xferQty and used for the inventory transfer.</description>
        <attribute name="inventoryItemId" type="String" mode="INOUT" optional="false"/>
        <attribute name="xferQty" type="BigDecimal" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.xferQty"/>
        </type-validate>
        </attribute>
    </service>
    <service name="completeInventoryTransfer" engine="java"
            location="org.ofbiz.product.inventory.InventoryServices" invoke="completeInventoryTransfer">
        <description>Completes the inventory transfer</description>
        <attribute name="inventoryTransferId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.inventoryTransferId"/>
        </type-validate>
        </attribute>
        <attribute name="receiveDate" type="Timestamp" mode="IN" optional="true"/>
    </service>
    <service name="cancelInventoryTransfer" engine="java"
            location="org.ofbiz.product.inventory.InventoryServices" invoke="cancelInventoryTransfer">
        <description>Cancel the inventory transfer</description>
        <attribute name="inventoryTransferId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.inventoryTransferId"/>
        </type-validate>
        </attribute>
    </service>

    <service name="createInventoryTransfersForProduct" engine="simple"
            location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryTransfersForProduct" auth="true">
        <description>Create inventory transfers for the given product and quantity. Return the units not available for transfers.</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
        </type-validate>
        </attribute>
        <attribute name="containerId" type="String" mode="IN" optional="true"/>
        <attribute name="facilityIdTo" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityIdTo"/>
        </type-validate>
        </attribute>
        <attribute name="sendDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
        </attribute>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.quantity"/>
        </type-validate>
        </attribute>
        <attribute name="reserveOrderEnumId" type="String" mode="IN" optional="true"/>
        <attribute name="quantityNotTransferred" type="BigDecimal" mode="OUT" optional="false"/>
    </service>

    <service name="issueImmediatelyFulfilledOrder" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml" invoke="issueImmediatelyFulfilledOrder" auth="false">
        <description>
            Issues the Inventory for an Order that was Immediately Fulfilled, like in a POS environment.
            Note that this skips the normal inventory reservation process, and the shipment process (no shipment is created).
        </description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderId"/>
        </type-validate>
        </attribute>
    </service>
    <service name="issueImmediatelyFulfilledOrderItem" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml" invoke="issueImmediatelyFulfilledOrderItem" auth="false">
        <description>
            Issues the Inventory for an Order Item that was Immediately Fulfilled for more info see the issueImmediatelyFulfilledOrder service.
        </description>
        <attribute name="orderId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderId"/>
        </type-validate>
        </attribute>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.orderItemSeqId"/>
        </type-validate>
        </attribute>
        <attribute name="orderHeader" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
        <attribute name="orderItem" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
        <attribute name="productStore" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
    </service>

    <service name="createProductFacility" default-entity-name="ProductFacility" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createProductFacility" auth="true">
        <description>Create an ProductFacility</description>
        <permission-service service-name="checkProductFacilityRelatedPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateProductFacility" default-entity-name="ProductFacility" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="updateProductFacility" auth="true">
        <description>Update an ProductFacility</description>
        <permission-service service-name="checkProductFacilityRelatedPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteProductFacility" default-entity-name="ProductFacility" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="deleteProductFacility" auth="true">
        <description>Delete an ProductFacility</description>
        <permission-service service-name="checkProductFacilityRelatedPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <service name="createProductFacilityLocation" default-entity-name="ProductFacilityLocation" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createProductFacilityLocation" auth="true">
        <description>Create an ProductFacilityLocation</description>
        <permission-service service-name="checkProductFacilityRelatedPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateProductFacilityLocation" default-entity-name="ProductFacilityLocation" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="updateProductFacilityLocation" auth="true">
        <description>Update an ProductFacilityLocation</description>
        <permission-service service-name="checkProductFacilityRelatedPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteProductFacilityLocation" default-entity-name="ProductFacilityLocation" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="deleteProductFacilityLocation" auth="true">
        <description>Delete an ProductFacilityLocation</description>
        <permission-service service-name="checkProductFacilityRelatedPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- Product Storage Services -->
    <service name="createFacility" default-entity-name="Facility" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="createFacility" auth="true">
        <description>Create a Facility</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="OUT" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="facilityTypeId" optional="false"/>
        <override name="facilityName" optional="false"/>
        <override name="ownerPartyId" optional="false"/>
    </service>
    <service name="updateFacility" default-entity-name="Facility" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="updateFacility" auth="true">
        <description>Update a Facility</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteFacility" default-entity-name="Facility" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="deleteFacility" auth="true">
        <description>Delete a Facility</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- Facility Attribute -->
    <service name="createFacilityAttribute" engine="entity-auto" default-entity-name="FacilityAttribute" invoke="create" auth="true">
        <description>Create Facility Attribute</description>
        <auto-attributes mode="IN" entity-name="FacilityAttribute" include="pk" optional="false"/>
        <auto-attributes mode="IN" entity-name="FacilityAttribute" include="nonpk" optional="true"/>
    </service>
    <service name="updateFacilityAttribute" engine="entity-auto" default-entity-name="FacilityAttribute" invoke="update" auth="true">
        <description>Update Facility Attribute</description>
        <auto-attributes mode="IN" entity-name="FacilityAttribute" include="pk" optional="false"/>
        <auto-attributes mode="IN" entity-name="FacilityAttribute" include="nonpk" optional="true"/>
    </service>
    <service name="deleteFacilityAttribute" engine="entity-auto" default-entity-name="FacilityAttribute" invoke="delete" auth="true">
        <description>Delete Facility Attribute</description>
        <auto-attributes mode="IN" entity-name="FacilityAttribute" include="pk" optional="false"/>
    </service>

    <service name="createFacilityLocation" default-entity-name="FacilityLocation" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="createFacilityLocation" auth="true">
        <description>Create a Facility Location</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
            </type-validate>
        </attribute>

        <attribute name="locationSeqId" type="String" mode="OUT" optional="false"/>
    </service>
    <service name="updateFacilityLocation" default-entity-name="FacilityLocation" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="updateFacilityLocation" auth="true">
        <description>Update a Facility Location</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteFacilityLocation" default-entity-name="FacilityLocation" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="deleteFacilityLocation" auth="true">
        <description>Delete a Facility Location</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <service name="createFacilityGroup" default-entity-name="FacilityGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="createFacilityGroup" auth="true">
        <description>Create a Facility Group</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="OUT" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="facilityGroupName" optional="false"/>
        <override name="facilityGroupTypeId" optional="false"/>
    </service>
    <service name="updateFacilityGroup" default-entity-name="FacilityGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="updateFacilityGroup" auth="true">
        <description>Update a Facility Group</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteFacilityGroup" default-entity-name="FacilityGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="deleteFacilityGroup" auth="true">
        <description>Delete a Facility Group</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- Facility ContactMech services -->
    <service name="createFacilityContactMech" engine="simple" debug="true"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="createFacilityContactMech" auth="true">
        <description>Create a FacilityContactMech</description>
        <permission-service service-name="facilityPermissionCheck" main-action="CREATE"/>
        <auto-attributes entity-name="ContactMech" include="nonpk" mode="IN" optional="true"/>
        <auto-attributes entity-name="FacilityContactMech" include="all" mode="IN" optional="true"/>
        <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="contactMechId" type="String" mode="INOUT" optional="true"/>
    </service>
    <service name="updateFacilityContactMech" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="updateFacilityContactMech" auth="true">
        <description>Update a FacilityContactMech</description>
        <permission-service service-name="facilityPermissionCheck" main-action="UPDATE"/>
        <auto-attributes entity-name="FacilityContactMech" include="all" mode="IN" optional="true"/>
        <attribute name="contactMechId" type="String" mode="INOUT" optional="false"/>
        <attribute name="contactMechTypeId" type="String" mode="IN" optional="false">
                <type-validate>
                    <fail-property resource="ProductErrorUiLabels" property="facility.contactMechTypeId"/>
                </type-validate>
        </attribute>
        <attribute name="infoString" type="String" mode="IN" optional="true"/>
        <attribute name="newContactMechId" type="String" mode="IN" optional="true"/>
    </service>
    <!-- SCIPIO: 2018-11-02: Same as updateFacilityContactMech but with contact mech already looked up -->
    <service name="updateFacilityContactMechGiven" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="updateFacilityContactMech" auth="true">
        <description>Update a FacilityContactMech</description>
        <permission-service service-name="facilityPermissionCheck" main-action="UPDATE"/>
        <implements service="updateFacilityContactMech"/>
        <attribute name="facilityContactMech" type="GenericValue" mode="IN" optional="false"/>
    </service>
    <!-- SCIPIO: 2018-10-30: deleteFacilityContactMech now also expires FacilityContactMechPurpose records -->
    <service name="deleteFacilityContactMech" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="deleteFacilityContactMechAndPurposes" auth="true">
        <description>Delete (expire) a FacilityContactMech (SCIPIO: 2018-10-30: Now also expires FacilityContactMechPurpose records)</description>
        <permission-service service-name="facilityPermissionCheck" main-action="DELETE"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
        </type-validate>
        </attribute>
        <attribute name="contactMechId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.contactMechId"/>
        </type-validate>
        </attribute>
    </service>
    <!-- SCIPIO: 2018-10-30: new deleteFacilityContactMechOnly, now that deleteFacilityContactMech expires the purposes -->
    <service name="deleteFacilityContactMechOnly" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="deleteFacilityContactMechOnly" auth="true">
        <description>Delete (expire) a FacilityContactMech only (SCIPIO: Not its purposes)</description>
        <permission-service service-name="facilityPermissionCheck" main-action="DELETE"/>
        <implements service="deleteFacilityContactMech"/>
    </service>
    <service name="createFacilityPostalAddress" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="createFacilityPostalAddress" auth="true">
        <description>Create a Postal Address</description>
        <permission-service service-name="facilityPermissionCheck" main-action="CREATE"/>
        <auto-attributes entity-name="FacilityContactMech" include="all" mode="IN" optional="true"/>
        <auto-attributes entity-name="PostalAddress" include="nonpk" mode="IN" optional="true"/>
        <attribute name="paymentMethodId" type="String" mode="IN" optional="true"/>
        <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="contactMechId" type="String" mode="OUT" optional="false"/>
        <override name="address1" optional="false"/>
        <override name="city" optional="false"/>
        <override name="postalCode" optional="true"/>
    </service>
    <service name="updateFacilityPostalAddress" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="updateFacilityPostalAddress" auth="true">
        <description>Update a Postal Address</description>
        <permission-service service-name="facilityPermissionCheck" main-action="UPDATE"/>
        <auto-attributes entity-name="FacilityContactMech" include="all" mode="IN" optional="true"/>
        <auto-attributes entity-name="PostalAddress" include="nonpk" mode="IN" optional="true"/>
        <attribute name="contactMechId" type="String" mode="INOUT" optional="false"/>
        <attribute name="directions" type="String" mode="IN" optional="true"/>
    </service>
    <service name="createFacilityTelecomNumber" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="createFacilityTelecomNumber" auth="true">
        <description>Create a Telecommunications Number</description>
        <permission-service service-name="facilityPermissionCheck" main-action="CREATE"/>
        <auto-attributes entity-name="FacilityContactMech" include="all" mode="IN" optional="true"/>
        <auto-attributes entity-name="TelecomNumber" include="nonpk" mode="IN" optional="true"/>
        <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="contactMechId" type="String" mode="OUT" optional="false"/>
    </service>
    <service name="updateFacilityTelecomNumber" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="updateFacilityTelecomNumber" auth="true">
        <description>Update a Telecommunications Number</description>
        <permission-service service-name="facilityPermissionCheck" main-action="UPDATE"/>
        <auto-attributes entity-name="FacilityContactMech" include="all" mode="IN" optional="true"/>
        <auto-attributes entity-name="TelecomNumber" include="nonpk" mode="IN" optional="true"/>
        <attribute name="contactMechId" type="String" mode="INOUT" optional="false"/>
    </service>
    <service name="createFacilityEmailAddress" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="createFacilityEmailAddress" auth="true">
        <description>Create an Email Address</description>
        <permission-service service-name="facilityPermissionCheck" main-action="UPDATE"/>
        <auto-attributes entity-name="ContactMech" include="nonpk" mode="IN" optional="true"/>
        <auto-attributes entity-name="FacilityContactMech" include="all" mode="IN" optional="true"/>
        <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="contactMechId" type="String" mode="INOUT" optional="true"/>
        <attribute name="emailAddress" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.emailAddress"/>
        </type-validate>
        </attribute>
    </service>
    <service name="updateFacilityEmailAddress" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="updateFacilityEmailAddress" auth="true">
        <description>Update an Email Address</description>
        <permission-service service-name="facilityPermissionCheck" main-action="UPDATE"/>
        <auto-attributes entity-name="FacilityContactMech" include="all" mode="IN" optional="true"/>
        <attribute name="contactMechId" type="String" mode="INOUT" optional="false"/>
        <attribute name="emailAddress" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.emailAddress"/>
            </type-validate>
        </attribute>
    </service>

    <service name="createFacilityContactMechPurpose" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="createFacilityContactMechPurpose">
        <description>Create a purpose for facility contact mech</description>
        <permission-service service-name="facilityPermissionCheck" main-action="CREATE"/>
        <auto-attributes entity-name="FacilityContactMechPurpose" include="pk" mode="IN" optional="false">
            <exclude field-name="fromDate"/>
        </auto-attributes>
        <attribute name="fromDate" type="Timestamp" mode="OUT" optional="false"/>
    </service>
    <service name="deleteFacilityContactMechPurpose" engine="simple"
            location="component://product/script/org/ofbiz/product/storage/FacilityContactMechServices.xml" invoke="deleteFacilityContactMechPurpose">
        <description>Delete a purpose for facility contact mech</description>
        <permission-service service-name="facilityPermissionCheck" main-action="DELETE"/>
        <auto-attributes entity-name="FacilityContactMechPurpose" include="pk" mode="IN" optional="false"/>
    </service>
    <!-- SCIPIO: 2018-10-31: ensureFacilityContactMechPurposes new service -->
    <service name="ensureFacilityContactMechPurposes" engine="java"
            location="org.ofbiz.party.contact.ContactMechServices" invoke="ensureFacilityContactMechPurposes" auth="true">
        <description>Ensures Party ContactMech has the requested purposes (SCIPIO)</description>
        <permission-service service-name="facilityPermissionCheck" main-action="UPDATE"/>
        <implements service="ensureContactMechPurposesInterface"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false"/>
    </service>

<!-- end cm -->
    <service name="addContactMechToFacility" engine="simple" default-entity-name="FacilityContactMech"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="addContactMechToFacility" auth="true">
        <description>Add ContactMech To Facility</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN"/>
    </service>
    <service name="removeContactMechFromFacility" engine="simple" default-entity-name="FacilityContactMech"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="removeContactMechFromFacility" auth="true">
        <description>Remove ContactMech From Facility</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN"/>
    </service>

    <service name="addFacilityToGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="addFacilityToGroup" auth="true">
        <description>Add Facility To FacilityGroup</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <attribute name="facilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false"/>
        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="sequenceNum" type="Long" mode="IN" optional="true"/>
    </service>
    <service name="updateFacilityToGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="updateFacilityToGroup" auth="true">
        <description>Update Facility -> Group Member</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <attribute name="facilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false"/>
        <attribute name="fromDate" type="Timestamp" mode="IN" optional="false"/>
        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="sequenceNum" type="Long" mode="IN" optional="true"/>
    </service>
    <service name="removeFacilityFromGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="removeFacilityFromGroup" auth="true">
        <description>Remove Facility From FacilityGroup</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <attribute name="facilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false"/>
        <attribute name="fromDate" type="Timestamp" mode="IN" optional="false"/>
    </service>

    <service name="addFacilityGroupToGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="addFacilityGroupToGroup" auth="true">
        <description>Add FacilityGroup To FacilityGroup</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <attribute name="facilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="parentFacilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="sequenceNum" type="Long" mode="IN" optional="true"/>
    </service>
    <service name="updateFacilityGroupToGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="updateFacilityGroupToGroup" auth="true">
        <description>Update FacilityGroup To FacilityGroup Rollup</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <attribute name="facilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="parentFacilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="fromDate" type="Timestamp" mode="IN" optional="false"/>
        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="sequenceNum" type="Long" mode="IN" optional="true"/>
    </service>
    <service name="removeFacilityGroupFromGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="removeFacilityGroupFromGroup" auth="true">
        <description>Remove FacilityGroup From FacilityGroup</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <attribute name="facilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="parentFacilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="fromDate" type="Timestamp" mode="IN" optional="false"/>
    </service>

    <service name="addPartyToFacility" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="addPartyToFacility" auth="true" default-entity-name="FacilityParty">
        <description>Create a FacilityParty record</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="fromDate" optional="true"/>
    </service>

    <service name="addPartyToFacilityGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="addPartyToFacilityGroup" auth="true">
        <description>Add Party To FacilityGroup</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <attribute name="facilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="partyId" type="String" mode="IN" optional="false"/>
        <attribute name="roleTypeId" type="String" mode="IN" optional="false"/>
    </service>

    <service name="removePartyFromFacility" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="removePartyFromFacility" auth="true" default-entity-name="FacilityParty">
        <description>Remove Party From Facility</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <service name="removePartyFromFacilityGroup" engine="simple"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="removePartyFromFacilityGroup" auth="true">
        <description>Remove Party From FacilityGroup</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <attribute name="facilityGroupId" type="String" mode="IN" optional="false"/>
        <attribute name="partyId" type="String" mode="IN" optional="false"/>
        <attribute name="roleTypeId" type="String" mode="IN" optional="false"/>
    </service>

    <service name="createFacilityContent" engine="simple" default-entity-name="FacilityContent"
        location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="createFacilityContent" auth="true">
        <description>Create a Facility Content</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="fromDate" optional="true"/>
    </service>

    <service name="deleteFacilityContent" engine="simple" default-entity-name="FacilityContent"
                location="component://product/script/org/ofbiz/product/storage/StorageServices.xml" invoke="deleteFacilityContent" auth="true">
        <description>Delete Content From Facility</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- Stock Move Services -->
    <service name="findStockMovesNeeded" engine="simple"
            location="component://product/script/org/ofbiz/product/inventory/StockMoveServices.xml" invoke="findStockMovesNeeded">
        <description>
            Find all Stock Moves that need to be done.
            This service differs from the inventory transfer services in that it does not require
            sufficient availableToPromise to move the stock, in fact it is generally triggered because
            some promised inventory is in a bulk location and needs to be moved to a pick location.
        </description>
        <permission-service service-name="facilityPermissionCheck" main-action="VIEW"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
            </type-validate>
        </attribute>
        <attribute name="moveByOisgirInfoList" type="List" mode="OUT" optional="true"/>
        <attribute name="stockMoveHandled" type="Map" mode="OUT" optional="true"/>
        <attribute name="warningMessageList" type="List" mode="OUT" optional="true"/>
    </service>
    <service name="findStockMovesRecommended" engine="simple"
            location="component://product/script/org/ofbiz/product/inventory/StockMoveServices.xml" invoke="findStockMovesRecommended">
        <description>
            Find all Stock Moves that should be done based on minimum quantities on each Pick/Primary ProductFacilityLocation.
        </description>
        <permission-service service-name="facilityPermissionCheck" main-action="VIEW"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
            </type-validate>
        </attribute>
        <attribute name="stockMoveHandled" type="Map" mode="IN" optional="true"/>
        <attribute name="moveByPflInfoList" type="List" mode="OUT" optional="true"/>
        <attribute name="warningMessageList" type="List" mode="OUT" optional="true"/>
    </service>
    <service name="processPhysicalStockMove" engine="simple"
            location="component://product/script/org/ofbiz/product/inventory/StockMoveServices.xml" invoke="processPhysicalStockMove">
        <description>
            Process a Physical Stock Move from one FacilityLocation to another, in the same Facility.
            This service will not only move quantities from one InventoryItem to another but it will
            also reassign any existing OrderItemShipGrpInvRes records to the new InventoryItem.
        </description>
        <attribute name="productId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
            </type-validate>
        </attribute>
        <attribute name="facilityId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
            </type-validate>
        </attribute>
        <attribute name="locationSeqId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.locationSeqId"/>
            </type-validate>
        </attribute>
        <attribute name="targetLocationSeqId" type="String" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.targetLocationSeqId"/>
            </type-validate>
        </attribute>
        <attribute name="quantityMoved" type="BigDecimal" mode="IN" optional="false">
            <type-validate>
                <fail-property resource="ProductErrorUiLabels" property="facility.quantityMoved"/>
            </type-validate>
        </attribute>
        <attribute name="warningMessageList" type="List" mode="INOUT" optional="true"/>
    </service>
    <!-- Inventory Label Services -->
    <service name="createInventoryItemLabelType" default-entity-name="InventoryItemLabelType" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryItemLabelType" auth="true">
        <description>Create an InventoryItemLabelType</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateInventoryItemLabelType" default-entity-name="InventoryItemLabelType" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="updateInventoryItemLabelType" auth="true">
        <description>Update an InventoryItemLabelType</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteInventoryItemLabelType" default-entity-name="InventoryItemLabelType" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="deleteInventoryItemLabelType" auth="true">
        <description>Delete an InventoryItemLabelType</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>
    <service name="createInventoryItemLabel" default-entity-name="InventoryItemLabel" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryItemLabel" auth="true">
        <description>Create an InventoryItemLabel</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="inventoryItemLabelTypeId" optional="false"/>
    </service>
    <service name="updateInventoryItemLabel" default-entity-name="InventoryItemLabel" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="updateInventoryItemLabel" auth="true">
        <description>Update an InventoryItemLabel</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true">
            <exclude field-name="inventoryItemLabelTypeId"/>
        </auto-attributes>
    </service>
    <service name="deleteInventoryItemLabel" default-entity-name="InventoryItemLabel" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="deleteInventoryItemLabel" auth="true">
        <description>Delete an InventoryItemLabel</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>
    <service name="createInventoryItemLabelAppl" default-entity-name="InventoryItemLabelAppl" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryItemLabelAppl" auth="true">
        <description>Create an InventoryItemLabelAppl</description>
        <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="IN" optional="false">
            <exclude field-name="inventoryItemLabelTypeId"/> <!-- The type is automatically retrieved from the inventoryItemLabel -->
        </auto-attributes>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="inventoryItemLabelId" optional="false"/>
    </service>
    <service name="updateInventoryItemLabelAppl" default-entity-name="InventoryItemLabelAppl" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="updateInventoryItemLabelAppl" auth="true">
        <description>Update an InventoryItemLabelAppl</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true">
            <exclude field-name="inventoryItemId"/>
        </auto-attributes>
    </service>
    <service name="deleteInventoryItemLabelAppl" default-entity-name="InventoryItemLabelAppl" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="deleteInventoryItemLabelAppl" auth="true">
        <description>Delete an InventoryItemLabelAppl</description>
        <permission-service service-name="facilityGenericPermission" main-action="DELETE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>
    <service name="setOrderReservationPriority" engine="simple" invoke="setOrderReservationPriority"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml"  auth="true">
        <description>set order priority</description>
        <attribute name="priority" mode="IN" type="String" optional="true"/>
        <attribute name="orderId" mode="IN" type="String" optional="false"/>
    </service>
    <service name="findProductInventorylocations" engine="simple"
                location="component://product/script/org/ofbiz/product/inventory/StockMoveServices.xml" invoke="findProductInventorylocations">
       <description>Find Product's inventory locations from facility</description>
       <permission-service service-name="facilityGenericPermission" main-action="VIEW"/>
       <attribute name="facilityId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.facilityId"/>
        </type-validate>
       </attribute>
       <attribute name="productId" type="String" mode="IN" optional="false">
        <type-validate>
            <fail-property resource="ProductErrorUiLabels" property="facility.productId"/>
        </type-validate>
       </attribute>
       <attribute name="LocationList" type="List" mode="OUT" optional="true"/>
    </service>
    <service name="setLastInventoryCount" engine="simple"
             location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="setLastInventoryCount">
        <description>Service which run as EECA (on InventoryItemDetail entity) and updates lastInventoryCount for products available in facility in ProductFacility entity</description>
        <attribute name="inventoryItemId" mode="IN" type="String" optional="false"/>
        <attribute name="inventoryItemDetail" mode="IN" type="GenericValue" optional="true">
            <description>Optional InventoryItemDetail record to help implement entity cache configured in inventory.properties (SCIPIO)</description>
        </attribute>
        <attribute name="lastInvMode" mode="IN" type="String" optional="true">
            <description>Mode for setting last inventory count, or type/source of the call. Values: AUTO (default), MANUAL (SCIPIO)</description>
        </attribute>
        <attribute name="productId" mode="OUT" type="String" optional="true">
            <description>productId of the inventory item, for SECA and reuse (SCIPIO)</description>
        </attribute>
    </service>
    <service name="setProductLastInventoryCount" engine="simple"
             location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="setProductLastInventoryCount">
        <description>Service which run as EECA (on InventoryItemDetail entity) and updates lastInventoryCount for products available in facility in ProductFacility entity
            - runs for specified productId</description>
        <attribute name="productId" mode="IN" type="String" optional="false"/>
        <attribute name="lastInvMode" mode="IN" type="String" optional="true">
            <description>Mode for setting last inventory count, or type/source of the call. Values: AUTO (default), MANUAL (SCIPIO)</description>
        </attribute>
    </service>
    <service name="setAllProductsLastInventoryCount" engine="java"
             location="org.ofbiz.product.inventory.InventoryServices" invoke="setAllProductsLastInventoryCount" transaction-timeout="14400">
        <description>Service which run as EECA (on InventoryItemDetail entity) and updates lastInventoryCount for products available in facility in ProductFacility entity
            - runs for all products in the system (SCIPIO)</description>
        <permission-service service-name="facilityGenericPermission" main-action="ADMIN"/>
    </service>
    <service name="updateDirtyLastInventoryCounts" engine="java"
             location="org.ofbiz.product.inventory.InventoryServices" invoke="updateDirtyLastInventoryCounts" transaction-timeout="14400">
        <description>Checks all ProductFacility records for lastInventoryCount and those lastInvStamp greater than a configured or passed time
            and who were last updated in a non-manual way (lastInvMode AUTO) are recounted - used to trigger delayed recounts to automatically correct
            inventory cache amounts (SCIPIO)</description>
        <attribute name="expiryTime" mode="IN" type="Long" optional="true">
            <description>Expiry time in milliseconds</description>
        </attribute>
        <attribute name="sepTrans" mode="IN" type="Boolean" optional="true" default-value="true"/>
    </service>

    <service name="createUpdateFacilityGeoPoint" engine="simple" default-entity-name="GeoPoint"
                location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" invoke="createUpdateFacilityGeoPoint">
        <description>Create or update GeoPoint assigned to facility</description>
        <permission-service service-name="facilityGenericPermission" main-action="UPDATE"/>
        <attribute name="facilityId" mode="IN" type="String"/>
        <auto-attributes include="all" mode="IN" optional="true"/>
        <override name="dataSourceId" optional="false"/>
        <override name="latitude" optional="false"/>
        <override name="longitude" optional="false"/>
    </service>
    <service name="createContainer" default-entity-name="Container" engine="entity-auto" invoke="create" auth="true">
        <description>Create a new Container Record</description>
        <auto-attributes mode="INOUT" include="pk" optional="true"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
    </service>
    <service name="updateContainer" default-entity-name="Container" engine="entity-auto" invoke="update" auth="true">
        <description>Update a Container</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteContainer" default-entity-name="Container" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete an existing Container Record</description>
        <auto-attributes mode="IN" include="pk" optional="false"/>
    </service>
    <service name="createContainerType" default-entity-name="ContainerType" engine="entity-auto" invoke="create" auth="true">
        <description>Create a new ContainerType Record</description>
        <auto-attributes mode="INOUT" include="pk" optional="true"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
    </service>
    <service name="updateContainerType" default-entity-name="ContainerType" engine="entity-auto" invoke="update" auth="true">
        <description>Update a ContainerType</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteContainerType" default-entity-name="ContainerType" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete an existing ContainerType Record</description>
        <auto-attributes mode="IN" include="pk" optional="false"/>
    </service>

    <!-- FacilityGroupType services -->
    <service name="createFacilityGroupType" default-entity-name="FacilityGroupType" engine="entity-auto" invoke="create" auth="true">
        <description>Create a FacilityGroupType</description>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <auto-attributes include="pk" mode="INOUT" optional="true"/>
    </service>
    <service name="updateFacilityGroupType" default-entity-name="FacilityGroupType" engine="entity-auto" invoke="update" auth="true">
        <description>Update a FacilityGroupType</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteFacilityGroupType" default-entity-name="FacilityGroupType" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete a FacilityGroupType</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- FacilityTypeAttr services -->
    <service name="createFacilityTypeAttr" default-entity-name="FacilityTypeAttr" engine="entity-auto" invoke="create" auth="true">
        <description>Create a FacilityTypeAttr</description>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <auto-attributes include="pk" mode="INOUT" optional="false"/>
    </service>
    <service name="updateFacilityTypeAttr" default-entity-name="FacilityTypeAttr" engine="entity-auto" invoke="update" auth="true">
        <description>Update a FacilityTypeAttr</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeFacilityTypeAttr" default-entity-name="FacilityTypeAttr" engine="entity-auto" invoke="delete" auth="true">
        <description>Remove a FacilityTypeAttr</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>
    <!-- FacilityType services -->
    <service name="createFacilityType" default-entity-name="FacilityType" engine="entity-auto" invoke="create" auth="true">
        <description>Create a FacilityType record</description>
        <auto-attributes include="pk" mode="INOUT" optional="true"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateFacilityType" default-entity-name="FacilityType" engine="entity-auto" invoke="update" auth="true">
        <description>Update a FacilityType record</description>
        <auto-attributes include="pk" mode="IN"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteFacilityType" default-entity-name="FacilityType" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete a FacilityType record</description>
        <auto-attributes include="pk" mode="IN"/>
    </service>

    <!-- FacilityCarrierShipment services -->
    <service name="createFacilityCarrierShipment" default-entity-name="FacilityCarrierShipment" engine="entity-auto" invoke="create" auth="true">
        <description>Create a FacilityCarrierShipment record</description>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <auto-attributes include="pk" mode="INOUT" optional="false"/>
    </service>
    <service name="deleteFacilityCarrierShipment" default-entity-name="FacilityCarrierShipment" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete a FacilityCarrierShipment record</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- FacilityLocationGeoPoint services -->
    <service name="createFacilityLocationGeoPoint" default-entity-name="FacilityLocationGeoPoint" engine="entity-auto" invoke="create" auth="true">
        <description>Create a FacilityLocationGeoPoint record</description>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <auto-attributes include="pk" mode="INOUT" optional="false"/>
    </service>
    <service name="expireFacilityLocationGeoPoint" default-entity-name="FacilityLocationGeoPoint" engine="entity-auto" invoke="expire" auth="true">
        <description>Expire a FacilityLocationGeoPoint record</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- InventoryItemType services -->
    <service name="createInventoryItemType" engine="entity-auto" default-entity-name="InventoryItemType" invoke="create" auth="true">
        <description>Create InventoryItemType</description>
        <auto-attributes include="pk" mode="INOUT" optional="true"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateInventoryItemType" engine="entity-auto" default-entity-name="InventoryItemType" invoke="update" auth="true">
        <description>Update InventoryItemType</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteInventoryItemType" engine="entity-auto" default-entity-name="InventoryItemType" invoke="delete" auth="true">
        <description>Delete InventoryItemType</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>
</services>