Fixed bug 28216: The glitem is not printed when using financial invoice
authorFernando Soto <fernando.soto@peoplewalking.com>
Tue, 23 Dec 2014 09:09:52 -0500
changeset 25607 aacfb0fa0587
parent 25606 1c4fc1c5303f
child 25647 69229796406f
Fixed bug 28216: The glitem is not printed when using financial invoice

Modified the report to read the GL Item name.
Used the sugested solution.
src/org/openbravo/erpReports/RptC_Invoice_Lines_new.jrxml
--- a/src/org/openbravo/erpReports/RptC_Invoice_Lines_new.jrxml	Mon Dec 01 18:36:51 2014 -0500
+++ b/src/org/openbravo/erpReports/RptC_Invoice_Lines_new.jrxml	Tue Dec 23 09:09:52 2014 -0500
@@ -34,7 +34,7 @@
 	<parameter name="LOCALE" class="java.util.Locale" isForPrompting="false"/>
 	<parameter name="ISTAXINCLUDED" class="java.lang.String"/>
 	<queryString>
-		<![CDATA[SELECT C_INVOICE.C_INVOICE_ID, COALESCE(M_PRODUCT.NAME, C_INVOICELINE.DESCRIPTION) AS NAME_PRODUCT, C_INVOICELINE.QTYINVOICED,
+		<![CDATA[SELECT C_INVOICE.C_INVOICE_ID, COALESCE(M_PRODUCT.NAME, COALESCE(C_GLITEM.NAME, C_INVOICELINE.DESCRIPTION)) AS NAME_PRODUCT, C_INVOICELINE.QTYINVOICED,
      C_UOM.NAME AS UOMNAME, C_INVOICELINE.DESCRIPTION,
         CASE WHEN $P{ISTAXINCLUDED}='Y' THEN C_INVOICELINE.LINE_GROSS_AMOUNT ELSE C_INVOICELINE.LINENETAMT END AS LINENETAMT,
         CASE WHEN $P{ISTAXINCLUDED}='Y' THEN C_INVOICELINE.GROSS_UNIT_PRICE ELSE C_INVOICELINE.PRICEACTUAL END AS PRICEACTUAL,
@@ -44,7 +44,8 @@
                            left join M_INOUTLINE on  M_INOUTLINE.M_INOUTLINE_ID = C_INVOICELINE.M_INOUTLINE_ID
                            left join M_INOUT on M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
                            left join C_ORDERLINE on C_ORDERLINE.C_ORDERLINE_ID = C_INVOICELINE.C_ORDERLINE_ID
-                           left join C_ORDER on C_ORDERLINE.C_ORDER_ID = C_ORDER.C_ORDER_ID,
+                           left join C_ORDER on C_ORDERLINE.C_ORDER_ID = C_ORDER.C_ORDER_ID
+                           left join C_GLITEM on C_INVOICELINE.ACCOUNT_ID = C_GLITEM.C_GLITEM_ID,
            C_INVOICE
         WHERE C_INVOICELINE.C_INVOICE_ID = C_INVOICE.C_INVOICE_ID
         AND C_INVOICE.C_INVOICE_ID = $P{C_INVOICE_ID}