Package org.openbravo.test.costing
Class TestIssue37033
- java.lang.Object
-
- org.openbravo.test.base.MockableBaseTest
-
- org.openbravo.test.base.OBBaseTest
-
- org.openbravo.base.weld.test.WeldBaseTest
-
- org.openbravo.test.costing.TestCostingBase
-
- org.openbravo.test.costing.TestIssue37033
-
public class TestIssue37033 extends TestCostingBase
-
-
Field Summary
-
Fields inherited from class org.openbravo.test.base.OBBaseTest
DOLLAR, DOLLAR_ID, EURO, EURO_ID, QA_TEST_ADMIN_USER_ID, QA_TEST_CLIENT_ID, QA_TEST_ORG_ID, TEST_BP_CATEGORY_ID, TEST_CLIENT_ID, TEST_INVOICE_ID, TEST_LOCATION_ID, TEST_ORDER_ID, TEST_ORG_ID, TEST_ORG_TREE, TEST_PRODUCT_ID, TEST_ROLE_ID, TEST_US_ORG_ID, TEST_USER_ID, TEST_WAREHOUSE_ID, TEST2_USER_ID, userIds, watchFailures
-
-
Constructor Summary
Constructors Constructor Description TestIssue37033()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testIssue37033_CostAdjustmentToDecreaseCost()
Test for issue 37033.void
testIssue37033_CostAdjustmentToDecreaseCostWithReceiptPartiallyInvoiced()
Test for issue 37033.void
testIssue37033_CostAdjustmentToIncreaseCost()
Test for issue 37033.void
testIssue37033_CostAdjustmentToIncreaseCostWithReceiptPartiallyInvoiced()
Test for issue 37033.void
testIssue37033_NoCostAdjustment()
Test for issue 37033.-
Methods inherited from class org.openbravo.test.costing.TestCostingBase
setFinalConfiguration, setInitialConfiguration
-
Methods inherited from class org.openbravo.base.weld.test.WeldBaseTest
createTestArchive, getWeldComponent, resetOBInterceptors, setUp
-
Methods inherited from class org.openbravo.test.base.OBBaseTest
addReadWriteAccess, classSetUp, commitTransaction, count, getConnectionProvider, getOneInstance, getRandomUser, getTestLogAppender, initializeDalLayer, initializeDisabledTestCases, initializeTestLogAppender, isErrorOccured, reportException, rollback, setLogStackTraces, setQAAdminContext, setSystemAdministratorContext, setTestAdminContext, setTestLogAppenderLevel, setTestUserContext, setUserContext, shouldMockServletContext, staticInitializeDalLayer, testDone
-
Methods inherited from class org.openbravo.test.base.MockableBaseTest
mockStatic
-
-
-
-
Method Detail
-
testIssue37033_NoCostAdjustment
public void testIssue37033_NoCostAdjustment() throws Exception
Test for issue 37033. Test Plan No. 1, No Cost Adjustment- Create a product with purchase price 10.00
- Create and process a purchase order for one unit of product
- Create and process a goods receipt for one unit of product from purchase order
- Create an invoice from goods receipt
- Create a second invoice from same goods receipt
- Complete the second invoice
- Complete the first invoice
- Set "Enable Automatic Price Difference Correction" preference
- Run Costing Background process
- Asserts the original transaction cost is 10.00
- Asserts the total cost is 10.00
- Asserts the unit cost is 10.00
- Throws:
Exception
-
testIssue37033_CostAdjustmentToIncreaseCost
public void testIssue37033_CostAdjustmentToIncreaseCost() throws Exception
Test for issue 37033. Test Plan No. 2, Cost adjustment to increase cost- Create a product with purchase price 10.00
- Create and process a purchase order for one unit of product
- Create and process a goods receipt for one unit of product from purchase order
- Create an invoice from goods receipt
- Create a second invoice from same goods receipt
- Set unit price 20.00 in invoice line
- Complete the second invoice
- Complete the first invoice
- Set "Enable Automatic Price Difference Correction" preference
- Run Costing Background process
- Asserts the original transaction cost is 10.00
- Asserts the total cost is 15.00
- Asserts the unit cost is 15.00
- Throws:
Exception
-
testIssue37033_CostAdjustmentToDecreaseCost
public void testIssue37033_CostAdjustmentToDecreaseCost() throws Exception
Test for issue 37033. Test Plan No. 3, Cost adjustment to decrease cost- Create a product with purchase price 10.00
- Create and process a purchase order for one unit of product
- Create and process a goods receipt for one unit of product from purchase order
- Create an invoice from goods receipt
- Create a second invoice from same goods receipt
- Set unit price 5.00 in invoice line
- Complete the second invoice
- Complete the first invoice
- Set "Enable Automatic Price Difference Correction" preference
- Run Costing Background process
- Asserts the original transaction cost is 10.00
- Asserts the total cost is 7.50
- Asserts the unit cost is 7.50
- Throws:
Exception
-
testIssue37033_CostAdjustmentToIncreaseCostWithReceiptPartiallyInvoiced
public void testIssue37033_CostAdjustmentToIncreaseCostWithReceiptPartiallyInvoiced() throws Exception
Test for issue 37033. Test Plan No. 4, Cost adjustment to increase cost with receipt partially invoiced- Create a product with purchase price 10.00
- Create and process a purchase order for two unit of product
- Create and process a goods receipt for two unit of product from purchase order
- Create an invoice from goods receipt
- Set unit price 11.00 and quantity to 1 in invoice line
- Complete the invoice
- Set "Enable Automatic Price Difference Correction" preference
- Run Costing Background process
- Asserts the original transaction cost is 20.00
- Asserts the total cost is 21
- Asserts the unit cost is 21
- Throws:
Exception
-
testIssue37033_CostAdjustmentToDecreaseCostWithReceiptPartiallyInvoiced
public void testIssue37033_CostAdjustmentToDecreaseCostWithReceiptPartiallyInvoiced() throws Exception
Test for issue 37033. Test Plan No. 5, Cost adjustment to decrease cost with receipt partially invoiced- Create a product with purchase price 10.00
- Create and process a purchase order for two unit of product
- Create and process a goods receipt for two unit of product from purchase order
- Create an invoice from goods receipt
- Set unit price 9.00 and quantity to 1 in invoice line
- Complete the invoice
- Set "Enable Automatic Price Difference Correction" preference
- Run Costing Background process
- Asserts the original transaction cost is 20.00
- Asserts the total cost is 19
- Asserts the unit cost is 19
- Throws:
Exception
-
-