diff --git a/migration/i1.0a-release/oracle/201203121619_IDEMPIERE-726.sql b/migration/i1.0a-release/oracle/201203121619_IDEMPIERE-726.sql new file mode 100644 index 0000000000..55480a53b7 --- /dev/null +++ b/migration/i1.0a-release/oracle/201203121619_IDEMPIERE-726.sql @@ -0,0 +1,138 @@ +-- Mar 12, 2013 11:23:29 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsInverseDebitCreditOnly',202295,'D','Inverse Operation for Debit/Credit Only Column','Apply inverse operation to debit or credit only column','Inverse Operation for Debit/Credit Only Column','582bb9ba-18fe-44d5-a1c7-35c4b0abc922',0,TO_DATE('2013-03-12 23:23:27','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2013-03-12 23:23:27','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Mar 12, 2013 11:23:29 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=202295 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) +; + +-- Mar 12, 2013 11:24:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable,IsEncrypted) VALUES (0,'N',1,448,208803,'U','Y','N','N',0,'N',1,'N',20,'N',202295,'N','Y','e70f17d5-2b1e-4062-b1ce-72c931a403cb','Y','IsInverseDebitCreditOnly','Apply inverse operation to debit or credit only column','N','Inverse Operation for Debit/Credit Only Column','Y',TO_DATE('2013-03-12 23:24:04','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2013-03-12 23:24:04','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N','N') +; + +-- Mar 12, 2013 11:24:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=208803 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) +; + +-- Mar 12, 2013 11:24:15 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +ALTER TABLE PA_ReportLine ADD IsInverseDebitCreditOnly CHAR(1) DEFAULT 'N' CHECK (IsInverseDebitCreditOnly IN ('Y','N')) NOT NULL +; + +-- Mar 12, 2013 11:25:01 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Preference SET Value='Y',Updated=TO_DATE('2013-03-12 23:25:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Preference_ID=200000 +; + +-- Mar 12, 2013 11:25:42 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Field (ColumnSpan,NumLines,SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry) VALUES (3,1,0,'N',376,0,'N','N',208803,195,'Y',201872,'N','D','Apply inverse operation to debit or credit only column','Inverse Operation for Debit/Credit Only Column','Y','N','0b1330b3-1101-46be-8473-4ad3a26c8d1d',100,0,TO_DATE('2013-03-12 23:25:41','YYYY-MM-DD HH24:MI:SS'),0,100,TO_DATE('2013-03-12 23:25:41','YYYY-MM-DD HH24:MI:SS'),'Y','Y',195,1,'N') +; + +-- Mar 12, 2013 11:25:42 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201872 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) +; + +-- Mar 12, 2013 11:31:52 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET DisplayLogic='@LineType@=C&@CalculationType@=A,R,S',Updated=TO_DATE('2013-03-12 23:31:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201872 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=10,Updated=TO_DATE('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4786 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=20,Updated=TO_DATE('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4787 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=30,Updated=TO_DATE('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4789 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=40,Updated=TO_DATE('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4790 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=50,Updated=TO_DATE('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4792 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=60,Updated=TO_DATE('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4788 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=70,Updated=TO_DATE('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4793 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=80,Updated=TO_DATE('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4791 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=90,Updated=TO_DATE('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4796 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=100,Updated=TO_DATE('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4797 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=110,Updated=TO_DATE('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4798 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=120,Updated=TO_DATE('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4799 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=130, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201872 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=140,Updated=TO_DATE('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4800 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=150,Updated=TO_DATE('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4801 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=160,Updated=TO_DATE('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58043 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=170,Updated=TO_DATE('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58044 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=0,Updated=TO_DATE('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4785 +; + +SELECT register_migration_script('201203121619_IDEMPIERE-726.sql') FROM dual +; + diff --git a/migration/i1.0a-release/postgresql/201203121619_IDEMPIERE-726.sql b/migration/i1.0a-release/postgresql/201203121619_IDEMPIERE-726.sql new file mode 100644 index 0000000000..fabfe99dd7 --- /dev/null +++ b/migration/i1.0a-release/postgresql/201203121619_IDEMPIERE-726.sql @@ -0,0 +1,138 @@ +-- Mar 12, 2013 11:23:29 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsInverseDebitCreditOnly',202295,'D','Inverse Operation for Debit/Credit Only Column','Apply inverse operation to debit or credit only column','Inverse Operation for Debit/Credit Only Column','582bb9ba-18fe-44d5-a1c7-35c4b0abc922',0,TO_TIMESTAMP('2013-03-12 23:23:27','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2013-03-12 23:23:27','YYYY-MM-DD HH24:MI:SS'),0,100,100,'Y') +; + +-- Mar 12, 2013 11:23:29 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=202295 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) +; + +-- Mar 12, 2013 11:24:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,IsToolbarButton,IsAlwaysUpdateable,IsEncrypted) VALUES (0,'N',1,448,208803,'U','Y','N','N',0,'N',1,'N',20,'N',202295,'N','Y','e70f17d5-2b1e-4062-b1ce-72c931a403cb','Y','IsInverseDebitCreditOnly','Apply inverse operation to debit or credit only column','N','Inverse Operation for Debit/Credit Only Column','Y',TO_TIMESTAMP('2013-03-12 23:24:04','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2013-03-12 23:24:04','YYYY-MM-DD HH24:MI:SS'),100,0,'N','N','N') +; + +-- Mar 12, 2013 11:24:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=208803 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) +; + +-- Mar 12, 2013 11:24:15 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +ALTER TABLE PA_ReportLine ADD COLUMN IsInverseDebitCreditOnly CHAR(1) DEFAULT 'N' CHECK (IsInverseDebitCreditOnly IN ('Y','N')) NOT NULL +; + +-- Mar 12, 2013 11:25:01 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Preference SET Value='Y',Updated=TO_TIMESTAMP('2013-03-12 23:25:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Preference_ID=200000 +; + +-- Mar 12, 2013 11:25:42 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Field (ColumnSpan,NumLines,SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry) VALUES (3,1,0,'N',376,0,'N','N',208803,195,'Y',201872,'N','D','Apply inverse operation to debit or credit only column','Inverse Operation for Debit/Credit Only Column','Y','N','0b1330b3-1101-46be-8473-4ad3a26c8d1d',100,0,TO_TIMESTAMP('2013-03-12 23:25:41','YYYY-MM-DD HH24:MI:SS'),0,100,TO_TIMESTAMP('2013-03-12 23:25:41','YYYY-MM-DD HH24:MI:SS'),'Y','Y',195,1,'N') +; + +-- Mar 12, 2013 11:25:42 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=201872 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) +; + +-- Mar 12, 2013 11:31:52 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET DisplayLogic='@LineType@=C&@CalculationType@=A,R,S',Updated=TO_TIMESTAMP('2013-03-12 23:31:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201872 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=10,Updated=TO_TIMESTAMP('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4786 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=20,Updated=TO_TIMESTAMP('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4787 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=30,Updated=TO_TIMESTAMP('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4789 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=40,Updated=TO_TIMESTAMP('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4790 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=50,Updated=TO_TIMESTAMP('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4792 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=60,Updated=TO_TIMESTAMP('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4788 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=70,Updated=TO_TIMESTAMP('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4793 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=80,Updated=TO_TIMESTAMP('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4791 +; + +-- Mar 12, 2013 11:33:05 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2013-03-12 23:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4796 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4797 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4798 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4799 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=130, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=201872 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4800 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4801 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58043 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=170,Updated=TO_TIMESTAMP('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58044 +; + +-- Mar 12, 2013 11:33:06 PM MYT +-- IDEMPIERE-726 Financial Report: Add inverse operation option for credit/debit only column +UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2013-03-12 23:33:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4785 +; + +SELECT register_migration_script('201203121619_IDEMPIERE-726.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/I_PA_ReportLine.java b/org.adempiere.base/src/org/compiere/model/I_PA_ReportLine.java index 44e0cf41a0..32d77005e4 100644 --- a/org.adempiere.base/src/org/compiere/model/I_PA_ReportLine.java +++ b/org.adempiere.base/src/org/compiere/model/I_PA_ReportLine.java @@ -128,6 +128,19 @@ public interface I_PA_ReportLine */ public boolean isActive(); + /** Column name IsInverseDebitCreditOnly */ + public static final String COLUMNNAME_IsInverseDebitCreditOnly = "IsInverseDebitCreditOnly"; + + /** Set Inverse Operation for Debit/Credit Only Column. + * Apply inverse operation to debit or credit only column + */ + public void setIsInverseDebitCreditOnly (boolean IsInverseDebitCreditOnly); + + /** Get Inverse Operation for Debit/Credit Only Column. + * Apply inverse operation to debit or credit only column + */ + public boolean isInverseDebitCreditOnly(); + /** Column name IsPrinted */ public static final String COLUMNNAME_IsPrinted = "IsPrinted"; diff --git a/org.adempiere.base/src/org/compiere/model/X_PA_ReportLine.java b/org.adempiere.base/src/org/compiere/model/X_PA_ReportLine.java index 19a105f7e0..c48de17494 100644 --- a/org.adempiere.base/src/org/compiere/model/X_PA_ReportLine.java +++ b/org.adempiere.base/src/org/compiere/model/X_PA_ReportLine.java @@ -30,7 +30,7 @@ public class X_PA_ReportLine extends PO implements I_PA_ReportLine, I_Persistent /** * */ - private static final long serialVersionUID = 20121031L; + private static final long serialVersionUID = 20130312L; /** Standard Constructor */ public X_PA_ReportLine (Properties ctx, int PA_ReportLine_ID, String trxName) @@ -38,6 +38,8 @@ public class X_PA_ReportLine extends PO implements I_PA_ReportLine, I_Persistent super (ctx, PA_ReportLine_ID, trxName); /** if (PA_ReportLine_ID == 0) { + setIsInverseDebitCreditOnly (false); +// N setIsPrinted (true); // Y setLineType (null); @@ -147,6 +149,30 @@ public class X_PA_ReportLine extends PO implements I_PA_ReportLine, I_Persistent return ii.intValue(); } + /** Set Inverse Operation for Debit/Credit Only Column. + @param IsInverseDebitCreditOnly + Apply inverse operation to debit or credit only column + */ + public void setIsInverseDebitCreditOnly (boolean IsInverseDebitCreditOnly) + { + set_Value (COLUMNNAME_IsInverseDebitCreditOnly, Boolean.valueOf(IsInverseDebitCreditOnly)); + } + + /** Get Inverse Operation for Debit/Credit Only Column. + @return Apply inverse operation to debit or credit only column + */ + public boolean isInverseDebitCreditOnly () + { + Object oo = get_Value(COLUMNNAME_IsInverseDebitCreditOnly); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + /** Set Printed. @param IsPrinted Indicates if this document / line is printed diff --git a/org.adempiere.base/src/org/compiere/report/FinReport.java b/org.adempiere.base/src/org/compiere/report/FinReport.java index 74ef82445c..30645475c7 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReport.java +++ b/org.adempiere.base/src/org/compiere/report/FinReport.java @@ -507,17 +507,75 @@ public class FinReport extends SvrProcess { if (!m_lines[line].isLineTypeCalculation ()) continue; + + if (log.isLoggable(Level.FINE)) log.fine("Line " + line + " = #" + m_lines[line].getOper_1_ID() + " " + + m_lines[line].getCalculationType() + " #" + m_lines[line].getOper_2_ID()); - int oper_1 = m_lines[line].getOper_1_ID(); - int oper_2 = m_lines[line].getOper_2_ID(); - - if (log.isLoggable(Level.FINE)) log.fine("Line " + line + " = #" + oper_1 + " " - + m_lines[line].getCalculationType() + " #" + oper_2); - - // Adding - if (m_lines[line].isCalculationTypeAdd() - || m_lines[line].isCalculationTypeRange()) + List addList = new ArrayList(); + List notAddList = new ArrayList(); + + boolean inverse = m_lines[line].isInverseDebitCreditOnly(); + + if (m_lines[line].isCalculationTypeAdd() + || m_lines[line].isCalculationTypeRange()) { + for (int col = 0; col < m_columns.length; col++) + { + if (m_columns[col].isColumnTypeCalculation() || !inverse) + { + addList.add(col); + } + else + { + String amountType = m_columns[col].getPAAmountType(); + if (amountType != null && (amountType.startsWith("C") || amountType.startsWith("D"))) + { + notAddList.add(col); + } + else + { + addList.add(col); + } + } + } + } + else if (m_lines[line].isCalculationTypeSubtract()) + { + for (int col = 0; col < m_columns.length; col++) + { + if (m_columns[col].isColumnTypeCalculation() || !inverse) + { + notAddList.add(col); + } + else + { + String amountType = m_columns[col].getPAAmountType(); + if (amountType != null && (amountType.startsWith("C") || amountType.startsWith("D"))) + { + addList.add(col); + } + else + { + notAddList.add(col); + } + } + } + } + else + { + //percentage + for (int col = 0; col < m_columns.length; col++) + { + notAddList.add(col); + } + } + + // Adding + if (addList.size() > 0) + { + int oper_1 = m_lines[line].getOper_1_ID(); + int oper_2 = m_lines[line].getOper_2_ID(); + // Reverse range if (oper_1 > oper_2) { @@ -526,14 +584,14 @@ public class FinReport extends SvrProcess oper_2 = temp; } StringBuilder sb = new StringBuilder ("UPDATE T_Report SET ("); - for (int col = 0; col < m_columns.length; col++) + for (int col : addList) { if (col > 0) sb.append(","); sb.append ("Col_").append (col); } sb.append(") = (SELECT "); - for (int col = 0; col < m_columns.length; col++) + for (int col : addList) { if (col > 0) sb.append(","); @@ -558,18 +616,23 @@ public class FinReport extends SvrProcess if (log.isLoggable(Level.FINEST)) log.finest ("(+) " + sb.toString ()); } } - else // No Add (subtract, percent) + + // No Add (subtract, percent) + if (notAddList.size() > 0) { + int oper_1 = m_lines[line].getOper_1_ID(); + int oper_2 = m_lines[line].getOper_2_ID(); + // Step 1 - get First Value or 0 in there StringBuilder sb = new StringBuilder ("UPDATE T_Report SET ("); - for (int col = 0; col < m_columns.length; col++) + for (int col : notAddList) { if (col > 0) sb.append(","); sb.append ("Col_").append (col); } sb.append(") = (SELECT "); - for (int col = 0; col < m_columns.length; col++) + for (int col : notAddList) { if (col > 0) sb.append(","); @@ -591,14 +654,14 @@ public class FinReport extends SvrProcess // Step 2 - do Calculation with Second Value sb = new StringBuilder ("UPDATE T_Report r1 SET ("); - for (int col = 0; col < m_columns.length; col++) + for (int col : notAddList) { if (col > 0) sb.append(","); sb.append ("Col_").append (col); } sb.append(") = (SELECT "); - for (int col = 0; col < m_columns.length; col++) + for (int col : notAddList) { if (col > 0) sb.append(","); diff --git a/org.adempiere.base/src/org/compiere/util/Evaluator.java b/org.adempiere.base/src/org/compiere/util/Evaluator.java index db4eb744bd..648f484145 100644 --- a/org.adempiere.base/src/org/compiere/util/Evaluator.java +++ b/org.adempiere.base/src/org/compiere/util/Evaluator.java @@ -177,28 +177,34 @@ public class Evaluator String operand = st.nextToken(); // Second Part - String second = st.nextToken(); // get value - String secondEval = second.trim(); - if (second.indexOf('@') != -1) // variable + String rightToken = st.nextToken(); // get value + String[] list = rightToken.split("[,]"); + for(String second : list) { - second = second.replace('@', ' ').trim(); // strip tag - secondEval = source.get_ValueAsString (second); // replace with it's value + String secondEval = second.trim(); + if (second.indexOf('@') != -1) // variable + { + second = second.replace('@', ' ').trim(); // strip tag + secondEval = source.get_ValueAsString (second); // replace with it's value + } + secondEval = secondEval.replace('\'', ' ').replace('"', ' ').trim(); // strip ' and " + + // Handling of ID compare (null => 0) + if (first.indexOf("_ID") != -1 && firstEval.length() == 0) + firstEval = "0"; + if (second.indexOf("_ID") != -1 && secondEval.length() == 0) + secondEval = "0"; + + // Logical Comparison + boolean result = evaluateLogicTuple (firstEval, operand, secondEval); + // + if (s_log.isLoggable(Level.FINEST)) s_log.finest(logic + + " => \"" + firstEval + "\" " + operand + " \"" + secondEval + "\" => " + result); + if (result) + return true; } - secondEval = secondEval.replace('\'', ' ').replace('"', ' ').trim(); // strip ' and " - - // Handling of ID compare (null => 0) - if (first.indexOf("_ID") != -1 && firstEval.length() == 0) - firstEval = "0"; - if (second.indexOf("_ID") != -1 && secondEval.length() == 0) - secondEval = "0"; - - // Logical Comparison - boolean result = evaluateLogicTuple (firstEval, operand, secondEval); // - if (s_log.isLoggable(Level.FINEST)) s_log.finest(logic - + " => \"" + firstEval + "\" " + operand + " \"" + secondEval + "\" => " + result); - // - return result; + return false; } // evaluateLogicTuple /**