Exemplo n.º 1
0
        static public CashCashsubLedger getInctance()
        {
            if (m_instance == null)
            {
                m_instance = new CashCashsubLedger();
            }

            return(m_instance);
        }
Exemplo n.º 2
0
        // 得到当前系统现金账余额
        public static double getCachBalance()
        {
            double balance = -1;

            // 查询现金明细账中,最后一笔通过的审核的单据余额,就是当前系统的库存现金余额
            SortedDictionary <int, CashCashsubLedgerTable> cashCashsubLedgerList =
                CashCashsubLedger.getInctance().getAllReviewCashCashsubLedgerInfo();

            foreach (KeyValuePair <int, CashCashsubLedgerTable> index in cashCashsubLedgerList)
            {
                balance = index.Value.balance;
            }

            if (balance == -1)
            {
                // 如果系统中还没有任何一笔通过审核的现金交易,则查询 现金结存信息账(上月结转)表,得到当前系统的现余额
                balance = getCashBalanceLaseMonth();
            }

            return(balance);
        }