details:   https://code.openbravo.com/erp/devel/pi/rev/7c6329f153dd
changeset: 34262:7c6329f153dd
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Thu Jun 28 15:29:50 2018 +0530
summary:   Fixes Issue 38832:Copy from Order it does not copy line description

Order Line description was wrongly set from Order description,
it will be set from Order Line from which the new Order Line
is created.

details:   https://code.openbravo.com/erp/devel/pi/rev/9d031bc2d0c9
changeset: 34263:9d031bc2d0c9
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Mon Jul 02 22:37:49 2018 +0530
summary:   Related to Issue 38832:Copy from Order it does not copy line 
description

Modify the copy line from order related tests to check copied line
description with the original line description instead of checking
with header description

diffstat:

 
src-test/src/org/openbravo/test/copyLinesFromOrders/CopyLinesFromOrdersTest.java
            |  15 ++++---
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestConstants.java 
            |   5 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_13.java 
            |   7 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_14.java 
            |  11 +++--
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_15.java 
            |   7 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_16.java 
            |   8 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_17.java 
            |   8 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_18.java 
            |  19 ++++++---
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_19.java 
            |   7 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_20.java 
            |   7 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataSO_01.java 
            |   7 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataSO_02.java 
            |  11 +++--
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataSO_03.java 
            |   9 ++--
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataSO_04.java 
            |   8 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataSO_05.java 
            |   8 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataSO_06.java 
            |  19 ++++++---
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataSO_07.java 
            |   7 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataSO_08.java 
            |   7 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataSO_AUM_21.java
         |   7 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataSO_AUM_22.java
         |   7 ++-
 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CopyLinesFromOrdersTestData.java
   |   5 +-
 
src/org/openbravo/common/actionhandler/copyfromorderprocess/UpdateOrderLineInformation.java
 |   4 +-
 22 files changed, 114 insertions(+), 79 deletions(-)

diffs (truncated from 916 to 300 lines):

diff -r 493ea476aaad -r 9d031bc2d0c9 
src-test/src/org/openbravo/test/copyLinesFromOrders/CopyLinesFromOrdersTest.java
--- 
a/src-test/src/org/openbravo/test/copyLinesFromOrders/CopyLinesFromOrdersTest.java
  Wed Jul 04 09:22:23 2018 +0200
+++ 
b/src-test/src/org/openbravo/test/copyLinesFromOrders/CopyLinesFromOrdersTest.java
  Mon Jul 02 22:37:49 2018 +0530
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2017 Openbravo SLU 
+ * All portions are Copyright (C) 2017-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -94,7 +94,7 @@
  * Tests cases to check Copy Lines From Orders process
  * 
  * @author Mark
- *
+ * 
  */
 public class CopyLinesFromOrdersTest extends WeldBaseTest {
   final static private Logger log = 
LoggerFactory.getLogger(CopyLinesFromOrdersTest.class);
@@ -162,7 +162,8 @@
   public ParameterCdiTestRule<CopyLinesFromOrdersTestData> parameterValuesRule 
= new ParameterCdiTestRule<CopyLinesFromOrdersTestData>(
       PARAMS);
 
-  private @ParameterCdiTest CopyLinesFromOrdersTestData data;
+  private @ParameterCdiTest
+  CopyLinesFromOrdersTestData data;
 
   private static UOMManagementUtil uomUtil = new UOMManagementUtil();
 
@@ -465,6 +466,7 @@
         String expectedAttributeValue = expectedLineData[10];
         String expectedOperativeQty = expectedLineData[11];
         String expectedOperativeUOM = expectedLineData[12];
+        String expectedDescription = expectedLineData[13];
 
         String referenceOrderDocumentNo = 
orderLineCopied.getSOPOReference().getSalesOrder()
             .getDocumentNo();
@@ -514,12 +516,11 @@
             + "). Was expected " + headerDeliveryDate, lineDeliveryDate,
             comparesEqualTo(headerDeliveryDate));
 
