From b148b488fa2488424fb5e6795bdf64e73f5eae41 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 12 Dec 2012 09:02:41 -0500 Subject: [PATCH] IDEMPIERE-448 Add CopyFrom on Bank Statement / Peer review --- .../oracle/201212120818_IDEMPIERE-448.sql | 28 ++++--------------- .../postgresql/201212120818_IDEMPIERE-448.sql | 28 ++++--------------- .../compiere/process/CopyFromBankStmt.java | 17 +++++------ 3 files changed, 21 insertions(+), 52 deletions(-) diff --git a/migration/i1.0a-release/oracle/201212120818_IDEMPIERE-448.sql b/migration/i1.0a-release/oracle/201212120818_IDEMPIERE-448.sql index e8958432fd..540f03d2a0 100644 --- a/migration/i1.0a-release/oracle/201212120818_IDEMPIERE-448.sql +++ b/migration/i1.0a-release/oracle/201212120818_IDEMPIERE-448.sql @@ -1,107 +1,91 @@ -- Oct 4, 2012 1:29:34 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal +-- IDEMPIERE-448 Add CopyFrom on Bank Statement INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AccessLevel,Classname,CopyFromProcess,Created,CreatedBy,Description,EntityType,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,200012,'1','org.compiere.process.CopyFromBankStmt','N',TO_DATE('2012-10-04 13:29:33','YYYY-MM-DD HH24:MI:SS'),100,'Copy Lines from other bank statement','D','Y','N','N','N','N','Copy Lines','Y',0,0,TO_DATE('2012-10-04 13:29:33','YYYY-MM-DD HH24:MI:SS'),100,'C_BankStatement CopyFrom') ; -- Oct 4, 2012 1:29:35 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_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 t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=200012 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID) ; -- Oct 4, 2012 1:30:09 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,200008,'C_BankStatement.C_BankAccount_ID=@C_BankAccount_ID@',TO_DATE('2012-10-04 13:30:09','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','BankStatement of BankAccount','S',TO_DATE('2012-10-04 13:30:09','YYYY-MM-DD HH24:MI:SS'),100) ; -- Oct 4, 2012 1:30:16 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,1381,0,200012,200043,30,200008,'C_BankStatement_ID',TO_DATE('2012-10-04 13:30:16','YYYY-MM-DD HH24:MI:SS'),100,'Bank Statement of account','D',0,'The Bank Statement identifies a unique Bank Statement for a defined time period. The statement defines all transactions that occurred','Y','Y','N','Y','N','Bank Statement',10,TO_DATE('2012-10-04 13:30:16','YYYY-MM-DD HH24:MI:SS'),100) ; -- Oct 4, 2012 1:30:17 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal 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=200043 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) ; -- Oct 4, 2012 1:30:34 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,200585,2037,0,200012,28,392,'CopyFrom',TO_DATE('2012-10-04 13:30:33','YYYY-MM-DD HH24:MI:SS'),100,'N','Copy From Record','D',1,'Copy From Record','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Copy From',0,TO_DATE('2012-10-04 13:30:33','YYYY-MM-DD HH24:MI:SS'),100,0) ; -- Oct 4, 2012 1:30:34 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200585 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) ; -- Oct 4, 2012 1:30:36 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal ALTER TABLE C_BankStatement ADD CopyFrom CHAR(1) DEFAULT 'N' ; -- Oct 4, 2012 1:30:48 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,200585,200599,0,328,TO_DATE('2012-10-04 13:30:48','YYYY-MM-DD HH24:MI:SS'),100,'Copy From Record',1,'D','Copy From Record','Y','Y','Y','N','N','N','N','N','Copy From',TO_DATE('2012-10-04 13:30:48','YYYY-MM-DD HH24:MI:SS'),100) ; -- Oct 4, 2012 1:30:48 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_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_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200599 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) ; -- Oct 4, 2012 1:30:49 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,59035,200600,0,328,TO_DATE('2012-10-04 13:30:49','YYYY-MM-DD HH24:MI:SS'),100,'The date+time (expressed in decimal format) when the document has been processed',20,'D','The ProcessedOn Date+Time save the exact moment (nanoseconds precision if allowed by the DB) when a document has been processed.','Y','Y','Y','N','N','N','N','N','Processed On',TO_DATE('2012-10-04 13:30:49','YYYY-MM-DD HH24:MI:SS'),100) ; -- Oct 4, 2012 1:30:49 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_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_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200600 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200600 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=200599 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=8686 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=8687 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=10585 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=10586 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=10587 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=3999 ; -- Oct 4, 2012 1:31:11 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2012-10-04 13:31:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200599 ; +-- Dec 12, 2012 8:59:07 AM COT +UPDATE AD_Val_Rule SET Code='C_BankStatement.C_BankAccount_ID=@C_BankAccount_ID@ AND C_BankStatement.DocStatus IN (''CO'',''CL'')',Updated=TO_DATE('2012-12-12 08:59:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200008 +; + SELECT register_migration_script('201212120818_IDEMPIERE-448.sql') FROM dual -; \ No newline at end of file +; diff --git a/migration/i1.0a-release/postgresql/201212120818_IDEMPIERE-448.sql b/migration/i1.0a-release/postgresql/201212120818_IDEMPIERE-448.sql index 1a6fb88549..c89e6fea29 100644 --- a/migration/i1.0a-release/postgresql/201212120818_IDEMPIERE-448.sql +++ b/migration/i1.0a-release/postgresql/201212120818_IDEMPIERE-448.sql @@ -1,107 +1,91 @@ -- Oct 4, 2012 1:29:34 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal +-- IDEMPIERE-448 Add CopyFrom on Bank Statement INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AccessLevel,Classname,CopyFromProcess,Created,CreatedBy,Description,EntityType,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,200012,'1','org.compiere.process.CopyFromBankStmt','N',TO_TIMESTAMP('2012-10-04 13:29:33','YYYY-MM-DD HH24:MI:SS'),100,'Copy Lines from other bank statement','D','Y','N','N','N','N','Copy Lines','Y',0,0,TO_TIMESTAMP('2012-10-04 13:29:33','YYYY-MM-DD HH24:MI:SS'),100,'C_BankStatement CopyFrom') ; -- Oct 4, 2012 1:29:35 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_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 t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=200012 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID) ; -- Oct 4, 2012 1:30:09 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,200008,'C_BankStatement.C_BankAccount_ID=@C_BankAccount_ID@',TO_TIMESTAMP('2012-10-04 13:30:09','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','BankStatement of BankAccount','S',TO_TIMESTAMP('2012-10-04 13:30:09','YYYY-MM-DD HH24:MI:SS'),100) ; -- Oct 4, 2012 1:30:16 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,1381,0,200012,200043,30,200008,'C_BankStatement_ID',TO_TIMESTAMP('2012-10-04 13:30:16','YYYY-MM-DD HH24:MI:SS'),100,'Bank Statement of account','D',0,'The Bank Statement identifies a unique Bank Statement for a defined time period. The statement defines all transactions that occurred','Y','Y','N','Y','N','Bank Statement',10,TO_TIMESTAMP('2012-10-04 13:30:16','YYYY-MM-DD HH24:MI:SS'),100) ; -- Oct 4, 2012 1:30:17 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal 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=200043 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) ; -- Oct 4, 2012 1:30:34 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,200585,2037,0,200012,28,392,'CopyFrom',TO_TIMESTAMP('2012-10-04 13:30:33','YYYY-MM-DD HH24:MI:SS'),100,'N','Copy From Record','D',1,'Copy From Record','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Copy From',0,TO_TIMESTAMP('2012-10-04 13:30:33','YYYY-MM-DD HH24:MI:SS'),100,0) ; -- Oct 4, 2012 1:30:34 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200585 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID) ; -- Oct 4, 2012 1:30:36 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal ALTER TABLE C_BankStatement ADD COLUMN CopyFrom CHAR(1) DEFAULT 'N' ; -- Oct 4, 2012 1:30:48 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,200585,200599,0,328,TO_TIMESTAMP('2012-10-04 13:30:48','YYYY-MM-DD HH24:MI:SS'),100,'Copy From Record',1,'D','Copy From Record','Y','Y','Y','N','N','N','N','N','Copy From',TO_TIMESTAMP('2012-10-04 13:30:48','YYYY-MM-DD HH24:MI:SS'),100) ; -- Oct 4, 2012 1:30:48 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_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_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200599 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) ; -- Oct 4, 2012 1:30:49 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,59035,200600,0,328,TO_TIMESTAMP('2012-10-04 13:30:49','YYYY-MM-DD HH24:MI:SS'),100,'The date+time (expressed in decimal format) when the document has been processed',20,'D','The ProcessedOn Date+Time save the exact moment (nanoseconds precision if allowed by the DB) when a document has been processed.','Y','Y','Y','N','N','N','N','N','Processed On',TO_TIMESTAMP('2012-10-04 13:30:49','YYYY-MM-DD HH24:MI:SS'),100) ; -- Oct 4, 2012 1:30:49 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_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_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200600 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID) ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=200600 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=200599 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=8686 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=8687 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=10585 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=10586 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=10587 ; -- Oct 4, 2012 1:31:05 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=3999 ; -- Oct 4, 2012 1:31:11 PM CEST --- IDEMPIERE-344 - Improve usability for GL Journal UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2012-10-04 13:31:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200599 ; +-- Dec 12, 2012 8:59:07 AM COT +UPDATE AD_Val_Rule SET Code='C_BankStatement.C_BankAccount_ID=@C_BankAccount_ID@ AND C_BankStatement.DocStatus IN (''CO'',''CL'')',Updated=TO_TIMESTAMP('2012-12-12 08:59:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200008 +; + SELECT register_migration_script('201212120818_IDEMPIERE-448.sql') FROM dual -; \ No newline at end of file +; diff --git a/org.adempiere.base.process/src/org/compiere/process/CopyFromBankStmt.java b/org.adempiere.base.process/src/org/compiere/process/CopyFromBankStmt.java index e9a4fe5b0a..a117bd8214 100644 --- a/org.adempiere.base.process/src/org/compiere/process/CopyFromBankStmt.java +++ b/org.adempiere.base.process/src/org/compiere/process/CopyFromBankStmt.java @@ -22,7 +22,6 @@ import java.util.logging.Level; import org.compiere.model.MBankStatement; import org.compiere.model.MBankStatementLine; import org.compiere.model.MPayment; -import org.compiere.model.X_C_BankStatement; import org.compiere.util.DB; /** @@ -71,12 +70,12 @@ public class CopyFromBankStmt extends SvrProcess MBankStatement from = new MBankStatement(getCtx(), m_C_BankStatement_ID, get_TrxName()); MBankStatement to = new MBankStatement (getCtx(), To_C_BankStatement_ID, get_TrxName()); int no = 0; + + if ( ! (MBankStatement.DOCSTATUS_Completed.equals(from.getDocStatus()) || MBankStatement.DOCSTATUS_Closed.equals(from.getDocStatus())) ) + throw new IllegalArgumentException("Source must be closed or complete"); - MBankStatementLine[] fromLines = from.getLines(false); - for (int i = 0; i < fromLines.length; i++) + for (MBankStatementLine fromLine : from.getLines(false)) { - MBankStatementLine fromLine = fromLines[i]; - if (fromLine.getC_Payment_ID() > 0) { // check if payment is used on another statement @@ -84,16 +83,18 @@ public class CopyFromBankStmt extends SvrProcess + " FROM C_BankStatementLine bsl, C_BankStatement bs" + " WHERE bs.C_BankStatement_ID=bsl.C_BankStatement_ID" + " AND bs.DocStatus IN ('DR', 'CO', 'CL')" - + " AND bsl.C_Payment_ID="+fromLine.getC_Payment_ID(); - if (DB.getSQLValueEx(get_TrxName(), sql) == 0) + + " AND bsl.C_Payment_ID=?"; + if (DB.getSQLValueEx(get_TrxName(), sql, fromLine.getC_Payment_ID()) < 0) { MBankStatementLine toLine = new MBankStatementLine(to); toLine.setPayment(new MPayment(getCtx(), fromLine.getC_Payment_ID(), get_TrxName())); toLine.saveEx(); no++; + } else { + log.info("C_BankStatementLine not copied - related to a payment already present in a bank statement"); } } - else if (from.getDocStatus().equals(X_C_BankStatement.DOCSTATUS_Completed) || from.getDocStatus().equals(X_C_BankStatement.DOCSTATUS_Closed)) + else { MBankStatementLine toLine = new MBankStatementLine(to); toLine.setC_Currency_ID(fromLine.getC_Currency_ID());