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

This commit is contained in:
Carlos Ruiz 2017-04-18 14:11:52 +02:00
parent 6a2556e307
commit 313d4a5b98
1 changed files with 2 additions and 2 deletions

View File

@ -812,8 +812,8 @@ public abstract class Doc
{ {
if (DocumentType != null) if (DocumentType != null)
m_DocumentType = DocumentType; m_DocumentType = DocumentType;
// No Document Type defined // IDEMPIERE-3342 - prefer the category defined for the doctype if there is such column in the table
if (m_DocumentType == null && getC_DocType_ID() != 0) if (p_po.get_ColumnIndex("C_DocType_ID") >= 0 && getC_DocType_ID() != 0)
{ {
String sql = "SELECT DocBaseType, GL_Category_ID FROM C_DocType WHERE C_DocType_ID=?"; String sql = "SELECT DocBaseType, GL_Category_ID FROM C_DocType WHERE C_DocType_ID=?";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;