details:   https://code.openbravo.com/erp/devel/pi/rev/93a46c1b0e57
changeset: 16070:93a46c1b0e57
user:      Jon Alegría <jon.alegria <at> openbravo.com>
date:      Thu Apr 12 17:38:39 2012 +0200
summary:   Fixes issue 0020204: Create lines from should use 
ad_column_identifier to show
the product name

diffstat:

 src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java               |  
33 ++++++---
 src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql  |  
15 +++-
 src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql |  
14 ++-
 3 files changed, 41 insertions(+), 21 deletions(-)

diffs (220 lines):

diff -r 67c0f9be4dff -r 93a46c1b0e57 
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java       Thu Apr 
12 16:14:19 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java       Thu Apr 
12 17:38:39 2012 +0200
@@ -1461,9 +1461,11 @@
       for (int k = 0; k < ids.length; k++) {
         if (strType.equals("SHIPMENT")) {
           if (isSOTrx.equals("Y"))
-            data = CreateFromInvoiceData.selectFromShipmentUpdateSOTrx(conn, 
this, ids[k]);
+            data = CreateFromInvoiceData.selectFromShipmentUpdateSOTrx(conn, 
this,
+                vars.getLanguage(), ids[k]);
           else
-            data = CreateFromInvoiceData.selectFromShipmentUpdate(conn, this, 
ids[k]);
+            data = CreateFromInvoiceData.selectFromShipmentUpdate(conn, this, 
vars.getLanguage(),
+                ids[k]);
           dataAux = CreateFromInvoiceData
               .selectPriceList(conn, this, strDateInvoiced, strPriceList);
           if (dataAux == null || dataAux.length == 0) {
@@ -1476,9 +1478,11 @@
         } else {
           strPO = vars.getStringParameter("inpPurchaseOrder");
           if (isSOTrx.equals("Y"))
-            data = CreateFromInvoiceData.selectFromPOUpdateSOTrx(conn, this, 
ids[k]);
+            data = CreateFromInvoiceData.selectFromPOUpdateSOTrx(conn, this, 
vars.getLanguage(),
+                ids[k]);
           else
-            data = CreateFromInvoiceData.selectFromPOUpdate(conn, this, 
strKey, ids[k]);
+            data = CreateFromInvoiceData.selectFromPOUpdate(conn, this, 
strKey, vars.getLanguage(),
+                ids[k]);
         }
         if (data != null) {
           for (int i = 0; i < data.length; i++) {
@@ -1607,13 +1611,16 @@
         if (strType.equals("INVOICE")) {
           strInvoice = vars.getStringParameter("inpInvoice");
           if (!isSOTrx.equals("Y"))
-            data = CreateFromShipmentData.selectFromInvoiceUpdate(conn, this, 
ids[k]);
+            data = CreateFromShipmentData.selectFromInvoiceUpdate(conn, this, 
vars.getLanguage(),
+                ids[k]);
         } else {
           strPO = vars.getStringParameter("inpPurchaseOrder");
           if (isSOTrx.equals("Y"))
-            data = CreateFromShipmentData.selectFromPOUpdateSOTrx(conn, this, 
ids[k]);
+            data = CreateFromShipmentData.selectFromPOUpdateSOTrx(conn, this, 
vars.getLanguage(),
+                ids[k]);
           else
-            data = CreateFromShipmentData.selectFromPOUpdate(conn, this, 
ids[k]);
+            data = CreateFromShipmentData
+                .selectFromPOUpdate(conn, this, vars.getLanguage(), ids[k]);
         }
         if (data != null) {
           for (int i = 0; i < data.length; i++) {
@@ -1832,15 +1839,19 @@
         if (strType.equals("INVOICE")) {
           strInvoice = vars.getStringParameter("inpInvoice");
           if (isSOTrx.equals("Y"))
-            data = CreateFromShipmentData.selectFromInvoiceTrxUpdate(conn, 
this, ids[k]);
+            data = CreateFromShipmentData.selectFromInvoiceTrxUpdate(conn, 
this,
+                vars.getLanguage(), ids[k]);
           else
-            data = CreateFromShipmentData.selectFromInvoiceUpdate(conn, this, 
ids[k]);
+            data = CreateFromShipmentData.selectFromInvoiceUpdate(conn, this, 
vars.getLanguage(),
+                ids[k]);
         } else {
           strPO = vars.getStringParameter("inpPurchaseOrder");
           if (isSOTrx.equals("Y"))
-            data = CreateFromShipmentData.selectFromPOUpdateSOTrx(conn, this, 
ids[k]);
+            data = CreateFromShipmentData.selectFromPOUpdateSOTrx(conn, this, 
vars.getLanguage(),
+                ids[k]);
           else
-            data = CreateFromShipmentData.selectFromPOUpdate(conn, this, 
ids[k]);
+            data = CreateFromShipmentData
+                .selectFromPOUpdate(conn, this, vars.getLanguage(), ids[k]);
         }
         if (data != null) {
           for (int i = 0; i < data.length; i++) {
diff -r 67c0f9be4dff -r 93a46c1b0e57 
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql  
Thu Apr 12 16:14:19 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql  
Thu Apr 12 17:38:39 2012 +0200
@@ -225,7 +225,8 @@
     <Sql>
       <![CDATA[
       SELECT (CASE WHEN B.M_InOutLine_ID IS NULL THEN A.QTY ELSE B.QTY END) AS 
ID, 
-      A.C_UOM_ID,uom.UOMSymbol, A.M_Product_ID,p.NAME, 
A.C_OrderLine_ID,A.Line, uom.stdprecision AS stdprecision, cur.priceprecision, 
+      A.C_UOM_ID,uom.UOMSymbol, 
A.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), 
to_char(A.m_product_id), to_char(?)) AS NAME, 
+      A.C_OrderLine_ID,A.Line, uom.stdprecision AS stdprecision, 
cur.priceprecision, 
       B.M_InOutLine_ID, A.Description, (CASE WHEN B.M_InOutLine_ID IS NULL 
THEN A.quantityOrder ELSE B.quantityOrder END) AS quantityOrder, 
       (CASE WHEN B.M_InOutLine_ID IS NULL THEN A.M_Product_UOM_ID ELSE 
B.M_Product_UOM_ID END) AS M_Product_UOM_ID, A.M_ATTRIBUTESETINSTANCE_ID, 
A.ad_org_id,
       A.taxbaseamt
@@ -259,6 +260,7 @@
       ORDER BY A.Line
       ]]>
     </Sql>
+    <Parameter name="adLanguage"/>
     <Parameter name="piId"/>
     <Parameter name="piId"/>
     <Parameter name="cOrderlineId" optional="true" type="argument" after="AND 
A.M_Product_ID=p.M_Product_ID" text=" AND A.C_OrderLine_ID IN "/>
@@ -268,7 +270,7 @@
     <Sql>
       <![CDATA[
         SELECT (CASE WHEN il.M_INOUTLINE_ID IS NULL THEN 
(l.QtyOrdered-COALESCE(l.QTYINVOICED ,0)) ELSE il.MOVEMENTQTY END) AS ID, 
-        l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,p.NAME, 
+        l.C_UOM_ID,uom.UOMSymbol, 
l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), 
to_char(l.m_product_id), to_char(?)) AS NAME, 
         l.C_OrderLine_ID,l.Line, max(uom.stdprecision) AS stdprecision, 
cur.priceprecision, il.M_InOutLine_ID as M_InOutLine_ID, l.Description,
         (CASE WHEN il.M_INOUTLINE_ID IS NULL THEN 
l.quantityOrder*C_DIVIDE((l.QtyOrdered-COALESCE(l.QTYINVOICED 
,0)),(l.QtyOrdered)) ELSE il.quantityOrder END) AS quantityOrder, 
         (CASE WHEN il.M_INOUTLINE_ID IS NULL THEN l.M_Product_UOM_ID ELSE 
il.M_Product_UOM_ID END) AS M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, 
l.ad_org_id,
@@ -289,6 +291,7 @@
       ]]>
     </Sql>
     <Field name="rownum" value="count"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="cOrderlineId" optional="true" type="argument" after=" AND 
l.M_Product_ID=p.M_Product_ID " text=" AND l.C_OrderLine_ID IN "/>
   </SqlMethod>
   <SqlMethod name="selectFromShipment" type="preparedStatement" 
return="multiple">
@@ -482,8 +485,8 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
       <![CDATA[
-      SELECT (l.MovementQty-SUM(COALESCE(mi.Qty,0))) AS ID, 
l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,p.NAME, l.M_InOutLine_ID,l.Line,
-      l.C_OrderLine_ID, max(uom.STDPRECISION) as stdprecision, l.Description, 
l.quantityOrder*C_DIVIDE((l.MovementQty-SUM(COALESCE(mi.Qty,0))),l.MovementQty) 
as quantityOrder, 
+      SELECT (l.MovementQty-SUM(COALESCE(mi.Qty,0))) AS ID, 
l.C_UOM_ID,uom.UOMSymbol, 
l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), 
to_char(l.m_product_id), to_char(?)) AS NAME, 
+      l.M_InOutLine_ID,l.Line, l.C_OrderLine_ID, max(uom.STDPRECISION) as 
stdprecision, l.Description, 
l.quantityOrder*C_DIVIDE((l.MovementQty-SUM(COALESCE(mi.Qty,0))),l.MovementQty) 
as quantityOrder, 
       l.M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, 
COALESCE(co.taxbaseamt,0) * 
C_DIVIDE((l.MovementQty-SUM(COALESCE(mi.Qty,0))),COALESCE(co.qtyordered,1)) as 
taxbaseamt
       FROM M_INOUTLINE l left join M_MATCHINV mi on 
l.M_InOutLine_ID=mi.M_InOutLine_ID
             left join C_ORDERLINE co ON co.C_ORDERLINE_ID=l.C_ORDERLINE_ID,
@@ -494,13 +497,14 @@
       ORDER BY l.Line
       ]]>
     </Sql>
+    <Parameter name="adLanguage"/>
     <Parameter name="cInOutLineId" optional="true" type="argument" after="AND 
l.M_Product_ID=p.M_Product_ID" text=" AND l.M_InOutLine_ID IN "/>
   </SqlMethod>
   <SqlMethod name="selectFromShipmentUpdateSOTrx" type="preparedStatement" 
connection="true" return="multiple">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
       <![CDATA[
-        SELECT l.MovementQty AS ID, l.C_UOM_ID,uom.UOMSymbol, 
l.M_Product_ID,p.NAME, l.M_InOutLine_ID,l.Line,
+        SELECT l.MovementQty AS ID, l.C_UOM_ID,uom.UOMSymbol, 
l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), 
to_char(l.m_product_id), to_char(?)) AS NAME, l.M_InOutLine_ID,l.Line,
         l.C_OrderLine_ID, max(uom.STDPRECISION) as stdprecision, 
l.Description,l.quantityOrder, l.M_Product_UOM_ID,
         l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id
         FROM C_UOM uom, M_INOUTLINE l, M_PRODUCT p 
@@ -512,6 +516,7 @@
       ]]>
     </Sql>
     <Field name="rownum" value="count"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="cOrderlineId" optional="true" type="argument" after="AND 
