From e7b227200ed919f25a8bfdcebb22fff3a3fd1d8f Mon Sep 17 00:00:00 2001 From: Ray Lee Date: Thu, 9 Apr 2020 06:08:41 +0800 Subject: [PATCH] IDEMPIERE-4240 --- .../src/org/compiere/model/MDocTypeCounter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java b/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java index c1514643d7..8b9d333cfc 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java +++ b/org.adempiere.base/src/org/compiere/model/MDocTypeCounter.java @@ -82,6 +82,8 @@ public class MDocTypeCounter extends X_C_DocTypeCounter return Counter_C_DocType_ID; } // getCounterDocType_ID + + /** * Get (first) valid Counter document for document type * @param ctx context @@ -97,7 +99,7 @@ public class MDocTypeCounter extends X_C_DocTypeCounter // Direct Relationship MDocTypeCounter temp = null; - String sql = "SELECT * FROM C_DocTypeCounter WHERE C_DocType_ID=?"; + String sql = "SELECT * FROM C_DocTypeCounter WHERE IsActive = 'Y' and C_DocType_ID=?"; PreparedStatement pstmt = null; ResultSet rs = null; try