From a1cef5b0fdf369d5dea85567a98f5e5b2bfea50d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Nov 2021 02:28:24 +0100 Subject: [PATCH] IDEMPIERE-2620 Customer Drop Ships not implemented (#985) * IDEMPIERE-2620 Customer Drop Ships not implemented * IDEMPIERE-2620 Customer Drop Ships not implemented / fix help * IDEMPIERE-2620 Customer Drop Ships not implemented / clear display logic in sales order In sales order the drop ship doesn't change anything important in the system behavior, is more like a printing agreement with the customer, so it doesn't make sense to restrict it just to standard orders, it can be used in any type of order --- .../oracle/views/M_INOUT_CANDIDATE_V.sql | 1 - .../postgresql/views/M_INOUT_CANDIDATE_V.sql | 1 - .../oracle/202111161449_IDEMPIERE-2620.sql | 65 +++++++++++++++++++ .../202111161449_IDEMPIERE-2620.sql | 65 +++++++++++++++++++ .../org/compiere/process/InOutGenerate.java | 1 - 5 files changed, 130 insertions(+), 3 deletions(-) create mode 100644 migration/i8.2/oracle/202111161449_IDEMPIERE-2620.sql create mode 100644 migration/i8.2/postgresql/202111161449_IDEMPIERE-2620.sql diff --git a/db/ddlutils/oracle/views/M_INOUT_CANDIDATE_V.sql b/db/ddlutils/oracle/views/M_INOUT_CANDIDATE_V.sql index af82c4ed57..245d93e9c0 100644 --- a/db/ddlutils/oracle/views/M_INOUT_CANDIDATE_V.sql +++ b/db/ddlutils/oracle/views/M_INOUT_CANDIDATE_V.sql @@ -22,7 +22,6 @@ WHERE (o.DocStatus = 'CO' AND o.IsDelivered='N') -- Status must be CO - not CL WHERE l.M_Product_ID=p.M_Product_ID AND p.IsExcludeAutoDelivery='N')) -- we need to ship AND l.QtyOrdered <> l.QtyDelivered - AND o.IsDropShip='N' AND (l.M_Product_ID IS NOT NULL OR l.C_Charge_ID IS NOT NULL) -- Not confirmed shipment AND NOT EXISTS (SELECT * FROM M_InOutLine iol diff --git a/db/ddlutils/postgresql/views/M_INOUT_CANDIDATE_V.sql b/db/ddlutils/postgresql/views/M_INOUT_CANDIDATE_V.sql index af82c4ed57..245d93e9c0 100644 --- a/db/ddlutils/postgresql/views/M_INOUT_CANDIDATE_V.sql +++ b/db/ddlutils/postgresql/views/M_INOUT_CANDIDATE_V.sql @@ -22,7 +22,6 @@ WHERE (o.DocStatus = 'CO' AND o.IsDelivered='N') -- Status must be CO - not CL WHERE l.M_Product_ID=p.M_Product_ID AND p.IsExcludeAutoDelivery='N')) -- we need to ship AND l.QtyOrdered <> l.QtyDelivered - AND o.IsDropShip='N' AND (l.M_Product_ID IS NOT NULL OR l.C_Charge_ID IS NOT NULL) -- Not confirmed shipment AND NOT EXISTS (SELECT * FROM M_InOutLine iol diff --git a/migration/i8.2/oracle/202111161449_IDEMPIERE-2620.sql b/migration/i8.2/oracle/202111161449_IDEMPIERE-2620.sql new file mode 100644 index 0000000000..90685c9c33 --- /dev/null +++ b/migration/i8.2/oracle/202111161449_IDEMPIERE-2620.sql @@ -0,0 +1,65 @@ +CREATE OR REPLACE VIEW M_INOUT_CANDIDATE_V +(AD_CLIENT_ID, AD_ORG_ID, C_BPARTNER_ID, C_ORDER_ID, DOCUMENTNO, + DATEORDERED, C_DOCTYPE_ID, POREFERENCE, DESCRIPTION, SALESREP_ID, + M_WAREHOUSE_ID, TOTALLINES) +AS +SELECT + o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID, + o.DocumentNo, o.DateOrdered, o.C_DocType_ID, + o.POReference, o.Description, o.SalesRep_ID, + l.M_Warehouse_ID, + SUM((l.QtyOrdered-l.QtyDelivered)*l.PriceActual) AS TotalLines +FROM C_Order o + INNER JOIN C_OrderLine l ON (o.C_Order_ID=l.C_Order_ID) +WHERE (o.DocStatus = 'CO' AND o.IsDelivered='N') -- Status must be CO - not CL/RE + -- not Offers and open Walkin-Receipts + AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType + WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR')) + -- Delivery Rule - not manual + AND o.DeliveryRule<>'M' + AND (l.M_Product_ID IS NULL OR EXISTS + (SELECT * FROM M_Product p + WHERE l.M_Product_ID=p.M_Product_ID AND p.IsExcludeAutoDelivery='N')) + -- we need to ship + AND l.QtyOrdered <> l.QtyDelivered + AND (l.M_Product_ID IS NOT NULL OR l.C_Charge_ID IS NOT NULL) + -- Not confirmed shipment + AND NOT EXISTS (SELECT * FROM M_InOutLine iol + INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) + WHERE iol.C_OrderLine_ID=l.C_OrderLine_ID AND io.DocStatus IN ('DR','IN','IP','WC')) + -- +GROUP BY o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID, + o.DocumentNo, o.DateOrdered, o.C_DocType_ID, + o.POReference, o.Description, o.SalesRep_ID, l.M_Warehouse_ID; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_Element SET Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.',Updated=TO_DATE('2021-11-16 15:13:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=2466 +; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_Column SET ColumnName='IsDropShip', Name='Drop Shipment', Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.', Placeholder=NULL WHERE AD_Element_ID=2466 +; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_Process_Para SET ColumnName='IsDropShip', Name='Drop Shipment', Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.', AD_Element_ID=2466 WHERE UPPER(ColumnName)='ISDROPSHIP' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_Process_Para SET ColumnName='IsDropShip', Name='Drop Shipment', Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.', Placeholder=NULL WHERE AD_Element_ID=2466 AND IsCentrallyMaintained='Y' +; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_InfoColumn SET ColumnName='IsDropShip', Name='Drop Shipment', Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.', Placeholder=NULL WHERE AD_Element_ID=2466 AND IsCentrallyMaintained='Y' +; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_Field SET Name='Drop Shipment', Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.', Placeholder=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=2466) AND IsCentrallyMaintained='Y' +; + +-- Nov 16, 2021, 3:51:54 PM CET +UPDATE AD_Field SET DisplayLogic=NULL, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2021-11-16 15:51:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10124 +; + +SELECT register_migration_script('202111161449_IDEMPIERE-2620.sql') FROM dual +; + diff --git a/migration/i8.2/postgresql/202111161449_IDEMPIERE-2620.sql b/migration/i8.2/postgresql/202111161449_IDEMPIERE-2620.sql new file mode 100644 index 0000000000..35915c9bc7 --- /dev/null +++ b/migration/i8.2/postgresql/202111161449_IDEMPIERE-2620.sql @@ -0,0 +1,65 @@ +CREATE OR REPLACE VIEW M_INOUT_CANDIDATE_V +(AD_CLIENT_ID, AD_ORG_ID, C_BPARTNER_ID, C_ORDER_ID, DOCUMENTNO, + DATEORDERED, C_DOCTYPE_ID, POREFERENCE, DESCRIPTION, SALESREP_ID, + M_WAREHOUSE_ID, TOTALLINES) +AS +SELECT + o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID, + o.DocumentNo, o.DateOrdered, o.C_DocType_ID, + o.POReference, o.Description, o.SalesRep_ID, + l.M_Warehouse_ID, + SUM((l.QtyOrdered-l.QtyDelivered)*l.PriceActual) AS TotalLines +FROM C_Order o + INNER JOIN C_OrderLine l ON (o.C_Order_ID=l.C_Order_ID) +WHERE (o.DocStatus = 'CO' AND o.IsDelivered='N') -- Status must be CO - not CL/RE + -- not Offers and open Walkin-Receipts + AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType + WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR')) + -- Delivery Rule - not manual + AND o.DeliveryRule<>'M' + AND (l.M_Product_ID IS NULL OR EXISTS + (SELECT * FROM M_Product p + WHERE l.M_Product_ID=p.M_Product_ID AND p.IsExcludeAutoDelivery='N')) + -- we need to ship + AND l.QtyOrdered <> l.QtyDelivered + AND (l.M_Product_ID IS NOT NULL OR l.C_Charge_ID IS NOT NULL) + -- Not confirmed shipment + AND NOT EXISTS (SELECT * FROM M_InOutLine iol + INNER JOIN M_InOut io ON (iol.M_InOut_ID=io.M_InOut_ID) + WHERE iol.C_OrderLine_ID=l.C_OrderLine_ID AND io.DocStatus IN ('DR','IN','IP','WC')) + -- +GROUP BY o.AD_Client_ID, o.AD_Org_ID, o.C_BPartner_ID, o.C_Order_ID, + o.DocumentNo, o.DateOrdered, o.C_DocType_ID, + o.POReference, o.Description, o.SalesRep_ID, l.M_Warehouse_ID; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_Element SET Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.',Updated=TO_TIMESTAMP('2021-11-16 15:13:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=2466 +; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_Column SET ColumnName='IsDropShip', Name='Drop Shipment', Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.', Placeholder=NULL WHERE AD_Element_ID=2466 +; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_Process_Para SET ColumnName='IsDropShip', Name='Drop Shipment', Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.', AD_Element_ID=2466 WHERE UPPER(ColumnName)='ISDROPSHIP' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_Process_Para SET ColumnName='IsDropShip', Name='Drop Shipment', Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.', Placeholder=NULL WHERE AD_Element_ID=2466 AND IsCentrallyMaintained='Y' +; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_InfoColumn SET ColumnName='IsDropShip', Name='Drop Shipment', Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.', Placeholder=NULL WHERE AD_Element_ID=2466 AND IsCentrallyMaintained='Y' +; + +-- Nov 16, 2021, 3:13:12 PM CET +UPDATE AD_Field SET Name='Drop Shipment', Description='Drop Shipments are sent directly to the Drop Shipment Location', Help='Drop Shipments are sent directly to the Drop Shipment Location using the Drop Ship Business Partner name and contact.', Placeholder=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=2466) AND IsCentrallyMaintained='Y' +; + +-- Nov 16, 2021, 3:51:54 PM CET +UPDATE AD_Field SET DisplayLogic=NULL, AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-11-16 15:51:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10124 +; + +SELECT register_migration_script('202111161449_IDEMPIERE-2620.sql') FROM dual +; + diff --git a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java index 69cc01f6a8..12011dd63b 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java @@ -161,7 +161,6 @@ public class InOutGenerate extends SvrProcess // No Offer,POS .append(" AND o.C_DocType_ID IN (SELECT C_DocType_ID FROM C_DocType ") .append("WHERE DocBaseType='SOO' AND DocSubTypeSO NOT IN ('ON','OB','WR'))") - .append(" AND o.IsDropShip='N'") // No Manual .append(" AND o.DeliveryRule<>'M'") // Open Order Lines with Warehouse