-        String headerDescription = processingOrder.getDescription();
         String lineDescription = orderLineCopied.getDescription();
-        if (StringUtils.isNotEmpty(headerDescription) || 
StringUtils.isNotEmpty(lineDescription)) {
+        if (StringUtils.isNotEmpty(expectedDescription) || 
StringUtils.isNotEmpty(lineDescription)) {
           assertThat(testNumber + ". Wrong Order Line Description = " + 
lineDescription
-              + "). Was expected " + headerDescription, lineDescription,
-              comparesEqualTo(headerDescription));
+              + "). Was expected " + expectedDescription, lineDescription,
+              comparesEqualTo(expectedDescription));
         }
 
         // Check BP Address
diff -r 493ea476aaad -r 9d031bc2d0c9 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestConstants.java
--- 
a/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestConstants.java
   Wed Jul 04 09:22:23 2018 +0200
+++ 
b/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestConstants.java
   Mon Jul 02 22:37:49 2018 +0530
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2017 Openbravo SLU 
+ * All portions are Copyright (C) 2017-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -126,4 +126,7 @@
   public static final String DISABLE_AUM = "N";
   public static final String PRIMARY_AUM = "P";
 
+  public static final String LINE1_DESCRIPTION = "Line 1 Description";
+  public static final String LINE2_DESCRIPTION = "Line 2 Description";
+
 }
diff -r 493ea476aaad -r 9d031bc2d0c9 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_13.java
--- 
a/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_13.java
   Wed Jul 04 09:22:23 2018 +0200
+++ 
b/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_13.java
   Mon Jul 02 22:37:49 2018 +0530
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2017 Openbravo SLU 
+ * All portions are Copyright (C) 2017-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -26,7 +26,7 @@
  * Check created line has as SO/PO reference the order line from it was 
created.
  * 
  * @author Mark
- *
+ * 
  */
 public class CLFOTestDataPO_13 extends CopyLinesFromOrdersTestData {
 
@@ -65,6 +65,7 @@
     order1Line1.setPrice(new BigDecimal("2"));
     order1Line1.setTaxId(CLFOTestConstants.VAT10_TAX_ID);
     order1Line1.setWarehouseId(CLFOTestConstants.SPAIN_EAST_WAREHOUSE);
+    order1Line1.setDescription(CLFOTestConstants.LINE1_DESCRIPTION);
     setOrderLinesCopiedFrom(new OrderLineData[][] { new OrderLineData[] { 
order1Line1 } });
 
     // Information of the order that will be processed
@@ -100,7 +101,7 @@
         "10", CLFOTestConstants.BAG_UOM_NAME, "2.00", "2.00", "0",
         CLFOTestConstants.VAT10_TAX_NAME, TEST_ORDERFROM1_DOCUMENTNO,
         BPartnerDataConstants.VENDOR_A_LOCATION, 
CLFOTestConstants.SPAIN_ORGANIZATION_NAME, "",
-        null, null });
+        null, null, CLFOTestConstants.LINE1_DESCRIPTION });
     setExpectedOrderLines(expectedOrderLines);
   }
 
diff -r 493ea476aaad -r 9d031bc2d0c9 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_14.java
--- 
a/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_14.java
   Wed Jul 04 09:22:23 2018 +0200
