Beispiel #1
0
        static void Main()
        {
            List <Amount>    amounts    = LoadAmounts();
            List <WiresFile> wiersFiles = Tools.LoadWiresFiles();

            Tools.RewriteWiresFiles(wiersFiles);

            Dictionary <string, SctMoving> movingList = Tools.GetMovingList(amounts, wiersFiles);

            VD001.Run(movingList);
            VD002.Run(movingList);
            VD003.Run(movingList);
            VD004.Run(movingList);

            Console.WriteLine(movingList.Count);
        }
Beispiel #2
0
        public static void Run(Dictionary <string, SctMoving> movingList)
        {
            List <Amount>    amounts    = Program.LoadAmounts();
            List <WiresFile> wiersFiles = Tools.LoadWiresFiles();

            string[] paramsKrd = "расходы ссуда".Split(' ');
            string[] paramsDbt = "доходы".Split(' ');

            foreach (string sctName in movingList.Keys)
            {
                bool bDbt = CheckIfExists(paramsDbt, sctName);
                bool bKrd = CheckIfExists(paramsKrd, sctName);

                if (!bDbt && !bKrd)
                {
                    continue;
                }

                Sum sKont = movingList[sctName].SKont;
                if (sKont.IsZero)
                {
                    continue;
                }

                if (bKrd)
                {
                    wiersFiles[0].Insert(new Wire((Date)32, "все расходы", sctName, sKont, "", wiersFiles.Count + 1000));
                    wiersFiles[0].Insert(new Wire((Date)32, "баланс", "все расходы", sKont, "", wiersFiles.Count + 1000));
                }
                else
                {
                    wiersFiles[0].Insert(new Wire((Date)32, sctName, "все доходы", sKont, "", wiersFiles.Count + 1000));
                    wiersFiles[0].Insert(new Wire((Date)32, "все доходы", "баланс", sKont, "", wiersFiles.Count + 1000));
                }
            }

            movingList = Tools.GetMovingList(amounts, wiersFiles);

            VD001.Run(movingList, "vd004.txt");
        }