blob: 0f85518ecc42b3847e8515ba88ccf60ea7c45a8e [file] [log] [blame]
<?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"
xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="testGetFXConversion" short-description="Test case for service getFXConversion" login-required="false">
<set field="serviceCtx.uomId" value="EUR"/>
<set field="serviceCtx.uomIdTo" value="USD"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="getFXConversion" in-map-name="serviceCtx">
<results-to-map map-name="fxConversionResult"/>
</call-service>
<assert>
<not><if-empty field="fxConversionResult"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testAddPaymentMethodTypeGlAssignment" short-description="Test case for service addPaymentMethodTypeGlAssignment" login-required="false">
<set field="serviceCtx.paymentMethodTypeId" value="GIFT_CARD"/>
<set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
<set field="serviceCtx.glAccountId" value="999999"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="addPaymentMethodTypeGlAssignment" in-map-name="serviceCtx"/>
<entity-one value-field="paymentMethodTypeGlAccount" entity-name="PaymentMethodTypeGlAccount">
<field-map field-name="paymentMethodTypeId" value="GIFT_CARD"/>
<field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
</entity-one>
<assert>
<not><if-empty field="paymentMethodTypeGlAccount"/></not>
<if-compare operator="equals" value="999999" field="paymentMethodTypeGlAccount.glAccountId"></if-compare>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testRemovePaymentTypeGlAssignment" short-description="Test case for service removePaymentTypeGlAssignment" login-required="false">
<set field="serviceCtx.paymentTypeId" value="COMMISSION_PAYMENT"/>
<set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="removePaymentTypeGlAssignment" in-map-name="serviceCtx"/>
<entity-one value-field="paymentGlAccountTypeMap" entity-name="PaymentGlAccountTypeMap">
<field-map field-name="paymentTypeId" value="COMMISSION_PAYMENT"/>
<field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
</entity-one>
<assert>
<if-empty field="paymentGlAccountTypeMap"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyAcctgPreference" short-description="Test case for service createPartyAcctgPreference" login-required="false">
<set field="serviceCtx.partyId" value="DEMO_COMPANY"/>
<set field="serviceCtx.refundPaymentMethodId" value="9020"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyAcctgPreference" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyAcctgPreference" value-field="partyAcctgPreference">
<field-map field-name="partyId" value="DEMO_COMPANY"/>
</entity-one>
<assert>
<not><if-empty field="partyAcctgPreference"/></not>
<if-compare operator="equals" value="DEMO_COMPANY" field="partyAcctgPreference.partyId"></if-compare>
<if-compare operator="equals" value="9020" field="partyAcctgPreference.refundPaymentMethodId"></if-compare>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdatePartyAcctgPreference" short-description="Test case for service updatePartyAcctgPreference" login-required="false">
<set field="serviceCtx.partyId" value="DEMO_COMPANY1"/>
<set field="serviceCtx.refundPaymentMethodId" value="9020"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePartyAcctgPreference" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyAcctgPreference" value-field="partyAcctgPreference">
<field-map field-name="partyId" value="DEMO_COMPANY1"/>
</entity-one>
<assert>
<not><if-empty field="partyAcctgPreference"/></not>
<if-compare operator="equals" value="9020" field="partyAcctgPreference.refundPaymentMethodId"></if-compare>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testGetPartyAccountingPreferences" short-description="Test case for service getPartyAccountingPreferences" login-required="false">
<set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="getPartyAccountingPreferences" in-map-name="serviceCtx">
<results-to-map map-name="partyAcctgPreference"/>
</call-service>
<assert>
<not><if-empty field="partyAcctgPreference"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testSetAcctgCompany" short-description="Test case for service setAcctgCompany" login-required="false">
<set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="setAcctgCompany" in-map-name="serviceCtx"/>
<entity-and list="userPreferences" entity-name="UserPreference">
<field-map field-name="userPrefValue" value="DEMO_COMPANY1"/>
</entity-and>
<first-from-list entry="userPreference" list="userPreferences"/>
<assert>
<not><if-empty field="userPreference"/></not>
<if-compare operator="equals" value="GLOBAL_PREFERENCES" field="userPreference.userPrefGroupTypeId"></if-compare>
<if-compare operator="equals" value="ORGANIZATION_PARTY" field="userPreference.userPrefTypeId"></if-compare>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdateFXConversion" short-description="Test case for service updateFXConversion" login-required="false">
<set field="serviceCtx.uomId" value="EUR"/>
<set field="serviceCtx.uomIdTo" value="USD"/>
<set field="serviceCtx.conversionFactor" value="2.0"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updateFXConversion" in-map-name="serviceCtx"/>
<entity-and list="uomConversionDatedList" entity-name="UomConversionDated" filter-by-date="true">
<field-map field-name="uomId" value="EUR"/>
<field-map field-name="uomIdTo" value="USD"/>
</entity-and>
<first-from-list entry="uomConversionDated" list="uomConversionDatedList"/>
<assert>
<not><if-empty field="uomConversionDated"/></not>
<if-compare operator="equals" value="2.0" field="uomConversionDated.conversionFactor"></if-compare>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateGlAccountTypeDefault" short-description="Test case for service createGlAccountTypeDefault" login-required="false">
<set field="serviceCtx.glAccountTypeId" value="BALANCE_ACCOUNT"/>
<set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
<set field="serviceCtx.glAccountId" value="999999"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createGlAccountTypeDefault" in-map-name="serviceCtx"/>
<entity-one value-field="glAccountTypeDefault" entity-name="GlAccountTypeDefault">
<field-map field-name="glAccountTypeId" value="BALANCE_ACCOUNT"/>
<field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
</entity-one>
<assert>
<not><if-empty field="glAccountTypeDefault"/></not>
<if-compare operator="equals" value="999999" field="glAccountTypeDefault.glAccountId"></if-compare>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testRemoveGlAccountTypeDefault" short-description="Test case for service removeGlAccountTypeDefault" login-required="false">
<set field="serviceCtx.glAccountTypeId" value="ACCOUNTS_PAYABLE"/>
<set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
<set field="serviceCtx.glAccountId" value="999999"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="removeGlAccountTypeDefault" in-map-name="serviceCtx"/>
<entity-one value-field="glAccountTypeDefault" entity-name="GlAccountTypeDefault">
<field-map field-name="glAccountTypeId" value="ACCOUNTS_PAYABLE"/>
<field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
</entity-one>
<assert>
<if-empty field="glAccountTypeDefault"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testAddInvoiceItemTypeGlAssignment" short-description="Test case for service addInvoiceItemTypeGlAssignment" login-required="false">
<set field="serviceCtx.invoiceItemTypeId" value="PINV_FPROD_ITEM"/>
<set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
<set field="serviceCtx.glAccountId" value="999999"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="addInvoiceItemTypeGlAssignment" in-map-name="serviceCtx"/>
<entity-one value-field="invoiceItemTypeGlAccount" entity-name="InvoiceItemTypeGlAccount">
<field-map field-name="invoiceItemTypeId" value="PINV_FPROD_ITEM"/>
<field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
</entity-one>
<assert>
<not><if-empty field="invoiceItemTypeGlAccount"/></not>
<if-compare operator="equals" value="999999" field="invoiceItemTypeGlAccount.glAccountId"></if-compare>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testRemoveInvoiceItemTypeGlAssignment" short-description="Test case for service removeInvoiceItemTypeGlAssignment" login-required="false">
<set field="serviceCtx.invoiceItemTypeId" value="PINV_SALES_TAX"/>
<set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="removeInvoiceItemTypeGlAssignment" in-map-name="serviceCtx"/>
<entity-one value-field="invoiceItemTypeGlAccount" entity-name="InvoiceItemTypeGlAccount">
<field-map field-name="invoiceItemTypeId" value="PINV_SALES_TAX"/>
<field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
</entity-one>
<assert>
<if-empty field="invoiceItemTypeGlAccount"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testAddPaymentTypeGlAssignment" short-description="Test case for service addPaymentTypeGlAssignment" login-required="false">
<set field="serviceCtx.paymentTypeId" value="TAX_PAYMENT"/>
<set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
<set field="serviceCtx.glAccountTypeId" value="TAX_ACCOUNT"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="addPaymentTypeGlAssignment" in-map-name="serviceCtx"/>
<entity-one value-field="paymentGlAccountTypeMap" entity-name="PaymentGlAccountTypeMap">
<field-map field-name="paymentTypeId" value="TAX_PAYMENT"/>
<field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
</entity-one>
<assert>
<not><if-empty field="paymentGlAccountTypeMap"/></not>
<if-compare operator="equals" value="TAX_ACCOUNT" field="paymentGlAccountTypeMap.glAccountTypeId"></if-compare>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testRemovePaymentMethodTypeGlAssignment" short-description="Test case for service removePaymentMethodTypeGlAssignment" login-required="false">
<set field="serviceCtx.paymentMethodTypeId" value="CASH"/>
<set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="removePaymentMethodTypeGlAssignment" in-map-name="serviceCtx"/>
<entity-one value-field="paymentMethodTypeGlAccount" entity-name="PaymentMethodTypeGlAccount">
<field-map field-name="paymentMethodTypeId" value="CASH"/>
<field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
</entity-one>
<assert>
<if-empty field="paymentMethodTypeGlAccount"/>
</assert>
<check-errors/>
</simple-method>
</simple-methods>