RESOLVED: The inventory quantity to match for packing slip x item y cannot be reserved.

Question Status

Suggested Answer
--- asked a question on 28 Dec 2009 12:46 PM

Hi,

This issue is resolved. This issues shows how to clean up the purchase update history which is created when a user is matching packingslips during posting invoices. If the connection breaks however or the AOS is shutdown during this process, it may caused a situation in which unmatched packingslip cannot be matched anymore. The do not show up as packingslips open for matching.

It looks like this is caused by the new AX2009 functionality allow you to match different packingslip on different purchase orders and also allows you to invoice on several packingslips or even post partial quantities of an invoice or packingslip. But this hypothesis is not supported by doing some tests.

The short cut to the solution is running 'Accounts Payable --> Periodic --> Clean up --> Purchase update history clean up'. Enter a date and the type of history you want to clean up.

J.

=== 

Hi,

I have a PO with 3 purchase lines. All lines are received and require invoicing. I received 2 separate invoices: 1 invoice matching 1 purchase line. The other invoice matches the other 2 purchase lines and a purchase line of another purchase order.

I try to select Posting -> Invoice . With parameter: Quantity: Packing list I do not see any packing list to select. If I select all I see all 3 purchase lines. I can select a packing slip then (1 left). I get error:

The inventory quantity to match for packing slip x item y cannot be reserved.

Any help appreciated.

J.

Reply
SUDHAKAR POTTURI responded on 30 Dec 2009 11:42 PM

Hi while invoicing on the right u get one button packing slips first invoice matching one packing slip and again invoice matching the other two u wull achive your result.

Regards

Reply
--- responded on 30 Dec 2009 11:50 PM

Hi,

Thank you for your reply.

I need to check with the purchase department having this problem. But I think your solution will require 2 invoice numbers to be entered? I have setup that the invoice can only be used once. So using it twice will not be possible. Is this the scenario you describe?

J.

Reply
SUDHAKAR POTTURI responded on 31 Dec 2009 12:29 AM

Hi ,

 Yes as the vendors sent invoices separetly the invoices numbers will be diferrent .Any how in my scenario the invoices numberrs cant be same , they shd be different.

Regards

Reply
--- responded on 31 Dec 2009 12:33 AM

Ok. That is what I believed. So problem I encounter is still there.

Reply
SUDHAKAR POTTURI responded on 31 Dec 2009 12:59 AM

Hi

Got solution , In AP parameters updates tab there is an option called "check invoice numbers used" if u make it accept duplicates , you can specify single invoice number. Hope this solves u r problem .and Wish you a happy new year

Regrads

Reply
--- responded on 11 Jan 2010 6:59 AM

Hi,

I believe I have found a considerable bug in the new 'Microsoft Dynamics AX Matching invoices to portions of a packing slip'. Does anybody know how to report this or where to look up more problems on it and (hopefully) a work around?

I want to match an invoice on an packinglist no. 31299177, but if I select the packingslip for matching, it triggers next piece of code, not allowing me to invoice the packing slip.

Attached the code snippets.

I really dislike I have to pay for functionality not working except for the pain not being able to work properly. To whom do I have to turn to? Partner or MS?

J.

===

/// <summary>
/// Determines whether current record is reserved by a different PurchParmLine exclusive of the provided PurchParmLine.
/// </summary>
/// <param name="_excludeRecId">
/// records beloning to the given redId will be left out of the calculation;
/// </param>
/// <returns>
/// true if current record is reserved by a different PurchParmLine; otherwise, false.
/// </returns>
public boolean isReservedbyOtherPurchParmLine(recId _excludeRecId)
{
    PurchParmSubLine        purchParmSubLine;
    ;

    select firstonly RecId from purchParmSubLine
        where
            purchParmSubLine.JournalRefTableId == this.TableId &&
            purchParmSubLine.JournalRefRecId == this.RecId &&
            purchParmSubLine.LineRefRecId != _excludeRecId;

    if (purchParmSubLine.RecId != 0)
    {
        return true;
    }

    return false;
}

 

==> Getting some data for this problem gives:

/****** Script for SelectTopNRows command from SSMS ******/

SELECT [PARMID]

,[LINEREFRECID]

,[JOURNALREFTABLEID]

,[JOURNALREFRECID]

,[RECEIVENOW]

,[INVENTNOW]

,[DOCUMENTID]

,[DATAAREAID]

,[RECVERSION]

,[RECID]

FROM [V4A_DYNAMICSAX_2009_TEST].[dbo].[PURCHPARMSUBLINE]

where JOURNALREFTABLEID = 501

and

(

JOURNALREFRECID in (5637162149, 5637160906, 5637148582)

or

RECID in (5637162149, 5637160906, 5637148582)

)

or DOCUMENTID = '0031299177'

 

-->

PARMID LINEREFRECID JOURNALREFTABLEID JOURNALREFRECID RECEIVENOW INVENTNOW DOCUMENTID DATAAREAID RECVERSION RECID

SID0015827 5637160906 501 5637147339 1.000000000000 1.000000000000 0031299177 bzo 1 5637148582

 

--audit trail: 5637181587

--> The packing slip is posted, but the invoice cannot?

--DOCUMENTID = '0031299177' is the document no of the packing slip.

--Can I remove this line in [PURCHPARMSUBLINE] to allow invoice posting?

Reply
--- responded on 11 Jan 2010 7:16 AM

Hi,

This is the case/ bug report in functional point of view. My supplier uses SAP R/3.

