Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027705Openbravo ERP03. Procurement managementpublic2014-09-29 12:322017-11-14 11:47
psanjuan 
nonofrancisco 
urgentmajoralways
newopen 
20Ubuntu 8.04.1
 
 
Core
No
0027705: No matched invoice in case of booking an invoice prior to the receipt
No matched invoice in case of booking an invoice prior to the receipt
Go to purchase order and create a new order by entering below data:

Organization: F&B Us
BP: Be Soft Drinker
Date: 29/09/2014
Product: Cherry Cola
Ordered Quantity: 1000

Book the order. Let say order number is 1000110

Go to purchase invoice and create a new invoice dated on 30/09/2014 for F&B US and Be Soft Drinker BP. Use the process button "Create lines from" and select the order 1000110.

Complete and post the invoice. Let say invoice number is 10000563.

Go to Goods Receipts window and create a new receipt dated on 10/10/2014 (movement date) for F&B US and Be Soft Drinker BP. Use the process button "Create Lines From" and select the order 1000110. Select the line and receive only 80 units. Enter a Storage Bin. Press OK.
Complete and Post the receipt.
Posting would look like:
Debit: Inventory Asset 44 (80 units *0,55 )
Credit: Goods Received and not invoiced 44

Go to Goods Receipt window and create a new receipt dated on 20/10/2014 (movement date). Use the process button "Create Lines From" and select the order 1000110. Select the line and receive remaining 920 units. Enter a Storage Bin. Press OK.
Complete and Post the receipt.
Posting would look like:
Debit: Inventory Asset 506 (920 units *0,55 )
Credit: Goods Received and not invoiced 506

Go to goods receipts window and create a new receipt dated on 25/10/2014 (movement date). Use the process button "Create Lines From". This time select the invoice 10000563.

Realize that a quantity of 920 unit remains pending to be received. See image attached.


Receipts created from the order should be linked to the invoice, if the invoice is linked to the order. Therefore in our example there is nothing pending to be received.
No tags attached.
related to design defect 0031313 closed Triage Omni OMS Matched Invoice records are created in the Create Lines process (selecting order lines) but not in Pending Goods Receipt process 
png issue_27705.png (28,229) 2014-09-29 12:53
https://issues.openbravo.com/file_download.php?file_id=7279&type=bug
png
Issue History
2014-09-29 12:32psanjuanNew Issue
2014-09-29 12:32psanjuanAssigned To => dmiguelez
2014-09-29 12:32psanjuanModules => Core
2014-09-29 12:32psanjuanTriggers an Emergency Pack => No
2014-09-29 12:39psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6674#r6674
2014-09-29 12:53psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6675#r6675
2014-09-29 12:53psanjuanProposed Solution updated
2014-09-29 12:53psanjuanFile Added: issue_27705.png
2014-09-29 12:54psanjuanProposed Solution updated
2015-10-30 13:11ngarciaRelationship addedrelated to 0031313
2017-11-10 10:17ngarciaResolution time => 1512082800
2017-11-10 10:17ngarciaIssue Monitored: networkb
2017-11-10 10:18ngarciaAssigned Todmiguelez => Triage Finance
2017-11-10 11:00ngarciaResolution time1512082800 =>
2017-11-10 13:15dmiguelezAssigned ToTriage Finance => nonofrancisco
2017-11-14 11:47dmiguelezNote Added: 0100510
2017-11-14 11:47dmiguelezTypedefect => design defect

Notes
(0100510)
dmiguelez   
2017-11-14 11:47   
Moved to design defect:

We have M_InOutLine_ID reference in C_InvoiceLine which can hold information for a single Goods Receipt Line only. In the scenario reported we have multiple M_InoutLine_ID for a single C_InvoiceLine_ID. At the time of first partial Goods Receipt we mark Invoice Line ID with first M_InoutLine Reference and only for this record Match Invoice record is created and other are skipped.

Fixing this issue would require a deep refactor in the code and in the way to store the relationships between invoice lines and shipment lines.

Moved to design defect.


While trying to fix this Issue, several solutions were proposed, but nono of them was correct, also, some things were noted:

* Proposal: Create the MatchInvoice in the CreateFrom process. This is not correct. The MatchInvoice shold be created when completing the Document.
  If it is created with the process, it might happen that the user changes the data of the Goods Receipt Line before completing the Document.
  In this case the MatchInvoice record does not reflect the changes
* Note: CreateFrom_Shipment_data.xsql. Query updateInvoiceOrder. This is not correct
  Example: Create a Purchase Order of 5 Units. Create two Purchase Invoices of 3 and 2 units against the Purchase Order. Both Invoice Lines are related to the Order Line.
           Create a Goods Receipt of 1 unit. Following the logic of the query, this reception line is linked to both Invoice Lines. That is not correct.
           Also, it does not fully complete either line, so it is not possible to create a new relationshipt again