svn commit: r660193 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml testdef/accountingtests.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r660193 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml testdef/accountingtests.xml

mor-2
Author: mor
Date: Mon May 26 06:59:39 2008
New Revision: 660193

URL: http://svn.apache.org/viewvc?rev=660193&view=rev
Log:
Applied patch (for testing accounting transaction on adding finished products into the warehouse) from Jira issue OFBIZ-1790(https://issues.apache.org/jira/browse/OFBIZ-1790). Thanks Santosh Malviya, Sumit Pandit for this patch. Special thanks to Jacopo for providing write-up for all the test cases for testing accounting transaction on various business processes.

Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
    ofbiz/trunk/applications/accounting/testdef/accountingtests.xml

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml?rev=660193&r1=660192&r2=660193&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml Mon May 26 06:59:39 2008
@@ -72,6 +72,7 @@
             </else>    
             </if-compare>
         </iterate>
+        <check-errors/>
     </simple-method>
     
     <simple-method method-name="testAcctgTransOnEditPoInvoice" short-description="Test case for Purchase Invoices: editing, adding taxes and shipping charges and posting to GL" login-required="false">
@@ -127,7 +128,8 @@
         </iterate>
         <assert>
             <if-compare field-name="debitTotal" operator="equals" value="creditTotal"/>
-        </assert>            
+        </assert>
+        <check-errors/>            
     </simple-method>
     
     <simple-method method-name="testAcctgTransOnPaymentSentToSupplier" short-description="Test case for Payment sent to supplier for purchase invoice." login-required="false">
@@ -180,7 +182,8 @@
         </iterate>
         <assert>
             <if-compare field-name="debitTotal" operator="equals" value="creditTotal"/>
-        </assert>  
+        </assert>
+        <check-errors/>  
     </simple-method>
 
     <!-- Test case for Accounting Transaction on Sales -->
@@ -239,6 +242,7 @@
             </else>
             </if-compare>
         </iterate>
+        <check-errors/>
     </simple-method>
 
     <simple-method method-name="testAcctgTransOnSalesInvoice" short-description="Test case for Accounting Transaction for sales invoice" login-required="false">
@@ -491,4 +495,50 @@
         </iterate>  
         <check-errors/>
     </simple-method>
+    
+    <simple-method  method-name="testAcctgTransOnAddFinishedProductsIntoWarehouse" short-description="Production run test case on add finished product into warehouse" login-required="false">
+        <!-- Precondition: Inventory is received for following products:
+                 productId = MAT_A_COST, quantity = 4, facilityId = Web Store Warehouse
+                 productId = MAT_B_COST, quantity = 6, facilityId = Web Store Warehouse
+             then new production run is created and started for following product:
+                 productId = PROD_COST, quantity = 2, facilityId = Web Store Warehouse
+             then issue components and complete the product issuance and at last put 2 quantities into "Stock in" field
+             Post condition: In entity "AcctgTransEntry" two entries will be created:
+                * Debit, in account 140000 - "INVENTORY"; amount: 328$
+                * Credit, in account 142000 - "WORK IN PROGRESS INVENTORY", amount: 328$ (36$ + 42$ + 250$) -->
+
+        <set field="workEffortId" value="10000"/>
+        <set field="serviceCtx.workEffortId" from-field="workEffortId"/>
+        <entity-one entity-name="UserLogin" value-name="serviceCtx.userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <call-service service-name="productionRunProduce" in-map-name="serviceCtx"/>
+        
+        <!-- For credit entry -->
+        <entity-and entity-name="AcctgTransEntry" list-name="acctgTransEntryList">
+            <field-map field-name="productId" value="PROD_COST"/>
+            <field-map field-name="glAccountTypeId" value="WIP_INVENTORY"/>
+            <field-map field-name="glAccountId" value="142000"/>
+            <order-by field-name="-createdStamp"/>
+        </entity-and>
+        <first-from-list list-name="acctgTransEntryList" entry-name="acctgTransEntry"/>
+        <assert>
+            <if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C"/>
+            <if-compare field-name="acctgTransEntry.origAmount" operator="equals" value="328" type="Double"/>
+        </assert>
+        
+        <!-- For debit entry -->
+        <entity-and entity-name="AcctgTransEntry" list-name="acctgTransEntryList">
+            <field-map field-name="productId" value="PROD_COST"/>
+            <field-map field-name="glAccountTypeId" value="INVENTORY_ACCOUNT"/>
+            <field-map field-name="glAccountId" value="140000"/>
+            <order-by field-name="-createdStamp"/>
+        </entity-and>
+        <first-from-list list-name="acctgTransEntryList" entry-name="acctgTransEntry"/>
+        <assert>
+            <if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D"/>
+            <if-compare field-name="acctgTransEntry.origAmount" operator="equals" value="328" type="Double"/>
+        </assert>
+        <check-errors/>
+    </simple-method>
 </simple-methods>
\ No newline at end of file

Modified: ofbiz/trunk/applications/accounting/testdef/accountingtests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/accountingtests.xml?rev=660193&r1=660192&r2=660193&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/accountingtests.xml (original)
+++ ofbiz/trunk/applications/accounting/testdef/accountingtests.xml Mon May 26 06:59:39 2008
@@ -51,4 +51,7 @@
     <test-case case-name="auto-accounting-transaction-tests-ActualManufacturingCost">
         <simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml" name="testAcctgTransForActualManufacturingCost"/>
     </test-case>
+    <test-case case-name="auto-accounting-transaction-tests-AddFinishedProductsIntoWareHouse">
+        <simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml" name="testAcctgTransOnAddFinishedProductsIntoWarehouse"/>
+    </test-case>    
 </test-suite>
\ No newline at end of file