+++ 
b/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_14.java
   Mon Jul 02 22:37:49 2018 +0530
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2017 Openbravo SLU 
+ * All portions are Copyright (C) 2017-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -24,10 +24,10 @@
 
 /**
  * Check the created line has the following information taken from it header 
and not from the line
- * it is created: Order date, Schedule Delivery Date, Description.
+ * it is created: Order date, Schedule Delivery Date. Description is copied 
from line.
  * 
  * @author Mark
- *
+ * 
  */
 public class CLFOTestDataPO_14 extends CopyLinesFromOrdersTestData {
 
@@ -66,6 +66,7 @@
     order1Line1.setPrice(new BigDecimal("2"));
     order1Line1.setTaxId(CLFOTestConstants.VAT10_TAX_ID);
     order1Line1.setWarehouseId(CLFOTestConstants.SPAIN_EAST_WAREHOUSE);
+    order1Line1.setDescription(CLFOTestConstants.LINE1_DESCRIPTION);
     setOrderLinesCopiedFrom(new OrderLineData[][] { new OrderLineData[] { 
order1Line1 } });
 
     // Information of the order that will be processed
@@ -102,7 +103,7 @@
         "10", CLFOTestConstants.BAG_UOM_NAME, "2.00", "2.00", "0",
         CLFOTestConstants.VAT10_TAX_NAME, TEST_ORDERFROM1_DOCUMENTNO,
         BPartnerDataConstants.VENDOR_A_LOCATION, 
CLFOTestConstants.SPAIN_ORGANIZATION_NAME, "",
-        null, null });
+        null, null, CLFOTestConstants.LINE1_DESCRIPTION });
     setExpectedOrderLines(expectedOrderLines);
   }
 
@@ -113,7 +114,7 @@
 
   @Override
   public String getTestDescription() {
-    return "Check the created line has the following information taken from it 
header and not from the line it is created: Order date, Schedule Delivery Date, 
Description..";
+    return "Check the created line has the following information taken from it 
header and not from the line it is created: Order date, Schedule Delivery Date. 
Description is copied from line..";
   }
 
   @Override
diff -r 493ea476aaad -r 9d031bc2d0c9 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_15.java
--- 
a/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_15.java
   Wed Jul 04 09:22:23 2018 +0200
+++ 
b/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_15.java
   Mon Jul 02 22:37:49 2018 +0530
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2017 Openbravo SLU 
+ * All portions are Copyright (C) 2017-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -27,7 +27,7 @@
  * defined then it is used as BP address or the last address created for the 
header's BP.
  * 
  * @author Mark
- *
+ * 
  */
 public class CLFOTestDataPO_15 extends CopyLinesFromOrdersTestData {
 
@@ -66,6 +66,7 @@
     order1Line1.setPrice(new BigDecimal("2"));
     order1Line1.setTaxId(CLFOTestConstants.VAT10_TAX_ID);
     order1Line1.setWarehouseId(CLFOTestConstants.SPAIN_EAST_WAREHOUSE);
+    order1Line1.setDescription(CLFOTestConstants.LINE1_DESCRIPTION);
     setOrderLinesCopiedFrom(new OrderLineData[][] { new OrderLineData[] { 
order1Line1 } });
 
     // Information of the order that will be processed
@@ -101,7 +102,7 @@
         "10", CLFOTestConstants.BAG_UOM_NAME, "2.00", "2.00", "0",
         CLFOTestConstants.VAT10_TAX_NAME, TEST_ORDERFROM1_DOCUMENTNO,
         BPartnerDataConstants.VENDOR_B_LOCATION, 
CLFOTestConstants.SPAIN_ORGANIZATION_NAME, "",
-        null, null });
+        null, null, CLFOTestConstants.LINE1_DESCRIPTION });
     setExpectedOrderLines(expectedOrderLines);
   }
 
diff -r 493ea476aaad -r 9d031bc2d0c9 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_16.java
--- 
a/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_16.java
   Wed Jul 04 09:22:23 2018 +0200
+++ 
b/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_16.java
   Mon Jul 02 22:37:49 2018 +0530
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2017 Openbravo SLU 
+ * All portions are Copyright (C) 2017-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -31,7 +31,7 @@
  * Case A
  * 
  * @author Mark
