Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

BestCustomersByOrderTotal.cshtml

@model CustomerReportsSearchModel
@using Nop.Services.Orders;

@{
    //page title
    ViewBag.PageTitle = T("Admin.Reports.Customers.BestBy.BestByOrderTotal").Text;
    //active menu item (system name)
    NopHtml.SetActiveMenuItemSystemName("Customers by order total");
}

@{
    const string hideSearchBlockAttributeName = "CustomersBestByOrderTotalPage.HideSearchBlock";
    var hideSearchBlock = await genericAttributeService.GetAttributeAsync<bool>(await workContext.GetCurrentCustomerAsync(), hideSearchBlockAttributeName);
}

<div class="content-header clearfix">
    <h1 class="float-left">
        @T("Admin.Reports.Customers.BestBy.BestByOrderTotal")
    </h1>
</div>

<section class="content">
    <div class="container-fluid">
    <div class="form-horizontal">
        <div class="cards-group">
            <div class="card card-default card-search">
                <div class="card-body">
                    <div class="row search-row @(!hideSearchBlock ? "opened" : "")" data-hideAttribute="@hideSearchBlockAttributeName">
                        <div class="search-text">@T("Admin.Common.Search")</div>
                        <div class="icon-search"><i class="fas fa-magnifying-glass" aria-hidden="true"></i></div>
                        <div class="icon-collapse"><i class="far fa-angle-@(!hideSearchBlock ? "up" : "down")" aria-hidden="true"></i></div>
                    </div>

                    <div class="search-body @(hideSearchBlock ? "closed" : "")">

                        <div class="row">
                            <div class="col-md-5">
                                <div class="form-group row">
                                    <div class="col-md-4">
                                        <nop-label asp-for="BestCustomersByOrderTotal.StartDate" />
                                    </div>
                                    <div class="col-md-8">
                                        <nop-editor asp-for="BestCustomersByOrderTotal.StartDate" />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <div class="col-md-4">
                                        <nop-label asp-for="BestCustomersByOrderTotal.EndDate" />
                                    </div>
                                    <div class="col-md-8">
                                        <nop-editor asp-for="BestCustomersByOrderTotal.EndDate" />
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-7">
                                <div class="form-group row">
                                    <div class="col-md-4">
                                        <nop-label asp-for="BestCustomersByOrderTotal.OrderStatusId" />
                                    </div>
                                    <div class="col-md-8">
                                        <nop-select asp-for="BestCustomersByOrderTotal.OrderStatusId" asp-items="Model.BestCustomersByOrderTotal.AvailableOrderStatuses" />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <div class="col-md-4">
                                        <nop-label asp-for="BestCustomersByOrderTotal.PaymentStatusId" />
                                    </div>
                                    <div class="col-md-8">
                                        <nop-select asp-for="BestCustomersByOrderTotal.PaymentStatusId" asp-items="Model.BestCustomersByOrderTotal.AvailablePaymentStatuses" />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <div class="col-md-4">
                                        <nop-label asp-for="BestCustomersByOrderTotal.ShippingStatusId" />
                                    </div>
                                    <div class="col-md-8">
                                        <nop-select asp-for="BestCustomersByOrderTotal.ShippingStatusId" asp-items="Model.BestCustomersByOrderTotal.AvailableShippingStatuses" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="text-center col-12">
                                <button type="button" id="search-best-customers-ordertotal" class="btn btn-primary btn-search">
                                    <i class="fas fa-chart-line"></i>
                                    @T("Admin.Reports.Customers.RunReport")
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="card card-default">
                <div class="card-body">
                    <nop-doc-reference asp-string-resource="@T("Admin.Documentation.Reference.Reports", Docs.Reports + Utm.OnAdmin)" />

                    @await Html.PartialAsync("Table", new DataTablesModel
                    {
                        Name = "customers-ordertotal-grid",
                        UrlRead = new DataUrl("ReportBestCustomersByOrderTotalList", "Report", null),
                        SearchButtonId = "search-best-customers-ordertotal",
                        Length = Model.BestCustomersByOrderTotal.PageSize,
                        LengthMenu = Model.BestCustomersByOrderTotal.AvailablePageSizes,
                        Filters = new List<FilterParameter>
                        {
                            new FilterParameter(nameof(Model.BestCustomersByOrderTotal.OrderBy), (int)OrderByEnum.OrderByTotalAmount),
                            new FilterParameter(nameof(Model.BestCustomersByOrderTotal.StartDate), nameof(CustomerReportsSearchModel.BestCustomersByOrderTotal)),
                            new FilterParameter(nameof(Model.BestCustomersByOrderTotal.EndDate), nameof(CustomerReportsSearchModel.BestCustomersByOrderTotal)),
                            new FilterParameter(nameof(Model.BestCustomersByOrderTotal.OrderStatusId), nameof(CustomerReportsSearchModel.BestCustomersByOrderTotal)),
                            new FilterParameter(nameof(Model.BestCustomersByOrderTotal.PaymentStatusId), nameof(CustomerReportsSearchModel.BestCustomersByOrderTotal)),
                            new FilterParameter(nameof(Model.BestCustomersByOrderTotal.ShippingStatusId), nameof(CustomerReportsSearchModel.BestCustomersByOrderTotal))
                        },
                        ColumnCollection = new List<ColumnProperty>
                        {
                            new ColumnProperty(nameof(BestCustomersReportModel.CustomerName))
                            {
                                Title = T("Admin.Reports.Customers.BestBy.Fields.Customer").Text
                            },
                            new ColumnProperty(nameof(BestCustomersReportModel.OrderTotal))
                            {
                                Title = T("Admin.Reports.Customers.BestBy.Fields.OrderTotal").Text
                            },
                            new ColumnProperty(nameof(BestCustomersReportModel.OrderCount))
                            {
                                Title = T("Admin.Reports.Customers.BestBy.Fields.OrderCount").Text
                            },
                            new ColumnProperty(nameof(BestCustomersReportModel.CustomerId))
                            {
                                Title = T("Admin.Common.View").Text,
                                Width = "100",
                                ClassName =  NopColumnClassDefaults.Button,
                                Render = new RenderButtonView(new DataUrl("~/Admin/Customer/Edit/"))
                            }
                        }
                    })
                </div>
            </div>
        </div>
    </div>
</div>
</section>