Exemple #1
0
        public void TestGetBalances()
        {
            var glAccountBalances = GlBalnceService.GetBalances("Z900", "2020", "10");

            foreach (var item in glAccountBalances)
            {
                Console.WriteLine($"{ item.FSITEM} \t { item.BALANCE }");
            }
        }
Exemple #2
0
        public static double FsItemBalance(
            [ExcelArgument(Description = "公司代码")]
            string companyCode,
            [ExcelArgument(Description = "年度")]
            string year,
            [ExcelArgument(Description = "期间")]
            string period,
            [ExcelArgument(Description = "报表项, 在SAP中用GS03查看")]
            string fsItem,
            [ExcelArgument(Description = "金额类型(1:年初余额,2:期初余额,3:期间借方,4:期间贷方,5:期间净额,6:期末余额)")]
            int amountType)
        {
            double rv = 0.0;

            var glAccountBalances = GlBalnceService.GetBalances(companyCode.ToString(), year, period);
            var fsItemBalances    = glAccountBalances.FirstOrDefault(i => i.FSITEM.Equals(fsItem));

            switch (amountType)
            {
            case 1:
                rv = fsItemBalances.YR_OPENBAL;
                break;

            case 2:
                rv = fsItemBalances.OPEN_BALANCE;
                break;

            case 3:
                rv = fsItemBalances.DEBIT_PER;
                break;

            case 4:
                rv = fsItemBalances.CREDIT_PER;
                break;

            case 5:
                rv = fsItemBalances.PER_AMT;
                break;

            case 6:
                rv = fsItemBalances.BALANCE;
                break;
            }

            return(rv);
        }