From e205bb66de811201a6eb4b67b76f72430de77d81 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sun, 25 Mar 2012 21:37:57 -0500 Subject: [PATCH] IDEMPIERE-204 Add charge to Open Requisitions report http://jira.idempiere.com/browse/IDEMPIERE-204 --- db/ddlutils/oracle/views/RV_M_REQUISITION.sql | 4 +- .../postgresql/views/RV_M_REQUISITION.sql | 4 +- .../oracle/828_IDEMPIERE-204.sql | 41 +++++++++++++++++++ .../postgresql/828_IDEMPIERE-204.sql | 40 ++++++++++++++++++ 4 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 migration/360lts-release/oracle/828_IDEMPIERE-204.sql create mode 100644 migration/360lts-release/postgresql/828_IDEMPIERE-204.sql diff --git a/db/ddlutils/oracle/views/RV_M_REQUISITION.sql b/db/ddlutils/oracle/views/RV_M_REQUISITION.sql index d470af2110..8f603f0889 100644 --- a/db/ddlutils/oracle/views/RV_M_REQUISITION.sql +++ b/db/ddlutils/oracle/views/RV_M_REQUISITION.sql @@ -4,7 +4,7 @@ CREATE OR REPLACE VIEW RV_M_REQUISITION 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) + M_PRODUCT_ID, LINEDESCRIPTION, PRICEACTUAL, LINENETAMT, C_CHARGE_ID) AS SELECT r.M_Requisition_ID, r.AD_Client_ID, r.AD_Org_ID, r.IsActive, r.Created, r.CreatedBy, r.Updated, r.UpdatedBy, @@ -16,7 +16,7 @@ SELECT r.M_Requisition_ID, (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 + l.PriceActual, l.LineNetAmt, l.C_Charge_ID FROM M_Requisition r INNER JOIN M_RequisitionLine l ON (r.M_Requisition_ID=l.M_Requisition_ID); diff --git a/db/ddlutils/postgresql/views/RV_M_REQUISITION.sql b/db/ddlutils/postgresql/views/RV_M_REQUISITION.sql index d470af2110..8f603f0889 100644 --- a/db/ddlutils/postgresql/views/RV_M_REQUISITION.sql +++ b/db/ddlutils/postgresql/views/RV_M_REQUISITION.sql @@ -4,7 +4,7 @@ CREATE OR REPLACE VIEW RV_M_REQUISITION 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) + M_PRODUCT_ID, LINEDESCRIPTION, PRICEACTUAL, LINENETAMT, C_CHARGE_ID) AS SELECT r.M_Requisition_ID, r.AD_Client_ID, r.AD_Org_ID, r.IsActive, r.Created, r.CreatedBy, r.Updated, r.UpdatedBy, @@ -16,7 +16,7 @@ SELECT r.M_Requisition_ID, (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 + l.PriceActual, l.LineNetAmt, l.C_Charge_ID FROM M_Requisition r INNER JOIN M_RequisitionLine l ON (r.M_Requisition_ID=l.M_Requisition_ID); diff --git a/migration/360lts-release/oracle/828_IDEMPIERE-204.sql b/migration/360lts-release/oracle/828_IDEMPIERE-204.sql new file mode 100644 index 0000000000..b17f400dc8 --- /dev/null +++ b/migration/360lts-release/oracle/828_IDEMPIERE-204.sql @@ -0,0 +1,41 @@ +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, C_CHARGE_ID) +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, l.C_Charge_ID +FROM M_Requisition r + INNER JOIN M_RequisitionLine l ON (r.M_Requisition_ID=l.M_Requisition_ID); + + +-- Mar 22, 2012 9:47:24 AM COT +-- IDEMPIERE-204 Add charge to Open Requisitions report +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200082,711,'U',0,'N','N','N','The Charge indicates a type of Charge (Handling, Shipping, Restocking)','N',10,'N',19,'N',968,'N','N','N','C_Charge_ID','Additional document charges','Charge',100,TO_DATE('2012-03-22 09:47:22','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_DATE('2012-03-22 09:47:22','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Mar 22, 2012 9:47:24 AM COT +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=200082 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Mar 22, 2012 9:47:47 AM COT +UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2012-03-22 09:47:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200082 +; + +UPDATE AD_System + SET LastMigrationScriptApplied='828_IDEMPIERE-204.sql' +WHERE LastMigrationScriptApplied<'828_IDEMPIERE-204.sql' + OR LastMigrationScriptApplied IS NULL +; diff --git a/migration/360lts-release/postgresql/828_IDEMPIERE-204.sql b/migration/360lts-release/postgresql/828_IDEMPIERE-204.sql new file mode 100644 index 0000000000..483b03e957 --- /dev/null +++ b/migration/360lts-release/postgresql/828_IDEMPIERE-204.sql @@ -0,0 +1,40 @@ +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, C_CHARGE_ID) +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, l.C_Charge_ID +FROM M_Requisition r + INNER JOIN M_RequisitionLine l ON (r.M_Requisition_ID=l.M_Requisition_ID); + +-- Mar 22, 2012 9:47:24 AM COT +-- IDEMPIERE-204 Add charge to Open Requisitions report +INSERT INTO AD_Column (AD_Column_ID,AD_Table_ID,EntityType,Version,IsMandatory,IsTranslated,IsIdentifier,Help,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,CreatedBy,Updated,AD_Client_ID,AD_Org_ID,IsActive,Created,UpdatedBy) VALUES (200082,711,'U',0,'N','N','N','The Charge indicates a type of Charge (Handling, Shipping, Restocking)','N',10,'N',19,'N',968,'N','N','N','C_Charge_ID','Additional document charges','Charge',100,TO_TIMESTAMP('2012-03-22 09:47:22','YYYY-MM-DD HH24:MI:SS'),0,0,'Y',TO_TIMESTAMP('2012-03-22 09:47:22','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Mar 22, 2012 9:47:24 AM COT +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=200082 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) +; + +-- Mar 22, 2012 9:47:47 AM COT +UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2012-03-22 09:47:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200082 +; + +UPDATE AD_System + SET LastMigrationScriptApplied='828_IDEMPIERE-204.sql' +WHERE LastMigrationScriptApplied<'828_IDEMPIERE-204.sql' + OR LastMigrationScriptApplied IS NULL +;