l.isinvoiced = 'N' " text=" AND l.M_InOutLine_ID IN "/>
   </SqlMethod>
   <SqlMethod name="set" type="constant" return="multiple">
diff -r 67c0f9be4dff -r 93a46c1b0e57 
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql 
Thu Apr 12 16:14:19 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql 
Thu Apr 12 17:38:39 2012 +0200
@@ -212,7 +212,7 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
       <![CDATA[
-      SELECT l.QtyOrdered-SUM(COALESCE(m.Qty,0)) AS ID, 
l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,p.NAME, l.C_OrderLine_ID,
+      SELECT l.QtyOrdered-SUM(COALESCE(m.Qty,0)) AS ID, 
l.C_UOM_ID,uom.UOMSymbol, 
l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), 
to_char(l.m_product_id), to_char(?)) AS NAME, l.C_OrderLine_ID,
       l.Line, '' as C_InvoiceLine_ID, '' as M_InOutLine_ID, 
COALESCE(uom1.BREAKDOWN, 'N') AS BREAKDOWN, 
       MAX(mu.C_UOM_ID) AS C_UOM_ID_Conversion, MAX(uom1.STDPRECISION) AS 
STDPRECISION, 
       
l.QUANTITYORDER*C_DIVIDE((l.QtyOrdered-SUM(COALESCE(m.Qty,0))),(l.QtyOrdered)) 
AS quantityOrder, l.M_Product_UOM_ID,
@@ -230,14 +230,15 @@
       ]]>
     </Sql>
     <Field name="rownum" value="count"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="cOrderlineId" optional="true" type="argument" after="AND 
