diff --git a/base/src/org/adempiere/model/MPromotion.java b/base/src/org/adempiere/model/MPromotion.java index e7bdd24b09..6c5e497cbd 100644 --- a/base/src/org/adempiere/model/MPromotion.java +++ b/base/src/org/adempiere/model/MPromotion.java @@ -1,10 +1,30 @@ +/****************************************************************************** + * Copyright (C) 2009 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ package org.adempiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * + * @author hengsin + * + */ public class MPromotion extends X_M_Promotion { + private static final long serialVersionUID = 5437777366112957770L; + public MPromotion(Properties ctx, int M_Promotion_ID, String trxName) { super(ctx, M_Promotion_ID, trxName); } diff --git a/base/src/org/adempiere/model/MPromotionDistribution.java b/base/src/org/adempiere/model/MPromotionDistribution.java index f538843aa3..262c4dacbc 100644 --- a/base/src/org/adempiere/model/MPromotionDistribution.java +++ b/base/src/org/adempiere/model/MPromotionDistribution.java @@ -1,10 +1,30 @@ +/****************************************************************************** + * Copyright (C) 2009 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ package org.adempiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * + * @author hengsin + * + */ public class MPromotionDistribution extends X_M_PromotionDistribution { + private static final long serialVersionUID = 1532619121257280486L; + public MPromotionDistribution(Properties ctx, int M_PromotionDistribution_ID, String trxName) { super(ctx, M_PromotionDistribution_ID, trxName); diff --git a/base/src/org/adempiere/model/MPromotionGroup.java b/base/src/org/adempiere/model/MPromotionGroup.java index 22d6376af7..7397b27409 100644 --- a/base/src/org/adempiere/model/MPromotionGroup.java +++ b/base/src/org/adempiere/model/MPromotionGroup.java @@ -1,10 +1,30 @@ +/****************************************************************************** + * Copyright (C) 2009 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ package org.adempiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * + * @author hengsin + * + */ public class MPromotionGroup extends X_M_PromotionGroup { + private static final long serialVersionUID = 4203915332775348579L; + public MPromotionGroup(Properties ctx, int M_PromotionGroup_ID, String trxName) { super(ctx, M_PromotionGroup_ID, trxName); diff --git a/base/src/org/adempiere/model/MPromotionGroupLine.java b/base/src/org/adempiere/model/MPromotionGroupLine.java index 03854dd685..60a64c4e2f 100644 --- a/base/src/org/adempiere/model/MPromotionGroupLine.java +++ b/base/src/org/adempiere/model/MPromotionGroupLine.java @@ -1,10 +1,30 @@ +/****************************************************************************** + * Copyright (C) 2009 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ package org.adempiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * + * @author hengsin + * + */ public class MPromotionGroupLine extends X_M_PromotionGroupLine { + private static final long serialVersionUID = -3945719908086926013L; + public MPromotionGroupLine(Properties ctx, int M_PromotionGroupLine_ID, String trxName) { super(ctx, M_PromotionGroupLine_ID, trxName); diff --git a/base/src/org/adempiere/model/MPromotionLine.java b/base/src/org/adempiere/model/MPromotionLine.java index 4a92771d75..8a0f00a3b3 100644 --- a/base/src/org/adempiere/model/MPromotionLine.java +++ b/base/src/org/adempiere/model/MPromotionLine.java @@ -1,3 +1,16 @@ +/****************************************************************************** + * Copyright (C) 2009 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ package org.adempiere.model; import java.sql.ResultSet; @@ -5,6 +18,8 @@ import java.util.Properties; public class MPromotionLine extends X_M_PromotionLine { + private static final long serialVersionUID = -8284722914757724765L; + public MPromotionLine(Properties ctx, int M_PromotionLine_ID, String trxName) { super(ctx, M_PromotionLine_ID, trxName); } diff --git a/base/src/org/adempiere/model/MPromotionPreCondition.java b/base/src/org/adempiere/model/MPromotionPreCondition.java index bef3b60adf..58e69ba1c0 100644 --- a/base/src/org/adempiere/model/MPromotionPreCondition.java +++ b/base/src/org/adempiere/model/MPromotionPreCondition.java @@ -1,10 +1,30 @@ +/****************************************************************************** + * Copyright (C) 2009 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ package org.adempiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * + * @author hengsin + * + */ public class MPromotionPreCondition extends X_M_PromotionPreCondition { + private static final long serialVersionUID = 7344556244799964804L; + public MPromotionPreCondition(Properties ctx, int M_PromotionPreCondition_ID, String trxName) { super(ctx, M_PromotionPreCondition_ID, trxName); diff --git a/base/src/org/adempiere/model/MPromotionReward.java b/base/src/org/adempiere/model/MPromotionReward.java index 420cef2b27..a7081d179e 100644 --- a/base/src/org/adempiere/model/MPromotionReward.java +++ b/base/src/org/adempiere/model/MPromotionReward.java @@ -1,10 +1,30 @@ +/****************************************************************************** + * Copyright (C) 2009 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ package org.adempiere.model; import java.sql.ResultSet; import java.util.Properties; +/** + * + * @author hengsin + * + */ public class MPromotionReward extends X_M_PromotionReward { + private static final long serialVersionUID = -1466367082383341103L; + public MPromotionReward(Properties ctx, int M_PromotionReward_ID, String trxName) { super(ctx, M_PromotionReward_ID, trxName); diff --git a/base/src/org/adempiere/model/PromotionRule.java b/base/src/org/adempiere/model/PromotionRule.java index 941bfff3e5..b431218f8c 100644 --- a/base/src/org/adempiere/model/PromotionRule.java +++ b/base/src/org/adempiere/model/PromotionRule.java @@ -1,3 +1,16 @@ +/****************************************************************************** + * Copyright (C) 2009 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ package org.adempiere.model; import java.math.BigDecimal; @@ -21,6 +34,7 @@ import org.compiere.model.MOrderLine; import org.compiere.model.MTable; import org.compiere.model.Query; import org.compiere.util.DB; +import org.compiere.util.Env; /** * @@ -72,13 +86,13 @@ public class PromotionRule { OrderLineComparator olComparator = new OrderLineComparator(orderLineIndex); //distribute order lines for (Map.Entry> entry : promotions.entrySet()) { - Query query = new Query(MTable.get(order.getCtx(), I_M_PromotionDistribution.Table_ID), + Query query = new Query(Env.getCtx(), MTable.get(order.getCtx(), I_M_PromotionDistribution.Table_ID), "M_PromotionDistribution.M_Promotion_ID = ? AND M_PromotionDistribution.IsActive = 'Y'", order.get_TrxName()); query.setParameters(new Object[]{entry.getKey()}); query.setOrderBy("SeqNo"); List list = query.list(); - Query rewardQuery = new Query(MTable.get(order.getCtx(), I_M_PromotionReward.Table_ID), + Query rewardQuery = new Query(Env.getCtx(), MTable.get(order.getCtx(), I_M_PromotionReward.Table_ID), "M_PromotionReward.M_Promotion_ID = ? AND M_PromotionReward.IsActive = 'Y'", order.get_TrxName()); rewardQuery.setParameters(new Object[]{entry.getKey()}); rewardQuery.setOrderBy("SeqNo"); @@ -504,7 +518,7 @@ public class PromotionRule { * @throws SQLException */ private static List findPromotionLine(int promotion_ID, MOrder order) throws SQLException { - Query query = new Query(MTable.get(order.getCtx(), I_M_PromotionLine.Table_ID), " M_PromotionLine.M_Promotion_ID = ? AND M_PromotionLine.IsActive = 'Y'", order.get_TrxName()); + Query query = new Query(Env.getCtx(), MTable.get(order.getCtx(), I_M_PromotionLine.Table_ID), " M_PromotionLine.M_Promotion_ID = ? AND M_PromotionLine.IsActive = 'Y'", order.get_TrxName()); query.setParameters(new Object[]{promotion_ID}); Listplist = query.list(); //List diff --git a/base/src/org/adempiere/model/PromotionValidator.java b/base/src/org/adempiere/model/PromotionValidator.java index b8bd6f4c14..ee6d594858 100644 --- a/base/src/org/adempiere/model/PromotionValidator.java +++ b/base/src/org/adempiere/model/PromotionValidator.java @@ -1,3 +1,16 @@ +/****************************************************************************** + * Copyright (C) 2009 Low Heng Sin * + * Copyright (C) 2009 Idalica Corporation * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + *****************************************************************************/ package org.adempiere.model; import org.adempiere.exceptions.AdempiereException; @@ -11,6 +24,11 @@ import org.compiere.model.X_C_Order; import org.compiere.model.X_C_OrderLine; import org.compiere.util.DB; +/** + * + * @author hengsin + * + */ public class PromotionValidator implements ModelValidator { private int m_AD_Client_ID;