Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0002598Openbravo ERP03. Procurement managementpublic2008-02-07 08:462008-06-18 18:16
user71 
gorkaion 
normalminoralways
closedduplicate 
5
 
2.40alpha-r3 
No
Core
No
0002598: Pending Goods Receipts: Wrong DocumentNo
Version: 2.35MP1 (Oracle)

The class "MaterialReceiptPending.java" has an error in the function "processPurchaseOrder". When it's looking for the DocumentNo, it gets a wrong value, because it's getting the values "C_DocTypeTarget_ID" and "C_DocType_ID" by the Context values, OK, but in the next line:

strDocumentno = Utility.getDocumentNo(this, vars, "", "M_InOut", Utility.getContext(this, vars, "C_DocTypeTarget_ID", docTargetType), Utility.getContext(this, vars, "C_DocType_ID", docTargetType), false, true);

the parameter "docTargetType" it's wrong, because it must be the ad_window_id (184), the "Goods Receipt" window. Due this, it doesn't find the Context value and use the session default value, generating an error in the DocumentNo, because the session value to "C_DocTypeTarget_ID" and "C_DocType_ID" are 1000026 (Sales Standard Order).

The correct line is the next:

strDocumentno = Utility.getDocumentNo(this, vars, "", "M_InOut", Utility.getContext(this, vars, "C_DocTypeTarget_ID", "184"), Utility.getContext(this, vars, "C_DocType_ID", "184"), false, true);

and you have to define two Preferences (one for "C_DocTypeTarget_ID" and another one for "C_DocType_ID") without User, to the window "Goods Receipt" and value "1000007" (MM Receipt with Confirmation)
No tags attached.
depends on backport 0003735 closed gorkaion Pending Goods Receipts: Wrong DocumentNo 
Issue History
2008-06-18 18:16plujanStatusresolved => closed

Notes
(0006187)
user71   
2005-06-01 00:00   
(edited on: 2008-06-12 09:43)
This bug was originally reported in SourceForge bug tracker and then migrated to Mantis.

You can see the original bug report in:
https://sourceforge.net/support/tracker.php?aid=1888569 [^]
(0003158)
cromero   
2008-05-20 18:41   
(edited on: 2008-06-12 09:24)
Logged In: YES
user_id=1500614
Originator: NO

This same bug has been reported here:
https://issues.openbravo.com/view.php?id=314 [^]
with a different proposal for the solution
(0003159)
gorkaion   
2008-05-29 19:41   
(edited on: 2008-06-12 09:24)
Logged In: YES
user_id=1500690
Originator: NO

Fixed on trunk revision 4679

Now it is used AD_GET_DOCTYPE PL/SQL function to get the docTargetType.