From: SourceForge.net <no...@so...> - 2010-04-06 09:30:27
|
Bugs item #2982558, was opened at 2010-04-06 12:30 Message generated for change (Tracker Item Submitted) made by petruc You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2982558&group_id=176962 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Order (PO) Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: petru_c (petruc) Assigned to: Nobody/Anonymous (nobody) Summary: C_InvoiceLine and C_OrderLine's QtyInvoiced do not match Initial Comment: Hello everybody ! When completing an Invoice with lines created from a Purchase order, the “qtyInvoiced” field in C_OrderLine is not updated correctly(actually the C_OrderLine.qtyInvoiced is double the C_InvoiceLine.qtyInvoiced). The reason is a piece code added in revizion 11773 to MInvoice.java How does it work: -the completeIt() method from MInvoice creates MatchPO records for the invoice lines. The afterSave() method from MMatchPO updates the qtyInvoiced from orderLine, by adding the C_InvoiceLine.qtyInvoiced. So far, nothing is wrong. -In revision 11773, the following lines of code were added to Minvoice.java (completeIt() method): if (isNewMatchPO) addDocsPostProcess(po); replacing if (MClient.isClientAccountingImmediate()) { String ignoreError = DocumentEngine.postImmediate(po.getCtx(), po.getAD_Client_ID(), po.get_Table_ID(),po.get_ID(), true, po.get_TrxName()); } This causes the DocumentEngine to process the MatchPO document and save it... again..., therefore adding the C_InvoiceLine.qtyInvoiced for the second time to C_OrderLine.qtyInvoiced. I did some tests using the old code and it works just fine. I think it might be somehow related to this feature request : 2962094 . I tested it on http://www.testadempiere.com with the latest release (release_rev11894_20100402201017). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2982558&group_id=176962 |