Skip to content

Commit

Permalink
#1460 update barcode in order checkup reports and remove unused function
Browse files Browse the repository at this point in the history
#1460
FRESH-2159
  • Loading branch information
metas-lc committed May 8, 2017
1 parent d306ff5 commit e389071
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 15 deletions.
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.2.2.final using JasperReports Library version 6.2.2 -->
<!-- 2017-04-28T12:19:59 -->
<!-- 2017-05-08T14:20:43 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report_details" pageWidth="596" pageHeight="842" columnWidth="596" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="352f38d2-10a9-47ea-be33-9b905ff1f8f6">
<property name="ireport.scriptlethandling" value="0"/>
<property name="ireport.encoding" value="UTF-8"/>
Expand Down Expand Up @@ -44,11 +44,11 @@
ol.qtyentered,
pm.name as container,
uom.UOMSymbol AS UOMSymbol,
de_metas_endcustomer_fresh_reports.generate_barcode_order_checkup(t.AD_Table_ID, ol.C_OrderLine_ID) AS barcode
reportLine.barcode AS barcode
FROM
C_Order o
LEFT OUTER JOIN C_OrderLine ol ON o.C_Order_ID = ol.C_Order_ID AND ol.isActive = 'Y'
LEFT OUTER JOIN AD_Table t ON t.AD_Table_ID = get_Table_ID('C_OrderLine') AND t.isActive = 'Y'
LEFT OUTER JOIN C_Order_MFGWarehouse_ReportLine reportLine ON ol.C_OrderLine_ID = reportLine.C_OrderLine_ID
LEFT OUTER JOIN C_BPartner bp ON ol.C_BPartner_ID = bp.C_BPartner_ID AND bp.isActive = 'Y'
LEFT OUTER JOIN M_HU_PI_Item_Product ip ON ol.M_HU_PI_Item_Product_ID = ip.M_HU_PI_Item_Product_ID AND ip.isActive = 'Y'
LEFT OUTER JOIN M_HU_PI_Item pii ON ip.M_HU_PI_Item_ID = pii.M_HU_PI_Item_ID AND pii.isActive = 'Y'
Expand Down

This file was deleted.

