You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/12/08 06:47:09 UTC

svn commit: r888270 - in /ofbiz/trunk/applications/accounting: data/DemoPaymentsInvoices.xml script/org/ofbiz/accounting/test/AutoInvoiceTests.xml script/org/ofbiz/accounting/test/AutoPaymentTests.xml

Author: ashish
Date: Tue Dec  8 05:47:09 2009
New Revision: 888270

URL: http://svn.apache.org/viewvc?rev=888270&view=rev
Log:
Applied patch from Awdesh covering issues reported on Mailing list for failing of test cases.
Now everything is working fine when we ran "java -Xmx1024M -jar ofbiz.jar -test -component='accounting'".

Following points are covered in this patch:

1) Created one more PaymentGroup record that is 9001 (Because same PaymentGroup record is being used in two different test cases so prepared individual record for each of them) .
2) Removed record "<PaymentGroupMember paymentGroupId="9000" paymentId="8002" fromDate="2009-07-11 12:28:45.315"/>" because no Fin Account Trans record is present corresponding to this and as per business process when we create deposit slip or check run one trans record is also created which is associated with payment group record ,also changed value in test case accordingly .

Thanks Awdesh for the contribution.

Modified:
    ofbiz/trunk/applications/accounting/data/DemoPaymentsInvoices.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml

Modified: ofbiz/trunk/applications/accounting/data/DemoPaymentsInvoices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/DemoPaymentsInvoices.xml?rev=888270&r1=888269&r2=888270&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/DemoPaymentsInvoices.xml (original)
+++ ofbiz/trunk/applications/accounting/data/DemoPaymentsInvoices.xml Tue Dec  8 05:47:09 2009
@@ -112,9 +112,10 @@
     <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"/>
+
+    <PaymentGroup paymentGroupId="9001" paymentGroupTypeId="CHECK_RUN" paymentGroupName="Check run for 2009-08-11 12:28:45.315"/>
+    <PaymentGroupMember paymentGroupId="9001" paymentId="8002" fromDate="2009-08-11 12:28:45.315"/>
 
     <AcctgTrans acctgTransId="8000" acctgTransTypeId="PURCHASE_INVOICE" transactionDate="2009-07-06 16:50:43.806" isPosted="Y" postedDate="2009-07-06 16:50:44.219" glFiscalTypeId="ACTUAL" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" invoiceId="8000"/>
     <AcctgTrans acctgTransId="8001" acctgTransTypeId="OUTGOING_PAYMENT" transactionDate="2009-07-06 16:53:49.259" isPosted="Y" postedDate="2009-07-06 16:53:49.741" glFiscalTypeId="ACTUAL" partyId="AcctBigSupplier" roleTypeId="BILL_FROM_VENDOR" paymentId="8000"/>
@@ -212,11 +213,14 @@
             partyId="Company" transactionDate="2009-04-01 00:00:01.000" entryDate="2009-04-01 00:00:01.000" performedByPartyId="admin" statusId="FINACT_TRNS_APPROVED"/>
     <FinAccountTrans finAccountTransId="9101" finAccountTransTypeId="DEPOSIT" finAccountId="ABN_CHECKING" amount="75000.00" 
             partyId="Company" glReconciliationId="9000" transactionDate="2009-04-01 00:00:01.000" entryDate="2009-04-01 00:00:01.000" performedByPartyId="admin" statusId="FINACT_TRNS_APPROVED"/>
-    <FinAccountTrans finAccountTransId="9102" finAccountTransTypeId="DEPOSIT" finAccountId="ABN_CHECKING" amount="500.00" 
+    <FinAccountTrans finAccountTransId="9102" finAccountTransTypeId="WITHDRAWAL" finAccountId="ABN_CHECKING" amount="500.00" 
             partyId="Company" transactionDate="2009-07-18 00:00:01.000" entryDate="2009-07-18 00:00:01.000" performedByPartyId="admin" statusId="FINACT_TRNS_CREATED" paymentId="8001"/>
     <Payment paymentId="8001" finAccountTransId="9102"/>
     <FinAccountTrans finAccountTransId="9103" finAccountTransTypeId="DEPOSIT" finAccountId="ABN_CHECKING" amount="20.00" 
             partyId="Company" transactionDate="2009-08-12 16:34:33.306" entryDate="2009-08-12 16:34:33.306"  paymentId="8003" statusId="FINACT_TRNS_CREATED"/>
     <Payment paymentId="8003" finAccountTransId="9103"/>
+    <FinAccountTrans finAccountTransId="9104" finAccountTransTypeId="WITHDRAWAL" finAccountId="ABN_CHECKING" amount="33.990" 
+            partyId="Company" transactionDate="2009-07-18 00:00:01.000" entryDate="2009-08-11 12:28:45.315" performedByPartyId="admin" statusId="FINACT_TRNS_CREATED" paymentId="8002"/>
+    <Payment paymentId="8002" finAccountTransId="9104"/>
 
 </entity-engine-xml>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml?rev=888270&r1=888269&r2=888270&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml Tue Dec  8 05:47:09 2009
@@ -148,8 +148,8 @@
         -->
 
         <!-- Post condition : After Cancel Check Run process accounting transactions are automatically posted to the GL.
