Author: mor
Date: Wed May 21 06:03:49 2008
New Revision: 658672
URL: http://svn.apache.org/viewvc?rev=658672&view=rev
Log:
Patch applied for testing purchase order reciepts process from Jira Issue
OFBIZ-1782(https://issues.apache.org/jira/browse/OFBIZ-1782), with a
modification in condition under <iterate> section, comments. Thanks Sumit
Pandit for your patch.
Added:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
(with props)
Modified:
ofbiz/trunk/applications/accounting/testdef/accountingtests.xml
Added:
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=658672&view=auto
==============================================================================
---
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
(added)
+++
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
Wed May 21 06:03:49 2008
@@ -0,0 +1,75 @@
+<?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">
+
+ <simple-method method-name="testAcctgTransOnPoReceipts"
short-description="Test case for Accounting Transaction on Receipts of Purchase
Order." login-required="false">
+ <!-- Precondition : shipment is created from supplier and order
items are issued -->
+ <!-- create a purchase order using following:
+ Supplier : DemoSupplier
+ Item : WG-1111
+ Quantity : 10 -->
+
+ <!-- Post condition : Credit in account 214000 - UNINVOICED ITEM
RECEIPT amount = grand total of order.
+ Debit in account 140000- INVENTORY amount =
grand total of order. -->
+
+ <!-- set few variables so that they can be changed easily to test
with different values -->
+ <set field="orderId" value="WS10000"/>
+ <set field="productId" value="WG-1111"/>
+ <set field="orderItemSeqId" value="00001"/>
+ <set field="shipmentId" value="10000"/>
+
+ <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.inventoryItemTypeId"
value="NON_SERIAL_INV_ITEM"/>
+ <set field="serviceCtx.productId" from-field="productId"/>
+ <set field="serviceCtx.facilityId" value="WebStoreWarehouse"/>
+ <set field="serviceCtx.quantityAccepted" value="10" type="Double"/>
+ <set field="serviceCtx.quantityRejected" value="0" type="Double"/>
+ <set field="serviceCtx.shipmentId" from-field="shipmentId"/>
+ <set field="serviceCtx.orderId" from-field="orderId"/>
+ <set field="serviceCtx.orderItemSeqId"
from-field="orderItemSeqId"/>
+ <call-service service-name="receiveInventoryProduct"
in-map-name="serviceCtx">
+ <result-to-field result-name="inventoryItemId"
field-name="inventoryItemId"/>
+ </call-service>
+ <entity-condition entity-name="AcctgTransEntry"
list-name="acctgTransEntries">
+ <condition-expr field-name="productId" env-name="productId"/>
+ </entity-condition>
+ <iterate list-name="acctgTransEntries"
entry-name="acctgTransEntry">
+ <if-compare field-name="acctgTransEntry.debitCreditFlag"
operator="equals" value="C">
+ <assert>
+ <if-compare
field-name="acctgTransEntry.glAccountTypeId" operator="equals"
value="UNINVOICED_SHIP_RCPT"/>
+ <if-compare field-name="acctgTransEntry.glAccountId"
operator="equals" value="214000"/>
+ </assert>
+ <else>
+ <if-compare field-name="acctgTransEntry.debitCreditFlag"
operator="equals" value="D">
+ <assert>
+ <if-compare
field-name="acctgTransEntry.glAccountTypeId" operator="equals"
value="INVENTORY_ACCOUNT"/>
+ <if-compare
field-name="acctgTransEntry.glAccountId" operator="equals" value="140000"/>
+ </assert>
+ </if-compare>
+ </else>
+ </if-compare>
+ </iterate>
+ </simple-method>
+</simple-methods>
\ No newline at end of file
Propchange:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
------------------------------------------------------------------------------
svn:keywords = Date Rev Author URL Id
Propchange:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: ofbiz/trunk/applications/accounting/testdef/accountingtests.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/accountingtests.xml?rev=658672&r1=658671&r2=658672&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/accountingtests.xml (original)
+++ ofbiz/trunk/applications/accounting/testdef/accountingtests.xml Wed May 21
06:03:49 2008
@@ -21,4 +21,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="accounting-tests"><junit-test-suite
class-name="org.ofbiz.accounting.test.FinAccountTests"/></test-case>
+ <test-case case-name="auto-accouning-transaction-tests-ReceiptPO">
+ <simple-method-test
location="component://accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml"
name="testAcctgTransOnPoReceipts"/>
+ </test-case>
</test-suite>