Expand Up @@ -27,13 +27,12 @@ SELECT
report.PP_Plant_ID,
o.C_BPartner_ID,
o.DatePromised,
de_metas_endcustomer_fresh_reports.generate_barcode_order_checkup (t.AD_Table_ID, ol.C_OrderLine_ID) AS barcode
reportLine.barcode AS barcode
FROM
C_Order_MFGWarehouse_Report report
INNER JOIN C_Order o on (report.C_Order_ID=o.C_Order_ID) AND o.isActive = 'Y'
INNER JOIN C_Order_MFGWarehouse_ReportLine reportLine on (reportLine.C_Order_MFGWarehouse_Report_ID=report.C_Order_MFGWarehouse_Report_ID)
INNER JOIN C_OrderLine ol ON (ol.C_OrderLine_ID = reportLine.C_OrderLine_ID) AND ol.isActive = 'Y'
INNER JOIN AD_Table t ON t.AD_Table_ID = get_Table_ID('C_OrderLine') AND t.isActive = 'Y'
--
LEFT OUTER JOIN C_BPartner bp ON ol.C_BPartner_ID = bp.C_BPartner_ID AND bp.isActive = 'Y'
LEFT OUTER JOIN M_HU_PI_Item_Product ip ON ol.M_HU_PI_Item_Product_ID = ip.M_HU_PI_Item_Product_ID AND ip.isActive = 'Y'
Expand Down
@@ -0,0 +1,80 @@
drop view if exists report.RV_C_Order_MFGWarehouse_Report_Details;
create or replace view report.RV_C_Order_MFGWarehouse_Report_Details
AS
SELECT
ol.line,
att.Attributes,
COALESCE(bpp.ProductNo, p.value) AS ProductValue,
COALESCE(bpp.ProductName, p.Name) AS ProductName,
COALESCE(bpp.UPC, p.UPC) AS EAN,
-- Rounding these columns is important to have them in one group
-- Jasper groups by comparing the BigDecimals. In that logic, 1.00 is not the same as 1
round(ol.pricelist, 3) AS PriceList,
round(ip.qty, 3) AS Capacity,
round(ol.Priceactual, 3) AS PriceActual,
ol.QtyEnteredTU,
ol.QtyEntered,
pm.name as Container,
uom.UOMSymbol AS UOMSymbol,
--
-- Filtering columns
report.C_Order_MFGWarehouse_Report_ID,
report.DocumentType as ReportDocumentType,
reportLine.C_Order_MFGWarehouse_ReportLine_ID,
o.C_Order_ID,
ol.C_OrderLine_ID,
report.M_Warehouse_ID,
report.PP_Plant_ID,
o.C_BPartner_ID,
o.DatePromised,
reportLine.barcode AS barcode
FROM
C_Order_MFGWarehouse_Report report
INNER JOIN C_Order o on (report.C_Order_ID=o.C_Order_ID) AND o.isActive = 'Y'
INNER JOIN C_Order_MFGWarehouse_ReportLine reportLine on (reportLine.C_Order_MFGWarehouse_Report_ID=report.C_Order_MFGWarehouse_Report_ID)
INNER JOIN C_OrderLine ol ON (ol.C_OrderLine_ID = reportLine.C_OrderLine_ID) AND ol.isActive = 'Y'
--
LEFT OUTER JOIN C_BPartner bp ON ol.C_BPartner_ID = bp.C_BPartner_ID AND bp.isActive = 'Y'
LEFT OUTER JOIN M_HU_PI_Item_Product ip ON ol.M_HU_PI_Item_Product_ID = ip.M_HU_PI_Item_Product_ID AND ip.isActive = 'Y'
LEFT OUTER JOIN M_HU_PI_Item pii ON ip.M_HU_PI_Item_ID = pii.M_HU_PI_Item_ID AND pii.isActive = 'Y'
LEFT OUTER JOIN M_HU_PI_Item pmi ON pmi.M_HU_PI_Version_ID = pii.M_HU_PI_Version_ID AND pmi.isActive = 'Y'
AND pmi.ItemType= 'PM'
LEFT OUTER JOIN M_HU_PackingMaterial pm ON pmi.M_HU_PackingMaterial_ID = pm.M_HU_PackingMaterial_ID AND pm.isActive = 'Y'
-- Product and its translation
LEFT OUTER JOIN M_Product p ON ol.M_Product_ID = p.M_Product_ID AND p.isActive = 'Y'

LEFT OUTER JOIN C_BPartner_Product bpp ON bp.C_BPartner_ID = bpp.C_BPartner_ID AND bpp.isActive='Y'
AND p.M_Product_ID = bpp.M_Product_ID
LEFT OUTER JOIN M_Product_Category pc ON p.M_Product_Category_ID = pc.M_Product_Category_ID AND pc.isActive = 'Y'
-- Unit of measurement and its translation
LEFT OUTER JOIN C_UOM uom ON ol.C_UOM_ID = uom.C_UOM_ID AND uom.isActive = 'Y'
-- ADR Attribute
LEFT OUTER JOIN (
SELECT String_agg ( ai_value, ', ' ) AS Attributes, M_AttributeSetInstance_ID
FROM Report.fresh_Attributes
WHERE at_Value IN ( '1000015', '1000001' ) -- Marke (ADR), task 08891: also Herkunft
GROUP BY M_AttributeSetInstance_ID
) att ON ol.M_AttributeSetInstance_ID = att.M_AttributeSetInstance_ID
AND ol.M_AttributeSetInstance_ID != 0
WHERE
1=1
AND report.IsActive='Y' and reportLine.IsActive='Y'
AND pc.M_Product_Category_ID != getSysConfigAsNumeric('PackingMaterialProductCategoryID', ol.AD_Client_ID, ol.AD_Org_ID)
AND o.IsSOTrx != 'N'
AND o.DocStatus = 'CO'

/*
ORDER BY
CASE WHEN $P{c_order_id} IS NOT NULL THEN ol.line ELSE 0 END,
-- When no order document is given, sort to aggregate
p.name,
att.Attributes,
uom.UOMSymbol,
ol.Pricelist,
ol.PriceActual,
pm.name,
ip.qty
*/
;


@@ -0,0 +1 @@
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.generate_barcode_order_checkup(IN AD_Table_ID numeric, IN RECORD_ID numeric);

0 comments on commit e389071

Please sign in to comment.