| <?xml version="1.0" encoding="UTF-8" ?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods-v2.xsd"> |
| |
| <simple-method method-name="testGetInventoryAvailableByFacility" short-description="Test case for service getInventoryAvailableByFacility" login-required="false"> |
| <set field="serviceCtx.productId" value="GZ-2644"/> |
| <set field="serviceCtx.facilityId" value="WebStoreWarehouse"/> |
| <call-service service-name="getInventoryAvailableByFacility" in-map-name="serviceCtx"> |
| <result-to-field result-name="quantityOnHandTotal"/> |
| <result-to-field result-name="availableToPromiseTotal"/> |
| </call-service> |
| <assert> |
| <if-compare field="quantityOnHandTotal" operator="equals" value="509" type="BigDecimal"/> |
| <if-compare field="availableToPromiseTotal" operator="equals" value="509" type="BigDecimal"/> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| |
| <!-- Test Physical Inventory Adjustment --> |
| <simple-method method-name="testCreatePhysicalInventoryAndVariance" short-description="Test to create physical inventory and variance" login-required="false"> |
| <set field="serviceCtx.inventoryItemId" value="9024"/> |
| <set field="serviceCtx.varianceReasonId" value="VAR_LOST"/> |
| <entity-one entity-name="UserLogin" value-field="serviceCtx.userLogin"> |
| <field-map field-name="userLoginId" value="system"/> |
| </entity-one> |
| <call-service service-name="createPhysicalInventoryAndVariance" in-map-name="serviceCtx"> |
| <result-to-field result-name="physicalInventoryId" field="physicalInventoryId"/> |
| </call-service> |
| <assert> |
| <not><if-empty field="physicalInventoryId"/></not> |
| </assert> |
| <check-errors/> |
| </simple-method> |
| </simple-methods> |