IDEMPIERE-5020 Allow to show products without price in Info Product window (#957)

This commit is contained in:
Carlos Ruiz 2021-10-29 09:35:40 +02:00 committed by GitHub
parent 4e4a3d9bac
commit 180b11bd65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-5020 Allow to show products without price in Info Product window
-- Oct 28, 2021, 3:59:55 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200186,0,0,TO_DATE('2021-10-28 15:59:55','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2021-10-28 15:59:55','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','INFO_PRODUCT_SHOW_PRODUCTS_WITHOUT_PRICE','N','Show products without price in Info Product window','D','C','23e1f806-a084-4379-83ea-182dab696126')
;
SELECT register_migration_script('202110281600_IDEMPIERE-5020.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-5020 Allow to show products without price in Info Product window
-- Oct 28, 2021, 3:59:55 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200186,0,0,TO_TIMESTAMP('2021-10-28 15:59:55','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2021-10-28 15:59:55','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','INFO_PRODUCT_SHOW_PRODUCTS_WITHOUT_PRICE','N','Show products without price in Info Product window','D','C','23e1f806-a084-4379-83ea-182dab696126')
;
SELECT register_migration_script('202110281600_IDEMPIERE-5020.sql') FROM dual
;

View File

@ -44,7 +44,7 @@ public class MSysConfig extends X_AD_SysConfig
/**
*
*/
private static final long serialVersionUID = -7342115034093804064L;
private static final long serialVersionUID = -2487508787436200753L;
public static final String ADDRESS_VALIDATION = "ADDRESS_VALIDATION";
public static final String ALERT_SEND_ATTACHMENT_AS_XLS = "ALERT_SEND_ATTACHMENT_AS_XLS";
@ -106,6 +106,7 @@ public class MSysConfig extends X_AD_SysConfig
public static final String IMAGE_DB_STORAGE_SAVE_AS_ZIP = "IMAGE_DB_STORAGE_SAVE_AS_ZIP";
public static final String INFO_DEFAULTSELECTED = "INFO_DEFAULTSELECTED";
public static final String INFO_DOUBLECLICKTOGGLESSELECTION = "INFO_DOUBLECLICKTOGGLESSELECTION";
public static final String INFO_PRODUCT_SHOW_PRODUCTS_WITHOUT_PRICE = "INFO_PRODUCT_SHOW_PRODUCTS_WITHOUT_PRICE";
public static final String Invoice_ReverseUseNewNumber = "Invoice_ReverseUseNewNumber";
public static final String JASPER_SWAP_MAX_PAGES = "JASPER_SWAP_MAX_PAGES";
public static final String LASTRUN_RECORD_COUNT = "LASTRUN_RECORD_COUNT";

View File

@ -34,6 +34,7 @@ import org.adempiere.webui.util.ZKUpdateUtil;
import org.compiere.minigrid.ColumnInfo;
import org.compiere.model.MDocType;
import org.compiere.model.MRole;
import org.compiere.model.MSysConfig;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
@ -152,6 +153,11 @@ public class InfoProductWindow extends InfoWindow {
}
// IDEMPIERE-1979
prevWhereClause = where.toString();
if (MSysConfig.getBooleanValue(MSysConfig.INFO_PRODUCT_SHOW_PRODUCTS_WITHOUT_PRICE, false, Env.getAD_Client_ID(Env.getCtx()))) {
prevWhereClause = prevWhereClause.replaceAll(
"AND pr.M_PriceList_Version_ID = \\?",
"AND (pr.M_PriceList_Version_ID=? OR pr.M_PriceList_Version_ID IS NULL)");
}
return prevWhereClause;
}