diff --git a/migration/iD10/oracle/202305271307_IDEMPIERE-5687.sql b/migration/iD10/oracle/202305271307_IDEMPIERE-5687.sql new file mode 100644 index 0000000000..bcb1220d6c --- /dev/null +++ b/migration/iD10/oracle/202305271307_IDEMPIERE-5687.sql @@ -0,0 +1,18 @@ +-- IDEMPIERE-5687 Base Price List +SELECT register_migration_script('202305271307_IDEMPIERE-5687.sql') FROM dual; + +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- May 27, 2023, 1:07:01 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=50, XPosition=1,Updated=TO_TIMESTAMP('2023-05-27 13:07:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3316 +; + +-- May 27, 2023, 1:07:01 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=120, XPosition=5,Updated=TO_TIMESTAMP('2023-05-27 13:07:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1175 +; + +-- May 27, 2023, 1:07:01 PM CEST +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2023-05-27 13:07:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204933 +; + diff --git a/migration/iD10/postgresql/202305271307_IDEMPIERE-5687.sql b/migration/iD10/postgresql/202305271307_IDEMPIERE-5687.sql new file mode 100644 index 0000000000..f8cfe4202a --- /dev/null +++ b/migration/iD10/postgresql/202305271307_IDEMPIERE-5687.sql @@ -0,0 +1,15 @@ +-- IDEMPIERE-5687 Base Price List +SELECT register_migration_script('202305271307_IDEMPIERE-5687.sql') FROM dual; + +-- May 27, 2023, 1:07:01 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=50, XPosition=1,Updated=TO_TIMESTAMP('2023-05-27 13:07:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3316 +; + +-- May 27, 2023, 1:07:01 PM CEST +UPDATE AD_Field SET IsDisplayed='Y', SeqNo=120, XPosition=5,Updated=TO_TIMESTAMP('2023-05-27 13:07:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1175 +; + +-- May 27, 2023, 1:07:01 PM CEST +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2023-05-27 13:07:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204933 +; + diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutTimeExpense.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutTimeExpense.java index 9bd9bbff65..a8e7893f87 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutTimeExpense.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutTimeExpense.java @@ -76,6 +76,7 @@ public class CalloutTimeExpense extends CalloutEngine + " AND pp.M_PriceList_Version_ID=pv.M_PriceList_Version_ID" + " AND pv.M_PriceList_ID=pl.M_PriceList_ID" + " AND pv.IsActive='Y'" + + " AND pp.IsActive='Y'" + " AND p.M_Product_ID=?" // 1 + " AND pl.M_PriceList_ID=?" // 2 + " ORDER BY pv.ValidFrom DESC"; @@ -117,6 +118,7 @@ public class CalloutTimeExpense extends CalloutEngine + " AND pp.M_PriceList_Version_ID=pv.M_PriceList_Version_ID" + " AND pv.M_PriceList_ID=bpl.M_PriceList_ID" + " AND pv.IsActive='Y'" + + " AND pp.IsActive='Y'" + " AND bpl.M_PriceList_ID=pl.BasePriceList_ID" // Base + " AND p.M_Product_ID=?" // 1 + " AND pl.M_PriceList_ID=?" // 2 diff --git a/org.adempiere.base/src/org/compiere/model/MProductPricing.java b/org.adempiere.base/src/org/compiere/model/MProductPricing.java index 366636c806..ad4ae081ce 100644 --- a/org.adempiere.base/src/org/compiere/model/MProductPricing.java +++ b/org.adempiere.base/src/org/compiere/model/MProductPricing.java @@ -80,7 +80,7 @@ public class MProductPricing extends AbstractProductPricing private void checkVendorBreak() { int thereAreVendorBreakRecords = DB.getSQLValue(trxName, - "SELECT count(M_Product_ID) FROM M_ProductPriceVendorBreak WHERE M_Product_ID=? AND (C_BPartner_ID=? OR C_BPartner_ID is NULL)", + "SELECT COUNT(M_Product_ID) FROM M_ProductPriceVendorBreak WHERE IsActive='Y' AND M_Product_ID=? AND (C_BPartner_ID=? OR C_BPartner_ID IS NULL)", m_M_Product_ID, m_C_BPartner_ID); m_useVendorBreak = thereAreVendorBreakRecords > 0; }