Exemplo n.º 1
0
        public string GetDailyReportStr(DayReportModel dayReport)
        {
            TicketSet ticketSet = new TicketSet();

            ticketSet.TicketWidth = dayReport.TicketWidth;
            ticketSet.SignWeight  = '-';
            ticketSet.SignLight   = '-';
            ticketSet.Colper1     = 0.37M;
            ticketSet.Colper2     = 0.18M;
            ticketSet.Colper3     = 0.45M;

            ticketSet.DayReportModel = dayReport;

            var ticketStr = ticketSet.DayReport();

            return(ticketStr);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 打印日结单
        /// </summary>
        public void PrintDayReport()
        {
            DayReportModel dayReport = new DayReportModel();

            dayReport.TicketWidth  = 30;
            dayReport.StoreName    = "小慧1店";
            dayReport.Title        = "日结报表";
            dayReport.Title2       = "POS机号:001";
            dayReport.StockDateStr = "日结时间:" + DateTime.Now.ToString("yyyy-MM-dd");
            dayReport.PrintDate    = DateTime.Now;
            List <TransactionItemModel> transactionItemList = new List <TransactionItemModel>();

            transactionItemList.Add(new TransactionItemModel("销售合计", 6400, 77670000.40M));
            transactionItemList.Add(new TransactionItemModel("退货合计", 0, 0.00M));
            transactionItemList.Add(new TransactionItemModel("赠送合计", 7, 175.00M));
            transactionItemList.Add(new TransactionItemModel("换货合计", 71, 7767.40M));
            dayReport.TransactionItemList = transactionItemList;

            List <EmployeeModel> employeeList = new List <EmployeeModel>();
            EmployeeModel        employee1    = new EmployeeModel();

            employee1.EmployeeSN = "001";
            employee1.Name       = "员工1";
            employee1.BeginTime  = DateTime.Now.AddDays(-1);
            employee1.EndTime    = DateTime.Now;
            employee1.EmployeeTransactionItems = new List <TransactionItemModel>();
            var employee1ChildItems1 = new Dictionary <string, decimal>();

            employee1ChildItems1.Add("RMB-现金", 4361.00M);
            employee1ChildItems1.Add("RMB-银行卡", 891.00M);
            employee1ChildItems1.Add("RMB-自动抹零", 0.00M);
            employee1.EmployeeTransactionItems.Add(new TransactionItemModel("销售合计", 44, 445252.00M, employee1ChildItems1));
            //var employee1ChildItems2 = new Dictionary<string, decimal>();
            //employee1ChildItems2.Add("RMB-赠送", 200.00M);
            employee1.EmployeeTransactionItems.Add(new TransactionItemModel("赠送合计", 6, 3000M));
            employee1.EmployeeTransactionItems.Add(new TransactionItemModel("入款合计", 10, 2510.12M));
            employee1.EmployeeTransactionItems.Add(new TransactionItemModel("出款合计", 10, 310.22M));
            employee1.EmployeeTransactionItems.Add(new TransactionItemModel("退货合计", 10, 500.72M));
            employee1.EmployeeTransactionItems.Add(new TransactionItemModel("换货合计", 10, 510.10M));
            employee1.EmployeeTransactionItems.Add(new TransactionItemModel("剩余现金", 610.12M));

            EmployeeModel employee2 = new EmployeeModel();

            employee2.EmployeeSN = "002";
            employee2.Name       = "员工2";
            employee2.BeginTime  = DateTime.Now.AddDays(-1);
            employee2.EndTime    = DateTime.Now;
            employee2.EmployeeTransactionItems = new List <TransactionItemModel>();
            var employee2ChildItems1 = new Dictionary <string, decimal>();

            employee2ChildItems1.Add("RMB-现金", 4361.00M);
            employee2ChildItems1.Add("RMB-银行卡", 891.00M);
            employee2ChildItems1.Add("RMB-自动抹零", 0.00M);
            employee2.EmployeeTransactionItems.Add(new TransactionItemModel("销售合计", 44, 445252.00M, employee2ChildItems1));
            //var employee2ChildItems2 = new Dictionary<string, decimal>();
            //employee2ChildItems2.Add("RMB-赠送", 200.00M);
            employee2.EmployeeTransactionItems.Add(new TransactionItemModel("赠送合计", 6, 3000M));
            employee2.EmployeeTransactionItems.Add(new TransactionItemModel("入款合计", 10, 2510.12M));
            employee2.EmployeeTransactionItems.Add(new TransactionItemModel("出款合计", 10, 310.22M));
            employee2.EmployeeTransactionItems.Add(new TransactionItemModel("退货合计", 10, 500.72M));
            employee2.EmployeeTransactionItems.Add(new TransactionItemModel("换货合计", 10, 510.10M));
            employee2.EmployeeTransactionItems.Add(new TransactionItemModel("剩余现金", 610.12M));

            employeeList.Add(employee1);
            employeeList.Add(employee2);

            dayReport.EmployeeList = employeeList;

            string printStr = GetDailyReportStr(dayReport);

            PrintHelper.Print(printStr, null, true);
        }