From d18757a1e505c0d7ad7af53abdb4bc6c31826892 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Mon, 24 Aug 2009 13:03:33 +0000 Subject: [PATCH] BF [ 2843522 ] Open Requisitions report is showing all requisitions https://sourceforge.net/tracker/?func=detail&aid=2843522&group_id=176962&atid=879332 * Introduced RV_M_REQUISITION.QtyOrdered field which is equal with M_RequisitionLine.Qty if the C_orderLIne_ID is filled --- db/ddlutils/oracle/views/RV_M_REQUISITION.sql | 8 ++-- .../postgresql/views/RV_M_REQUISITION.sql | 8 ++-- migration/353a-trunk/oracle/538_BF2843522.sql | 39 ++++++++++++++++++ .../353a-trunk/postgresql/538_BF2843522.sql | 40 +++++++++++++++++++ 4 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 migration/353a-trunk/oracle/538_BF2843522.sql create mode 100644 migration/353a-trunk/postgresql/538_BF2843522.sql diff --git a/db/ddlutils/oracle/views/RV_M_REQUISITION.sql b/db/ddlutils/oracle/views/RV_M_REQUISITION.sql index 6baa98a918..d470af2110 100644 --- a/db/ddlutils/oracle/views/RV_M_REQUISITION.sql +++ b/db/ddlutils/oracle/views/RV_M_REQUISITION.sql @@ -3,8 +3,8 @@ CREATE OR REPLACE VIEW RV_M_REQUISITION CREATEDBY, UPDATED, UPDATEDBY, DOCUMENTNO, DESCRIPTION, HELP, AD_USER_ID, M_PRICELIST_ID, M_WAREHOUSE_ID, ISAPPROVED, PRIORITYRULE, DATEREQUIRED, TOTALLINES, DOCACTION, DOCSTATUS, - PROCESSED, M_REQUISITIONLINE_ID, LINE, QTY, M_PRODUCT_ID, - LINEDESCRIPTION, PRICEACTUAL, LINENETAMT) + PROCESSED, M_REQUISITIONLINE_ID, LINE, QTY, QTYORDERED, + M_PRODUCT_ID, LINEDESCRIPTION, PRICEACTUAL, LINENETAMT) AS SELECT r.M_Requisition_ID, r.AD_Client_ID, r.AD_Org_ID, r.IsActive, r.Created, r.CreatedBy, r.Updated, r.UpdatedBy, @@ -12,7 +12,9 @@ SELECT r.M_Requisition_ID, r.AD_User_ID, r.M_PriceList_ID, r.M_Warehouse_ID, r.IsApproved, r.PriorityRule, r.DateRequired, r.TotalLines, r.DocAction, r.DocStatus, r.Processed, l.M_RequisitionLine_ID, l.Line, - l.Qty, l.M_Product_ID, + l.Qty, + (CASE WHEN l.C_OrderLine_ID IS NOT NULL THEN l.Qty ELSE 0 END) AS QtyOrdered, + l.M_Product_ID, l.Description AS LineDescription, l.PriceActual, l.LineNetAmt FROM M_Requisition r diff --git a/db/ddlutils/postgresql/views/RV_M_REQUISITION.sql b/db/ddlutils/postgresql/views/RV_M_REQUISITION.sql index 6baa98a918..d470af2110 100644 --- a/db/ddlutils/postgresql/views/RV_M_REQUISITION.sql +++ b/db/ddlutils/postgresql/views/RV_M_REQUISITION.sql @@ -3,8 +3,8 @@ CREATE OR REPLACE VIEW RV_M_REQUISITION CREATEDBY, UPDATED, UPDATEDBY, DOCUMENTNO, DESCRIPTION, HELP, AD_USER_ID, M_PRICELIST_ID, M_WAREHOUSE_ID, ISAPPROVED, PRIORITYRULE, DATEREQUIRED, TOTALLINES, DOCACTION, DOCSTATUS, - PROCESSED, M_REQUISITIONLINE_ID, LINE, QTY, M_PRODUCT_ID, - LINEDESCRIPTION, PRICEACTUAL, LINENETAMT) + PROCESSED, M_REQUISITIONLINE_ID, LINE, QTY, QTYORDERED, + M_PRODUCT_ID, LINEDESCRIPTION, PRICEACTUAL, LINENETAMT) AS SELECT r.M_Requisition_ID, r.AD_Client_ID, r.AD_Org_ID, r.IsActive, r.Created, r.CreatedBy, r.Updated, r.UpdatedBy, @@ -12,7 +12,9 @@ SELECT r.M_Requisition_ID, r.AD_User_ID, r.M_PriceList_ID, r.M_Warehouse_ID, r.IsApproved, r.PriorityRule, r.DateRequired, r.TotalLines, r.DocAction, r.DocStatus, r.Processed, l.M_RequisitionLine_ID, l.Line, - l.Qty, l.M_Product_ID, + l.Qty, + (CASE WHEN l.C_OrderLine_ID IS NOT NULL THEN l.Qty ELSE 0 END) AS QtyOrdered, + l.M_Product_ID, l.Description AS LineDescription, l.PriceActual, l.LineNetAmt FROM M_Requisition r diff --git a/migration/353a-trunk/oracle/538_BF2843522.sql b/migration/353a-trunk/oracle/538_BF2843522.sql new file mode 100644 index 0000000000..b8dec2e05c --- /dev/null +++ b/migration/353a-trunk/oracle/538_BF2843522.sql @@ -0,0 +1,39 @@ +CREATE OR REPLACE VIEW RV_M_REQUISITION +(M_REQUISITION_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, + CREATEDBY, UPDATED, UPDATEDBY, DOCUMENTNO, DESCRIPTION, + HELP, AD_USER_ID, M_PRICELIST_ID, M_WAREHOUSE_ID, ISAPPROVED, + PRIORITYRULE, DATEREQUIRED, TOTALLINES, DOCACTION, DOCSTATUS, + PROCESSED, M_REQUISITIONLINE_ID, LINE, QTY, QTYORDERED, + M_PRODUCT_ID, LINEDESCRIPTION, PRICEACTUAL, LINENETAMT) +AS +SELECT r.M_Requisition_ID, + r.AD_Client_ID, r.AD_Org_ID, r.IsActive, r.Created, r.CreatedBy, r.Updated, r.UpdatedBy, + r.DocumentNo, r.Description, r.Help, + r.AD_User_ID, r.M_PriceList_ID, r.M_Warehouse_ID, r.IsApproved, r.PriorityRule, + r.DateRequired, r.TotalLines, r.DocAction, r.DocStatus, r.Processed, + l.M_RequisitionLine_ID, l.Line, + l.Qty, + (CASE WHEN l.C_OrderLine_ID IS NOT NULL THEN l.Qty ELSE 0 END) AS QtyOrdered, + l.M_Product_ID, + l.Description AS LineDescription, + l.PriceActual, l.LineNetAmt +FROM M_Requisition r + INNER JOIN M_RequisitionLine l ON (r.M_Requisition_ID=l.M_Requisition_ID); + + + +-- 24.08.2009 15:49:41 EEST +-- Requisition Improvements +INSERT INTO AD_Column (AD_Column_ID,IsParent,AD_Client_ID,AD_Org_ID,AD_Table_ID,Help,FieldLength,Created,CreatedBy,Updated,Version,IsActive,Description,ColumnName,IsKey,AD_Reference_ID,IsTranslated,IsMandatory,IsIdentifier,IsSelectionColumn,AD_Element_ID,IsUpdateable,EntityType,Name,UpdatedBy,IsAlwaysUpdateable,IsEncrypted) VALUES (57956,'N',0,0,711,'The Ordered Quantity indicates the quantity of a product that was ordered.',22,TO_DATE('2009-08-24 15:49:39','YYYY-MM-DD HH24:MI:SS'),0,TO_DATE('2009-08-24 15:49:39','YYYY-MM-DD HH24:MI:SS'),0,'Y','Ordered Quantity','QtyOrdered','N',29,'N','N','N','N',531,'N','D','Ordered Quantity',0,'N','N') +; + +-- 24.08.2009 15:49:42 EEST +-- Requisition Improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57956 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- 24.08.2009 15:50:36 EEST +-- Requisition Improvements +UPDATE AD_ReportView SET WhereClause='Qty<>QtyOrdered',Updated=TO_DATE('2009-08-24 15:50:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_ReportView_ID=146 +; + diff --git a/migration/353a-trunk/postgresql/538_BF2843522.sql b/migration/353a-trunk/postgresql/538_BF2843522.sql new file mode 100644 index 0000000000..a97a1def94 --- /dev/null +++ b/migration/353a-trunk/postgresql/538_BF2843522.sql @@ -0,0 +1,40 @@ +DROP VIEW RV_M_REQUISITION; +CREATE OR REPLACE VIEW RV_M_REQUISITION +(M_REQUISITION_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, + CREATEDBY, UPDATED, UPDATEDBY, DOCUMENTNO, DESCRIPTION, + HELP, AD_USER_ID, M_PRICELIST_ID, M_WAREHOUSE_ID, ISAPPROVED, + PRIORITYRULE, DATEREQUIRED, TOTALLINES, DOCACTION, DOCSTATUS, + PROCESSED, M_REQUISITIONLINE_ID, LINE, QTY, QTYORDERED, + M_PRODUCT_ID, LINEDESCRIPTION, PRICEACTUAL, LINENETAMT) +AS +SELECT r.M_Requisition_ID, + r.AD_Client_ID, r.AD_Org_ID, r.IsActive, r.Created, r.CreatedBy, r.Updated, r.UpdatedBy, + r.DocumentNo, r.Description, r.Help, + r.AD_User_ID, r.M_PriceList_ID, r.M_Warehouse_ID, r.IsApproved, r.PriorityRule, + r.DateRequired, r.TotalLines, r.DocAction, r.DocStatus, r.Processed, + l.M_RequisitionLine_ID, l.Line, + l.Qty, + (CASE WHEN l.C_OrderLine_ID IS NOT NULL THEN l.Qty ELSE 0 END) AS QtyOrdered, + l.M_Product_ID, + l.Description AS LineDescription, + l.PriceActual, l.LineNetAmt +FROM M_Requisition r + INNER JOIN M_RequisitionLine l ON (r.M_Requisition_ID=l.M_Requisition_ID); + + + +-- 24.08.2009 15:49:41 EEST +-- Requisition Improvements +INSERT INTO AD_Column (AD_Column_ID,IsParent,AD_Client_ID,AD_Org_ID,AD_Table_ID,Help,FieldLength,Created,CreatedBy,Updated,Version,IsActive,Description,ColumnName,IsKey,AD_Reference_ID,IsTranslated,IsMandatory,IsIdentifier,IsSelectionColumn,AD_Element_ID,IsUpdateable,EntityType,Name,UpdatedBy,IsAlwaysUpdateable,IsEncrypted) VALUES (57956,'N',0,0,711,'The Ordered Quantity indicates the quantity of a product that was ordered.',22,TO_TIMESTAMP('2009-08-24 15:49:39','YYYY-MM-DD HH24:MI:SS'),0,TO_TIMESTAMP('2009-08-24 15:49:39','YYYY-MM-DD HH24:MI:SS'),0,'Y','Ordered Quantity','QtyOrdered','N',29,'N','N','N','N',531,'N','D','Ordered Quantity',0,'N','N') +; + +-- 24.08.2009 15:49:42 EEST +-- Requisition Improvements +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57956 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) +; + +-- 24.08.2009 15:50:36 EEST +-- Requisition Improvements +UPDATE AD_ReportView SET WhereClause='Qty<>QtyOrdered',Updated=TO_TIMESTAMP('2009-08-24 15:50:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_ReportView_ID=146 +; +