When you try to complete the asset material receipt found this error:
15:12:45.794===========> MDepreciationWorkfile.load: [WFP_2c89ccac-fa90-44ed-a312-f0424ef9d16f] - A_Depreciation_Workfile_ID=1000004, SQL=SELECT A_Depreciation_Workfile_ID,AD_Client_ID,AD_Org_ID,A_Accumulated_Depr,A_Asset_Cost,A_Asset_ID,A_Asset_Life_Current_Year,A_Period_Forecast,A_Prior_Year_Accumulated_Depr,PostingType,IsDepreciated,IsActive,DateAcct,CreatedBy,Created,AssetDepreciationDate,A_Salvage_Value,A_QTY_Current,UpdatedBy,Updated,Processing,A_Period_Posted,A_Life_Period,A_Asset_Life_Years,A_Base_Amount,A_Calc_Accumulated_Depr,A_Curr_Dep_Exp,A_Current_Period,A_Accumulated_Depr_F,A_Asset_Life_Years_F,A_Life_Period_F,UseLifeYears,UseLifeMonths,UseLifeYears_F,UseLifeMonths_F,A_Asset_Remaining,A_Asset_Remaining_F,(case when UseLifeMonths - decode(A_Current_Period, 0, 1, A_Current_Period)+ 1> 0 then (A_Asset_Cost - A_Accumulated_Depr)/(UseLifeMonths - decode(A_Current_Period, 0, 1, A_Current_Period) + 1) else 0 end) AS A_Expense_SL,(case when UseLifeMonths_F - decode(A_Current_Period, 0, 1, A_Current_Period)+ 1> 0 then (A_Asset_Cost - A_Accumulated_Depr_F)/(UseLifeMonths_F - decode(A_Current_Period, 0, 1, A_Current_Period) + 1) else 0 end) AS A_Expense_SL_F,(select min(A_Life_Period_Max) from A_Asset a left join A_Asset_Class ac on (ac.A_Asset_Class_ID=a.A_Asset_Class_ID) where a.A_Asset_ID=A_Depreciation_Workfile.A_Asset_ID) AS A_Life_Period_Max,(select min(A_Life_Period_MIN) from A_Asset a left join A_Asset_Class ac on (ac.A_Asset_Class_ID=a.A_Asset_Class_ID) where a.A_Asset_ID=A_Depreciation_Workfile.A_Asset_ID) AS A_Life_Period_Min,A_Tip_Finantare,A_Valoare_Cofinantare,A_Valoare_Tert,Description,A_FundingMode_ID,Processed,A_Depreciation_Workfile_UU,C_AcctSchema_ID FROM A_Depreciation_Workfile WHERE A_Depreciation_Workfile_ID=? [33] org.postgresql.util.PSQLException: ERROR: function decode(numeric, integer, integer, numeric) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts. Position: 618; State=42883; ErrorCode=0 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553) at ... org.compiere.model.PO.save(PO.java:2226) at org.compiere.model.PO.saveEx(PO.java:2314) at org.compiere.model.MAssetAddition.createAsset(MAssetAddition.java:199) at org.compiere.model.MAssetAddition.createAsset(MAssetAddition.java:122)
DECODE function doesn't work in native postgres changed to CASE
When you try to complete the asset material receipt found this error:
15:12:45.794===========> MDepreciationWorkfile.load: [WFP_2c89ccac-fa90-44ed-a312-f0424ef9d16f] - A_Depreciation_Workfile_ID=1000004, SQL=SELECT A_Depreciation_Workfile_ID,AD_Client_ID,AD_Org_ID,A_Accumulated_Depr,A_Asset_Cost,A_Asset_ID,A_Asset_Life_Current_Year,A_Period_Forecast,A_Prior_Year_Accumulated_Depr,PostingType,IsDepreciated,IsActive,DateAcct,CreatedBy,Created,AssetDepreciationDate,A_Salvage_Value,A_QTY_Current,UpdatedBy,Updated,Processing,A_Period_Posted,A_Life_Period,A_Asset_Life_Years,A_Base_Amount,A_Calc_Accumulated_Depr,A_Curr_Dep_Exp,A_Current_Period,A_Accumulated_Depr_F,A_Asset_Life_Years_F,A_Life_Period_F,UseLifeYears,UseLifeMonths,UseLifeYears_F,UseLifeMonths_F,A_Asset_Remaining,A_Asset_Remaining_F,(case when UseLifeMonths - decode(A_Current_Period, 0, 1, A_Current_Period)+ 1> 0 then (A_Asset_Cost - A_Accumulated_Depr)/(UseLifeMonths - decode(A_Current_Period, 0, 1, A_Current_Period) + 1) else 0 end) AS A_Expense_SL,(case when UseLifeMonths_F - decode(A_Current_Period, 0, 1, A_Current_Period)+ 1> 0 then (A_Asset_Cost - A_Accumulated_Depr_F)/(UseLifeMonths_F - decode(A_Current_Period, 0, 1, A_Current_Period) + 1) else 0 end) AS A_Expense_SL_F,(select min(A_Life_Period_Max) from A_Asset a left join A_Asset_Class ac on (ac.A_Asset_Class_ID=a.A_Asset_Class_ID) where a.A_Asset_ID=A_Depreciation_Workfile.A_Asset_ID) AS A_Life_Period_Max,(select min(A_Life_Period_MIN) from A_Asset a left join A_Asset_Class ac on (ac.A_Asset_Class_ID=a.A_Asset_Class_ID) where a.A_Asset_ID=A_Depreciation_Workfile.A_Asset_ID) AS A_Life_Period_Min,A_Tip_Finantare,A_Valoare_Cofinantare,A_Valoare_Tert,Description,A_FundingMode_ID,Processed,A_Depreciation_Workfile_UU,C_AcctSchema_ID FROM A_Depreciation_Workfile WHERE A_Depreciation_Workfile_ID=? [33]
org.postgresql.util.PSQLException: ERROR: function decode(numeric, integer, integer, numeric) does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 618; State=42883; ErrorCode=0
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
at ...
org.compiere.model.PO.save(PO.java:2226)
at org.compiere.model.PO.saveEx(PO.java:2314)
at org.compiere.model.MAssetAddition.createAsset(MAssetAddition.java:199)
at org.compiere.model.MAssetAddition.createAsset(MAssetAddition.java:122)
DECODE function doesn't work in native postgres
changed to CASE