// GET: ReceiptsChart
        public ActionResult ReceiptsChart(ReceiptsModels model)
        {
            // Fill Chart Data ------------------------------------------
            #region Chart Data

            var api  = new ReportsApiController();
            var data = api.GetInvoiceRemainChart(model).ToList();

            var opt = new ChartOption()
            {
                Name      = "receiptsChart",
                ChartType = ChartTypes.Column,
                //XAxisData = chartCategories,
                YAxisData = new Data(data.Select(x => new Point()
                {
                    Id = x.id.ToString(), Name = x.name, Y = x.y
                }).ToArray()),
                Tilte          = "گزارش جمعی رسیدی ها به تفکیک متصدی ها",
                YAxisTitle     = "جمع ریالی",
                SeriesName     = "پرسنل",
                ShowLegend     = false,
                ShowDataLabels = true,
                SubTitle       = $"مبلغ کل رسیدی دفتر: {data.Sum(x => (long)x.y).ToString("N0", CultureInfo.GetCultureInfo("fa-IR"))}"
            };

            #endregion
            //----------------------------------------------------------

            return(PartialView("Receipt/ReceiptsChart", HtmlHelperExtensions.GetHighChart(opt)));
        }
예제 #2
0
        public IEnumerable <dynamic> GetInvoiceRemainChart(ReceiptsModels model)
        {
            var result = Connections.SaleBranch.SqlConn.Query("sp_GetInvoiceRemainChart",
                                                              new
            {
                EmployeeID     = CurrentUser.UserName,
                EmployeeTypeid = CurrentUser.EmployeeType,
                FromRemain     = model.FromNo,
                ToRemain       = model.ToNo,
                DistanceAfterDistributeDate = model.DistanceAfterDistributeDate,
                RunDate = DateTime.Now.GetPersianDateNumber()
            },
                                                              commandType: System.Data.CommandType.StoredProcedure);

            return(result);
        }
        public ActionResult Receipts(ReceiptsModels model)
        {
            ViewBag.Title   = "گزارش رسیدی";
            ViewData["dir"] = "ltr";

            if (model == null || (model.FromNo == 0 && model.ToNo == 0))
            {
                model = new ReceiptsModels()
                {
                    FromNo = 10000,
                    ToNo   = 1000000000000,
                    DistanceAfterDistributeDate = 2
                };
            }

            return(View("Receipt/Receipts", model));
        }
        // GET: ReceiptsTable
        public ActionResult ReceiptsTable(ReceiptsModels model)
        {
            ViewBag.Username = CurrentUser.UserName;

            // Fill Table data ------------------------------------------
            #region Table Data

            var tableData = Connections.SaleBranch.SqlConn.ExecuteReader(
                "sp_GetInvoiceRemain",
                new
            {
                EmployeeID     = CurrentUser.UserName,
                EmployeeTypeid = CurrentUser.EmployeeType,
                FromRemain     = model.FromNo,
                ToRemain       = model.ToNo,
                DistanceAfterDistributeDate = model.DistanceAfterDistributeDate,
                RunDate = DateTime.Now.GetPersianDateNumber()
            },
                commandType: CommandType.StoredProcedure).ToDataTable();

            var tblModel = new TableOption()
            {
                Id   = "receipts",
                Data = tableData,
                DisplayRowsLength    = 10,
                Orders               = new[] { Tuple.Create(0, OrderType.desc) },
                TotalFooterColumns   = new[] { "InvoiceRemain", "Payable" },
                AverageFooterColumns = new[] { "ShamsiDateDiff" },
                CurrencyColumns      = new[] { 8, 9 }
            };

            #endregion
            //-----------------------------------------------------------


            ToolsController.SetLastUserRunningAction(CurrentUser.UserName, "ReceiptsTable", tableData);

            return(PartialView("Receipt/ReceiptsTable", tblModel));
        }