ilscipio/scipio-erp

View on GitHub
applications/order/servicedef/services.xml

Summary

Maintainability
Test Coverage
<?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>Order Services</description>
    <vendor>OFBiz</vendor>
    <version>1.0</version>

    <!-- Order processing services -->
    <service name="orderNotificationInterface" engine="interface" location="" invoke="">
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="emailType" type="String" mode="OUT" optional="false"/>
        <attribute name="screenUri" type="String" mode="IN" optional="true"/>
        <attribute name="comments" type="String" mode="IN" optional="true"/>
        <attribute name="body" type="String" mode="OUT" optional="true"/>
        <attribute name="sendTo" type="String" mode="IN" optional="true"/>
        <attribute name="sendCc" type="String" mode="IN" optional="true"/>
        <attribute name="sendBcc" type="String" mode="IN" optional="true"/>
        <attribute name="note" type="String" mode="IN" optional="true"/>
        <attribute name="temporaryAnonymousUserLogin" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
        <attribute name="messageWrapper" type="org.ofbiz.service.mail.MimeMessageWrapper" mode="OUT" optional="true"/>
        <attribute name="orderId" type="String" mode="OUT" optional="true"/>
        <attribute name="subject" type="String" mode="OUT" optional="true"/>
        <attribute name="communicationEventId" type="String" mode="OUT" optional="true"/>
    </service>
    <service name="sendOrderConfirmation" engine="java" require-new-transaction="true" max-retry="3"
            location="org.ofbiz.order.order.OrderServices" invoke="sendOrderConfirmNotification">
        <description>Send a order confirmation</description>
        <implements service="orderNotificationInterface"/>
    </service>
    <service name="sendOrderChangeNotification" engine="java" require-new-transaction="true" max-retry="3"
            location="org.ofbiz.order.order.OrderServices" invoke="sendOrderChangeNotification">
        <description>Send a order notification</description>
        <implements service="orderNotificationInterface"/>
    </service>
    <service name="sendOrderCompleteNotification" engine="java" require-new-transaction="true" max-retry="3"
            location="org.ofbiz.order.order.OrderServices" invoke="sendOrderCompleteNotification">
        <description>Send a order notification</description>
        <implements service="orderNotificationInterface"/>
    </service>
    <service name="sendOrderBackorderNotification" engine="java" require-new-transaction="true" max-retry="3"
            location="org.ofbiz.order.order.OrderServices" invoke="sendOrderBackorderNotification">
        <description>Send a order notification</description>
        <implements service="orderNotificationInterface"/>
    </service>
    <service name="sendOrderPayRetryNotification" engine="java" require-new-transaction="true" max-retry="3"
            location="org.ofbiz.order.order.OrderServices" invoke="sendOrderPayRetryNotification">
        <description>Send a order notification</description>
        <implements service="orderNotificationInterface"/>
    </service>

    <!--SCIPIO: new payment notification services -->
    <service name="sendOrderPayChangeNotification" engine="java" require-new-transaction="true" max-retry="3"
             location="org.ofbiz.order.order.OrderServices" invoke="sendOrderPayChangeNotification">
        <description>Send a order notification</description>
        <implements service="orderNotificationInterface"/>
    </service>
    <service name="sendOrderPayCompleteNotification" engine="java" require-new-transaction="true" max-retry="3"
             location="org.ofbiz.order.order.OrderServices" invoke="sendOrderPayCompleteNotification">
        <description>Send a order notification</description>
        <implements service="orderNotificationInterface"/>
    </service>

    <service name="sendProcessNotification" engine="java" require-new-transaction="true" max-retry="3"
            location="org.ofbiz.order.order.OrderServices" invoke="sendProcessNotification">
        <description>Limit Service for order processing workflow; sends activitiy notifications</description>
        <attribute name="workEffortId" type="String" mode="IN"/>
        <attribute name="adminEmailList" type="String" mode="IN"/>
        <attribute name="assignedPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="assignedRoleTypeId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="createOrderNotificationLog" engine="simple" default-entity-name="OrderNotification"
            location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="createNotificationLog">
        <description>Logs when a notification was sent</description>
        <auto-attributes include="pk" mode="OUT" optional="false"/>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="emailType" type="String" mode="IN" optional="false"/>
        <attribute name="comments" type="String" mode="IN" optional="true"/>
    </service>

    <service name="storeOrder" engine="java" validate="true" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="createOrder">
        <description>Creates order entities</description>
        <attribute name="partyId" type="String" mode="IN" optional="false"/>
        <attribute name="placingCustomerPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="billToCustomerPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="shipToCustomerPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="endUserCustomerPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="billFromVendorPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="shipFromVendorPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="supplierAgentPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="orderName" type="String" mode="IN" optional="true"/>
        <attribute name="visitId" type="String" mode="IN" optional="true"/>
        <attribute name="affiliateId" type="String" mode="IN" optional="true"/>
        <attribute name="productStoreId" type="String" mode="IN" optional="true"/>
        <attribute name="originFacilityId" type="String" mode="IN" optional="true"/>
        <attribute name="transactionId" type="String" mode="IN" optional="true"/>
        <attribute name="terminalId" type="String" mode="IN" optional="true"/>
        <attribute name="workEffortId" type="String" mode="IN" optional="true"/>
        <attribute name="autoOrderShoppingListId" type="String" mode="IN" optional="true"/>
        <attribute name="webSiteId" type="String" mode="IN" optional="true"/>
        <attribute name="externalId" type="String" mode="IN" optional="true"/>
        <attribute name="internalCode" type="String" mode="IN" optional="true"/>
        <attribute name="distributorId" type="String" mode="IN" optional="true"/>
        <attribute name="orderTypeId" type="String" mode="INOUT" optional="false"/>
        <attribute name="salesChannelEnumId" type="String" mode="IN" optional="true"/>
        <attribute name="orderItemGroups" type="List" mode="IN" optional="true"/>
        <attribute name="orderItems" type="List" mode="IN" optional="false"/>
        <attribute name="orderTerms" type="List" mode="IN" optional="true"/>
        <!-- workeffort contains the rental start/enddate, nbr of persons. WorkEfforts is mandatory for ordertype = RENTAL_ORDER_ITEM-->
        <attribute name="workEfforts" type="List" mode="IN" optional="true"/>
        <attribute name="orderAdjustments" type="List" mode="IN" optional="false"/>
        <attribute name="billingAccountId" type="String" mode="IN" optional="true"/>
        <attribute name="shippingAmount" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="firstAttemptOrderId" type="String" mode="IN" optional="true"/>
        <attribute name="currencyUom" type="String" mode="IN" optional="false"/>
        <attribute name="grandTotal" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="taxAmount" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="orderDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="orderItemShipGroupInfo" type="List" mode="IN" optional="true"/>
        <attribute name="orderItemAttributes" type="List" mode="IN" optional="true"/>
        <attribute name="orderAttributes" type="List" mode="IN" optional="true"/>
        <attribute name="orderPaymentInfo" type="List" mode="IN" optional="true"/>
        <attribute name="orderContactMechs" type="List" mode="IN" optional="true"/>
        <attribute name="orderItemContactMechs" type="List" mode="IN" optional="true"/>
        <attribute name="orderItemPriceInfos" type="List" mode="IN" optional="true"/>
        <attribute name="orderProductPromoUses" type="List" mode="IN" optional="true"/>
        <attribute name="orderProductPromoCodes" type="Set" mode="IN" optional="true"/>
        <attribute name="orderItemSurveyResponses" type="List" mode="IN" optional="true"/>
        <attribute name="trackingCodeOrders" type="List" mode="IN" optional="true"/>
        <attribute name="orderAdditionalPartyRoleMap" type="Map" mode="IN" optional="true"/>
        <attribute name="orderItemAssociations" type="List" mode="IN" optional="true"/>
        <attribute name="orderInternalNotes" type="List" mode="IN" optional="true"/>
        <attribute name="orderNotes" type="List" mode="IN" optional="true"/>
        <attribute name="supplierPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="orderId" type="String" mode="INOUT" optional="true"/>
        <attribute name="originOrderId" type="String" mode="IN" optional="true"/>
        <attribute name="marketplaceId" type="String" mode="IN" optional="true"/>
        <attribute name="statusId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="callProcessOrderPayments" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="callProcessOrderPayments" auth="false">
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
        <attribute name="manualHold" type="Boolean" mode="IN" optional="true"/>
    </service>
    <service name="createOrderFromShoppingCart" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="createOrderFromShoppingCart" auth="false">
        <property name="shoppingCart.update" type="Boolean" value="true"><description>SCIPIO: This service modifies the passed shoppingCart</description></property>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="INOUT" optional="false"/>
        <attribute name="orderId" type="String" mode="OUT" optional="false"/>
    </service>
    <service name="createSimpleNonProductSalesOrder" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="createSimpleNonProductSalesOrder" auth="true">
        <attribute name="paymentMethodId" type="String" mode="IN" optional="false"/>
        <attribute name="productStoreId" type="String" mode="IN" optional="false"/>
        <attribute name="currency" type="String" mode="IN" optional="false"/>
        <attribute name="partyId" type="String" mode="IN" optional="false"/>
        <attribute name="itemMap" type="Map" mode="IN" optional="false"/>
        <attribute name="orderId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="createOrderItemBilling" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="createOrderItemBilling">
        <description>Create a new order item billing record</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="invoiceId" type="String" mode="IN" optional="false"/>
        <attribute name="invoiceItemSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="amount" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="itemIssuanceId" type="String" mode="IN" optional="true"/>
        <attribute name="shipmentReceiptId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="orderAdjustmentPermissionCheck" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="orderAdjustmentPermissionCheck">
        <description>Permission service for the creation and editing of order adjustments</description>
        <implements service="permissionInterface"/>
    </service>

    <service name="createOrderAdjustment" default-entity-name="OrderAdjustment" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="createOrderAdjustment">
        <description>Creates a new order adjustment record</description>
        <permission-service service-name="orderAdjustmentPermissionCheck" main-action="CREATE"/>
        <auto-attributes mode="OUT" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <override name="orderAdjustmentTypeId" optional="false"/>
        <override name="orderId" optional="false"/>
    </service>
    <service name="updateOrderAdjustment" default-entity-name="OrderAdjustment" engine="simple"
        location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="updateOrderAdjustment">
        <description>Update an order adjustment record</description>
        <auto-attributes mode="IN" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <override name="orderId" optional="false"/>
    </service>
    <service name="deleteOrderAdjustment" default-entity-name="OrderAdjustment" engine="simple"
        location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="deleteOrderAdjustment">
        <description>Delete an order adjustment record</description>
        <auto-attributes mode="IN" include="pk" optional="false"/>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>  <!-- needed for resetGrandTotal seca -->
        <attribute name="productPromoCodeId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="createOrderAdjustmentBilling" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="createOrderAdjustmentBilling">
        <description>Create a new order adjustment billing record</description>
        <attribute name="orderAdjustmentId" type="String" mode="IN" optional="false"/>
        <attribute name="invoiceId" type="String" mode="IN" optional="false"/>
        <attribute name="invoiceItemSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="amount" type="BigDecimal" mode="IN" optional="true"/>
    </service>

    <service name="createPaymentFromPreference" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="createPaymentFromPreference">
        <description>Creates a payment using the order payment preference</description>
        <attribute name="orderPaymentPreferenceId" type="String" mode="IN" optional="false"/>
        <attribute name="paymentFromId" type="String" mode="IN" optional="true"/>
        <attribute name="paymentRefNum" type="String" mode="IN" optional="true"/>
        <attribute name="comments" type="String" mode="IN" optional="true"/>
        <attribute name="eventDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="paymentId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="updateTrackingNumber" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="updateTrackingNumber">
        <description>Sets the tracking number on a shipment preference</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="trackingNumber" type="String" mode="IN" optional="false"/>
    </service>

    <service name="resetGrandTotal" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="resetGrandTotal" require-new-transaction="false">
        <!-- NOTE: require-new-transaction is false because this service is often run as a sync action on an ECA, so generally at the same time and in a separate TX it runs into locking problems -->
        <description>Reset the grandTotal of an existing order</description>
        <attribute name="orderId" type="String" mode="IN"/>
    </service>
    <service name="setEmptyGrandTotals" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="setEmptyGrandTotals">
        <description>Find all OrderHeaders with no grandTotal and call resetGrandTotal</description>
        <attribute name="forceAll" type="Boolean" mode="IN" optional="true"/>
    </service>

    <service name="recalcShippingTotal" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="recalcOrderShipping">
        <description>Adjust the order shipping amount</description>
        <attribute name="orderId" type="String" mode="IN"/>
    </service>
    <service name="recalcTaxTotal" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="recalcOrderTax">
        <description>Adjust the order tax amount</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="changeOrderStatus" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="setOrderStatus">
        <description>Change the status of an existing order</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="statusId" type="String" mode="IN"/>
        <attribute name="setItemStatus" type="String" mode="IN" optional="true"/>
        <attribute name="oldStatusId" type="String" mode="OUT" optional="false"/>
        <attribute name="orderStatusId" type="String" mode="OUT" optional="true"/>
        <attribute name="orderTypeId" type="String" mode="OUT" optional="true"/>
        <attribute name="needsInventoryIssuance" type="String" mode="OUT" optional="true"/>
        <attribute name="grandTotal" type="BigDecimal" mode="OUT" optional="true"/>
        <attribute name="changeReason" type="String" mode="IN" optional="true"/>
    </service>

    <service name="changeOrderItemStatus" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="setItemStatus">
        <description>Change the status of an existing order item.  If no orderItemSeqId is specified, the status of all order items will be changed.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="fromStatusId" type="String" mode="IN" optional="true"/>
        <attribute name="statusId" type="String" mode="IN" optional="false"/>
        <attribute name="statusDateTime" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="changeReason" type="String" mode="IN" optional="true"/>
        <attribute name="checkOutPaymentId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="cancelOrderItem" engine="java" auth="true" transaction-timeout="3000"
            location="org.ofbiz.order.order.OrderServices" invoke="cancelOrderItem">
        <description>Cancel an Order Item Quantity</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="cancelQuantity" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="itemReasonMap" type="Map" mode="IN" string-map-prefix="irm_" optional="true"/>
        <attribute name="itemCommentMap" type="Map" mode="IN" string-map-prefix="icm_" optional="true"/>
        <attribute name="itemQtyMap" type="Map" mode="IN" string-map-prefix="iqm_" optional="true"/>
    </service>
    <service name="cancelOrderItemNoActions" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="cancelOrderItem">
        <description>Cancel an Order Item Quantity. This is equal to cancelOrderItem but no ECAs are attached to this service.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="true"/>
        <attribute name="cancelQuantity" type="BigDecimal" mode="IN" optional="true"/>
    </service>

    <service name="updateOrderItems" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="updateApprovedOrderItems" transaction-timeout="7200">
        <description>Update the quantities/prices for an existing order</description>
        <attribute name="orderId" type="String" mode="INOUT" optional="false"/>
        <attribute name="supplierPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="orderTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="calcTax" type="Boolean" mode="IN" optional="true" default-value="true"/>
        <attribute name="itemDescriptionMap" type="Map" mode="IN" string-map-prefix="idm_" optional="true"/>
        <attribute name="itemQtyMap" type="Map" mode="IN" string-map-prefix="iqm_" optional="false"/>
        <attribute name="itemPriceMap" type="Map" mode="IN" string-map-prefix="ipm_" optional="false"/>
        <attribute name="overridePriceMap" type="Map" mode="IN" string-map-prefix="opm_" optional="false"/>
        <attribute name="itemReasonMap" type="Map" mode="IN" string-map-prefix="irm_" optional="true"/>
        <attribute name="itemCommentMap" type="Map" mode="IN" string-map-prefix="icm_" optional="true"/>
        <attribute name="itemAttributesMap" type="Map" mode="IN" string-map-prefix="iam_" optional="true"/>
        <attribute name="itemShipDateMap" type="Map" mode="IN" string-map-prefix="isdm_" optional="true"/>
        <attribute name="itemDeliveryDateMap" type="Map" mode="IN" string-map-prefix="iddm_" optional="true"/>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
    </service>
    <service name="loadCartForUpdate" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="loadCartForUpdate">
        <description>Load an existing shopping cart</description>
        <attribute name="orderId" type="String" mode="INOUT" optional="false"/>
        <!-- <attribute name="userLogin" type="String" mode="IN" optional="false"/> -->
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
    </service>
    <service name="saveUpdatedCartToOrder" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="saveUpdatedCartToOrder">
        <description>Update the quantities/prices for an existing order</description>
        <attribute name="orderId" type="String" mode="INOUT" optional="false"/>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
        <attribute name="calcTax" type="Boolean" mode="IN" optional="true" default-value="true"/>
        <attribute name="deleteItems" type="Boolean" mode="IN" optional="true" default-value="false"/>
        <attribute name="changeMap" type="Map" mode="IN" optional="false"/>
    </service>
    <service name="appendOrderItem" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="addItemToApprovedOrder" transaction-timeout="7200">
        <description>Append an item to an existing order</description>
        <attribute name="orderId" type="String" mode="INOUT" optional="false"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="productId" type="String" mode="IN" optional="false"/>
        <attribute name="prodCatalogId" type="String" mode="IN" optional="true"/>
        <attribute name="basePrice" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="false"/>
        <attribute name="amount" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="overridePrice" type="String" mode="IN" optional="true"/>
        <attribute name="reasonEnumId" type="String" mode="IN" optional="true"/>
        <attribute name="orderItemTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="changeComments" type="String" mode="IN" optional="true"/>
        <attribute name="itemDesiredDeliveryDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="itemAttributesMap" type="Map" mode="IN" optional="true"/>
        <attribute name="calcTax" type="Boolean" mode="IN" optional="true" default-value="true"/>
        <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
    </service>

    <service name="recreateOrderAdjustments" engine="simple" auth="true"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="recreateOrderAdjustments">
        <description>Remove all existing order adjustments, recalc them and persist in OrderAdjustment.</description>
        <permission-service service-name="orderAdjustmentPermissionCheck" main-action="UPDATE"/>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
    </service>

    <service name="processOrderPayments" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="processOrderPayments">
        <description>Process payments for an order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
    </service>

    <service name="updateOrderPaymentPreference" engine="java" auth="true" default-entity-name="OrderPaymentPreference"
            location="org.ofbiz.order.order.OrderServices" invoke="updateOrderPaymentPreference">
        <auto-attributes mode="INOUT" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <attribute name="checkOutPaymentId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="checkOrderItemStatus" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="checkItemStatus">
      <description>Check the status of all items and cancel/approve/complete the order if we can</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
    </service>

    <service name="updateOrderStatusFromReceipt" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="updateOrderStatusFromReceipt">
        <description>Updates the (purchase) order/order item status based on receipt</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="currentStatusId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="autoCancelOrderItems" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="cancelFlaggedSalesOrders">
            <description>Batch service which automatically cancels sales order and/or sales order items.
                Sales orders : These will be cancelled if the order status equals CREATED and it has been
                  either 30 days or ProductStore.daysCancelNoPay since the order was created. A value of 0 for
                  ProductStore.daysCancelNoPay means do not auto-cancel.
                Sales order items : This is only for orders on the APPROVED status. Items will be cancelled if the
                  item is flagged with an autoCancelDate and does not have a dontCancelDate and dontCancelUserLogin
                  associated with it, and it is past the autoCancelDate.</description>

        <!-- this service has no parameters IN or OUT -->
    </service>

    <service name="setAllowOrderSplit" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="allowOrderSplit">
        <description>Set the Allow Split Flag To 'Y' (true)</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
    </service>

    <service name="getOrderItemShipGroupEstimatedShipDate" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="getOrderItemShipGroupEstimatedShipDate" auth="true">
        <description>Compute and return the OrderItemShipGroup estimated ship date based on the associated items.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="estimatedShipDate" type="Timestamp" mode="OUT" optional="true"/>
    </service>

    <service name="addOrderRole" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="addRoleType">
        <description>Adds a RoleType to an order</description>
        <attribute name="removeOld" type="Boolean" mode="IN" optional="true"/>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="partyId" type="String" mode="IN"/>
        <attribute name="roleTypeId" type="String" mode="IN"/>
    </service>

    <service name="removeOrderRole" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="removeRoleType">
        <description>Removes a RoleType from an order</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="partyId" type="String" mode="IN"/>
        <attribute name="roleTypeId" type="String" mode="IN"/>
    </service>

    <service name="createOrderPaymentPreference" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="createPaymentPreference">
        <description>Creates an order payment preference</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="paymentMethodTypeId" type="String" mode="IN"/>
        <attribute name="paymentMethodId" type="String" mode="IN" optional="true"/>
        <attribute name="statusId" type="String" mode="IN" optional="true"/>
        <attribute name="maxAmount" type="BigDecimal" mode="IN" optional="true"/>
        <attribute name="orderPaymentPreferenceId" type="String" mode="OUT"/>
    </service>

    <service name="createOrderNote" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="createOrderNote" auth="true">
        <description>Create a note item and associate with a order header</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="note" type="String" mode="IN" allow-html="any"/>
        <attribute name="internalNote" type="String" mode="IN"/>
        <attribute name="noteName" type="String" mode="IN" optional="true"/>
    </service>

    <service name="updateOrderNote" engine="simple" default-entity-name="OrderHeaderNote"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateOrderNote" auth="true">
        <description>Toggle Order Note and make it either Public or Private</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="noteId" type="String" mode="IN" optional="false"/>
        <attribute name="internalNote" type="String" mode="IN" optional="false"/>
    </service>

    <!-- Order (digital) Fulfillment Services -->
    <service name="checkDigitalItemFulfillment" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="checkDigitalItemFulfillment" auth="true">
        <description>Check an order for digital items and invoice/capture + fulfill the items</description>
        <attribute name="orderId" type="String" mode="IN"/>
    </service>
   <service name="fulfillDigitalItems" engine="java" require-new-transaction="true" transaction-timeout="300"
       location="org.ofbiz.order.order.OrderServices" invoke="fulfillDigitalItems">
       <description>Order Fulfillment</description>
       <attribute name="orderId" type="String" mode="IN" optional="false"/>
       <attribute name="orderItems" type="java.util.List" mode="IN" optional="false"/>
   </service>
   <service name="itemFulfillmentInterface" engine="interface" invoke="" location="" auth="false" >
       <auto-attributes entity-name="ProductContent" include="pk" mode="IN" optional="false"/>
       <attribute name="orderItem" type="org.ofbiz.entity.GenericValue" mode="IN" optional="false"/>
   </service>
    <service name="invoiceServiceItems" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="invoiceServiceItems" auth="true">
        <description>Check an order for service items and invoice the items</description>
        <attribute name="orderId" type="String" mode="IN"/>
    </service>
    <!-- Order View Services -->
    <service name="getOrderedSummaryInformation" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="getOrderedSummaryInformation">
        <description>Get Ordered Summary Information</description>
        <attribute name="partyId" type="String" mode="IN" optional="false"/>
        <attribute name="roleTypeId" type="String" mode="IN" optional="true"/> <!-- defaults to PLACING_CUSTOMER -->
        <attribute name="orderTypeId" type="String" mode="IN" optional="true"/> <!-- defaults to SALES_ORDER -->
        <attribute name="statusId" type="String" mode="IN" optional="true"/> <!-- defaults to ORDER_COMPLETED -->
        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
        <attribute name="monthsToInclude" type="Integer" mode="IN" optional="true"/> <!-- if monthsToInclude specified along with fromDate/thruDate, will override fromDate/thruDate -->
        <attribute name="totalOrders" type="Long" mode="OUT" optional="false"/>
        <attribute name="totalGrandAmount" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="totalSubRemainingAmount" type="BigDecimal" mode="OUT" optional="false"/>
    </service>

    <service name="getOrderHeaderInformation" engine="java" validate="false"
            location="org.ofbiz.order.order.OrderServices" invoke="getOrderHeaderInformation">
        <description>Get basic order header information.</description>
        <auto-attributes entity-name="OrderHeader" include="pk" mode="INOUT" optional="false"/>
        <auto-attributes entity-name="OrderHeader" include="nonpk" mode="OUT" optional="true"/>
    </service>

    <service name="getOrderShippingAmount" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="getOrderShippingAmount">
        <description>Get the total shipping for an order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="shippingAmount" type="BigDecimal" mode="OUT" optional="false"/>
    </service>
    <service name="getOrderStatus" engine="simple" location="component://order/script/org/ofbiz/order/order/OrderServices.xml"
            invoke="getOrderStatus" auth="false">
        <description>Gets the order status</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="statusId" type="String" mode="OUT" optional="false"/>
    </service>

    <!-- Order Delivery Services -->
    <service name="createOrderDeliverySchedule" default-entity-name="OrderDeliverySchedule" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderDeliveryServices.xml" invoke="createOrderDeliverySchedule">
        <description>Creates a delivery schedule for the specified order</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="orderItemSeqId" optional="true"/>
    </service>
    <service name="updateOrderDeliverySchedule" default-entity-name="OrderDeliverySchedule" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderDeliveryServices.xml" invoke="updateOrderDeliverySchedule">
        <description>Update an existing delivery schedule for a specified purchase order</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="sendOrderDeliveryScheduleNotification" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderDeliveryServices.xml" invoke="sendOrderDeliveryScheduleNotification">
        <description>Send Order Delivery Schedule Notification</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="checkSupplierRelatedOrderPermission" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderDeliveryServices.xml" invoke="checkSupplierRelatedOrderPermissionService">
        <description>Check Supplier Related Order Permission</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="checkAction" type="String" mode="IN" optional="true"/>
        <attribute name="callingMethodName" type="String" mode="IN" optional="true"/>
        <attribute name="hasSupplierRelatedPermission" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="updateShoppingListQuantitiesFromOrder" engine="java"
            location="org.ofbiz.order.shoppinglist.ShoppingListServices" invoke="updateShoppingListQuantitiesFromOrder">
            <description>Given an orderId, this service will look through all its OrderItems and for each shoppingListItemId
              and shoppingListItemSeqId, update the quantity purchased in the ShoppingListItem entity.  Used for
              tracking how many of shopping list items are purchased.  This service is mounted as a seca on storeOrder.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
    </service>

    <!-- serialization test -->
    <service name="shoppingCartRemoteTest" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="shoppingCartRemoteTest">
        <attribute name="cart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="IN" optional="false"/>
    </service>
    <service name="shoppingCartTest" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="shoppingCartTest">
    </service>

    <!-- OrderShipment Services -->
    <service name="createOrderShipment" default-entity-name="OrderShipment" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderShipment" auth="true">
        <description>Create OrderShipment</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateOrderShipment" default-entity-name="OrderShipment" engine="simple"
        location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateOrderShipment" auth="true">
        <description>Update OrderShipment</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteOrderShipment" default-entity-name="OrderShipment" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="deleteOrderShipment" auth="true">
        <description>Delete OrderShipment</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- mass order changes -->
    <service name="massOrderChangeInterface" engine="interface" location="" invoke="">
        <description>Interface for Mass Order Change Services</description>
        <attribute name="orderIdList" type="List" mode="IN" optional="false"/>
    </service>

    <service name="massPickOrders" engine="java" transaction-timeout="300"
            location="org.ofbiz.order.order.OrderServices" invoke="massPickOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massChangeOrderApproved" engine="java" transaction-timeout="300"
            location="org.ofbiz.order.order.OrderServices" invoke="massChangeApproved" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massProcessOrders" engine="java" transaction-timeout="300"
            location="org.ofbiz.order.order.OrderServices" invoke="massProcessOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massHoldOrders" engine="java" transaction-timeout="300"
            location="org.ofbiz.order.order.OrderServices" invoke="massHoldOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massCancelOrders" engine="java" transaction-timeout="300"
            location="org.ofbiz.order.order.OrderServices" invoke="massCancelOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massCancelRemainingPurchaseOrderItems" engine="java" transaction-timeout="300"
            location="org.ofbiz.order.order.OrderServices" invoke="massCancelRemainingPurchaseOrderItems" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massRejectOrders" engine="java" transaction-timeout="300"
            location="org.ofbiz.order.order.OrderServices" invoke="massRejectOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massQuickShipOrders" engine="java" transaction-timeout="300"
            location="org.ofbiz.order.order.OrderServices" invoke="massQuickShipOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
    </service>
    <service name="massPrintOrders" engine="java" transaction-timeout="300"
            location="org.ofbiz.order.order.OrderServices" invoke="massPrintOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
        <attribute name="screenLocation" type="String" mode="IN" optional="false"/>
        <attribute name="printerName" type="String" mode="IN" optional="true"/>
    </service>
    <service name="massCreateFileForOrders" engine="java" transaction-timeout="300"
            location="org.ofbiz.order.order.OrderServices" invoke="massCreateFileForOrders" auth="true">
        <implements service="massOrderChangeInterface"/>
        <attribute name="screenLocation" type="String" mode="IN" optional="false"/>
    </service>

    <service name="getNextOrderId" engine="simple"
        location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="getNextOrderId">
        <description>Get the Next Order ID According to Settings on the PartyAcctgPreference Entity for the given Party</description>
        <implements service="storeOrder" optional="true"/>
        <attribute name="partyId" type="String" mode="IN" optional="false"/>
        <attribute name="productStoreId" type="String" mode="IN" optional="true"/>
        <attribute name="orderId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="orderSequence_enforced" engine="simple"
        location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="orderSequence_enforced">
        <implements service="getNextOrderId"/>
        <attribute name="partyAcctgPreference" type="org.ofbiz.entity.GenericValue" mode="IN"/>
        <override name="orderId" type="Long" mode="OUT"/>
    </service>

    <!-- OrderHeader -->
    <service name="createOrderHeader" default-entity-name="OrderHeader" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderHeader" auth="true">
        <description>Create OrderHeader</description>
        <auto-attributes include="pk" mode="INOUT" optional="true"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateOrderHeader" default-entity-name="OrderHeader" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateOrderHeader" auth="true">
        <description>Update OrderHeader</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>

    <!-- CommunicationEvents related to orders -->
    <service name="createCommunicationEventOrder" engine="simple"
            location="component://order/script/org/ofbiz/order/communication/CommunicationEventServices.xml" invoke="createCommunicationEventOrder" auth="true">
        <description>Create a Communication Event Order</description>
        <auto-attributes entity-name="CommunicationEventOrder" include="pk" mode="IN"/>
    </service>
    <service name="removeCommunicationEventOrder" engine="simple"
            location="component://order/script/org/ofbiz/order/communication/CommunicationEventServices.xml" invoke="removeCommunicationEventOrder" auth="true">
        <description>Remove a Communication Event Order</description>
        <auto-attributes entity-name="CommunicationEventOrder" include="pk" mode="IN"/>
    </service>

    <!-- Order Shipping and Contacts -->
    <service name="createOrderItemShipGroup" default-entity-name="OrderItemShipGroup" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderItemShipGroup" auth="true">
        <description>Creates a new OrderItemShipGroup.</description>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="shipGroupSeqId" type="String" mode="INOUT" optional="true"/>
    </service>
    <service name="updateOrderItemShipGroup" default-entity-name="OrderItemShipGroup" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateOrderItemShipGroup" auth="true">
        <description>Updates OrderItemShipGroup.  The shipmentMethod field is of the format ${shipmentMethodTypeId}@${carrierPartyId}</description>
        <auto-attributes mode="IN" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <attribute name="oldContactMechId" type="String" mode="IN" optional="true"/>
        <attribute name="shipmentMethod" type="String" mode="IN" optional="true"/>
        <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="createOrderContactMech" default-entity-name="OrderContactMech" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderContactMech" auth="true">
        <description>Create Order Contact Mech</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <service name="updateOrderContactMech" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateOrderContactMech" auth="true" default-entity-name="OrderContactMech">
        <description>Update Order Contact Mech</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <attribute name="oldContactMechId" type="String" mode="IN" optional="true"/>
    </service>

    <service name="removeOrderContactMech" default-entity-name="OrderContactMech" engine="simple"
        location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="removeOrderContactMech" auth="true">
        <description>Remove Order Contact Mech</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <!-- OrderTerms -->
    <service name="createOrderTerm" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderTerm" auth="true">
        <description>Create an Order Term</description>
        <auto-attributes entity-name="OrderTerm" include="pk" mode="IN" optional="false"/>
        <auto-attributes entity-name="OrderTerm" include="nonpk" mode="IN" optional="true"/>
        <override name="orderItemSeqId" optional="true"/>
    </service>
    <service name="updateOrderTerm" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateOrderTerm" auth="true">
        <description>Update an Order Term</description>
        <auto-attributes entity-name="OrderTerm" include="pk" mode="IN" optional="false"/>
        <auto-attributes entity-name="OrderTerm" include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="removeOrderTerm" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="removeOrderTerm" auth="true">
        <description>Remove an Order Term</description>
        <auto-attributes entity-name="OrderTerm" include="pk" mode="IN" optional="false"/>
    </service>

    <service name="checkCreateDropShipPurchaseOrders" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="checkCreateDropShipPurchaseOrders" auth="true">
        <description>If the order is a sales order, create purchase orders (drop shipments) for each ship group associated to a supplier</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
    </service>

    <service name="addPaymentMethodToOrder" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="addPaymentMethodToOrder" auth="true">
        <description>Add Payment Method to Order.From this servicewe will call the createOrderPaymentPreference service to create OrderPaymentPreference</description>
        <attribute type="String" mode="IN" name="orderId" optional="false"/>
        <attribute type="String" mode="IN" name="paymentMethodId" optional="false"/>
        <attribute type="BigDecimal" mode="IN" name="maxAmount"/>
        <attribute type="String" mode="OUT" name="orderPaymentPreferenceId"/>
    </service>

    <service name="completePurchaseOrder" engine="group" auth="true">
        <description>Completes a purchase order by cancelling remaining (unreceived) item quantities and generating new product requirements
            from those quantities</description>
        <group>
            <invoke name="cancelRemainingPurchaseOrderItems" result-to-context="true"/>
            <invoke name="generateReqsFromCancelledPOItems" result-to-context="true"/>
            <invoke name="checkOrderItemStatus" result-to-context="true"/>
        </group>
    </service>

    <service name="cancelRemainingPurchaseOrderItems" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="cancelRemainingPurchaseOrderItems" auth="true">
        <description>Cancels remaining (unreceived) quantities for items of an order. Does not consider received-but-rejected quantities.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
    </service>

    <service name="generateReqsFromCancelledPOItems" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="generateReqsFromCancelledPOItems" auth="true">
        <description>Generates a product requirement for the total cancelled quantity over all order items for each product</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="facilityId" type="String" mode="IN" optional="false"/>
    </service>

    <service name="getOrderItemInvoicedAmountAndQuantity" engine="java"
            location="org.ofbiz.order.order.OrderServices" invoke="getOrderItemInvoicedAmountAndQuantity" auth="true">
        <description>Determines the total amount invoiced for a given order item over all invoices by totalling the item
            subtotal (via OrderItemBilling), any adjustments for that item (via OrderAdjustmentBilling), and the item's
            share of any order-level adjustments (that calculated by applying the percentage of the items total that the item represents
            to the order-level adjustments total (also via OrderAdjustmentBilling). Also returns the quantity invoiced for the item over
            all invoices, to aid in prorating.</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="invoicedAmount" type="BigDecimal" mode="OUT" optional="false"/>
        <attribute name="invoicedQuantity" type="BigDecimal" mode="OUT" optional="false"/>
    </service>

    <!-- SCIPIO: Original findOrders interface has been refactored -->
    <!-- order lookup services -->
    <service name="findOrdersCommon" engine="interface">
        <description>Common order search fields</description>
        <!-- order header fields -->
        <attribute name="orderId" type="String" mode="IN" optional="true"/>
        <attribute name="orderName" type="String" mode="IN" optional="true"/>
        <attribute name="orderTypeId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="orderStatusId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="productStoreId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="orderWebSiteId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="salesChannelEnumId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="createdBy" type="String" mode="IN" optional="true"/>
        <attribute name="terminalId" type="String" mode="IN" optional="true"/>
        <attribute name="transactionId" type="String" mode="IN" optional="true"/>
        <attribute name="externalId" type="String" mode="IN" optional="true"/>
        <attribute name="internalCode" type="String" mode="IN" optional="true"/>
        <attribute name="useEntryDate" type="String" mode="IN" optional="true"/> <!-- Y/N use entryDate instead of orderDate -->
        <attribute name="minDate" type="String" mode="IN" optional="true"/> <!-- converted to Timestamp -->
        <attribute name="maxDate" type="String" mode="IN" optional="true"/> <!-- converted to Timestamp -->
        <attribute name="hasBackOrders" type="String" mode="IN" optional="true"/> <!-- Y to only show orders with items on backorder -->

        <!-- order role fields -->
        <attribute name="userLoginId" type="String" mode="IN" optional="true"/>
        <attribute name="roleTypeId" type="List" mode="IN" optional="true"/> <!-- can pass multiple values as list -->
        <attribute name="partyId" type="String" mode="IN" optional="true"/>

        <!-- order item fields -->
        <attribute name="correspondingPoId" type="String" mode="IN" optional="true"/>
        <attribute name="subscriptionId" type="String" mode="IN" optional="true"/>
        <attribute name="productId" type="String" mode="IN" optional="true"/>
        <attribute name="budgetId" type="String" mode="IN" optional="true"/>
        <attribute name="quoteId" type="String" mode="IN" optional="true"/>

        <!-- Product identification -->
        <attribute name="goodIdentificationTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="goodIdentificationIdValue" type="String" mode="IN" optional="true"/>

        <attribute name="billingAccountId" type="String" mode="IN" optional="true"/>
        <attribute name="finAccountId" type="String" mode="IN" optional="true"/>
        <attribute name="cardNumber" type="String" mode="IN" optional="true"/>
        <attribute name="accountNumber" type="String" mode="IN" optional="true"/>
        <attribute name="paymentStatusId" type="String" mode="IN" optional="true"/>

        <!-- shipment/inventory fields -->
        <attribute name="inventoryItemId" type="String" mode="IN" optional="true"/>
        <attribute name="softIdentifier" type="String" mode="IN" optional="true"/>
        <attribute name="serialNumber" type="String" mode="IN" optional="true"/>
        <attribute name="shipmentId" type="String" mode="IN" optional="true"/>

        <!-- inventory problem fields -->
        <attribute name="filterInventoryProblems" type="String" mode="IN" optional="true"/>
        <attribute name="filterPOsWithRejectedItems" type="String" mode="IN" optional="true"/>
        <attribute name="filterPOsOpenPastTheirETA" type="String" mode="IN" optional="true"/>
        <attribute name="filterPartiallyReceivedPOs" type="String" mode="IN" optional="true"/>

        <attribute name="isViewed" type="String" mode="IN" optional="true"/> <!-- show orders with viewed Y/N -->
        <attribute name="shipmentMethod" type="String" mode="IN" optional="true"/>
        <attribute name="gatewayAvsResult" type="String" mode="IN" optional="true"/>
        <attribute name="gatewayScoreResult" type="String" mode="IN" optional="true"/>

        <!-- ship to country fields -->
        <attribute name="countryGeoId" type="String" mode="IN" optional="true"/>
        <attribute name="includeCountry" type="String" mode="IN" optional="true"/>        

        <!-- inventory problem results -->
        <attribute name="filterInventoryProblemsList" type="List" mode="OUT" optional="true"/>
        <attribute name="filterPOsWithRejectedItemsList" type="List" mode="OUT" optional="true"/>
        <attribute name="filterPOsOpenPastTheirETAList" type="List" mode="OUT" optional="true"/>
        <attribute name="filterPartiallyReceivedPOsList" type="List" mode="OUT" optional="true"/>

        <!-- actual results -->
        <attribute name="paramList" type="String" mode="OUT" optional="false"/>
        <attribute name="orderList" type="List" mode="OUT" optional="false"/>
        <attribute name="orderListSize" type="Integer" mode="OUT" optional="false"/>
    </service>
    
    <service name="findOrders" engine="java" transaction-timeout="300" auth="true"
            location="org.ofbiz.order.order.OrderLookupServices" invoke="findOrders">
        <description>Uses dynamic view entity to find orders; returns a list of Order (OrderHeader) objects</description>
        <implements service="findOrdersCommon" />
        
        <!-- view and page fields -->
        <attribute name="viewIndex" type="Integer" mode="INOUT" optional="false"/>
        <attribute name="viewSize" type="Integer" mode="INOUT" optional="false"/>
        <attribute name="showAll" type="String" mode="INOUT" optional="true"/>

        <!-- index fields -->
        <attribute name="highIndex" type="Integer" mode="OUT" optional="false"/>
        <attribute name="lowIndex" type="Integer" mode="OUT" optional="false"/>
    </service>
    
    <service name="findOrdersInternal" engine="java" transaction-timeout="300" auth="true"
            location="org.ofbiz.order.order.OrderLookupServices" invoke="findOrdersInternal">
        <description>Uses dynamic view entity to find orders; returns a list of Order (OrderHeader) objects.
            SCIPIO: Version of findOrders with extra functions for internal calls (not meant for receiving request parameters directly).</description>
        <implements service="findOrders" />
        
        <!-- SCIPIO: if explicit true, errors return as failure instead of error -->
        <attribute name="errorAsFailure" type="Boolean" mode="IN" optional="true"/>
    </service>
        
    <service name="findOrdersFull" engine="java" transaction-timeout="300" auth="true"
            location="org.ofbiz.order.order.OrderLookupServices" invoke="findOrdersFull">
        <description>Uses dynamic view entity to find orders; returns a full list of Order (OrderHeader) objects (no limitation set by viewIndex/viewSize).
            SCIPIO: Version of findOrders that does not limit to view size and returns all.</description>
        <implements service="findOrdersCommon" />
        
        <!-- SCIPIO: if explicit true, errors return as failure instead of error -->
        <attribute name="errorAsFailure" type="Boolean" mode="IN" optional="true"/>
        
        <attribute name="showAll" type="String" mode="INOUT" optional="true"/>
    </service>

    <service name="checkOrderIsOnBackOrder" engine="simple" auth="false"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="checkOrderIsOnBackOrder">
        <description>Check if an Order is on Back Order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="isBackOrder" type="Boolean" mode="OUT" optional="false"/>
    </service>

    <service name="createTestSalesOrders" engine="java" auth="true" transaction-timeout="300"
            location="org.ofbiz.order.test.OrderTestServices" invoke="createTestSalesOrders">
        <description>Bulk create test sales orders. Note that default-values depend on demo data in [Scipio: shop]/data.</description>
        <attribute name="productCategoryId" type="String" mode="IN" optional="true" default-value="100"/>
        <attribute name="productStoreId" type="String" mode="IN" optional="true" default-value="ScipioShop"/>
        <attribute name="currencyUomId" type="String" mode="IN" optional="true" default-value="USD"/>
        <attribute name="partyId" type="String" mode="IN" optional="true" default-value="DemoCustomer"/>
        <attribute name="numberOfOrders" type="Integer" mode="IN" optional="true" default-value="10"/>
        <attribute name="shipOrder" type="Boolean" mode="IN" optional="true" default-value="false"/>
        <attribute name="numberOfProductsPerOrder" type="Integer" mode="IN" optional="true" default-value="5"/>
        <attribute name="salesChannel" type="String" mode="IN" optional="true"/>
    </service>
    <!-- add require-new-transaction="true" to the following service to fix the lock wait timeout problem, or leave it off to cause that problem -->
    <service name="createTestSalesOrderSingle" engine="java" auth="true" transaction-timeout="300"
        location="org.ofbiz.order.test.OrderTestServices" invoke="createTestSalesOrderSingle">
        <description>Bulk create test sales orders. Note that default-values depend on demo data in [Scipio: shop]/data.</description>
        <attribute name="productCategoryId" type="String" mode="IN" optional="true" default-value="100"/>
        <attribute name="productId" type="String" mode="IN" optional="true"/>
        <attribute name="productStoreId" type="String" mode="IN" optional="true" default-value="ScipioShop"/>
        <attribute name="currencyUomId" type="String" mode="IN" optional="true" default-value="USD"/>
        <attribute name="partyId" type="String" mode="IN" optional="true" default-value="DemoCustomer"/>
        <attribute name="numberOfProductsPerOrder" type="Integer" mode="IN" optional="true" default-value="5"/>
        <attribute name="salesChannel" type="String" mode="IN" optional="true"/>
        <attribute name="shipOrder" type="Boolean" mode="IN" optional="true" default-value="false"/>
        <attribute name="orderId" type="String" mode="OUT" optional="false"/>
    </service>

    <service name="changeOrderPaymentStatus" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="setOrderPaymentStatus">
        <description>Change the payment status of an existing order</description>
        <attribute name="orderPaymentPreferenceId" type="String" mode="IN" optional="false"/>
        <attribute name="changeReason" type="String" mode="IN" optional="true"/>
    </service>

    <service name="createOrderItemChange" engine="simple" auth="true" default-entity-name="OrderItemChange"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderItemChange">
        <description>Creates a new OrderItemChange record</description>
        <auto-attributes mode="OUT" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <override name="orderId" optional="false"/>
        <override name="orderItemSeqId" optional="false"/>
        <override name="changeTypeEnumId" optional="false"/>
    </service>
    <service name="runSubscriptionAutoReorders" engine="java" auth="true" use-transaction="false"
        location="org.ofbiz.order.order.OrderServices" invoke="runSubscriptionAutoReorders">
        <description>A service designed to be automatically run by job scheduler to create orders from subscriptions which need to be extended.
            This is done by looking for all subscriptions which are active and where the automaticExtend flag is set to "Y"</description>
    </service>

    <service name="createUpdateShippingAddress" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createUpdateShippingAddress" auth="true">
        <description>Creates new shipping address and update existing address</description>
        <attribute name="productStoreId" mode="IN" type="String" optional="true"/>
        <attribute name="setDefaultShipping" mode="IN" type="String" optional="true"/>
        <attribute name="keepAddressBook" mode="IN" type="String" optional="true"/>
        <attribute name="partyId" mode="IN" type="String" optional="true"/>
        <attribute name="userLogin" mode="IN" type="org.ofbiz.entity.GenericValue" optional="true"/>
        <attribute name="shipToAttnName" mode="IN" type="String" optional="true"/>
        <attribute name="shipToName" mode="IN" type="String" optional="true"/>
        <attribute name="shipToAddress1" mode="IN" type="String" optional="false"/>
        <attribute name="shipToAddress2" mode="IN" type="String" optional="true"/>
        <attribute name="shipToCity" mode="IN" type="String" optional="false"/>
        <attribute name="shipToStateProvinceGeoId" mode="IN" type="String" optional="false"/>
        <attribute name="shipToPostalCode" mode="IN" type="String" optional="false"/>
        <attribute name="shipToCountryGeoId" mode="IN" type="String" optional="false"/>
        <attribute name="shipToContactMechId" mode="IN" type="String" optional="true"/>
        <attribute name="contactMechId" mode="OUT" type="String" optional="false"/>
        <attribute name="billToContactMechId" mode="IN" type="String" optional="true"/>
    </service>

    <service name="createUpdateBillingAddress" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createUpdateBillingAddress" auth="true">
        <description>Creates new billing address and update existing address</description>
        <attribute name="productStoreId" mode="IN" type="String" optional="true"/>
        <attribute name="setDefaultBilling" mode="IN" type="String" optional="true"/>
        <attribute name="keepAddressBook" mode="IN" type="String" optional="true"/>
        <attribute name="useShippingAddressForBilling" mode="IN" type="String" optional="true"/>
        <attribute name="partyId" mode="IN" type="String" optional="true"/>
        <attribute name="userLogin" mode="IN" type="org.ofbiz.entity.GenericValue" optional="true"/>
        <attribute name="billToAttnName" mode="IN" type="String" optional="true"/>
        <attribute name="billToName" mode="IN" type="String" optional="true"/>
        <attribute name="billToAddress1" mode="IN" type="String" optional="true"/>
        <attribute name="billToAddress2" mode="IN" type="String" optional="true"/>
        <attribute name="billToCity" mode="IN" type="String" optional="true"/>
        <attribute name="billToStateProvinceGeoId" mode="IN" type="String" optional="true"/>
        <attribute name="billToPostalCode" mode="IN" type="String" optional="true"/>
        <attribute name="billToCountryGeoId" mode="IN" type="String" optional="true"/>
        <attribute name="shipToContactMechId" mode="IN" type="String" optional="true"/>
        <attribute name="billToContactMechId" mode="IN" type="String" optional="true"/>
        <attribute name="contactMechId" mode="OUT" type="String" optional="false"/>
    </service>

    <service name="createUpdateCreditCard" engine="simple" auth="true" default-entity-name="CreditCard"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createUpdateCreditCard">
        <description>Create/Update credit card</description>
        <attribute name="expMonth" type="String" mode="IN" optional="false"/>
        <attribute name="expYear" type="String" mode="IN" optional="false"/>
        <attribute name="cardType" type="String" mode="IN" optional="false"/>
        <attribute name="cardNumber" type="String" mode="IN" optional="false"/>
        <attribute name="partyId" type="String" mode="IN" optional="true"/>
        <attribute name="companyNameOnCard" type="String" mode="IN" optional="true"/>
        <attribute name="titleOnCard" type="String" mode="IN" optional="true"/>
        <attribute name="firstNameOnCard" type="String" mode="IN" optional="false"/>
        <attribute name="middleNameOnCard" type="String" mode="IN" optional="true"/>
        <attribute name="lastNameOnCard" type="String" mode="IN" optional="false"/>
        <attribute name="suffixOnCard" type="String" mode="IN" optional="true"/>
        <attribute name="contactMechId" type="String" mode="IN" optional="true"/>
        <attribute name="paymentMethodId" type="String" mode="IN" optional="true"/>
        <attribute name="paymentMethodId" type="String" mode="OUT" optional="false"/>
    </service>

   <service name="setUnitPriceAsLastPrice" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="setUnitPriceAsLastPrice" auth="false">
        <description>Sets unit price as last price for product</description>
        <attribute name="supplierPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="orderTypeId" type="String" mode="IN" optional="true"/>
        <attribute name="orderId" type="String" mode="IN" optional="true"/>
        <attribute name="orderItems" type="List" mode="IN" optional="true"/>
        <attribute name="facilityId" type="String" mode="IN" optional="true"/>
        <attribute name="productId" type="String" mode="IN" optional="true"/>
        <attribute name="unitCost" mode="IN" type="String" optional="true"/>
        <attribute name="itemPriceMap" type="Map" mode="IN" string-map-prefix="ipm_" optional="true"/>
        <attribute name="overridePriceMap" type="Map" mode="IN" string-map-prefix="opm_" optional="true"/>
        <attribute name="orderCurrencyUnitPrice" type="String" mode="IN" optional="true"/>
   </service>

    <service name="cancelAllBackOrders" engine="simple"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="cancelAllBackOrders" auth="true">
        <description>Cancels those back orders from suppliers whose cancel back order date (cancelBackOrderDate) has passed the current date</description>
    </service>

    <service name="updateShippingMethodAndCharges" engine="simple" 
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateShippingMethodAndCharges">
        <description>Compare order's shipping amount and new shipping amount(based on weight and dimension of packages).If new shipping amount is more then or less than default percentage (defined in shipment.properties) of Order's shipping amount, then shipping method and shipping charges are updated. And if new shipping amount is not more then or less than default percentage (defined in shipment.properties)% of Order's shipping amount then only shipping method is updated.Also updates record in ShipmentRouteSegment entity</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="oldContactMechId" type="String" mode="IN" optional="false"/>
        <attribute name="shipmentMethodAndAmount" type="String" mode="IN" optional="false"/>
        <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="false"/>
        <attribute name="orderAdjustmentId" type="String" mode="IN" optional="false"/>
        <attribute name="shippingAmount" type="String" mode="IN" optional="false"/>
        <attribute name="shipmentId" type="String" mode="IN" optional="false"/>
        <attribute name="shipmentRouteSegmentId" type="String" mode="IN" optional="false"/>
    </service>

    <service name="setShippingInstructions" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="setShippingInstructions">
        <description>Set the shipping instructions for an order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="shippingInstructions" type="String" mode="IN" optional="true"/>
    </service>
    <service name="setGiftMessage" engine="java" auth="true"
            location="org.ofbiz.order.order.OrderServices" invoke="setGiftMessage">
        <description>Set Gift message for an order</description>
        <attribute name="orderId" type="String" mode="IN" optional="false"/>
        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
        <attribute name="giftMessage" type="String" mode="IN" optional="true"/>
    </service>
    <service name="createAlsoBoughtProductAssocs" engine="java" auth="true" 
            location="org.ofbiz.order.order.OrderServices" invoke="createAlsoBoughtProductAssocs" hideResultInLog="true" log="quiet"
            semaphore="fail">
        <description>
            Cycles through all newly created sales orders and creates ProductAssoc records (of type ALSO_BOUGHT) for products 
            that were purchased together.  If a ProductAssoc record already exists then the quantity field is incremented by one.
            Newly created orders are determined by looking for orders that were created after the JobSandbox.startDateTime of the
            previous async execution of this service, alternatively the service can be supplied with a orderEntryFromDateTime 
            parameter which will process all orders placed after that date/time or as a final option processAllOrders can be set
            to true to force a calculation of all orders ever placed with orderEntryFromDateTime being ignored.
            SCIPIO: 2020-03-10: This service is now under a fail semaphore and will fail if already running;
            this service is by default and usually run as a job every 24h (see OrderScheduledServices.xml)
            and if an execution tries to run during another, it will fail but should simply pick up at the next execution some time later.
        </description>
        <attribute name="orderEntryFromDateTime" mode="IN" type="Timestamp" optional="true"/>
        <attribute name="processAllOrders" mode="IN" type="Boolean" optional="true"/>
    </service>
    <service name="createAlsoBoughtProductAssocsAlways" engine="java" auth="true"
             location="org.ofbiz.order.order.OrderServices" invoke="createAlsoBoughtProductAssocs" hideResultInLog="true" log="quiet">
        <description>
            Cycles through all newly created sales orders and creates ProductAssoc records (of type ALSO_BOUGHT) for products
            that were purchased together.  If a ProductAssoc record already exists then the quantity field is incremented by one.
            Newly created orders are determined by looking for orders that were created after the JobSandbox.startDateTime of the
            previous async execution of this service, alternatively the service can be supplied with a orderEntryFromDateTime
            parameter which will process all orders placed after that date/time or as a final option processAllOrders can be set
            to true to force a calculation of all orders ever placed with orderEntryFromDateTime being ignored.
            SCIPIO: 2020-03-10: This is simply the original implementation of createAlsoBoughtProductAssocs without semaphore,
            in case its execution must be forced for some reason.
        </description>
        <implements service="createAlsoBoughtProductAssocs"/>
    </service>
    <service name="createAlsoBoughtProductAssocsForOrder" engine="java" auth="true" hideResultInLog="true" log="quiet"
            location="org.ofbiz.order.order.OrderServices" invoke="createAlsoBoughtProductAssocsForOrder">
        <description>
            Creates ProductAssoc records (of type ALSO_BOUGHT) for products that were purchased together in the Order.  If a ProductAssoc record already exists then the quantity field is incremented by one.  If a variant product has
            been ordered then the association is made to its parent product.
        </description>
        <attribute name="orderId" mode="IN" type="String" optional="false"/>
    </service>
    <service name="productAvailabalityByFacility" engine="simple" location="component://order/script/org/ofbiz/order/order/OrderServices.xml"
            invoke="productAvailabalityByFacility" auth="true">
        <description>
            Calculate ATP and QOH According For each facility
        </description>
        <attribute name="productId" type="String" mode="IN" optional="false"/>
        <attribute name="ownerPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="availabalityList" type="List" mode="OUT"/>
    </service>
    
    <service name="addOrderItemShipGroup" engine="java" auth="true" default-entity-name="OrderItemShipGroup"
             location="org.ofbiz.order.order.OrderServices" invoke="addOrderItemShipGroup">
        <description>Creates a new OrderItemShipGroup with maySplit and isGift filled.</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="shipGroupSeqId" mode="INOUT" optional="true"/>
    </service>
    <service name="deleteOrderItemShipGroup" engine="java" auth="true" default-entity-name="OrderItemShipGroup"
             location="org.ofbiz.order.order.OrderServices"
             invoke="deleteOrderItemShipGroup">
        <description>delete Order Item Ship Group </description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <service name="addOrderItemShipGroupAssoc" engine="java" auth="true" default-entity-name="OrderItemShipGroupAssoc"
             location="org.ofbiz.order.order.OrderServices"
             invoke="addOrderItemShipGroupAssoc">
        <description>add Order Item Ship Group Assoc and if order item ship group not exit, create it before</description>
        <implements service="addOrderItemShipGroup" optional="true"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateOrderItemShipGroupAssoc" engine="java" auth="true" default-entity-name="OrderItemShipGroupAssoc"
             location="org.ofbiz.order.order.OrderServices"
             invoke="updateOrderItemShipGroupAssoc">
        <description>update OrderItem from OISG, totalQuantity is used only if controller is a multi services </description>
        <auto-attributes include="all" mode="IN" optional="true"/>
        <attribute name="totalQuantity" type="BigDecimal"  mode="INOUT"  optional="true"/>
        <attribute name="rowCount" type="Integer" mode="IN" optional="true"/>
        <attribute name="rowNumber" type="Integer" mode="INOUT" optional="true"/>
    </service>
    <service name="deleteOrderItemShipGroupAssoc" engine="entity-auto" auth="true" default-entity-name="OrderItemShipGroupAssoc" invoke="delete">
        <description>delete Order Item Ship Group Assoc</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

    <service name="createQuoteTerm" engine="simple" default-entity-name="QuoteTerm"
        location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="createQuoteTerm">
        <description>
            Create a new Quate term.
        </description>
        <auto-attributes mode="IN" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
        <override name="quoteItemSeqId" type="String" mode="IN" optional="true"/>
    </service>
    <service name="updateQuoteTerm" engine="simple" default-entity-name="QuoteTerm"
        location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="updateQuoteTerm">
        <description>
            Edit the Quate term.
        </description>
        <auto-attributes mode="IN" include="pk" optional="false"/>
        <auto-attributes mode="IN" include="nonpk" optional="true"/>
    </service>
    <service name="deleteQuoteTerm" engine="simple" default-entity-name="QuoteTerm"
        location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="deleteQuoteTerm">
        <description>
            delete the Quate term.
        </description>
        <auto-attributes mode="IN" include="pk" optional="false"/>
    </service>
    
    <!-- Use for link the payment and the invoice When Received Payment -->
    <service name="createOrderPaymentApplication" engine="simple" auth="true"
            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderPaymentApplication">
        <description>Create Order Payment Application</description>
        <attribute name="paymentId" type="String" mode="IN" optional="false"/>
    </service>
    
    <service name="createTestOrderRentalProduct" engine="simple" auth="true"
        location="component://order/script/org/ofbiz/order/test/ShoppingCartTests.xml" invoke="testCreateOrderRentalProduct">
        <description>Create Test Order Rental of an asset which is shipped from and returned to inventory</description>
    </service>
    
    <service name="testCreateShoppinCartAndOrder" engine="simple" auth="true"
        location="component://order/script/org/ofbiz/order/test/ShoppingCartTests.xml" invoke="testCreateShoppinCartAndOrder">
        <description>Create an order using a shopping cart - only used internally in ShoppingCartTests.xml for test purpose</description>
        <attribute name="orderMap" type="Map" mode="OUT"/>
    </service>
    
    <!-- Order Item Attribute -->
    <service name="createOrderItemAttribute" engine="entity-auto" default-entity-name="OrderItemAttribute" invoke="create" auth="true">
        <description>Create Order Item Attribute</description>
        <auto-attributes mode="IN" entity-name="OrderItemAttribute" include="pk" optional="false"/>
        <auto-attributes mode="IN" entity-name="OrderItemAttribute" include="nonpk" optional="true"/>
    </service>
    <service name="updateOrderItemAttribute" engine="entity-auto" default-entity-name="OrderItemAttribute" invoke="update" auth="true">
        <description>Update Order Item Attribute</description>
        <auto-attributes mode="IN" entity-name="OrderItemAttribute" include="pk" optional="false"/>
        <auto-attributes mode="IN" entity-name="OrderItemAttribute" include="nonpk" optional="true"/>
    </service>
    <service name="deleteOrderItemAttribute" engine="entity-auto" default-entity-name="OrderItemAttribute" invoke="delete" auth="true">
        <description>Delete Order Item Attribute</description>
        <auto-attributes mode="IN" entity-name="OrderItemAttribute" include="pk" optional="false"/>
    </service>
    
    <!-- Order Item Group Order -->
    <service name="createOrderItemGroupOrder" engine="entity-auto" default-entity-name="OrderItemGroupOrder" invoke="create" auth="true">
        <description>Create Order Item Group Order</description>
        <auto-attributes mode="IN" entity-name="OrderItemGroupOrder" include="pk" optional="false"/>
    </service>
    
    <service name="countProductQuantityOrdered" engine="java"
        location="org.ofbiz.order.order.OrderServices" invoke="countProductQuantityOrdered" auth="true">
        <description>count Product Quantity Ordered</description>
        <attribute name="productId" type="String" mode="IN" optional="false"/>
        <attribute name="quantity" type="BigDecimal" mode="IN" optional="false"/>
    </service>
    
    <service name="MoveItemBetweenShipGroups" engine="simple" 
        location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="MoveItemBetweenShipGroups">
        <description>Move order items between ship groups</description>
        <attribute name="orderId" type="String" mode="IN"/>
        <attribute name="orderItemSeqId" type="String" mode="IN"/>
        <attribute name="fromGroupIndex" type="String" mode="IN"/>
        <attribute name="toGroupIndex" type="String" mode="IN"/>
        <attribute name="quantity" type="BigDecimal" mode="IN"/>
    </service>
    
    <service name="updateShipGroupShipInfo" engine="java" location="org.ofbiz.order.order.OrderServices" invoke="updateShipGroupShipInfo" auth="true">
            <description>Update Shipping Information on Order View</description>
         <attribute name="contactMechId" type="String" mode="IN" optional="false"/>
         <attribute name="orderId" type="String" mode="IN" optional="true"/>
         <attribute name="oldContactMechId" type="String" mode="IN" optional="true"/>
         <attribute name="shipGroupSeqId" type="String" mode="IN" optional="true"/>
         <attribute name="shipmentMethod" type="String" mode="IN" optional="true"/>
    </service>

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

    <service name="createOrderAdjustmentTypeAttr" default-entity-name="OrderAdjustmentTypeAttr" engine="entity-auto" invoke="create" auth="true">
        <description>Create a OrderAdjustmentTypeAttr</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="updateOrderAdjustmentTypeAttr" default-entity-name="OrderAdjustmentTypeAttr" engine="entity-auto" invoke="update" auth="true">
        <description>Update a OrderAdjustmentTypeAttr</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>
    <service name="deleteOrderAdjustmentTypeAttr" default-entity-name="OrderAdjustmentTypeAttr" engine="entity-auto" invoke="delete" auth="true">
        <description>Delete a OrderAdjustmentTypeAttr</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
    </service>

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