Hi everyone,
I'm working on a formula in Acumatica to calculate adjusted transaction amounts based on the ARTran.CuryTranAmt and OTP-specific tax logic. Here's the formula I'm using:
=Sum( (IIF([ARTran.DrCr]='C',1,-1)) * ( [ARTran.CuryTranAmt] + IIF( NOT IsNull([CWTaxesSum.Refnbr]) AND [CWTaxesSum.TaxableAmount] <> 0 AND [ARTran.TaxCategoryID] = 'OTP', [ARTran.CuryTranAmt]/[CWTaxesSum.TaxableAmount]*[CWTaxesSum.TaxAmt], 0 ) ) )
Total

The issue: The total calculated using this formula is higher than expected when compared to manually summed values. Even when I remove the OTP logic, the total still seems inflated. Could this be due to duplicate records from joins or grouping issues?
Has anyone faced a similar issue or can suggest how to troubleshoot or optimize this formula to avoid duplication or over-calculation?
I need to handle NAn
