Friday 20 October 2006

Intercompany payments BUG Dynamics Ax V4 Loc Build

In AX V4 August release the following intercompany related bug has been found.

It is possible to create intercompany Links between companies and Axapta will in those instances in V4 maintain information about the established invoices and will try to settle on both sides simoultaneously.

This works well, except in the case where you decide to use an intercompany account but not to do the full interaction, that is you untick the intercompany box. The result is you have an invoice on an account with an intercompany setup with no corresponding entry on the related account in the other company.

This could be because you want to register a fee or other invoice or it could be that the account was not intercompany but now is as you have changed your setup.

Ax will forcibly try to settle a transaction on the other set of accounts inspite of it knowing it is not there.

To correct this BUG two small changes are needed in two methods of the LedgerJournalCheckPost Class.

The Methods IntercompanyPaymentExist and IntercompanyTransferToCustPayment need to have a new variable added in the declaration in order that we can query it later in a select.

// Intercompany only if the invoice was booked with intercompany link active
VendInvoiceJour VendInvoiceJour;
// Information is stored in the invoice And the Select statement
select firstonly forceplaceholders vendSettlement
where vendSettlement.OffsetTransVoucher == ledgerJournalTrans.Voucher
join vendTrans where vendTrans.RecId == vendSettlement.TransRecId
&& vendTrans.AccountNum == vendSettlement.AccountNum
&& vendTrans.Invoice

Should have added to it the following

select firstonly forceplaceholders vendSettlement
where vendSettlement.OffsetTransVoucher == ledgerJournalTrans.Voucher
join vendTrans
where vendTrans.RecId == vendSettlement.TransRecId
&& vendTrans.AccountNum == vendSettlement.AccountNum
&& vendTrans.Invoice
// Added search
join VendInvoiceJour
where VendInvoiceJour.InvoiceId == VendTrans.Invoice
&& VendInvoiceJour.InvoiceDate == VendTrans.TransDate
&& VendInvoiceJour.InvoiceAccount == VendTrans.AccountNum;
if (vendTrans.Invoice && VendInvoiceJour.InterCompanyCompanyId)
// Added check to avoid issue
{The check on the IntercompanyId field ensures that the transaction was done using IC.
//

Hope this may help someone somewhere :-)

/Sven Jochimsen

No comments: