diff --git a/migration/i8.1z/oracle/202011121122_IDEMPIERE-4569.sql b/migration/i8.1z/oracle/202011121122_IDEMPIERE-4569.sql new file mode 100644 index 0000000000..883193b5ec --- /dev/null +++ b/migration/i8.1z/oracle/202011121122_IDEMPIERE-4569.sql @@ -0,0 +1,13 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-4569 PostgreSQL Native error on Asset Material Receipt +-- Nov 31, 2020, 11:22:07 AM +UPDATE AD_Column SET ColumnSql = '(case when UseLifeMonths - (case when A_Current_Period = 0 then 1 else A_Current_Period end )+ 1> 0 then (A_Asset_Cost - A_Accumulated_Depr)/(UseLifeMonths - (case when A_Current_period = 0 then 1 else A_Current_Period end) + 1) else 0 end)' WHERE AD_Column_ID=59287 +; + +UPDATE AD_Column SET ColumnSql = '(case when UseLifeMonths_F - (case when A_Current_Period = 0 then 1 else A_Current_Period end )+ 1 > 0 then (A_Asset_Cost - A_Accumulated_Depr_F)/(UseLifeMonths_F - (case when A_Current_Period = 0 then 1 else A_Current_Period end ) + 1) else 0 end)' WHERE AD_Column_ID=59288 +; + +SELECT register_migration_script('202011121122_IDEMPIERE-4569.sql') FROM dual +; diff --git a/migration/i8.1z/postgresql/202011121122_IDEMPIERE-4569.sql b/migration/i8.1z/postgresql/202011121122_IDEMPIERE-4569.sql new file mode 100644 index 0000000000..7d48fca61d --- /dev/null +++ b/migration/i8.1z/postgresql/202011121122_IDEMPIERE-4569.sql @@ -0,0 +1,10 @@ +-- IDEMPIERE-4569 PostgreSQL Native error on Asset Material Receipt +-- Nov 31, 2020, 11:22:07 AM +UPDATE AD_Column SET ColumnSql = '(case when UseLifeMonths - (case when A_Current_Period = 0 then 1 else A_Current_Period end )+ 1> 0 then (A_Asset_Cost - A_Accumulated_Depr)/(UseLifeMonths - (case when A_Current_period = 0 then 1 else A_Current_Period end) + 1) else 0 end)' WHERE AD_Column_ID = 59287 +; + +UPDATE AD_Column SET ColumnSql = '(case when UseLifeMonths_F - (case when A_Current_Period = 0 then 1 else A_Current_Period end )+ 1 > 0 then (A_Asset_Cost - A_Accumulated_Depr_F)/(UseLifeMonths_F - (case when A_Current_Period = 0 then 1 else A_Current_Period end ) + 1) else 0 end)' WHERE AD_Column_ID = 59288 +; + +SELECT register_migration_script('202011121122_IDEMPIERE-4569.sql') FROM dual +;