- *
+ * 
  */
 public class CLFOTestDataPO_16 extends CopyLinesFromOrdersTestData {
 
@@ -70,6 +70,7 @@
     order1Line1.setPrice(new BigDecimal("1.36"));
     order1Line1.setTaxId(CLFOTestConstants.ADQUISICIONES_IVA_21_TAX_ID);
     order1Line1.setWarehouseId(CLFOTestConstants.ESPANA_NORTE_WAREHOUSE);
+    order1Line1.setDescription(CLFOTestConstants.LINE1_DESCRIPTION);
     setOrderLinesCopiedFrom(new OrderLineData[][] { new OrderLineData[] { 
order1Line1 } });
 
     // Information of the order that will be processed
@@ -107,7 +108,8 @@
         CLFOTestConstants.UNIT_UOM_NAME, "1.36", "1.36", "0",
         CLFOTestConstants.ADQUISICIONES_IVA_21_TAX_NAME, 
TEST_ORDERFROM1_DOCUMENTNO,
         BPartnerDataConstants.BEBIDAS_ALEGRES_LOCATION,
-        CLFOTestConstants.FB_ESPANA_NORTE_ORGANIZATION_NAME, "", null, null });
+        CLFOTestConstants.FB_ESPANA_NORTE_ORGANIZATION_NAME, "", null, null,
+        CLFOTestConstants.LINE1_DESCRIPTION });
     setExpectedOrderLines(expectedOrderLines);
   }
 
diff -r 493ea476aaad -r 9d031bc2d0c9 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_17.java
--- 
a/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_17.java
   Wed Jul 04 09:22:23 2018 +0200
+++ 
b/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_17.java
   Mon Jul 02 22:37:49 2018 +0530
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2017 Openbravo SLU 
+ * All portions are Copyright (C) 2017-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -31,7 +31,7 @@
  * Case B
  * 
  * @author Mark
- *
+ * 
  */
 public class CLFOTestDataPO_17 extends CopyLinesFromOrdersTestData {
 
@@ -70,6 +70,7 @@
     order1Line1.setPrice(new BigDecimal("1.36"));
     order1Line1.setTaxId(CLFOTestConstants.ADQUISICIONES_IVA_21_TAX_ID);
     order1Line1.setWarehouseId(CLFOTestConstants.ESPANA_NORTE_WAREHOUSE);
+    order1Line1.setDescription(CLFOTestConstants.LINE1_DESCRIPTION);
     setOrderLinesCopiedFrom(new OrderLineData[][] { new OrderLineData[] { 
order1Line1 } });
 
     // Information of the order that will be processed
@@ -107,7 +108,8 @@
         CLFOTestConstants.UNIT_UOM_NAME, "1.36", "1.36", "0",
         CLFOTestConstants.ADQUISICIONES_IVA_21_TAX_NAME, 
TEST_ORDERFROM1_DOCUMENTNO,
         BPartnerDataConstants.BEBIDAS_ALEGRES_LOCATION,
-        CLFOTestConstants.FB_ESPANA_NORTE_ORGANIZATION_NAME, "", null, null });
+        CLFOTestConstants.FB_ESPANA_NORTE_ORGANIZATION_NAME, "", null, null,
+        CLFOTestConstants.LINE1_DESCRIPTION });
     setExpectedOrderLines(expectedOrderLines);
   }
 
diff -r 493ea476aaad -r 9d031bc2d0c9 
src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_18.java
--- 
a/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_18.java
   Wed Jul 04 09:22:23 2018 +0200
+++ 
b/src-test/src/org/openbravo/test/copyLinesFromOrders/data/CLFOTestDataPO_18.java
   Mon Jul 02 22:37:49 2018 +0530
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2017 Openbravo SLU 
+ * All portions are Copyright (C) 2017-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -48,7 +48,7 @@
  * Product with attributes (not an instance attribute). In this case the 
attribute isn't copied.
  * 
  * @author Mark
- *
+ * 
  */
 public class CLFOTestDataPO_18 extends CopyLinesFromOrdersTestData {

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to