diff --git a/db/ddlutils/postgresql/views/RV_STORAGE.sql b/db/ddlutils/postgresql/views/RV_STORAGE.sql index 41701a40bd..4d50d57a84 100644 --- a/db/ddlutils/postgresql/views/RV_STORAGE.sql +++ b/db/ddlutils/postgresql/views/RV_STORAGE.sql @@ -9,9 +9,9 @@ CREATE OR REPLACE VIEW RV_STORAGE AS SELECT s.AD_Client_ID, s.AD_Org_ID, -- Product - s.M_Product_ID,p.Value,p.Name,p.Description,p.UPC,p.SKU, - p.C_UOM_ID,p.M_Product_Category_ID,p.Classification, p.Weight,p.Volume,p.VersionNo, - p.GuaranteeDays,p.GuaranteeDaysMin, + s.M_Product_ID, p.Value,p.Name, p.Description, p.UPC, p.SKU, + p.C_UOM_ID, p.M_Product_Category_ID, p.Classification, p.Weight, p.Volume, p.VersionNo, + p.GuaranteeDays, p.GuaranteeDaysMin, -- Locator s.M_Locator_ID, l.M_Warehouse_ID, l.X, l.Y, l.Z, -- Storage @@ -22,7 +22,10 @@ SELECT s.AD_Client_ID, s.AD_Org_ID, asi.GuaranteeDate, -- see PAttributeInstance.java daysBetween(asi.GuaranteeDate,getdate()) AS ShelfLifeDays, daysBetween(asi.GuaranteeDate,getdate())-p.GuaranteeDaysMin AS GoodForDays, - CASE WHEN COALESCE(p.GuaranteeDays,0)>0 THEN ROUND((daysBetween(asi.GuaranteeDate,getdate())/p.GuaranteeDays)*100,0) ELSE NULL END AS ShelfLifeRemainingPct + CASE WHEN COALESCE(p.GuaranteeDays,0)>0 + THEN ROUND((daysBetween(asi.GuaranteeDate,getdate())/p.GuaranteeDays)*100,0) + ELSE NULL + END AS ShelfLifeRemainingPct FROM M_Storage s INNER JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID) INNER JOIN M_Product p ON (s.M_Product_ID=p.M_Product_ID) diff --git a/db/ddlutils/postgresql/views/RV_TRANSACTION.sql b/db/ddlutils/postgresql/views/RV_TRANSACTION.sql index 6720db2265..7724a07ae1 100644 --- a/db/ddlutils/postgresql/views/RV_TRANSACTION.sql +++ b/db/ddlutils/postgresql/views/RV_TRANSACTION.sql @@ -37,7 +37,7 @@ FROM M_Transaction t LEFT OUTER JOIN M_MovementLine ml ON (t.M_MovementLine_ID=ml.M_MovementLine_ID) LEFT OUTER JOIN M_InOutLine iol ON (t.M_InOutLine_ID=iol.M_InOutLine_ID) LEFT OUTER JOIN M_ProductionLine prdl ON (t.M_ProductionLine_ID=prdl.M_ProductionLine_ID) - LEFT OUTER JOIN M_ProductionPlan prdp ON (prdl.M_ProductionPlan_ID=prdp.M_ProductionPlan_ID) + LEFT OUTER JOIN M_ProductionPlan prdp ON (prdl.M_ProductionPlan_ID=prdp.M_ProductionPlan_ID) LEFT OUTER JOIN C_ProjectIssue pjl ON (t.C_ProjectIssue_ID=pjl.C_ProjectIssue_ID); diff --git a/db/ddlutils/postgresql/views/RV_WAREHOUSEPRICE.sql b/db/ddlutils/postgresql/views/RV_WAREHOUSEPRICE.sql index e8bee47bc6..869b13b75b 100644 --- a/db/ddlutils/postgresql/views/RV_WAREHOUSEPRICE.sql +++ b/db/ddlutils/postgresql/views/RV_WAREHOUSEPRICE.sql @@ -34,6 +34,3 @@ WHERE p.IsSummary='N' AND p.IsActive='Y' AND pr.IsActive='Y' AND w.IsActive='Y'; --AND UPPER(p.Value) LIKE ? AND UPPER(p.Name) LIKE ? --AND UPPER(p.UPC) LIKE ? AND UPPER(p.SKU) LIKE ? --ORDER BY QtyAvailable DESC, Margin DESC; - - -