12-06-2021 04:04 AM - last edited on 05-02-2023 10:43 AM by JackLacava
Hi Experts,
I have the following rule to translate my opening balance adjustment (entered manually in the current year) at an opening rate.
If (api.Cons.IsCurrency() And Not api.Cons.IsLocalCurrencyforEntity()) Then
'Only run for foreign currency
Dim timeId As Integer = api.Pov.Time.MemberPk.MemberId
Dim prioryearid As Integer = api.Time.GetLastPeriodInPriorYear(timeid)
Dim rateTypeClo As FxRateType = api.FxRates.GetFxRateTypeForAssetLiability()
' get closing rate from prior year
Dim pycloRate As Decimal = api.FxRates.GetCalculatedFxRate(rateTypeClo,prioryearid)
'use closing rate from PY to translate this member
api.Data.calculate("F#ObalAdj = C#Local:F#ObalAdj*" & pyclorate,"A#Bs.Base")
End If
While this works perfectly for data entered via Forms, it doesn't work for adjustments entered via journals.
When a journal is posted against ObalAdj member, I see 2 things happening:
1. The AdjInput member translates at opening rate based on above rule (as expected)
2. The AdjConsolidated member translates at closing rate
3. The sum of AdjInput & AdjConsolidated members roll up the hierarchy
Therefore, my translated opening balance adjustment is incorrect.
Can you please advise how I can stop the default translation to closing rate for just the opening balance adjustment member (for journal entries)?
Regards,
Sou
03-04-2022 08:13 AM
I have this issue too, is there a solution?
03-04-2022 08:21 AM
Hi,
I tweaked my logic as below and it's working now.
api.Data.calculate("F#ObalAdj:0#AdjConsolidated= C#Local:F#ObalAdj:0#AdjInput*" & pyclorate,"A#Bs.Base") 'use closing rate from PY to translate this member
There is also a translate function that can be used in this case instead of calculate.
Regards,
Sou
03-04-2022 08:24 AM
Thanks, really appreciate the quick response