IDEMPIERE-4837:on Product Info, only defaulting price list when window has UserPriceListInProductInfo ctx variable set. (#754)

This commit is contained in:
Deepak Pansheriya 2021-07-06 00:57:41 +05:30 committed by GitHub
parent 458a12fda0
commit 72ba9fd9d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 4 deletions

View File

@ -0,0 +1,19 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jun 30, 2021, 4:57:03 PM IST
--All window having following table should hae priceList defaulted
--C_Order = 259
--I_Order = 591
--I_Invoice = 598
--C_Project = 203
--C_Invoice = 318
--M_Requisition = 702
UPDATE AD_Window SET PredefinedContextVariables='UsePriceListInProductInfo=Y',Updated=TO_DATE('2021-06-30 16:57:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100
WHERE AD_Window_ID in (Select w.ad_window_ID from AD_Window w inner join AD_Tab tb on (w.AD_Window_ID=tb.AD_Window_ID)
WHERE tb.AD_Table_ID in (259,591,598,203,318,702))
;
SELECT register_migration_script('202106301804_IDEMPIERE-4837.sql') FROM dual
;

View File

@ -0,0 +1,16 @@
--Adding UsePriceListInProductInfo ctx variable on window
-- Jun 30, 2021, 4:57:03 PM IST
--All window having following table should hae priceList defaulted
--C_Order = 259
--I_Order = 591
--I_Invoice = 598
--C_Project = 203
--C_Invoice = 318
--M_Requisition = 702
UPDATE AD_Window SET PredefinedContextVariables='UsePriceListInProductInfo=Y',Updated=TO_TIMESTAMP('2021-06-30 16:57:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100
WHERE AD_Window_ID in (Select w.ad_window_ID from AD_Window w inner join AD_Tab tb on (w.AD_Window_ID=tb.AD_Window_ID)
WHERE tb.AD_Table_ID in (259,591,598,203,318,702))
;
SELECT register_migration_script('202106301804_IDEMPIERE-4837.sql') FROM dual
;

View File

@ -2091,7 +2091,7 @@ public final class Env
/** New Line */ /** New Line */
public static final String NL = System.getProperty("line.separator"); public static final String NL = System.getProperty("line.separator");
/* Prefix for predefined context variables coming from menu or window definition */ /* Prefix for predefined context variables coming from menu or window definition */
private static final String PREFIX_PREDEFINED_VARIABLE = "+"; public static final String PREFIX_PREDEFINED_VARIABLE = "+";
/** /**

View File

@ -443,9 +443,15 @@ public class InfoProductWindow extends InfoWindow {
@Override @Override
protected void initParameters() { protected void initParameters() {
int M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "M_Warehouse_ID"); int M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "M_Warehouse_ID");
int M_PriceList_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "M_PriceList_ID");
String usePriceList=Env.getContext(Env.getCtx(), p_WindowNo, Env.PREFIX_PREDEFINED_VARIABLE+"UsePriceListInProductInfo");
int M_PriceList_Version_ID = findPLV (M_PriceList_ID); int M_PriceList_Version_ID = 0;
if ("Y".equalsIgnoreCase(usePriceList))
{
int M_PriceList_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "M_PriceList_ID");
M_PriceList_Version_ID = findPLV(M_PriceList_ID);
}
// Set Warehouse // Set Warehouse
if (M_Warehouse_ID == 0) if (M_Warehouse_ID == 0)
M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), Env.M_WAREHOUSE_ID); M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), Env.M_WAREHOUSE_ID);