---
title: "Fix for wrong Cost and Margin calculation in Sales profitability analysis window (AR409000)"
description: "Previously, the Sales profitability analysis window (AR409000) was showing wrong calculation on the Cost and Margin columns for order types which had document type credit note."
lang: en
languages:
  en: https://docs.vismasoftware.no/visma-net-erp/release-notes/2025-08-26-fix-for-wrong-cost-and-margin-calculation-in-sales-profitability-analysis/index.md
lastmod: 2025-08-26
---

> Documentation index: https://docs.vismasoftware.no/visma-net-erp/llms.txt


# Fix for wrong Cost and Margin calculation in Sales profitability analysis window (AR409000)

Last modified August 26, 2025

2025-08-26


Label: order-to-cash:customer-ledger


Version: 10.63



Previously, the Sales profitability analysis window (AR409000) was showing wrong calculation on the Cost and Margin columns for order types which had document type credit note. This has now been fixed for new and existing companies that didn't have any manual customization on this generic inquiry.\
For existing companies that had customization changes on this generic inquiry, you need to edit the generic inquiry and update the formula in the Results Grid tab for the field ARTran.TranCost with the following query:  =IIf(\[ARTran.SOOrderType\]='CR' OR \[ARTran.SOOrderType\]='RC', -1, IIf(\[ARTran.DrCr\]='D', -1, 1))\*\[ARTran.TranCost\]



---

[View this page](https://docs.vismasoftware.no/visma-net-erp/release-notes/2025-08-26-fix-for-wrong-cost-and-margin-calculation-in-sales-profitability-analysis/)
