The fix provided will allow the accrual to happen correctly.
When the last transaction system comes to the else statement, already accountingCurrencyAmount is negative amount , if we multiply
with sign(ledgerJournalTransAccrualTrans.AmountCur) then it will become +ve amount. Hence we are getting the wrong amount.
From this fix we are not multiplying with sign(ledgerJournalTransAccrualTrans.AmountCur) then system
takes the correctly value.
accountingCurrencyAmount = -accountingCurrencyAmount;
reportingCurrencyAmount = -reportingCurrencyAmount;