diff --git a/base/src/org/compiere/process/AllocationReset.java b/base/src/org/compiere/process/AllocationReset.java index 07c80dbbac..4306e57c11 100644 --- a/base/src/org/compiere/process/AllocationReset.java +++ b/base/src/org/compiere/process/AllocationReset.java @@ -22,8 +22,10 @@ import java.sql.Timestamp; import java.util.logging.Level; import org.compiere.model.MAllocationHdr; +import org.compiere.util.AdempiereUserError; import org.compiere.util.DB; import org.compiere.util.Env; +import org.compiere.util.Msg; import org.compiere.util.Trx; /** @@ -44,6 +46,8 @@ public class AllocationReset extends SvrProcess private Timestamp p_DateAcct_To = null; /** Allocation directly */ private int p_C_AllocationHdr_ID = 0; + /** All Allocations */ + private boolean p_AllAllocations = false; /** Transaction */ private Trx m_trx = null; @@ -70,6 +74,8 @@ public class AllocationReset extends SvrProcess p_DateAcct_From = (Timestamp)para[i].getParameter(); p_DateAcct_To = (Timestamp)para[i].getParameter_To(); } + else if (name.equals("AllAllocations")) + p_AllAllocations = "Y".equals(para[i].getParameter()); else log.log(Level.SEVERE, "Unknown Parameter: " + name); } @@ -84,7 +90,11 @@ public class AllocationReset extends SvrProcess { log.info ("C_BP_Group_ID=" + p_C_BP_Group_ID + ", C_BPartner_ID=" + p_C_BPartner_ID + ", DateAcct= " + p_DateAcct_From + " - " + p_DateAcct_To - + ", C_AllocationHdr_ID=" + p_C_AllocationHdr_ID); + + ", C_AllocationHdr_ID=" + p_C_AllocationHdr_ID + + ", AllAllocations=" + p_AllAllocations); + + if (p_C_AllocationHdr_ID == 0 && ! p_AllAllocations) + throw new AdempiereUserError(Msg.parseTranslation(getCtx(), "@Mandatory@: @C_AllocationHdr_ID@")); m_trx = Trx.get(Trx.createTrxName("AllocReset"), true); int count = 0; diff --git a/migration/354a-trunk/oracle/645_BF2873784_BadDefaults.sql b/migration/354a-trunk/oracle/645_BF2873784_BadDefaults.sql new file mode 100644 index 0000000000..f1ea8b3eb0 --- /dev/null +++ b/migration/354a-trunk/oracle/645_BF2873784_BadDefaults.sql @@ -0,0 +1,25 @@ +-- Dec 14, 2009 5:36:58 PM COT +-- FR2873784_bad defaults +UPDATE AD_Process_Para SET DefaultValue='0.01',Updated=TO_DATE('2009-12-14 17:36:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=219 +; + +-- Dec 14, 2009 5:39:26 PM COT +UPDATE AD_Process_Para SET DefaultValue='-99999', DefaultValue2='99999',Updated=TO_DATE('2009-12-14 17:39:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=173 +; + +-- Dec 14, 2009 5:43:07 PM COT +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,54099,0,'AllAllocations',TO_DATE('2009-12-14 17:43:06','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','All Allocations','All Allocations',TO_DATE('2009-12-14 17:43:06','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Dec 14, 2009 5:43:07 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54099 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 14, 2009 5:44:52 PM COT +INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,DisplayLogic,EntityType,FieldLength,IsActive,IsCentrallyMaintained,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,54099,0,303,53382,20,'AllAllocations',TO_DATE('2009-12-14 17:44:52','YYYY-MM-DD HH24:MI:SS'),100,'N',NULL,'D',1,'Y','Y','Y','N','All Allocations',50,TO_DATE('2009-12-14 17:44:52','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Dec 14, 2009 5:44:52 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53382 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; + diff --git a/migration/354a-trunk/postgresql/645_BF2873784_BadDefaults.sql b/migration/354a-trunk/postgresql/645_BF2873784_BadDefaults.sql new file mode 100644 index 0000000000..78a22fd8c3 --- /dev/null +++ b/migration/354a-trunk/postgresql/645_BF2873784_BadDefaults.sql @@ -0,0 +1,25 @@ +-- Dec 14, 2009 5:36:58 PM COT +-- FR2873784_bad defaults +UPDATE AD_Process_Para SET DefaultValue='0.01',Updated=TO_TIMESTAMP('2009-12-14 17:36:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=219 +; + +-- Dec 14, 2009 5:39:26 PM COT +UPDATE AD_Process_Para SET DefaultValue='-99999', DefaultValue2='99999',Updated=TO_TIMESTAMP('2009-12-14 17:39:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=173 +; + +-- Dec 14, 2009 5:43:07 PM COT +INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,54099,0,'AllAllocations',TO_TIMESTAMP('2009-12-14 17:43:06','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','All Allocations','All Allocations',TO_TIMESTAMP('2009-12-14 17:43:06','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Dec 14, 2009 5:43:07 PM COT +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54099 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID) +; + +-- Dec 14, 2009 5:44:52 PM COT +INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,DisplayLogic,EntityType,FieldLength,IsActive,IsCentrallyMaintained,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,54099,0,303,53382,20,'AllAllocations',TO_TIMESTAMP('2009-12-14 17:44:52','YYYY-MM-DD HH24:MI:SS'),100,'N',NULL,'D',1,'Y','Y','Y','N','All Allocations',50,TO_TIMESTAMP('2009-12-14 17:44:52','YYYY-MM-DD HH24:MI:SS'),100) +; + +-- Dec 14, 2009 5:44:52 PM COT +INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=53382 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID) +; +