You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mo...@apache.org on 2008/05/23 16:06:50 UTC
svn commit: r659545 - in /ofbiz/trunk/applications/accounting:
script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
testdef/accountingtests.xml
Author: mor
Date: Fri May 23 07:06:50 2008
New Revision: 659545
URL: http://svn.apache.org/viewvc?rev=659545&view=rev
Log:
Patch applied for testing accounting transaction on Sales Invoice from Jira Issue OFBIZ-1786(https://issues.apache.org/jira/browse/OFBIZ-1786). Thanks Awdesh Parihar for this patch and thanks to Sumit Pandit and others for their help in review etc.
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=659545&r1=659544&r2=659545&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 Fri May 23 07:06:50 2008
@@ -240,4 +240,57 @@
</if-compare>
</iterate>
</simple-method>
+
+ <simple-method method-name="testAcctgTransOnSalesInvoice" short-description="Test case for Accounting Transaction for sales invoice" login-required="false">
+ <!-- Precondition:
+ 1. Create a sales order
+ 2. From the order view screen, approve the order
+ 3. From the order view screen, create a shipment to the customer (click on "New Shipment For Ship Group" and then click on the "Update" button in the next screen)
+ 4. Issue the order items to the shipment: select the "Order Items" tab and then click on "Issue All."
+ 5. From the shipment detail screen of the shipment created in the previous step (there is a link to it from the order detail screen), set the status of the shipment to "pack"(Click on "Edit" and then from statusId drop down select statusId = "Pack" and then click update); this action will generate a sales invoice
+ -->
+ <!-- Process tested by test case:
+ 1. Go to the invoice detail screen (there is a link to the invoice from the order detail screen) and click on the "set status to ready"; this action will generate and post to the GL the accounting transaction for the sales invoice
+ -->
+ <!-- Post condition: "Set status to ready"; This action will generate and post to the GL the accounting transaction for the sales invoice
+ * Credit; in account=400000 - Account Type="SALES_ACCOUNT"
+ * Debit; in account=120000 - Account Type="ACCOUNTS_RECEIVABLE"
+ -->
+
+ <set field="invoiceId" value="CI1"/>
+
+ <entity-one entity-name="UserLogin" value-name="userLogin">
+ <field-map field-name="userLoginId" value="system"/>
+ </entity-one>
+ <set field="serviceCtx.userLogin" from-field="userLogin"/>
+ <set field="serviceCtx.invoiceId" from-field="invoiceId"/>
+ <set field="serviceCtx.statusId" value="INVOICE_READY"/>
+ <call-service service-name="setInvoiceStatus" in-map-name="serviceCtx"/>
+
+ <entity-one entity-name="Invoice" value-name="invoice">
+ <field-map field-name="invoiceId" env-name="invoiceId"/>
+ </entity-one>
+ <get-related value-name="invoice" relation-name="AcctgTrans" list-name="acctgTransList"/>
+ <first-from-list list-name="acctgTransList" entry-name="acctgTrans"/>
+ <get-related value-name="acctgTrans" relation-name="AcctgTransEntry" list-name="acctgTransEntries"/>
+
+ <assert><not><if-empty field-name="acctgTransEntries"/></not></assert>
+ <iterate entry-name="acctgTransEntry" list-name="acctgTransEntries">
+ <if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
+ <!--<assert>
+ <if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="SALES_ACCOUNT"/>
+ <if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="400000"/>
+ </assert>-->
+ <else>
+ <if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
+ <assert>
+ <if-compare field-name="acctgTransEntry.glAccountTypeId" operator="equals" value="ACCOUNTS_RECEIVABLE"/>
+ <if-compare field-name="acctgTransEntry.glAccountId" operator="equals" value="120000"/>
+ </assert>
+ </if-compare>
+ </else>
+ </if-compare>
+ </iterate>
+ <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=659545&r1=659544&r2=659545&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/accountingtests.xml (original)
+++ ofbiz/trunk/applications/accounting/testdef/accountingtests.xml Fri May 23 07:06:50 2008
@@ -37,4 +37,7 @@
<test-case case-name="auto-accounting-transaction-tests-SalesOrderShipments ">
<simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml" name="testAcctgTransForSalesOrderShipments"/>
</test-case>
-</test-suite>
+ <test-case case-name="auto-accounting-transaction-tests-SalesInvoice">
+ <simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml" name="testAcctgTransOnSalesInvoice"/>
+ </test-case>
+</test-suite>
\ No newline at end of file