Exemplo n.º 1
0
        public static DailyStatusReport New(ITenantDBsDir dir, DateTime date)
        {
            var ds       = new DailyStatusReport(dir, date);
            var colxnsDb = ds.DBsDir.Collections.For(date);
            var mkt      = ds.DBsDir.MarketState;

            ds.BranchName      = mkt.BranchName;
            ds.SectionColxns   = new DailyColxnsReport(date, ds.DBsDir);
            ds.StallsInventory = new StallsInventoryReport(colxnsDb, mkt);
            ds.CollectorsPerf  = CollectorsPerformanceReport.New(ds.DBsDir.MarketState, colxnsDb);
            ds.OtherColxns     = ds.LoadOtherColxns(colxnsDb);
            ds.BankDeposits    = ds.LoadBankDeposits(colxnsDb);
            ds.Overdues        = ds.DBsDir.Balances.TotalOverdues(date);
            return(ds);
        }
Exemplo n.º 2
0
        public static CollectorsPerformanceReport New(IMarketStateDB mkt, ICollectionsDB db)
        {
            var cp = new CollectorsPerformanceReport();

            var collectors = db.CollectorsSnapshot
                             ?? mkt.Collectors.GetAll();

            foreach (var collector in collectors)
            {
                cp.Add(CollectorPerformanceRow.New(collector, mkt.Stalls, db, mkt));
            }

            cp.RemoveAll(_ => !_.Any());

            return(cp);
        }