Concerns: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=e50fac2f-d69f-4659-9c18-f008183c2419

PO  ItemNo PackingSlip InvoiceNo

po1 itemno1 ps1 invoice1
po2 itemno2 ps1 invoice2
po2 itemno3 ps1 invoice2
po2 itemno4 ps2 invoice2

So dataflow:
po1 --> ps1, invoice1
po2 --> (ps1,ps2), (invoice1, invoice2)

Any help is appreciated.

J.

Reply
--- responded on 11 Jan 2010 7:24 AM

*** THIS SOLUTION IS UNCONFIRMED. DO NOT USE IN PRODUCTION *** 

Hi,

I have done next in my test database/ setup.

  1. Look up any related data based on parmid
  2. delete PURCHPARMSUBLINE where PARMID = 'sid0015827'
  3. Now the matching details on invoice posting show correctly 2 packing slips. I deselect the one of p21 of po2.
  4. Then I check matching details and invoice matches the amount of the po1.
  5. Now I can post my invoice without any problems.

Can a developer of MS Dynamics AX 2009 confirm this bug and the solution I put forward here?

Thank you.

J.

 

 

Reply
André Arnaud de Calavon responded on 11 Jan 2010 1:15 PM

Hi

With your information I dont know for sure if you encountered a bug. We did not have any problems with partial invoicing. In the past (v3.0) I had a similar problem when trying to post an invoice on a purchase order which was linked to a project. It turned out to be a bug in some tailor made software for the master planning.

regards,

André

Reply
--- responded on 11 Jan 2010 1:25 PM

Hi Andre,

As far as I know there is no tailor made software:

Do you know where *sub tables are used for? There are a lot of records in it. Can you have a look at your table?

PO  ItemNo PackingSlip InvoiceNo

po1 itemno1 ps1 invoice1
po2 itemno2 ps1 invoice2
po2 itemno3 ps1 invoice2
po2 itemno4 ps2 invoice2

So dataflow:
po1 --> ps1, invoice1
po2 --> (ps1,ps2), (invoice1, invoice2)

I saw the product suggestion / bug report is not there, only for 299 euro to get assistance in 4 hrs.

J.

Reply
André Arnaud de Calavon responded on 11 Jan 2010 1:40 PM

Hi,

The purchparm* tables are used for the user input on invoice posting. When posting the information in the tables are used directly and the status will be executed. If you post in a batch (AOS will do it for you). The records are kept with a status wainting to be executed.

The PurchParmSubLine is new in AX2009. I can check the contents within 10 hours. At this moment it is evening in our country. And there is a hardware maintenance, so I cannot access.

regards,

André

Reply
--- responded on 11 Jan 2010 2:21 PM

Hi Andre,

  1. I confirm what you state. The table is used once you open the invoice posting and select a packing slip. Then records are created in it. Below some sql statements.
  2. If you cancel this screen, the records are removed.
  3. Can it be that is the AOS is killed or client - server connection is lost that those records remain and cannot be matched anymore? The user told me that connection was lost and after that could not match anymore? It seems that you use this table for batch processing. So much be some intermediate table then?
  4. If you post the invoice the records remain however.
  5. What if you delete the content of this table? Is it used to match packing list and invoice or just temporarily use?

Mvgt,
J.

=================

SELECT COUNT(*) FROM [PURCHPARMSUBLINE]

SELECT * FROM [PURCHPARMSUBLINE]

--1279

select MAX(parmid) FROM [PURCHPARMSUBLINE] --SID0017506

select Min(parmid) FROM [PURCHPARMSUBLINE] --SID0000199

 

Reply
André Arnaud de Calavon responded on 11 Jan 2010 10:06 PM

Hi,

For the purchparm* tables a function called "Purch update history clean up" exists within AX. You can find this function in the periodic, clean up section of the purchase ledger area.

If this function does not delete your "hanging" lines you can surely delete these lines manually. You can select which lines can be deleted: only executed or erroneous lines as well. The next posting of your invoice will create new lines.

I think that the lost of the server connection can indeed cause this problem. The parm tables are committed in the database before the real update of the invoice starts.

regards,

André

Reply
--- responded on 12 Jan 2010 12:14 AM

Dear Andre,

I confirm issue has been resolved. This functionality does clean the tables listed above:

Accounts Payable --> Periodic --> Clean up --> Purchase update history clean up.

These all result empty or count = 0 after running:

SELECT COUNT(*) FROM [PURCHPARMSUBLINE]

SELECT * FROM [PURCHPARMSUBLINE]

select MAX(parmid) FROM [PURCHPARMSUBLINE]

select Min(parmid) FROM [PURCHPARMSUBLINE]

This table still holds one record:

select * from dbo.PURCHPARMSUBTABLE

Thank you very much./ Dank je wel.

J.

Reply
--- responded on 4 Aug 2010 7:15 AM

This does not work on the day itself. So today this error, you can only run it next day. So next resolves:

delete [PURCHPARMSUBLINE]
delete PURCHPARMSUBTABLE

Reply
Suggested Answer
Rushi K responded on 20 Apr 2014 6:13 AM

The issue persists with AX 2012 R2 and in my case neither PurchParmSubLine had records nor there were any pending invoices.

I was able to resolve the issue by deleting invoice records from "Invoice history and matching details" (AP > Inquiries > History ) form.

The batch was stuck in status "Waiting" and hence the problem.

Hope this helps :)

Reply