A customer received an error when trying to use my AP Payment Apply Library to apply a manual payment to an open vendor invoice. My library said that the invoice was not found, but the customer sent me a screen shot of the invoice listed in the Payables Transaction Inquiry window.
It looked like this:
That seemed odd. The invoice was obviously present. We had the right vendor and the right invoice number. But my apply library couldn't apply a manual payment to the invoice.
I asked the client to query the invoice record in PM20000, with a query like this.
SELECT * FROM PM20000 WHERE DOCTYPE = 1 AND VENDORID = 'ALLENSON0001' AND DOCNUMBR = 'C100'
Sure enough, the record was there and looked normal. But I looked again at the data, and found two odd values.
Notice that the batch number is "sa", and the batch source is XXPM_Trxent.
What in the world does that mean?
I Googled "XXPM_Trxent", but only found the DynDeveloper reference on PM10300, which only said "Real time", which doesn't mean anything to me.
So I then searched the TWO database on my development server and behold, I had one Payables invoice with the same symptoms.
I then inquired on that open invoice in GP and saw the issue. The invoice was in a foreign currency.
It would seem that those two field values indicate a multi-currency transaction. I don't know the details of why those values are set differently, but this is relevant to applying AP payments because Dynamics GP does not allow you to apply an unposted AP payment to an open invoice if multi-currency is involved.
If you attempt to apply an AP payment to an invoice with a different currency, you get this message.
You have to first post the payment, and you can then apply the open payment to the open invoice, and the multi-currency calculations and related transactions can be processed by GP.
So it appears that I need to add an additional validation rule to my AP Apply Library to check for this situation and provide a specific message for it.