[ FR 2836965 ] Group1 and Group2 fields are not considered in Schema Lines (Fixed)

http://sourceforge.net/tracker/index.php?func=detail&aid=2836965&group_id=176962&atid=879335
[ FR 1871403 ] Adding new field of product into Price List Schema (Fixed)
http://sourceforge.net/tracker/index.php?func=detail&aid=1871403&group_id=176962&atid=879335
Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2836965
This commit is contained in:
mjudd 2010-02-25 13:12:33 +00:00
parent 8aaa009751
commit d4834a9372
1 changed files with 61 additions and 57 deletions

View File

@ -264,6 +264,7 @@ public class M_PriceList_Create extends SvrProcess {
+ " ,limit_addamt" + " ,limit_discount" + " ,limit_addamt" + " ,limit_discount"
+ " ,limit_rounding" + " ,limit_minamt" + " ,limit_rounding" + " ,limit_minamt"
+ " ,limit_maxamt" + " ,limit_fixed" + " ,limit_maxamt" + " ,limit_fixed"
+ " ,group1" + " ,group2"
+ " ,c_conversiontype_id" + " ,c_conversiontype_id"
+ " FROM M_DiscountSchemaLine" + " FROM M_DiscountSchemaLine"
+ " WHERE M_DiscountSchema_ID=" + " WHERE M_DiscountSchema_ID="
@ -294,8 +295,7 @@ public class M_PriceList_Create extends SvrProcess {
+ " SELECT DISTINCT " + m_AD_PInstance_ID +", po.M_Product_ID " + " SELECT DISTINCT " + m_AD_PInstance_ID +", po.M_Product_ID "
+ " FROM M_Product p, M_Product_PO po" + " FROM M_Product p, M_Product_PO po"
+ " WHERE p.M_Product_ID=po.M_Product_ID " + " WHERE p.M_Product_ID=po.M_Product_ID "
+ " AND (p.AD_Client_ID=" + " AND (p.AD_Client_ID=" + v.getInt("AD_Client_ID")
+ v.getInt("AD_Client_ID")
+ " OR p.AD_Client_ID=0)" + " OR p.AD_Client_ID=0)"
+ " AND p.IsActive='Y' AND po.IsActive='Y' AND po.IsCurrentVendor='Y' " + " AND p.IsActive='Y' AND po.IsActive='Y' AND po.IsCurrentVendor='Y' "
// //
@ -303,15 +303,16 @@ public class M_PriceList_Create extends SvrProcess {
// //
// globalqss - detected bug, JDBC returns zero for null values // globalqss - detected bug, JDBC returns zero for null values
// so we're going to use NULLIF(value, 0) // so we're going to use NULLIF(value, 0)
+ " AND (NULLIF(" + dl.getInt("M_Product_Category_ID") + " AND (NULLIF(" + dl.getInt("M_Product_Category_ID") + ",0) IS NULL"
+ ",0) IS NULL OR p.M_Product_Category_ID IN (" + " OR p.M_Product_Category_ID IN (" + getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID")) + "))"
+ getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID")) + "))" + " AND (NULLIF(" + dl.getInt("C_BPartner_ID") + ",0) IS NULL OR po.C_BPartner_ID=" + dl.getInt("C_BPartner_ID") + ")"
+ " AND (NULLIF(" + dl.getInt("C_BPartner_ID") + " AND (NULLIF(" + dl.getInt("M_Product_ID") + ",0) IS NULL OR p.M_Product_ID=" + dl.getInt("M_Product_ID") + ")";
+ ",0) IS NULL OR po.C_BPartner_ID="
+ dl.getInt("C_BPartner_ID") + ")" if (dl.getString("Group1")!=null)
+ " AND (NULLIF(" + dl.getInt("M_Product_ID") sqlins = sqlins + " AND (p.Group1=('" + dl.getString("Group1") + "'))";
+ ",0) IS NULL OR p.M_Product_ID=" if (dl.getString("Group2")!=null)
+ dl.getInt("M_Product_ID") + ")"; sqlins = sqlins + " AND (p.Group2=('" + dl.getString("Group2") + "'))";
cnti = DB.executeUpdate(sqlins, get_TrxName()); cnti = DB.executeUpdate(sqlins, get_TrxName());
if (cnti == -1) if (cnti == -1)
raiseError(" INSERT INTO T_Selection ", sqlins); raiseError(" INSERT INTO T_Selection ", sqlins);
@ -326,17 +327,14 @@ public class M_PriceList_Create extends SvrProcess {
+ " SELECT DISTINCT " + m_AD_PInstance_ID +", p.M_Product_ID" + " SELECT DISTINCT " + m_AD_PInstance_ID +", p.M_Product_ID"
+ " FROM M_Product p, M_ProductPrice pp" + " FROM M_Product p, M_ProductPrice pp"
+ " WHERE p.M_Product_ID=pp.M_Product_ID" + " WHERE p.M_Product_ID=pp.M_Product_ID"
+ " AND pp.M_PriceList_Version_ID = " + " AND pp.M_PriceList_Version_ID = " + v.getInt("M_PriceList_Version_Base_ID")
+ v.getInt("M_PriceList_Version_Base_ID")
+ " AND p.IsActive='Y' AND pp.IsActive='Y'" + " AND p.IsActive='Y' AND pp.IsActive='Y'"
// //
//Optional Restrictions //Optional Restrictions
// //
+ " AND (NULLIF(" + dl.getInt("M_Product_Category_ID") + " AND (NULLIF(" + dl.getInt("M_Product_Category_ID") + ",0) IS NULL"
+ ",0) IS NULL OR p.M_Product_Category_ID IN (" + " OR p.M_Product_Category_ID IN (" + getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID")) + "))"
+ getSubCategoryWhereClause(dl.getInt("M_Product_Category_ID")) + "))" + " AND (NULLIF(" + dl.getInt("C_BPartner_ID") + ",0) IS NULL OR EXISTS "
+ " AND (NULLIF(" + dl.getInt("C_BPartner_ID")
+ ",0) IS NULL OR EXISTS "
+ "(SELECT m_product_id" + "(SELECT m_product_id"
+ ",c_bpartner_id" + ",c_bpartner_id"
+ ",ad_client_id" + ",ad_client_id"
@ -366,11 +364,17 @@ public class M_PriceList_Create extends SvrProcess {
+ ",deliverytime_actual" + ",deliverytime_actual"
+ ",qualityrating" + ",qualityrating"
+ ",royaltyamt" + ",royaltyamt"
+ " , manufacturer FROM M_Product_PO po WHERE po.M_Product_ID=p.M_Product_ID AND po.C_BPartner_ID=" + ",group1"
+ dl.getInt("C_BPartner_ID") + "))" + ",group2"
+ " AND (NULLIF(" + dl.getInt("M_Product_ID") + ",manufacturer FROM M_Product_PO po WHERE po.M_Product_ID=p.M_Product_ID"
+ ",0) IS NULL OR p.M_Product_ID=" + " AND po.C_BPartner_ID=" + dl.getInt("C_BPartner_ID") + "))"
+ dl.getInt("M_Product_ID") + ")"; + " AND (NULLIF(" + dl.getInt("M_Product_ID") + ",0) IS NULL OR p.M_Product_ID=" + dl.getInt("M_Product_ID") + ")";
if (dl.getString("Group1")!=null)
sqlins = sqlins + " AND (p.Group1=('" + dl.getString("Group1") + "'))";
if (dl.getString("Group2")!=null)
sqlins = sqlins + " AND (p.Group2=('" + dl.getString("Group2") + "'))";
cnti = DB.executeUpdate(sqlins, get_TrxName()); cnti = DB.executeUpdate(sqlins, get_TrxName());
if (cnti == -1) if (cnti == -1)
raiseError( raiseError(