首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GL- adempiere中的类别序列

GL- adempiere中的类别序列
EN

Stack Overflow用户
提问于 2017-04-01 04:10:39
回答 1查看 78关注 0票数 0

我想为每个现金日记帐创建一个类似于文档序列的GL-Category序列。

我在现金日记帐窗口中添加了一个名为日记帐号的字段。

我想为每个现金日记帐生成一个数字,并将其递增1?

EN

回答 1

Stack Overflow用户

发布于 2017-10-15 22:01:52

文档序列由ADempiere中的PO.java类管理。要使用它,您需要向表中添加一个列名为"DocumentNo“的列。您需要在顺序表中添加该条目以跟踪编号。

下面是PO.java中的代码,它在第一次保存记录时运行。

代码语言:javascript
复制
    //  Set new DocumentNo
    String columnName = "DocumentNo";
    int index = p_info.getColumnIndex(columnName);
    if (index != -1 && p_info.getColumn(index).ColumnSQL == null)
    {
        String value = (String)get_Value(index);
        if (value != null && value.startsWith("<") && value.endsWith(">"))
            value = null;
        if (value == null || value.length() == 0)
        {
            int dt = p_info.getColumnIndex("C_DocTypeTarget_ID");
            if (dt == -1)
                dt = p_info.getColumnIndex("C_DocType_ID");
            if (dt != -1)       //  get based on Doc Type (might return null)
                value = DB.getDocumentNo(get_ValueAsInt(dt), m_trxName, false, this);
            if (value == null)  //  not overwritten by DocType and not manually entered
                value = DB.getDocumentNo(getAD_Client_ID(), p_info.getTableName(), m_trxName, this);
            set_ValueNoCheck(columnName, value);
        }
    }
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43148934

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档