簡體   English   中英

后代中的GL類別序列

[英]GL-Category Sequence in adempiere

我想為每個現金日記帳創建一個像文檔序列這樣的GL類別序列。

我在現金日記帳窗口中添加了一個稱為日記帳編號的字段。

我想為每個現金日記帳生成一個數字並將其遞增1?

文檔序列由ADempiere中的PO.java類管理。 要使用它,您需要在表中添加一個列名稱為“ DocumentNo”的列。 您將需要在“序列”表中添加條目以跟蹤數字。

這是PO.java中的代碼,該代碼在第一次保存記錄時運行。

    //  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);
        }
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM