In posting, when selecting a GL Category, the type of document is not taken into account.

Description

We can create some GL_Category for one DocBaseType in "Document Type" window and for each GL_Category create one Document Type. For example:
No — DocType — GL_Category — DocBaseType
1 — Allocation — AP Cash/Payments — CMA
2 — Allocation-2 — AP Cash/Payments-2 — CMA

Then we create document Allocation with doctype = "Allocation-2". When we post this document into fact_acct creates lines with GL_Category_ID = "AP Cash/Payments", but it is wrong, because must be GL_Category_ID = "AP Cash/Payments-2".

___________________

Error in Doc.java class in method "public void setDocumentType (String DocumentType)"
The solution is:

// We have a document Type, but no GL info - search for DocType
if (m_GL_Category_ID == 0)
{
String sql = "SELECT GL_Category_ID FROM C_DocType "
+ "WHERE AD_Client_ID=? AND DocBaseType=?";

+ if (getC_DocType_ID() > 0)
+ sql = sql + " AND C_DocType_ID = ?";

PreparedStatement pstmt = null;
ResultSet rsDT = null;
try
{

Environment

None

Assignee

Carlos Ruiz

Reporter

Денис Кузнецов

Labels

None

Tested By

None

Components

Affects versions

Priority

Major
Configure