Merge pull request #27659 from nextchamp-saqib/fix-32644

fix: setting of gain/loss if party account is in company currency