Author: ashish
Date: Mon Jul 13 09:38:43 2009 New Revision: 793517 URL: http://svn.apache.org/viewvc?rev=793517&view=rev Log: Applied patch from jira issue OFBIZ-2719 - (Accounting - AP)Junit test case to test the service which will cancel the issued check group(PaymentGroup with type CHECK_RUN). This patch includes: – Written test case to test service cancelCheckRunPayments. Thanks Arpit, Sumit & Chirag for your contribution. Modified: ofbiz/trunk/applications/accounting/data/PaymentsInvoices.xml ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml ofbiz/trunk/applications/accounting/testdef/paymenttests.xml Modified: ofbiz/trunk/applications/accounting/data/PaymentsInvoices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/PaymentsInvoices.xml?rev=793517&r1=793516&r2=793517&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/data/PaymentsInvoices.xml (original) +++ ofbiz/trunk/applications/accounting/data/PaymentsInvoices.xml Mon Jul 13 09:38:43 2009 @@ -73,4 +73,81 @@ <Invoice invoiceId="8001" invoiceTypeId="PURCHASE_INVOICE" partyIdFrom="AcctBigSupplier" partyId="Company" statusId="INVOICE_READY" invoiceDate="2009-07-06 16:48:40.952" paidDate="2009-07-06 16:52:52.901"/> <InvoiceItem invoiceId="8001" invoiceItemSeqId="1" invoiceItemTypeId="PINV_SURCHARGE_ADJ" taxableFlag="Y" quantity="1.000000" amount="10.000"/> + + <!--demo data for testCancelCheckRunPayments--> + <Invoice invoiceId="8002" invoiceTypeId="PURCHASE_INVOICE" partyIdFrom="AcctBigSupplier" partyId="Company" statusId="INVOICE_PAID" invoiceDate="2009-07-11 12:24:31.85" paidDate="2009-07-11 12:28:44.034" currencyUomId="USD"/> + <Invoice invoiceId="8003" invoiceTypeId="PURCHASE_INVOICE" partyIdFrom="AcctBigSupplier" partyId="Company" statusId="INVOICE_PAID" invoiceDate="2009-07-11 12:25:26.085" paidDate="2009-07-11 12:28:44.034" currencyUomId="USD"/> + <Invoice invoiceId="8004" invoiceTypeId="PURCHASE_INVOICE" partyIdFrom="DemoSupplier" partyId="Company" statusId="INVOICE_PAID" invoiceDate="2009-07-11 12:26:29.758" paidDate="2009-07-11 12:28:44.95" currencyUomId="USD"/> + + <InvoiceItem invoiceId="8002" invoiceItemSeqId="00001" invoiceItemTypeId="PINV_WE_ITEM" uomId="USD" taxableFlag="Y" amount="33.990"/> + <InvoiceItem invoiceId="8002" invoiceItemSeqId="00002" invoiceItemTypeId="PINV_SURCHARGE_ADJ" uomId="USD" taxableFlag="Y" amount="2.440"/> + <InvoiceItem invoiceId="8003" invoiceItemSeqId="00001" invoiceItemTypeId="PINV_WE_ITEM" uomId="USD" taxableFlag="Y" amount="33.990"/> + <InvoiceItem invoiceId="8003" invoiceItemSeqId="00002" invoiceItemTypeId="PINV_SURCHARGE_ADJ" uomId="USD" taxableFlag="Y" amount="2.440"/> + <InvoiceItem invoiceId="8003" invoiceItemSeqId="00003" invoiceItemTypeId="PITM_FEE" taxableFlag="Y" amount="10.000"/> + <InvoiceItem invoiceId="8004" invoiceItemSeqId="00001" invoiceItemTypeId="PINV_WE_ITEM" uomId="USD" taxableFlag="Y" amount="33.990"/> + + <InvoiceStatus statusId="INVOICE_IN_PROCESS" invoiceId="8002" statusDate="2009-07-11 12:24:31.854"/> + <InvoiceStatus statusId="INVOICE_IN_PROCESS" invoiceId="8003" statusDate="2009-07-11 12:25:26.088"/> + <InvoiceStatus statusId="INVOICE_IN_PROCESS" invoiceId="8004" statusDate="2009-07-11 12:26:29.761"/> + <InvoiceStatus statusId="INVOICE_READY" invoiceId="8002" statusDate="2009-07-11 12:24:42.425"/> + <InvoiceStatus statusId="INVOICE_READY" invoiceId="8003" statusDate="2009-07-11 12:26:07.814"/> + <InvoiceStatus statusId="INVOICE_READY" invoiceId="8004" statusDate="2009-07-11 12:27:04.758"/> + <InvoiceStatus statusId="INVOICE_PAID" invoiceId="8002" statusDate="2009-07-11 12:28:44.788"/> + <InvoiceStatus statusId="INVOICE_PAID" invoiceId="8003" statusDate="2009-07-11 12:28:44.589"/> + <InvoiceStatus statusId="INVOICE_PAID" invoiceId="8004" statusDate="2009-07-11 12:28:45.144"/> + + <Payment paymentId="8001" paymentTypeId="VENDOR_PAYMENT" paymentMethodTypeId="COMPANY_CHECK" partyIdFrom="Company" partyIdTo="AcctBigSupplier" statusId="PMNT_SENT" effectiveDate="2009-07-11 12:28:44.034" paymentRefNum="100,100" amount="82.86" currencyUomId="USD"/> + <Payment paymentId="8002" paymentTypeId="VENDOR_PAYMENT" paymentMethodTypeId="COMPANY_CHECK" partyIdFrom="Company" partyIdTo="DemoSupplier" statusId="PMNT_SENT" effectiveDate="2009-07-11 12:28:44.95" paymentRefNum="100,101" amount="33.99" currencyUomId="USD"/> + + <PaymentApplication paymentApplicationId="9000" paymentId="8001" invoiceId="8002" amountApplied="36.43"/> + <PaymentApplication paymentApplicationId="9001" paymentId="8001" invoiceId="8003" amountApplied="46.43"/> + <PaymentApplication paymentApplicationId="9002" paymentId="8002" invoiceId="8004" amountApplied="33.99"/> + + <PaymentGroup paymentGroupId="9000" paymentGroupTypeId="CHECK_RUN" paymentGroupName="Check Run for 2009-07-11 12:28:44.95"/> + + <PaymentGroupMember paymentGroupId="9000" paymentId="8001" fromDate="2009-07-11 12:28:45.315"/> + <PaymentGroupMember paymentGroupId="9000" paymentId="8002" fromDate="2009-07-11 12:28:45.315"/> + + <AcctgTrans acctgTransId="8003" acctgTransTypeId="PURCHASE_INVOICE" transactionDate="2009-07-11 12:24:42.744" isPosted="Y" postedDate="2009-07-11 12:24:43.469" glFiscalTypeId="ACTUAL" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" invoiceId="8002"/> + <AcctgTrans acctgTransId="8004" acctgTransTypeId="PURCHASE_INVOICE" transactionDate="2009-07-11 12:26:08.03" isPosted="Y" postedDate="2009-07-11 12:26:08.317" glFiscalTypeId="ACTUAL" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" invoiceId="8003"/> + <AcctgTrans acctgTransId="8005" acctgTransTypeId="PURCHASE_INVOICE" transactionDate="2009-07-11 12:27:04.916" isPosted="Y" postedDate="2009-07-11 12:27:05.127" glFiscalTypeId="ACTUAL" partyId="DemoSupplier" roleTypeId="BILL_FROM_VENDOR" invoiceId="8004"/> + <AcctgTrans acctgTransId="8006" acctgTransTypeId="OUTGOING_PAYMENT" transactionDate="2009-07-11 12:28:44.219" isPosted="Y" postedDate="2009-07-11 12:28:44.451" glFiscalTypeId="ACTUAL" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" paymentId="8001"/> + <AcctgTrans acctgTransId="8007" acctgTransTypeId="PAYMENT_APPL" transactionDate="2009-07-11 12:28:44.655" isPosted="Y" postedDate="2009-07-11 12:28:44.762" glFiscalTypeId="ACTUAL" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" invoiceId="8003" paymentId="8001"/> + <AcctgTrans acctgTransId="8008" acctgTransTypeId="PAYMENT_APPL" transactionDate="2009-07-11 12:28:44.828" isPosted="Y" postedDate="2009-07-11 12:28:44.933" glFiscalTypeId="ACTUAL" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" invoiceId="8002" paymentId="8001"/> + <AcctgTrans acctgTransId="8009" acctgTransTypeId="OUTGOING_PAYMENT" transactionDate="2009-07-11 12:28:44.996" isPosted="Y" postedDate="2009-07-11 12:28:45.1" glFiscalTypeId="ACTUAL" partyId="DemoSupplier" roleTypeId="BILL_FROM_VENDOR" paymentId="8002"/> + <AcctgTrans acctgTransId="8010" acctgTransTypeId="PAYMENT_APPL" transactionDate="2009-07-11 12:28:45.183" isPosted="Y" postedDate="2009-07-11 12:28:45.305" glFiscalTypeId="ACTUAL" partyId="DemoSupplier" roleTypeId="BILL_FROM_VENDOR" invoiceId="8004" paymentId="8002"/> + + <AcctgTransEntry acctgTransId="8003" acctgTransEntrySeqId="00001" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountId="140000" organizationPartyId="Company" amount="33.99" currencyUomId="USD" origAmount="33.99" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8003" acctgTransEntrySeqId="00002" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountId="516100" organizationPartyId="Company" amount="2.44" currencyUomId="USD" origAmount="2.44" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8003" acctgTransEntrySeqId="00003" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="36.43" currencyUomId="USD" origAmount="36.43" origCurrencyUomId="USD" debitCreditFlag="C" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8004" acctgTransEntrySeqId="00001" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountId="140000" organizationPartyId="Company" amount="33.99" currencyUomId="USD" origAmount="33.99" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8004" acctgTransEntrySeqId="00002" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountId="516100" organizationPartyId="Company" amount="2.44" currencyUomId="USD" origAmount="2.44" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8004" acctgTransEntrySeqId="00003" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountId="516100" organizationPartyId="Company" amount="10.00" currencyUomId="USD" origAmount="10.00" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8004" acctgTransEntrySeqId="00004" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="46.43" currencyUomId="USD" origAmount="46.43" origCurrencyUomId="USD" debitCreditFlag="C" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8005" acctgTransEntrySeqId="00001" acctgTransEntryTypeId="_NA_" partyId="DemoSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountId="140000" organizationPartyId="Company" amount="33.99" currencyUomId="USD" origAmount="33.99" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8005" acctgTransEntrySeqId="00002" acctgTransEntryTypeId="_NA_" partyId="DemoSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="33.99" currencyUomId="USD" origAmount="33.99" origCurrencyUomId="USD" debitCreditFlag="C" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8006" acctgTransEntrySeqId="00001" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountId="112000" organizationPartyId="Company" amount="82.86" currencyUomId="USD" origAmount="82.86" origCurrencyUomId="USD" debitCreditFlag="C" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8006" acctgTransEntrySeqId="00002" acctgTransEntryTypeId="_NA_" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="82.86" currencyUomId="USD" origAmount="82.86" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8007" acctgTransEntrySeqId="00001" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="46.43" currencyUomId="USD" origAmount="46.43" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8007" acctgTransEntrySeqId="00002" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="46.43" currencyUomId="USD" origAmount="46.43" origCurrencyUomId="USD" debitCreditFlag="C" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8008" acctgTransEntrySeqId="00001" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="36.43" currencyUomId="USD" origAmount="36.43" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8008" acctgTransEntrySeqId="00002" acctgTransEntryTypeId="_NA_" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="36.43" currencyUomId="USD" origAmount="36.43" origCurrencyUomId="USD" debitCreditFlag="C" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8009" acctgTransEntrySeqId="00001" acctgTransEntryTypeId="_NA_" partyId="DemoSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountId="112000" organizationPartyId="Company" amount="33.99" currencyUomId="USD" origAmount="33.99" origCurrencyUomId="USD" debitCreditFlag="C" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8009" acctgTransEntrySeqId="00002" acctgTransEntryTypeId="_NA_" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="33.99" currencyUomId="USD" origAmount="33.99" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8010" acctgTransEntrySeqId="00001" acctgTransEntryTypeId="_NA_" partyId="DemoSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="33.99" currencyUomId="USD" origAmount="33.99" origCurrencyUomId="USD" debitCreditFlag="D" reconcileStatusId="AES_NOT_RECONCILED"/> + <AcctgTransEntry acctgTransId="8010" acctgTransEntrySeqId="00002" acctgTransEntryTypeId="_NA_" partyId="DemoSupplier" roleTypeId="BILL_FROM_VENDOR" glAccountTypeId="ACCOUNTS_PAYABLE" glAccountId="210000" organizationPartyId="Company" amount="33.99" currencyUomId="USD" origAmount="33.99" origCurrencyUomId="USD" debitCreditFlag="C" reconcileStatusId="AES_NOT_RECONCILED"/> + + <GlAccountHistory glAccountId="112000" organizationPartyId="Company" customTimePeriodId="6010" postedDebits="0.00" postedCredits="116.85"/> + <GlAccountHistory glAccountId="112000" organizationPartyId="Company" customTimePeriodId="6013" postedDebits="0.00" postedCredits="116.85"/> + <GlAccountHistory glAccountId="140000" organizationPartyId="Company" customTimePeriodId="6010" postedDebits="101.97" postedCredits="0.00"/> + <GlAccountHistory glAccountId="140000" organizationPartyId="Company" customTimePeriodId="6013" postedDebits="101.97" postedCredits="0.00"/> + <GlAccountHistory glAccountId="210000" organizationPartyId="Company" customTimePeriodId="6010" postedDebits="233.70" postedCredits="233.70"/> + <GlAccountHistory glAccountId="210000" organizationPartyId="Company" customTimePeriodId="6013" postedDebits="233.70" postedCredits="233.70"/> + <GlAccountHistory glAccountId="516100" organizationPartyId="Company" customTimePeriodId="6010" postedDebits="14.88" postedCredits="0.00"/> + <GlAccountHistory glAccountId="516100" organizationPartyId="Company" customTimePeriodId="6013" postedDebits="14.88" postedCredits="0.00"/> + + <GlAccountOrganization glAccountId="112000" organizationPartyId="Company" fromDate="2001-01-01 00:00:00.0" postedBalance="-116.85"/> + <GlAccountOrganization glAccountId="140000" organizationPartyId="Company" fromDate="2001-01-01 00:00:00.0" postedBalance="101.97"/> + <GlAccountOrganization glAccountId="210000" organizationPartyId="Company" fromDate="2001-01-01 00:00:00.0" postedBalance="0.00"/> + <GlAccountOrganization glAccountId="516100" organizationPartyId="Company" fromDate="2001-01-01 00:00:00.0" postedBalance="14.88"/> </entity-engine-xml> Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml?rev=793517&r1=793516&r2=793517&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml Mon Jul 13 09:38:43 2009 @@ -189,4 +189,43 @@ <check-errors/> <log level="info" message="Test case ran successfully for input - invoiceIds : ${invoiceIds} and output - paymentGroupId : ${paymentGroupId}"/> </simple-method> + + <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="9000"/> + <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="PaymentGroupMember" list="paymentGroupMembers"> + <field-map field-name="paymentGroupId"/> + </entity-and> + <iterate list="paymentGroupMembers" entry="paymentGroupMember"> + <assert> + <not> + <if-empty field="paymentGroupMember.thruDate"/> + </not> + </assert> + <check-errors/> + <get-related-one value-field="paymentGroupMember" relation-name="Payment" to-value-field="payment"/> + <assert> + <if-compare field="payment.statusId" operator="equals" value="PMNT_VOID"/> + </assert> + </iterate> + <log level="info" message="Test case for cancelCheckRunPayments ran successfully for paymentGroupId = ${paymentGroupId}"/> + </simple-method> + </simple-methods> \ No newline at end of file Modified: ofbiz/trunk/applications/accounting/testdef/paymenttests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/paymenttests.xml?rev=793517&r1=793516&r2=793517&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/testdef/paymenttests.xml (original) +++ ofbiz/trunk/applications/accounting/testdef/paymenttests.xml Mon Jul 13 09:38:43 2009 @@ -40,4 +40,10 @@ <test-case case-name="auto-tests-createPaymentAndPaymentGroupForInvoices"> <simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml" name="testCreatePaymentAndPaymentGroupForInvoices"/> </test-case> + + <!--Test case for cancel check run--> + <test-case case-name="auto-test-CancelCheckRunPayments"> + <simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml" name="testCancelCheckRunPayments"/> + </test-case> + </test-suite> \ No newline at end of file |
Free forum by Nabble | Edit this page |