I've been coding eConnect for a while, and this one was hard. I wanted to be sure to save this for future use.
Because of its 'bolted on' nature, Analytical Accounting is often not straight forward.
This is a complete working example of a PM Transaction that uses AA.
Notes:
Not every line in the distribution needs AA; the AA lines need their own counter for that reason.
The DocType here for the AA is 0, not 1. That's in the documentation
Some errors that I got along the way:
An item with the same key has already been added
There are no distribution accounts linked to an Accounting Class.
The example below fixes those issues