From ca2570e90eb7c0b329174bec2c41224022e6ea84 Mon Sep 17 00:00:00 2001 From: Orlando Curieles Date: Sun, 22 Nov 2020 06:54:35 -0500 Subject: [PATCH] IDEMPIERE-4569 Migration Script (#401) * IDEMPIERE-4569 Migration Script * Update 202011121122_IDEMPIERE-4569.sql * Update 202011121122_IDEMPIERE-4569.sql Co-authored-by: Carlos Ruiz --- .../i8.1z/oracle/202011121122_IDEMPIERE-4569.sql | 13 +++++++++++++ .../postgresql/202011121122_IDEMPIERE-4569.sql | 10 ++++++++++ 2 files changed, 23 insertions(+) create mode 100644 migration/i8.1z/oracle/202011121122_IDEMPIERE-4569.sql create mode 100644 migration/i8.1z/postgresql/202011121122_IDEMPIERE-4569.sql 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 +;