-            * ACCOUNTS PAYABLE 210000  - debitTotal increased of $116.85 ; creditTotal increased of $233.7 ; debitCreditDifference decreased of $116.85
-            * GENERAL CHECKING ACCOUNT 111100 - debitTotal increased of $116.85 ; debitCreditDifference increased of $116.85
+            * ACCOUNTS PAYABLE 210000  - debitTotal increased of $82.86 ; creditTotal increased of $165.72 ; debitCreditDifference decreased of $82.86
+            * GENERAL CHECKING ACCOUNT 111100 - debitTotal increased of $82.86 ; debitCreditDifference increased of $82.86
         -->
         <entity-one entity-name="UserLogin" value-field="userLogin">
             <field-map field-name="userLoginId" value="system"/>
@@ -164,35 +164,45 @@
             <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 CANCEL CHECK RUN  : ACCOUNTS PAYABLE ;debitTotal :${payableDebitTotal} ; creditTotal:${payableCreditTotal} ; debitCreditDifference : ${payableDebitCreditDifference}"/>
         <log level="info" message="BEFORE  RUNNING CANCEL CHECK RUN : UNDEPOSITED RECEIPTS ;debitTotal :${undepositedDebitTotal} ; creditTotal:${undepositedCreditTotal} ; debitCreditDifference : ${undepositedDebitCreditDifference}"/>
+        
         <set field="paymentGroupId" value="9000"/>
         <set field="cancelCheckRunPaymentsMap.userLogin" from-field="userLogin"/>
         <set field="cancelCheckRunPaymentsMap.paymentGroupId" from-field="paymentGroupId"/>
         <call-service service-name="cancelCheckRunPayments" in-map-name="cancelCheckRunPaymentsMap"/>
-        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 116.85}" type="BigDecimal"/>
-        <set field="totalPayableCreditAmount" value="${payableCreditTotal + 233.7}" type="BigDecimal"/>
-        <set field="totalPayableDebitCreditDifference" value="${payableDebitCreditDifference -116.85}" type="BigDecimal"/>
+        <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">
+        
+        <set field="totalPayableDebitAmount" value="${payableDebitTotal + 82.86}" type="BigDecimal"/>
+        <set field="totalPayableCreditAmount" value="${payableCreditTotal + 165.72}" type="BigDecimal"/>
+        <set field="totalPayableDebitCreditDifference" value="${payableDebitCreditDifference - 82.86}" 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="totalUndepositedDebitAmount" value="${undepositedDebitTotal + 116.85}" type="BigDecimal"/>
-        <set field="totalUndepositedDebitCreditDifference" value="${undepositedDebitCreditDifference + 116.85}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitAmount" value="${undepositedDebitTotal + 82.86}" type="BigDecimal"/>
+        <set field="totalUndepositedDebitCreditDifference" value="${undepositedDebitCreditDifference + 82.86}" 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"/>
@@ -204,6 +214,8 @@
             <if-compare-field field="totalUndepositedDebitCreditDifference" operator="equals" to-field="undepositedDebitCreditDifference" type="BigDecimal"/>
         </assert>
         <check-errors/>
+
+        </if-compare>
         <log level="info" message="AFTER  RUNNING CANCEL CHECK RUN: ACCOUNTS PAYABLE ;debitTotal :${payableDebitTotal} ; creditTotal:${payableCreditTotal} ; debitCreditDifference : ${payableDebitCreditDifference}"/>
         <log level="info" message="AFTER  RUNNING CANCEL CHECK RUN  : UNDEPOSITED RECEIPTS ;debitTotal :${undepositedDebitTotal} ; creditTotal:${undepositedCreditTotal} ; debitCreditDifference : ${undepositedDebitCreditDifference}"/>
     </simple-method>

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=888270&r1=888269&r2=888270&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 Tue Dec  8 05:47:09 2009
@@ -203,28 +203,31 @@
         <!-- Post condition : thruDate for PaymentGroupMember should be Not Null
                               payment status should be changed to PMNT_VOID. -->
 
-        <set field="paymentGroupId" value="9000"/>
+        <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="PaymentGroupMember" list="paymentGroupMembers">
+        <entity-and entity-name="PmtGrpMembrPaymentAndFinAcctTrans"  list="paymentGroupMemberAndTransList">
             <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>
+        <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>
     



Re: svn commit: r888270 - in /ofbiz/trunk/applications/accounting: data/DemoPaymentsInvoices.xml script/org/ofbiz/accounting/test/AutoInvoiceTests.xml script/org/ofbiz/accounting/test/AutoPaymentTests.xml

Posted by Awdesh Parihar <aw...@gmail.com>.
Thanks  Ashish ,  Jacques and Scott .
--
Awdesh

Re: svn commit: r888270 - in /ofbiz/trunk/applications/accounting: data/DemoPaymentsInvoices.xml script/org/ofbiz/accounting/test/AutoInvoiceTests.xml script/org/ofbiz/accounting/test/AutoPaymentTests.xml

Posted by Jacques Le Roux <ja...@les7arts.com>.
> Author: ashish
> Date: Tue Dec  8 05:47:09 2009
> New Revision: 888270
> 
> URL: http://svn.apache.org/viewvc?rev=888270&view=rev
> Log:
> Applied patch from Awdesh covering issues reported on Mailing list for failing of test cases.
> Now everything is working fine when we ran "java -Xmx1024M -jar ofbiz.jar -test -component='accounting'".

Thanks Awdesh!

Jacques
()  ascii ribbon campaign against HTML e-mail
/\  www.asciiribbon.org