blob: 6e57ed230366f6105ee7a561ceacb705d61a6177 [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"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
<!-- Test case for Batching Payments process-->
<simple-method method-name="testCreatePaymentGroupAndMember" short-description="auto test createPaymentGroupAndMember service" login-required="false">
<set field="paymentIds[]" value="demo10001"/>
<set field="paymentIds[]" value="demo10000"/>
<set field="paymentGroupTypeId" value="BATCH_PAYMENT"/>
<set field="paymentGroupName" value="Payment Batch"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceInMap.paymentIds" from-field="paymentIds"/>
<set field="serviceInMap.paymentGroupTypeId" from-field="paymentGroupTypeId"/>
<set field="serviceInMap.paymentGroupName" from-field="paymentGroupName"/>
<set field="serviceInMap.userLogin" from-field="userLogin"/>
<call-service service-name="createPaymentGroupAndMember" in-map-name="serviceInMap">
<result-to-field result-name="paymentGroupId"/>
</call-service>
<entity-one entity-name="PaymentGroup" value-field="paymentGroup"/>
<entity-and entity-name="PaymentGroupMember" list="paymentGroupMemberList">
<field-map field-name="paymentGroupId"/>
</entity-and>
<assert>
<not><if-empty field="paymentGroupMemberList"/></not>
<if-compare-field field="paymentGroupName" operator="equals" to-field="paymentGroup.paymentGroupName"/>
<if-compare-field field="paymentGroupTypeId" operator="equals" to-field="paymentGroup.paymentGroupTypeId"/>
</assert>
<check-errors/>
<iterate list="paymentGroupMemberList" entry="paymentGroupMember">
<assert>
<or>
<if-compare-field field="paymentGroupMember.paymentId" operator="equals" to-field="paymentIds[0]"/>
<if-compare-field field="paymentGroupMember.paymentId" operator="equals" to-field="paymentIds[1]"/>
</or>
</assert>
<check-errors/>
</iterate>
<log level="info" message="Payment Group ${paymentGroupId} is created successfully for payments"/>
</simple-method>
<!--Test case for voiding payments -->
<simple-method method-name="testVoidPayment" short-description="Test case for voiding payments" login-required="false">
<!-- Precondition : payment is in sent status and invoice is in ready for posting status
Credit in account 213000 - CUSTOMER CREDIT
Debit in account 210000 - ACCOUNTS PAYABLE -->
<!-- Post condition : payment status changes to void.
removes PaymentApplication if any associated.
Credit in account 210000- ACCOUNTS PAYABLE
Debit in account 213000 - CUSTOMER CREDIT-->
<set field="paymentId" value="8000"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="voidPaymentMap.userLogin" from-field="userLogin"/>
<set field="voidPaymentMap.paymentId" from-field="paymentId"/>
<call-service service-name="voidPayment" in-map-name="voidPaymentMap"/>
<entity-one entity-name="Payment" value-field="payment"/>
<assert>
<if-compare field="payment.statusId" operator="equals" value="PMNT_VOID"/>
</assert>
<check-errors/>
<set field="orderBy[]" value="-transactionDate"/>
<get-related relation-name="AcctgTrans" value-field="payment" list="acctgTransList" order-by-list="orderBy"/>
<first-from-list list="acctgTransList" entry="acctgTrans"/>
<get-related relation-name="AcctgTransEntry" value-field="acctgTrans" list="acctgTransEntries"/>
<iterate list="acctgTransEntries" entry="acctgTransEntry">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<assert>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="213000"/>
</assert>
</if-compare>
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<assert>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="210000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_PAYABLE"/>
</assert>
</if-compare>
</iterate>
<check-errors/>
</simple-method>
<!--Test case for canceling invoices-->
<simple-method method-name="testCancelInvoice" short-description="Test case for canceling invoices" login-required="false">
<!-- Precondition : invoice is in ready status
Credit in account 210000 - ACCOUNTS PAYABLE
Debit in account 516100 -->
<!-- Post condition : invoice status changes to cancelled.
removes PaymentApplication if any associated.
Credit in account 516100
Debit in account 210000 - ACCOUNTS PAYABLE -->
<set field="invoiceId" value="8001"/>
<set field="statusId" value="INVOICE_CANCELLED"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="setInvoiceStatusMap.userLogin" from-field="userLogin"/>
<set field="setInvoiceStatusMap.invoiceId" from-field="invoiceId"/>
<set field="setInvoiceStatusMap.statusId" from-field="statusId"/>
<call-service service-name="setInvoiceStatus" in-map-name="setInvoiceStatusMap"/>
<entity-one entity-name="Invoice" value-field="invoice"/>
<assert>
<if-compare field="invoice.statusId" operator="equals" value="INVOICE_CANCELLED"/>
</assert>
<check-errors/>
<set field="orderBy[]" value="-transactionDate"/>
<get-related relation-name="AcctgTrans" value-field="invoice" list="acctgTransList" order-by-list="orderBy"/>
<first-from-list list="acctgTransList" entry="acctgTrans"/>
<get-related relation-name="AcctgTransEntry" value-field="acctgTrans" list="acctgTransEntries"/>
<iterate list="acctgTransEntries" entry="acctgTransEntry">
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
<assert>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="516100"/>
</assert>
</if-compare>
<if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
<assert>
<if-compare field="acctgTransEntry.glAccountId" operator="equals" value="210000"/>
<if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_PAYABLE"/>
</assert>
</if-compare>
</iterate>
<check-errors/>
</simple-method>
<!--Test case for process mass check run-->
<simple-method method-name="testCreatePaymentAndPaymentGroupForInvoices" short-description="Test case for validate service which is creating payment and payment group" login-required="false">
<!-- Precondition : Invoice is in ready status.
Invoice outstanding amount should be greater than zero -->
<!-- Following process is tested by test case:
This will call createPaymentAndPaymentGroupForInvoices service and return a paymentGroupId;
1. Checked for paymentGroupId for not empty
2. Checked for associated paymentGroupMembers for not empty -->
<!-- Post condition : Invoice status should be changed to paid.
Payment should be created with PaymentApplications.
PaymentGroup and PaymentGroupMembers should be created. -->
<entity-one entity-name="UserLogin" value-field="createPaymentAndPaymentGroupForInvoicesMap.userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="createPaymentAndPaymentGroupForInvoicesMap.organizationPartyId" value="Company"/>
<set field="createPaymentAndPaymentGroupForInvoicesMap.checkStartNumber" type="Long" value="100101"/>
<string-to-list string="8000" list="invoiceIds"/>
<string-to-list string="8008" list="invoiceIds"/>
<set field="createPaymentAndPaymentGroupForInvoicesMap.invoiceIds" from-field="invoiceIds"/>
<set field="createPaymentAndPaymentGroupForInvoicesMap.paymentMethodTypeId" value="COMPANY_CHECK"/>
<set field="createPaymentAndPaymentGroupForInvoicesMap.paymentMethodId" value="SC_CHECKING"/>
<call-service service-name="createPaymentAndPaymentGroupForInvoices" in-map-name="createPaymentAndPaymentGroupForInvoicesMap">
<result-to-field result-name="paymentGroupId"/>
</call-service>
<assert>
<not>
<if-empty field="paymentGroupId"/>
</not>
</assert>
<check-errors/>
<entity-condition entity-name="PaymentGroupMember" list="paymentGroupMembers">
<condition-expr field-name="paymentGroupId" from-field="paymentGroupId"/>
</entity-condition>
<assert>
<not>
<if-empty field="paymentGroupMembers"/>
</not>
</assert>
<check-errors/>
<log level="info" message="Test case ran successfully for input - invoiceIds : ${invoiceIds} and output - paymentGroupId : ${paymentGroupId}"/>
</simple-method>
<!--Test case for cancel check run-->
<simple-method method-name="testCancelCheckRunPayments" short-description="Test case for cancelCheckRunPayments" login-required="false">
<!-- Pre condition : Invoice is in paid status.
Payment should be present.
thruDate for PaymentGroupMember should be Null -->
<!-- Following process is tested by test case:
This will call cancelCheckRunPayments service;
1. Checked for thruDate for not empty
2. Checked for associated payment status as PMNT_VOID -->
<!-- Post condition : thruDate for PaymentGroupMember should be Not Null
payment status should be changed to PMNT_VOID. -->
<set field="paymentGroupId" value="9001"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="cancelCheckRunPaymentsMap.userLogin" from-field="userLogin"/>
<set field="cancelCheckRunPaymentsMap.paymentGroupId" from-field="paymentGroupId"/>
<call-service service-name="cancelCheckRunPayments" in-map-name="cancelCheckRunPaymentsMap"/>
<entity-and entity-name="PmtGrpMembrPaymentAndFinAcctTrans" list="paymentGroupMemberAndTransList">
<field-map field-name="paymentGroupId"/>
</entity-and>
<first-from-list list="paymentGroupMemberAndTransList" entry="paymentGroupMemberAndTrans"/>
<if-compare field="paymentGroupMemberAndTrans.finAccountTransStatusId" operator="not-equals" value="FINACT_TRNS_APPROVED">
<iterate list="paymentGroupMemberAndTransList" entry="paymentGroupMemberAndTrans">
<assert>
<not>
<if-empty field="paymentGroupMemberAndTrans.thruDate"/>
</not>
</assert>
<check-errors/>
<assert>
<if-compare field="paymentGroupMemberAndTrans.statusId" operator="equals" value="PMNT_VOID"/>
</assert>
<check-errors/>
</iterate>
</if-compare>
<log level="info" message="Test case for cancelCheckRunPayments ran successfully for paymentGroupId = ${paymentGroupId}"/>
</simple-method>
<!-- Test case for deposit or withdraw payments -->
<simple-method method-name="testDepositWithdrawPayments" short-description="test depositWithdrawPayments service" login-required="false">
<set field="paymentIds[]" value="demo10010"/>
<set field="finAccountId" value="SC_CHECKING"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="depositWithdrawPaymentsMap.paymentIds" from-field="paymentIds"/>
<set field="depositWithdrawPaymentsMap.finAccountId" from-field="finAccountId"/>
<set field="depositWithdrawPaymentsMap.userLogin" from-field="userLogin"/>
<call-service service-name="depositWithdrawPayments" in-map-name="depositWithdrawPaymentsMap"/>
<entity-condition entity-name="Payment" list="payments">
<condition-expr field-name="paymentId" operator="in" from-field="paymentIds"/>
</entity-condition>
<iterate list="payments" entry="payment">
<get-related-one value-field="payment" relation-name="FinAccountTrans" to-value-field="finAccountTrans"/>
<assert><not><if-empty field="finAccountTrans"/></not></assert>
<check-errors/>
<assert>
<or>
<if-compare field="finAccountTrans.finAccountTransTypeId" operator="equals" value="DEPOSIT"/>
<if-compare field="finAccountTrans.finAccountTransTypeId" operator="equals" value="WITHDRAWAL"/>
</or>
<if-compare-field field="finAccountTrans.amount" operator="equals" to-field="payment.amount"/>
</assert>
<check-errors/>
</iterate>
<log level="info" message="fin Account Trans has been created for passed payments"/>
</simple-method>
<simple-method method-name="testDepositWithdrawPaymentsInSingleTrans" short-description="test depositWithdrawPayments service for single transaction" login-required="false">
<set field="paymentIds[]" value="8004"/>
<set field="finAccountId" value="SC_CHECKING"/>
<set field="groupInOneTransaction" value="Y"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="depositWithdrawPaymentsMap.paymentIds" from-field="paymentIds"/>
<set field="depositWithdrawPaymentsMap.finAccountId" from-field="finAccountId"/>
<set field="depositWithdrawPaymentsMap.groupInOneTransaction" from-field="groupInOneTransaction"/>
<set field="depositWithdrawPaymentsMap.paymentGroupTypeId" value="BATCH_PAYMENT"/>
<set field="depositWithdrawPaymentsMap.userLogin" from-field="userLogin"/>
<call-service service-name="depositWithdrawPayments" in-map-name="depositWithdrawPaymentsMap">
<result-to-field result-name="finAccountTransId"/>
</call-service>
<set field="paymentRunningTotal" type="BigDecimal" value="0"/>
<entity-condition entity-name="Payment" list="payments">
<condition-expr field-name="paymentId" operator="in" from-field="paymentIds"/>
</entity-condition>
<iterate list="payments" entry="payment">
<set field="paymentRunningTotal" value="${paymentRunningTotal + payment.amount}" type="BigDecimal"/>
</iterate>
<entity-one entity-name="FinAccountTrans" value-field="finAccountTrans"/>
<assert>
<if-compare-field field="finAccountTrans.amount" operator="equals" to-field="paymentRunningTotal"/>
</assert>
<check-errors/>
<iterate list="payments" entry="payment">
<assert>
<if-compare-field field="payment.finAccountTransId" operator="equals" to-field="finAccountTransId"/>
</assert>
<check-errors/>
</iterate>
<log level="info" message="fin Account Trans has been created with Id ${finAccountTransId}"/>
</simple-method>
<!--Test case for fin account trans-->
<simple-method method-name="testSetFinAccountTransStatus" short-description="test case for setFinAccountTransStatus service" login-required="false">
<!-- Precondition : FinAccountTrans should be in CREATED status -->
<!-- Post condition : FinAccountTrans status changes to CANCELED
Clear finAccountTransId field and update associated Payment record -->
<set field="finAccountTransId" value="9102"/>
<set field="statusId" value="FINACT_TRNS_CANCELED"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="setFinAccountTransStatusMap.finAccountTransId" from-field="finAccountTransId"/>
<set field="setFinAccountTransStatusMap.statusId" from-field="statusId"/>
<set field="setFinAccountTransStatusMap.userLogin" from-field="userLogin"/>
<call-service service-name="setFinAccountTransStatus" in-map-name="setFinAccountTransStatusMap"/>
<entity-one entity-name="FinAccountTrans" value-field="finAccountTrans"/>
<assert>
<if-compare-field field="finAccountTrans.statusId" operator="equals" to-field="statusId"/>
</assert>
<check-errors/>
<get-related-one relation-name="Payment" value-field="finAccountTrans" to-value-field="payment"/>
<if-not-empty field="payment">
<assert>
<if-empty field="payment.finAccountTransId"/>
</assert>
<check-errors/>
</if-not-empty>
</simple-method>
<!--Test case to verify GL postings for Void Payment process-->
<simple-method method-name="testGlPostingsOnVoidPayment" short-description="Test case to verify GL postings for Void Payment Process" login-required="false">
<!-- Precondition :
* Payment is in sent status so accounting transaction is already posted to the GL
* GL Account associated with Payment :8003 are ACCOUNTS RECEVABLE and UNDEPOSITED RECEIPTS
* Credit in account 120000 - ACCOUNTS RECEVABLE ;debitTotal :$754.17 ; creditTotal:$274.18 ; debitCreditDifference : $479.99
* Debit in account 112000 UNDEPOSITED RECEIPTS ;debitTotal :$136.85 ; creditTotal:$116.85 ; debitCreditDifference : $20
-->
<!-- Post condition : When status is set to void, an reverse accounting transaction is automatically posted to the GL.
* Payment status changes to void.
* Credit in account 112000- UNDEPOSITED RECEIPTS ;debitTotal :$136.85 ; creditTotal: $136.85 ; debitCreditDifference : $0
* Debit in account 120000 - ACCOUNTS RECEVABLE debitTotal :$774.17 ; creditTotal: $274.18 ; debitCreditDifference : $ 499.99
-->
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="getAcctgTransEntriesAndTransTotalMap.userLogin" from-field="userLogin"/>
<set field="getAcctgTransEntriesAndTransTotalMap.organizationPartyId" value="Company"/>
<set field="getAcctgTransEntriesAndTransTotalMap.customTimePeriodStartDate" value="2011-01-01 16:55:01.0" type="Timestamp"/>
<set field="getAcctgTransEntriesAndTransTotalMap.customTimePeriodEndDate" value="2011-12-31 16:55:01.0" type="Timestamp"/>
<set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" value="120000"/>
<call-service service-name="getAcctgTransEntriesAndTransTotal" in-map-name="getAcctgTransEntriesAndTransTotalMap">
<result-to-field result-name="debitTotal" field="receivableDebitTotal"/>
<result-to-field result-name="creditTotal" field="receivableCreditTotal"/>
<result-to-field result-name="debitCreditDifference" field="receivableDebitCreditDifference"/>
</call-service>
<set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" value="112000"/>
<call-service service-name="getAcctgTransEntriesAndTransTotal" in-map-name="getAcctgTransEntriesAndTransTotalMap">
<result-to-field result-name="debitTotal" field="undepositedDebitTotal"/>
<result-to-field result-name="creditTotal" field="undepositedCreditTotal"/>
<result-to-field result-name="debitCreditDifference" field="undepositedDebitCreditDifference"/>
</call-service>
<log level="info" message="BEFORE RUNNING VOID PAYMENT : ACCOUNTS RECEVABLE ;debitTotal :${receivableDebitTotal} ; creditTotal:${receivableCreditTotal} ; debitCreditDifference : ${receivableDebitCreditDifference}"/>
<log level="info" message="BEFORE RUNNING VOID PAYMENT : UNDEPOSITED RECEIPTS ;debitTotal :${undepositedDebitTotal} ; creditTotal:${undepositedCreditTotal} ; debitCreditDifference : ${undepositedDebitCreditDifference}"/>
<set field="paymentId" value="8003"/>
<set field="voidPaymentMap.userLogin" from-field="userLogin"/>
<set field="voidPaymentMap.paymentId" from-field="paymentId"/>
<call-service service-name="voidPayment" in-map-name="voidPaymentMap"/>
<set field="totalReceivableDebitAmount" value="${receivableDebitTotal + 20.00}" type="BigDecimal"/>
<set field="totalReceivableDebitCreditDifference" value="${receivableDebitCreditDifference + 20.00}" type="BigDecimal"/>
<set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" value="120000"/>
<call-service service-name="getAcctgTransEntriesAndTransTotal" in-map-name="getAcctgTransEntriesAndTransTotalMap">
<result-to-field result-name="debitTotal" field="receivableDebitTotal"/>
<result-to-field result-name="creditTotal" field="receivableCreditTotal"/>
<result-to-field result-name="debitCreditDifference" field="receivableDebitCreditDifference"/>
</call-service>
<assert>
<if-compare-field field="totalReceivableDebitAmount" operator="equals" to-field="receivableDebitTotal" type="BigDecimal"/>
<if-compare-field field="totalReceivableDebitCreditDifference" operator="equals" to-field="receivableDebitCreditDifference" type="BigDecimal"/>
</assert>
<check-errors/>
<set field="totalUndepositedCreditAmount" value="${undepositedCreditTotal + 20.00}" type="BigDecimal"/>
<set field="totalUndepositedDebitCreditDifference" value="${undepositedDebitCreditDifference - 20.00}" type="BigDecimal"/>
<set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" value="112000"/>
<call-service service-name="getAcctgTransEntriesAndTransTotal" in-map-name="getAcctgTransEntriesAndTransTotalMap">
<result-to-field result-name="debitTotal" field="undepositedDebitTotal"/>
<result-to-field result-name="creditTotal" field="undepositedCreditTotal"/>
<result-to-field result-name="debitCreditDifference" field="undepositedDebitCreditDifference"/>
</call-service>
<assert>
<if-compare-field field="totalUndepositedCreditAmount" operator="equals" to-field="undepositedCreditTotal" type="BigDecimal"/>
<if-compare-field field="totalUndepositedDebitCreditDifference" operator="equals" to-field="undepositedDebitCreditDifference" type="BigDecimal"/>
</assert>
<check-errors/>
<log level="info" message="AFTER RUNNING VOID PAYMENT : ACCOUNTS RECEVABLE ;debitTotal :${receivableDebitTotal} ; creditTotal:${receivableCreditTotal}; debitCreditDifference : ${receivableDebitCreditDifference}"/>
<log level="info" message="AFTER RUNNING VOID PAYMENT : UNDEPOSITED RECEIPTS ;debitTotal :${undepositedDebitTotal} ; creditTotal:${undepositedCreditTotal} ; debitCreditDifference : ${undepositedDebitCreditDifference}"/>
</simple-method>
<!---Test case to verify GL postings for Check Run process-->
<simple-method method-name="testGlPostingOnCheckRun" short-description="Test case to verify GL postings for Check Run functionality" login-required="false">
<!-- Precondition :
* Invoice is in ready status so accounting transaction is already posted to the GL
* GL Accounts associated with Invoice :8007 are ACCOUNTS PAYABLE and UNINVOICED ITEM RECEIPTS
* Credit in account 210000 - ACCOUNTS PAYABLE ;debitTotal $430 ; creditTotal:$1955.4 ; debitCreditDifference : $ -1524.85
* Debit in account 214000 - UNINVOICED ITEM RECEIPTS;debitTotal :$408 ; creditTotal:$48 ; debitCreditDifference : $360
* UNDEPOSITED RECEIPTS 112000 - debitTotal :$136.85 ; creditTotal:$136.85 ; debitCreditDifference : $0
-->
<!-- Post condition : After Check Run process accounting transactions are automatically posted to the GL.
* Payment get associated with invoice.
* GL Accounts associated with Payment are ACCOUNTS PAYABLE and UNDEPOSITED RECEIPTS.
* ACCOUNTS PAYABLE 210000(for Invoice and Payment) - debitTotal $503.41 ; creditTotal:$1991.83 ; debitCreditDifference : $ -1488.42
* UNINVOICED ITEM RECEIPTS 214000 - debitTotal :$408 ; creditTotal:$48 ; debitCreditDifference : $360
* GENERAL CHECKING ACCOUNT 111100 (for payment)- debitTotal :$136.85 ; creditTotal:$173.28 ; debitCreditDifference : $ -36.43
-->
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="getAcctgTransEntriesAndTransTotalMap.userLogin" from-field="userLogin"/>
<set field="getAcctgTransEntriesAndTransTotalMap.organizationPartyId" value="Company"/>
<set field="getAcctgTransEntriesAndTransTotalMap.customTimePeriodStartDate" value="2011-01-01 16:55:01.0" type="Timestamp"/>
<set field="getAcctgTransEntriesAndTransTotalMap.customTimePeriodEndDate" value="2011-12-31 16:55:01.0" type="Timestamp"/>
<set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" value="210000"/>
<call-service service-name="getAcctgTransEntriesAndTransTotal" in-map-name="getAcctgTransEntriesAndTransTotalMap">
<result-to-field result-name="debitTotal" field="payableDebitTotal"/>
<result-to-field result-name="creditTotal" field="payableCreditTotal"/>
<result-to-field result-name="debitCreditDifference" field="payableDebitCreditDifference"/>
</call-service>
<set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" value="111100"/>
<call-service service-name="getAcctgTransEntriesAndTransTotal" in-map-name="getAcctgTransEntriesAndTransTotalMap">
<result-to-field result-name="debitTotal" field="undepositedDebitTotal"/>
<result-to-field result-name="creditTotal" field="undepositedCreditTotal"/>
<result-to-field result-name="debitCreditDifference" field="undepositedDebitCreditDifference"/>
</call-service>
<log level="info" message="BEFORE RUNNING CHECK RUN : ACCOUNTS PAYABLE ;debitTotal :${payableDebitTotal} ; creditTotal:${payableCreditTotal} ; debitCreditDifference : ${payableDebitCreditDifference}"/>
<log level="info" message="BEFORE RUNNING VOID PAYMENT : GENERAL CHECKING ACCOUNT ;debitTotal :${undepositedDebitTotal} ; creditTotal:${undepositedCreditTotal} ; debitCreditDifference : ${undepositedDebitCreditDifference}"/>
<clear-field field="invoiceIds"/>
<string-to-list string="8007" list="invoiceIds"/>
<set field="createPaymentAndPaymentGroupForInvoicesMap.userLogin" from-field="userLogin"/>
<set field="createPaymentAndPaymentGroupForInvoicesMap.organizationPartyId" value="Company"/>
<set field="createPaymentAndPaymentGroupForInvoicesMap.checkStartNumber" type="Long" value="100100"/>
<set field="createPaymentAndPaymentGroupForInvoicesMap.invoiceIds" from-field="invoiceIds"/>
<set field="createPaymentAndPaymentGroupForInvoicesMap.paymentMethodTypeId" value="COMPANY_CHECK"/>
<set field="createPaymentAndPaymentGroupForInvoicesMap.paymentMethodId" value="SC_CHECKING"/>
<call-service service-name="createPaymentAndPaymentGroupForInvoices" in-map-name="createPaymentAndPaymentGroupForInvoicesMap">
<result-to-field result-name="paymentGroupId"/>
</call-service>
<set field="totalPayableDebitAmount" value="${payableDebitTotal + 36.43}" type="BigDecimal"/>
<set field="totalPayableCreditAmount" from-field="payableCreditTotal" type="BigDecimal"/>
<set field="totalPayableDebitCreditDifference" value="${payableDebitCreditDifference + 36.43}" type="BigDecimal"/>
<set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" value="210000"/>
<call-service service-name="getAcctgTransEntriesAndTransTotal" in-map-name="getAcctgTransEntriesAndTransTotalMap">
<result-to-field result-name="debitTotal" field="payableDebitTotal"/>
<result-to-field result-name="creditTotal" field="payableCreditTotal"/>
<result-to-field result-name="debitCreditDifference" field="payableDebitCreditDifference"/>
</call-service>
<assert>
<if-compare-field field="totalPayableDebitAmount" operator="equals" to-field="payableDebitTotal" type="BigDecimal"/>
<if-compare-field field="totalPayableCreditAmount" operator="equals" to-field="payableCreditTotal" type="BigDecimal"/>
<if-compare-field field="totalPayableDebitCreditDifference" operator="equals" to-field="payableDebitCreditDifference" type="BigDecimal"/>
</assert>
<check-errors/>
<set field="totalUndepositedCreditAmount" value="${undepositedCreditTotal + 36.43}" type="BigDecimal"/>
<set field="totalUndepositedDebitCreditDifference" value="${undepositedDebitCreditDifference - 36.43}" type="BigDecimal"/>
<set field="getAcctgTransEntriesAndTransTotalMap.glAccountId" value="111100"/>
<call-service service-name="getAcctgTransEntriesAndTransTotal" in-map-name="getAcctgTransEntriesAndTransTotalMap">
<result-to-field result-name="debitTotal" field="undepositedDebitTotal"/>
<result-to-field result-name="creditTotal" field="undepositedCreditTotal"/>
<result-to-field result-name="debitCreditDifference" field="undepositedDebitCreditDifference"/>
</call-service>
<assert>
<if-compare-field field="totalUndepositedCreditAmount" operator="equals" to-field="undepositedCreditTotal" type="BigDecimal"/>
<if-compare-field field="totalUndepositedDebitCreditDifference" operator="equals" to-field="undepositedDebitCreditDifference" type="BigDecimal"/>
</assert>
<check-errors/>
<log level="info" message="AFTER RUNNING CHECK RUN : ACCOUNTS PAYABLE ;debitTotal :${payableDebitTotal} ; creditTotal:${payableCreditTotal} ; debitCreditDifference : ${payableDebitCreditDifference}"/>
<log level="info" message="AFTER RUNNING VOID PAYMENT : GENERAL CHECKING ACCOUNT ;debitTotal :${undepositedDebitTotal} ; creditTotal:${undepositedCreditTotal} ; debitCreditDifference : ${undepositedDebitCreditDifference}"/>
</simple-method>
<simple-method method-name="disabled-testUpdatePaymentMethodAddress" short-description="Creates a new postal address for Company and then calls updatePaymentMethodAddress with the new contactMechId" login-required="false">
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="flexadmin"/>
</entity-one>
<!-- Create a new Postal Address, set the bare minimum necessary, this test isn't about the postal address -->
<set field="createPartyPostalAddress.userLogin" from-field="userLogin"/>
<set field="createPartyPostalAddress.address1" value="2003 Open Blvd"/>
<set field="createPartyPostalAddress.city" value="2003 Open Blvd"/>
<set field="createPartyPostalAddress.postalCode" value="999999"/>
<call-service service-name="createPartyPostalAddress" in-map-name="createPartyPostalAddress">
<result-to-field result-name="contactMechId"/>
</call-service>
<!-- Count the number of EftAccounts and CreditCards associated to the oldContactMechId, use to verify at the end -->
<entity-count count-field="noEftAccounts9000Before" entity-name="EftAccount">
<condition-expr field-name="contactMechId" value="9000"/>
</entity-count>
<entity-count count-field="noCreditCards9000Before" entity-name="CreditCard">
<condition-expr field-name="contactMechId" value="9000"/>
</entity-count>
<!-- Run the actual service to be tested -->
<set field="updatePaymentMethodAddress.userLogin" from-field="userLogin"/>
<set field="updatePaymentMethodAddress.oldContactMechId" value="9000"/>
<set field="updatePaymentMethodAddress.contactMechId" from-field="contactMechId"/>
<call-service service-name="updatePaymentMethodAddress" in-map-name="updatePaymentMethodAddress"/>
<!-- Count the number EftAccounts and CreditCards now associated with the oldContactMechId (should be zero for both)-->
<entity-count count-field="noEftAccounts9000After" entity-name="EftAccount">
<condition-expr field-name="contactMechId" value="9000"/>
</entity-count>
<entity-count count-field="noCreditCards9000After" entity-name="CreditCard">
<condition-expr field-name="contactMechId" value="9000"/>
</entity-count>
<!-- Count the number of EftAccounts and CreditCards associated to the oldContactMechId, use to verify at the end -->
<entity-count count-field="noEftAccountsNewContactMech" entity-name="EftAccount">
<condition-expr field-name="contactMechId" from-field="contactMechId"/>
</entity-count>
<entity-count count-field="noCreditCardsNewContactMech" entity-name="CreditCard">
<condition-expr field-name="contactMechId" from-field="contactMechId"/>
</entity-count>
<!-- Verify the results -->
<assert>
<!-- New contactMech should have the same number of payment methods as the old did -->
<if-compare-field field="noEftAccountsNewContactMech" operator="equals" to-field="noEftAccounts9000Before" type="Long"/>
<if-compare-field field="noCreditCardsNewContactMech" operator="equals" to-field="noCreditCards9000Before" type="Long"/>
<!-- Old contactMech should no longer have any payment methods associated to it -->
<if-compare field="noEftAccounts9000After" operator="equals" value="0" type="Long"/>
<if-compare field="noCreditCards9000After" operator="equals" value="0" type="Long"/>
</assert>
<check-errors/>
</simple-method>
</simple-methods>