web
You’re offline. This is a read only version of the page.
close
  • Auto Charges setup: align with Trade Agreement "most specific wins" logic

    Auto charges and trade agreements both use the Account Code hierarchy (Table / Group / All) to determine which rules apply to a transaction. However, they resolve matching rules in fundamentally different ways. Trade agreements use "most specific wins" — if a Table-level price exists, Group and All are skipped. Auto charges use accumulative matching — if rules exist at both Group and All level, BOTH fire, causing double-stacking of charges on the same order.


    This inconsistency is counter-intuitive for D365 practitioners, leads to unintended double-charging in common B2B/B2C scenarios, and forces workarounds (eliminating all "All" rules and assigning every customer to an explicit charge group) that increase configuration complexity and operational risk.


    I propose aligning the auto charge Account Code resolution with the trade agreement pattern: most specific match wins, less specific levels are skipped. The AND logic already exists at the charge line level within a single header — it does not need to be duplicated at the header/account code level in my opinion.


    The change is isolated to the ApplyAutoCharges method in the CRT Services layer, requires no database schema changes, and can be gated behind a configuration parameter for backward compatibility.


    A detailed analysis with code-level evidence from the decompiled CSU V9.57/10.0.47 codebase is attached.