l.M_Product_ID=p.M_Product_ID" text=" AND l.C_OrderLine_ID IN "/>
   </SqlMethod>
   <SqlMethod name="selectFromPOUpdateSOTrx" type="preparedStatement" 
connection="true" return="multiple">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
       <![CDATA[
-      SELECT l.QtyOrdered - COALESCE(l.QTYDELIVERED,0) AS ID, 
l.C_UOM_ID,uom.UOMSymbol, l.M_Product_ID,p.NAME, l.C_OrderLine_ID,
-      l.Line, '' as C_InvoiceLine_ID, '' as M_InOutLine_ID, 
COALESCE(uom1.BREAKDOWN, 'N') AS BREAKDOWN, 
+      SELECT l.QtyOrdered - COALESCE(l.QTYDELIVERED,0) AS ID, 
l.C_UOM_ID,uom.UOMSymbol, 
l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), 
to_char(l.m_product_id), to_char(?)) AS NAME, 
+      l.C_OrderLine_ID, l.Line, '' as C_InvoiceLine_ID, '' as M_InOutLine_ID, 
COALESCE(uom1.BREAKDOWN, 'N') AS BREAKDOWN, 
       MAX(mu.C_UOM_ID) AS C_UOM_ID_Conversion, MAX(uom1.STDPRECISION) AS 
