예제 #1
0
        private void ProcessHtmlStoreSUB(bool twoCreditAccounts)
        {
            StoreSUB report = GetReportFactory().GetReportStoreSUB(StartPeriod, EndPeriod, twoCreditAccounts, GetClientID());

            LoadGridSUB(report.Items, report.Summaries);
            SetLinkText("sub", "store", twoCreditAccounts);
        }
예제 #2
0
        private void ProcessHtmlAllSUB()
        {
            var      factory  = GetReportFactory();
            RoomSUB  roomSUB  = factory.GetReportRoomSUB(StartPeriod, EndPeriod, GetClientID());
            ToolSUB  toolSUB  = factory.GetReportToolSUB(StartPeriod, EndPeriod, GetClientID());
            StoreSUB storeSUB = factory.GetReportStoreSUB(StartPeriod, EndPeriod, false, GetClientID());

            IEnumerable <ServiceUnitBillingReportItem> allItems = ReportFactory.GetAllSUB(roomSUB, toolSUB, storeSUB, out double total);

            gvSUB.Columns[1].Visible = true;
            gvSUB.Columns[2].Visible = EndPeriod != StartPeriod.AddMonths(1);
            gvSUB.DataSource         = allItems;
            gvSUB.DataBind();
            SetTotalText(total);
            SetLinkText("sub", "all");
        }
예제 #3
0
        public StoreSUB GetStoreSUB(DateTime sd, DateTime ed, int id = 0, string option = null)
        {
            var twoCreditAccounts = false;

            if (!string.IsNullOrEmpty(option))
            {
                twoCreditAccounts = option == "two-credit-accounts";
            }

            StoreSUB report = new StoreSUB {
                StartPeriod = sd, EndPeriod = ed, ClientID = id, TwoCreditAccounts = twoCreditAccounts
            };

            StoreServiceUnitBillingGenerator.Create(Session, report).Generate();
            return(report);
        }
예제 #4
0
        private void ProcessExcelStoreSUB(bool twoCreditAccounts)
        {
            string filePath;

            if (twoCreditAccounts)
            {
                if (StartPeriod >= ReportSettings.July2009)
                {
                    StoreSUB report = GetReportFactory().GetReportStoreSUB(StartPeriod, EndPeriod, twoCreditAccounts, GetClientID());
                    filePath = GenerateExcelSUB(report.Items, report.Summaries, "Store");
                }
                else
                {
                    BillingUnit SummaryUnit1 = new BillingUnit();
                    BillingUnit SummaryUnit2 = new BillingUnit();
                    StoreReport rpt          = new StoreReport(StartPeriod, EndPeriod);
                    DataTable   dtStore      = rpt.GenerateDataTable(SummaryUnit1, SummaryUnit2);
                    filePath = rpt.GenerateExcelFile(dtStore);
                }
            }
            else
            {
                if (StartPeriod >= ReportSettings.July2009)
                {
                    StoreSUB report = GetReportFactory().GetReportStoreSUB(StartPeriod, EndPeriod, twoCreditAccounts, GetClientID());
                    filePath = GenerateExcelSUB(report.Items, report.Summaries, "Store");
                }
                else
                {
                    BillingUnit SummaryUnit1 = new BillingUnit();
                    BillingUnit SummaryUnit2 = new BillingUnit();
                    StoreReport rpt          = new StoreReport(StartPeriod, EndPeriod);
                    DataTable   dtStore      = rpt.GenerateDataTable(SummaryUnit1, SummaryUnit2);
                    filePath = rpt.GenerateExcelFile(dtStore);
                }
            }

            OutputExcel(filePath);
        }
예제 #5
0
        public static List <ServiceUnitBillingReportItem> GetAllSUB(RoomSUB roomSUB, ToolSUB toolSUB, StoreSUB storeSUB, out double total)
        {
            var allItems = new List <ServiceUnitBillingReportItem>();

            allItems.AddRange(roomSUB.CombinedItems);
            allItems.AddRange(toolSUB.CombinedItems);
            allItems.AddRange(storeSUB.CombinedItems);

            total = 0;

            foreach (var bu in roomSUB.Summaries)
            {
                total += bu.MerchandiseAmount;
            }

            foreach (var bu in toolSUB.Summaries)
            {
                total += bu.MerchandiseAmount;
            }

            foreach (var bu in storeSUB.Summaries)
            {
                total += bu.MerchandiseAmount;
            }

            return(allItems);
        }