IDEMPIERE-4297 Improve test data (#344)

Fix error reported by @hengsin
Doc_Invoice.getValidCombination_ID: NO account Type=4

Make explicit the deprecation in code and hide the deprecated account fields on IDEMPIERE-362
This commit is contained in:
Carlos Ruiz 2020-11-02 03:39:40 +01:00 committed by GitHub
parent 6e96c43303
commit c9a766c806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 93 additions and 6 deletions

View File

@ -0,0 +1,43 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- IDEMPIERE-4297 Improve test data + IDEMPIERE-362
-- Nov 1, 2020, 8:06:40 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-11-01 20:06:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12354
;
-- Nov 1, 2020, 8:07:11 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-11-01 20:07:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2602
;
-- Nov 1, 2020, 8:08:20 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-11-01 20:08:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2660
;
-- Nov 1, 2020, 8:08:23 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-11-01 20:08:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12349
;
-- Nov 1, 2020, 8:08:26 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-11-01 20:08:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5134
;
-- Nov 1, 2020, 8:08:28 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-11-01 20:08:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4095
;
-- Nov 1, 2020, 8:08:30 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-11-01 20:08:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4094
;
-- Nov 1, 2020, 8:08:35 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-11-01 20:08:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4093
;
-- Nov 1, 2020, 8:08:37 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2020-11-01 20:08:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4092
;
SELECT register_migration_script('202011012009_4297_362.sql') FROM dual
;

View File

@ -0,0 +1,40 @@
-- IDEMPIERE-4297 Improve test data + IDEMPIERE-362
-- Nov 1, 2020, 8:06:40 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-11-01 20:06:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12354
;
-- Nov 1, 2020, 8:07:11 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-11-01 20:07:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2602
;
-- Nov 1, 2020, 8:08:20 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-11-01 20:08:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2660
;
-- Nov 1, 2020, 8:08:23 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-11-01 20:08:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12349
;
-- Nov 1, 2020, 8:08:26 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-11-01 20:08:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5134
;
-- Nov 1, 2020, 8:08:28 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-11-01 20:08:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4095
;
-- Nov 1, 2020, 8:08:30 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-11-01 20:08:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4094
;
-- Nov 1, 2020, 8:08:35 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-11-01 20:08:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4093
;
-- Nov 1, 2020, 8:08:37 PM CET
UPDATE AD_Field SET IsActive='N', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2020-11-01 20:08:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4092
;
SELECT register_migration_script('202011012009_4297_362.sql') FROM dual
;

View File

@ -1228,9 +1228,9 @@ public abstract class Doc
/** Account Type - Invoice - AP */ /** Account Type - Invoice - AP */
public static final int ACCTTYPE_V_Liability = 2; public static final int ACCTTYPE_V_Liability = 2;
/** Account Type - Invoice - AP Service */ /** Account Type - Invoice - AP Service */
public static final int ACCTTYPE_V_Liability_Services = 3; public static final int ACCTTYPE_V_Liability_Services = 3; // Deprecated IDEMPIERE-362
/** Account Type - Invoice - AR Service */ /** Account Type - Invoice - AR Service */
public static final int ACCTTYPE_C_Receivable_Services = 4; public static final int ACCTTYPE_C_Receivable_Services = 4; // Deprecated IDEMPIERE-362
/** Account Type - Payment - Unallocated */ /** Account Type - Payment - Unallocated */
public static final int ACCTTYPE_UnallocatedCash = 10; public static final int ACCTTYPE_UnallocatedCash = 10;
@ -1313,7 +1313,7 @@ public abstract class Doc
sql = "SELECT V_Liability_Acct FROM C_BP_Vendor_Acct WHERE C_BPartner_ID=? AND C_AcctSchema_ID=?"; sql = "SELECT V_Liability_Acct FROM C_BP_Vendor_Acct WHERE C_BPartner_ID=? AND C_AcctSchema_ID=?";
para_1 = getC_BPartner_ID(); para_1 = getC_BPartner_ID();
} }
else if (AcctType == ACCTTYPE_V_Liability_Services) else if (AcctType == ACCTTYPE_V_Liability_Services) // Deprecated IDEMPIERE-362
{ {
sql = "SELECT V_Liability_Services_Acct FROM C_BP_Vendor_Acct WHERE C_BPartner_ID=? AND C_AcctSchema_ID=?"; sql = "SELECT V_Liability_Services_Acct FROM C_BP_Vendor_Acct WHERE C_BPartner_ID=? AND C_AcctSchema_ID=?";
para_1 = getC_BPartner_ID(); para_1 = getC_BPartner_ID();
@ -1323,7 +1323,7 @@ public abstract class Doc
sql = "SELECT C_Receivable_Acct FROM C_BP_Customer_Acct WHERE C_BPartner_ID=? AND C_AcctSchema_ID=?"; sql = "SELECT C_Receivable_Acct FROM C_BP_Customer_Acct WHERE C_BPartner_ID=? AND C_AcctSchema_ID=?";
para_1 = getC_BPartner_ID(); para_1 = getC_BPartner_ID();
} }
else if (AcctType == ACCTTYPE_C_Receivable_Services) else if (AcctType == ACCTTYPE_C_Receivable_Services) // Deprecated IDEMPIERE-362
{ {
sql = "SELECT C_Receivable_Services_Acct FROM C_BP_Customer_Acct WHERE C_BPartner_ID=? AND C_AcctSchema_ID=?"; sql = "SELECT C_Receivable_Services_Acct FROM C_BP_Customer_Acct WHERE C_BPartner_ID=? AND C_AcctSchema_ID=?";
para_1 = getC_BPartner_ID(); para_1 = getC_BPartner_ID();

View File

@ -418,7 +418,9 @@ public class Doc_Invoice extends Doc
// Receivables DR // Receivables DR
int receivables_ID = getValidCombination_ID(Doc.ACCTTYPE_C_Receivable, as); int receivables_ID = getValidCombination_ID(Doc.ACCTTYPE_C_Receivable, as);
int receivablesServices_ID = getValidCombination_ID (Doc.ACCTTYPE_C_Receivable_Services, as); // Deprecated IDEMPIERE-362
// int receivablesServices_ID = getValidCombination_ID (Doc.ACCTTYPE_C_Receivable_Services, as);
int receivablesServices_ID = receivables_ID;
if (m_allLinesItem || !as.isPostServices() if (m_allLinesItem || !as.isPostServices()
|| receivables_ID == receivablesServices_ID) || receivables_ID == receivablesServices_ID)
{ {
@ -606,7 +608,9 @@ public class Doc_Invoice extends Doc
// Liability CR // Liability CR
int payables_ID = getValidCombination_ID (Doc.ACCTTYPE_V_Liability, as); int payables_ID = getValidCombination_ID (Doc.ACCTTYPE_V_Liability, as);
int payablesServices_ID = getValidCombination_ID (Doc.ACCTTYPE_V_Liability_Services, as); // Deprecated IDEMPIERE-362
// int payablesServices_ID = getValidCombination_ID (Doc.ACCTTYPE_V_Liability_Services, as);
int payablesServices_ID = payables_ID;
if (m_allLinesItem || !as.isPostServices() if (m_allLinesItem || !as.isPostServices()
|| payables_ID == payablesServices_ID) || payables_ID == payablesServices_ID)
{ {