STDPRECISION, 
       l.QUANTITYORDER*C_DIVIDE((l.QtyOrdered - 
COALESCE(l.QTYDELIVERED,0)),(l.QtyOrdered)) as quantityOrder, 
l.M_Product_UOM_ID,
       l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, l.DESCRIPTION AS DESCRIPTION
@@ -253,6 +254,7 @@
       ]]>
     </Sql>
     <Field name="rownum" value="count"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="cOrderlineId" optional="true" type="argument" after="AND 
l.M_Product_ID=p.M_Product_ID" text=" AND l.C_OrderLine_ID IN "/>
   </SqlMethod>
   <SqlMethod name="selectFromInvoice" type="preparedStatement" 
return="multiple">
@@ -412,7 +414,7 @@
     <Sql>
       <![CDATA[
       SELECT l.QtyInvoiced-SUM(COALESCE(mi.Qty,0)) AS ID, 
l.C_UOM_ID,uom.UOMSymbol,
-      l.M_Product_ID,p.NAME, l.C_InvoiceLine_ID,l.Line, l.C_OrderLine_ID, 
COALESCE(uom1.BREAKDOWN, 'N') AS BREAKDOWN, 
+      l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), 
to_char(l.m_product_id), to_char(?)) AS NAME, l.C_InvoiceLine_ID,l.Line, 
l.C_OrderLine_ID, COALESCE(uom1.BREAKDOWN, 'N') AS BREAKDOWN, 
       MAX(mu.C_UOM_ID) AS C_UOM_ID_Conversion, MAX(uom1.STDPRECISION) AS 
STDPRECISION, l.QUANTITYORDER, l.M_Product_UOM_ID,
       l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, l.DESCRIPTION AS DESCRIPTION, 
l.C_INVOICE_ID
       FROM C_INVOICELINE l left join  M_Product_UOM mu on l.M_Product_UOM_ID = 
mu.M_Product_UOM_ID 
@@ -429,6 +431,7 @@
       ]]>
     </Sql>
     <Field name="rownum" value="count"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="cInvoicelineId" optional="true" type="argument" 
after="AND l.M_Product_ID=p.M_Product_ID " text=" AND l.C_InvoiceLine_ID IN "/>
   </SqlMethod>
   <SqlMethod name="selectFromInvoiceTrxUpdate" type="preparedStatement" 
connection="true" return="multiple">
@@ -436,7 +439,7 @@
     <Sql>
       <![CDATA[
       SELECT l.QtyInvoiced-SUM(COALESCE(mi.MOVEMENTQTY,0)) AS ID, 
l.C_UOM_ID,uom.UOMSymbol,
-      l.M_Product_ID,p.NAME, l.C_InvoiceLine_ID,l.Line, l.C_OrderLine_ID, 
COALESCE(uom1.BREAKDOWN, 'N') AS BREAKDOWN, 
+      l.M_Product_ID,Ad_Column_Identifier(to_char('M_Product'), 
to_char(l.m_product_id), to_char(?)) AS NAME, l.C_InvoiceLine_ID,l.Line, 
l.C_OrderLine_ID, COALESCE(uom1.BREAKDOWN, 'N') AS BREAKDOWN, 
       MAX(mu.C_UOM_ID) AS C_UOM_ID_Conversion, MAX(uom1.STDPRECISION) AS 
STDPRECISION, l.QUANTITYORDER, l.M_Product_UOM_ID,
       l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, l.DESCRIPTION AS DESCRIPTION
       FROM C_INVOICELINE l left join  M_Product_UOM mu on l.M_Product_UOM_ID = 
mu.M_Product_UOM_ID 
@@ -455,6 +458,7 @@
       ]]>
     </Sql>
     <Field name="rownum" value="count"/>
+    <Parameter name="adLanguage"/>
     <Parameter name="cInvoicelineId" optional="true" type="argument" 
after="AND l.M_Product_ID=p.M_Product_ID " text=" AND l.C_InvoiceLine_ID IN "/>
   </SqlMethod>
   <SqlMethod name="set" type="constant" return="multiple">

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to