PO Matching and PO list in Create Lines From: wrong result

Description

First part of the issue may be not issue at all. I'm not sure how it must work. But it is what lead me to the actual problem.

First part:
1. Create a Purchase Order for 10 pieces of Product
2. Create an Invoice for 5 items, complete it
3. Try to create Material Receipt for 10 items - system will to allow it (java.lang.IllegalStateException: Total matched qty > invoiced qty. MatchedQty=10, InvoicedQty=5, Line=MInvoiceLine[1000001,10,QtyInvoiced=5,LineNetAmt=900])
4. You still can create MR for 5 items twice in a row. As a result: 10 delivered, but 5 invoiced pieces.
Is it a proper behaviour for system? I'm not sure.

The next part:
1. Create Purchase Order for BP from first part
2. Click "Create Lines From"
3. Open list of Purchase Orders. Here you will not see PO from first part
4. Click on BP field to open Info Window and select same BP. And now in Purchase Order list you could see that Invoice from part one, where Qty Ordered is not equals to Qty Invoiced. Quantity of items would be 0 in grid.

Problem for the second part lies in fact that in first case system calls WCreateFromShipmentUI.initBPartner() method. And when you are changing BP -
WCreateFromShipmentUI.valueChange() where initBPOrderDetails() called with "forInvoice = true" unconditionally.

So, at least there is an bug in using wrong parameters for loading Order data.
And about first part - I would be glad to hear either it is a bug or I'm doing it wrong.
Everything was tested on Demo.

Environment

None

Activity

Show:
Nit K.
December 11, 2017, 4:46 AM

On First Part.
1. Create a Purchase Order for 10 pieces of Product
2. Create an Invoice for 5 items, complete it
3. Try to create Material Receipt for 10 items - system will to allow it (java.lang.IllegalStateException: Total matched qty > invoiced qty. MatchedQty=10, InvoicedQty=5, Line=MInvoiceLine[1000001,10,QtyInvoiced=5,LineNetAmt=900])
>> I try do step 1-3, not found any error (Material receipt qty=10).
4. You still can create MR for 5 items twice in a row. As a result: 10 delivered, but 5 invoiced pieces.
>> In step 4, I can't create MR (material receipt) for any qty after do step 3 with qty 10. But I can create another invoice with qty 5 (the remaining)

Is it a proper behaviour for system? I'm not sure.
In my opinion, (I'm an accountant) this is a normal process that you can do this.
Company has department account and stock control separate. The document from supplier will send separate also. Suppler will send the document(delivery document) to your company when send the product or send the invoice document when need the collect money.

In second Part (next part), I'd not yet done.

Carlos Ruiz
December 14, 2017, 3:18 PM

Part 1 - seems normal

Part 2 - committed fix - thanks for the tip

Assignee

Carlos Ruiz

Reporter

Anton Mostovenko

Labels

None

Tested By

None

Components

Fix versions

Affects versions

Priority

Minor
Configure