There are a couple of possible causes the rrror - 'Purchase Analysis code XXX does not exist Transaction count after EXECUTE':
It does not exist (The code does not exist in the system and will need to be created).
The purchase analysis code exists but is the wrong currency, wrong type (bank/discount/stock/purchase), or is inactive.
