< Summary

Information
Class: AspNetCoreGeneratedDocument.Areas_Studio2_Views_Shared__StandartOrderRow
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Studio2/Views/Shared/_StandartOrderRow.cshtml
Line coverage
0%
Covered lines: 0
Uncovered lines: 90
Coverable lines: 90
Total lines: 499
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 206
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ExecuteAsync()0%426422060%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Studio2/Views/Shared/_StandartOrderRow.cshtml

#LineLine coverage
 1@model List<OzonDomains.Models.Order>
 2
 3
 4<style>
 5
 6    th {
 7        white-space: nowrap;
 8    }
 9
 10    .container .row .col-md-4 {
 11        flex: 0 0 auto;
 12        max-width: 33.3333%;
 13    }
 14
 15    .container .custom-width-large {
 16        width: 265px;
 17    }
 18
 19    .product-cell {
 20        font-size: 11px;
 21    }
 22
 23        .product-cell:hover .product-popup {
 24            display: block;
 25        }
 26
 27    #processingDateFilter,
 28    #shippingDateFilter {
 29        width: 70px;
 30    }
 31
 32    #deliveryPeriodInput,
 33    #timeLeftDayInput {
 34        width: 50px;
 35    }
 36
 37    #statusFilter,
 38    #appStatusFilterInput,
 39    #supplierFilter
 40    {
 41        width: 103px;
 42    }
 43
 44    #ozonClientFilterInput,
 45    #deliveryCityFilter{
 46        width: 125px;
 47    }
 48
 49    #currentPriceWithDiscountFilter,
 50    #quantityFilter,
 51    #priceFilter,
 52    #shipmentAmountFilter,
 53    #purchasePriceFilter,
 54    #costPriceFilter,
 55    #ozonCommissionFilter,
 56    #profitFilter,
 57    #discountFilter {
 58        width: 70px;
 59        max-width: 70px;
 60    }
 61
 62    a {
 63        text-decoration: none;
 64    }
 65
 66    .horizontal-line {
 67        border-top: 1px solid #ccc;
 68        margin: 20px 0;
 69    }
 70
 71    #infoWindow {
 72        position: fixed;
 73        display: none;
 74        border: 1px solid #ccc;
 75        background-color: #fff;
 76        padding: 10px;
 77        z-index: 9999;
 78    }
 79
 80    th.active {
 81        background-color: #f4f4f4; /* Цвет подсветки */
 82    }
 83
 84    .button-container {
 85        display: flex;
 86        gap: 10px; /* Расстояние между кнопками */
 87    }
 88
 89    .horizontal-inputs {
 90        display: flex;
 91        align-items: center;
 92    }
 93
 94        .horizontal-inputs > div {
 95            margin-right: 10px; /* Отступ между элементами */
 96        }
 97
 98    .vertical-align {
 99        display: flex;
 100        flex-direction: column;
 101        align-items: center;
 102        justify-content: space-between;
 103        height: 100%;
 104    }
 105
 106        .vertical-align > * {
 107            margin: 2px 0; /* Минимальный отступ между элементами */
 108        }
 109
 110    .checkbox-column {
 111        display: flex;
 112        justify-content: center;
 113        align-items: center;
 114        width: 10px;
 115    }
 116
 117    .nowrap {
 118        white-space: nowrap;
 119    }
 120
 121    .product-cell {
 122        /* Убедитесь, что ширина элемента установлена */
 123        width: 100%; /* Или установите конкретную ширину, если нужно */
 124        /* Обрезка текста и добавление многоточия */
 125        white-space: nowrap;
 126        overflow: hidden;
 127        text-overflow: ellipsis;
 128    }
 129
 130    /* Изначально скрываем кнопку */
 131    .clear-btn {
 132        display: none;
 133        position: absolute;
 134        left: 100%;
 135        transform: translateX(0) translateY(-50%); /* Прижимаем к основной кнопке и центрируем по вертикали */
 136        z-index: 10; /* Поверх других элементов */
 137        top: 50%; /* Центрируем по вертикали относительно главной кнопки */
 138        opacity: 0; /* Прозрачность кнопки */
 139        border: solid 1px;
 140    }
 141
 142        /* Показываем кнопку при наведении на основную или на саму кнопку очистки */
 143        .btn-container:hover .clear-btn,
 144        .clear-btn:hover {
 145            display: block;
 146            opacity: 1; /* Увеличиваем непрозрачность при наведении */
 147            border: solid 1px;
 148        }
 149
 150    /* Обёртка для кнопок */
 151    .btn-container {
 152        position: relative;
 153        display: inline-block;
 154    }
 155
 156    .bg-green-300 {
 157        background-color: #73c487 !important; /* Bootstrap's 'bg-success' color */
 158    }
 159
 160    .placeholder {
 161        min-height: 1em; /* Вы можете настроить минимальную высоту по вашему усмотрению */
 162    }
 163
 164    button:focus {
 165        outline: none !important;
 166        box-shadow: none !important;
 167    }
 168
 169</style>
 0170@foreach (var item in Model)
 171        {
 0172            string rowClass = "custom-white";
 173
 0174            if (item.AppStatus?.Name == "Заказан поставщику")
 175            {
 0176                rowClass = "table-success";
 177            }
 178
 0179            if (item.IsReturnable == true)
 180            {
 0181                rowClass = "custom-red";
 182            }
 183
 0184            if (
 0185                (item.AppStatus?.Name == "Отменен" && (item.Status == "Отменён" || string.IsNullOrEmpty(item.Status))) |
 0186                item.Status == "Отменен" ||
 0187                item.Status == "Отменён"
 0188            )
 189            {
 0190                rowClass = "table-danger";
 191            }
 192
 0193            if (item.AppStatus?.Name  == "Отгружен постащиком")
 194            {
 0195                rowClass = "table-info";
 196            }
 197
 198
 199
 200            <tr class=@rowClass oncontextmenu="showInfoAtCursor('@item.Id', event); return false;">
 201                <td class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("ShipmentNumber") ? "bg-warning
 202                    <div class="d-flex align-items-center">
 0203                        @if (item.ExcelFileData != null)
 204                        {
 205                            <a href="@Url.Action("ViewFile", new { filePath = item.ExcelFileData.FolderName, fileName = 
 206                                <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class
 207                                    <path fill-rule="evenodd" d="M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-
 208                                </svg>
 209                            </a>
 210                        }
 211
 212                        <span class="ml-2">
 0213                            @Html.DisplayFor(modelItem => item.ShipmentNumber)
 214                        </span>
 215                    </div>
 216                </td>
 217
 218                <td>
 219                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("OzonClient") ? "bg-warnin
 0220                        @if (item.OzonClient != null)
 221                        {
 0222                            string ozonClient = item.OzonClient.Name;
 0223                            if (ozonClient.Length > 18)
 224                            {
 0225                                ozonClient = ozonClient.Substring(0,18) + "...";
 226                            }
 0227                            @ozonClient
 228                        }
 229                    </div>
 230
 0231                    @if (item.DeliveryCity != null && item.DeliveryCity != "")
 232                    {
 233                        <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("DeliveryCity") ? "bg-
 234                            @{
 0235                                string deliveryCity = item.DeliveryCity;
 0236                                if (deliveryCity.Length > 11)
 237                                {
 0238                                    deliveryCity = deliveryCity.Substring(0, 11) + "...";
 239                                }
 0240                                @deliveryCity
 241                            }
 242                        </div>
 243                    }
 0244                    @if (!string.IsNullOrEmpty(item.TrackingNumber))
 245                    {
 246                        <div class="text-muted" style="white-space: nowrap;" title="@item.TrackingNumber">
 0247                            <small>@item.TrackingNumber</small>
 248                        </div>
 249                    }
 250                </td>
 251
 252                <td>
 253                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("ProcessingDate") ? "bg-wa
 0254                        @Html.DisplayFor(modelItem => item.FormattedProcessingDate)
 255                    </div>
 256
 257                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("ShippingDate") ? "bg-warn
 0258                        @Html.DisplayFor(modelItem => item.FormattedShippingDate)
 259                    </div>
 260                </td>
 261
 262                <td>
 263                    <div style="white-space: nowrap; text-align: right;">
 0264                        <div title="@Html.DisplayFor(modelItem => item.FormattedDeliveryDay) @Html.DisplayFor(modelItem 
 265                    </div>
 266
 267                    <div style="white-space: nowrap; text-align: right;" class="text-muted">
 0268                        @Html.DisplayFor(modelItem => item.FormattedTimeLeftDay)
 269                    </div>
 270                </td>
 271
 272                <td>
 273                    <div class="container">
 274                        <div class="row mb-0 justify-content-between">
 275                                <div id="thArticle" title="@item.ProductKey" class="col-md-4 d-flex align-items-center m
 276                                        @{
 0277                                            string? productKey = item.ProductKey;
 0278                                            if (productKey != null && productKey.Length > 17)
 279                                            {
 0280                                                productKey = productKey.Substring(0, 17) + "...";
 281                                            }
 282                                        }
 0283                                        @productKey
 284                                </div>
 285
 286                                <div id="thManufacturer" class="col-md-4 d-flex flex-column mb-1 nowrap text-center">
 0287                                    @if(item.EtProducer != null && item.EtProducer.Name == null)
 288                                    {
 289                                       <form  asp-area="Studio2" asp-action="Index" asp-controller="Producers" method="p
 290                                            <input type="hidden" name="MarketPrefix" value="@item.EtProducer.MarketPrefi
 291                                            <button type="submit" class="btn btn-link">Указать</button>
 292                                       </form>
 293                                    }
 294                                    else
 295                                    {
 0296                                        @(item.EtProducer?.Name ?? "")
 297                                    }
 298                                </div>
 299
 300                                <div id="thArticle2" class="col-md-4 d-flex flex-column mb-1 nowrap text-end">
 0301                                    @if(item.Article != null){
 0302                                       @Html.DisplayFor(modelItem => item.Article)
 303                                    }
 304                                </div>
 305                        </div>
 306                        <div class="row mt-0">
 307                                <div id="thProductName" class="custom-width-large d-flex flex-column text-muted">
 308                                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("ProductNa
 309                                        <div class="product-cell" title="@Html.DisplayFor(modelItem => item.ProductName)
 0310                                            @Html.DisplayFor(modelItem => item.ProductName)
 311                                        </div>
 312                                    </div>
 313                                </div>
 314                        </div>
 315                    </div>
 316                </td>
 317
 318                <td>
 319                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("Status") ? "bg-warning" :
 0320                        @if(item.Status != null){
 0321                            string status = item.Status;
 0322                            if (status.Length > 14)
 323                            {
 0324                                status = status.Substring(0, 14) + "...";
 325                            }
 0326                            @status
 327                        }
 328                        else{
 329                            <br/>
 330                        }
 331
 332                    </div>
 333
 334                    @{
 0335                        var bgAppStatusColor = item.AppStatus?.StatusColor?.ColorCode ?? "transparent";
 0336                        var appStatusTextColor = StatusColorContrast.GetTextColor(bgAppStatusColor);
 0337                        var appStatusFull = item.AppStatus?.Name;
 0338                        var appStatusShort = appStatusFull;
 0339                        if (appStatusShort?.Length > 14)
 340                        {
 0341                            appStatusShort = appStatusShort.Substring(0, 14) + "...";
 342                        }
 0343                        var statusUrl = Url.Action("OrderStatus", "OrderStatusFlow", new { area = "Studio2", id = item.I
 344                    }
 345                    <a href="@statusUrl" target="_blank" class="text-decoration-none d-block"
 346                       title="@appStatusFull">
 347                        <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("AppStatusId") ? "bg-w
 348                             style="font-size: 13px;
 349                                    --status-badge-bg:@bgAppStatusColor;
 350                                    --status-badge-fg:@appStatusTextColor;
 351                                    background-color:@bgAppStatusColor;
 352                                    color:@appStatusTextColor;
 353                                    padding: 2px 5px;
 354                                    border-radius: 4px;
 355                                    font-weight: normal;">
 0356                            @appStatusShort
 357                        </div>
 358                    </a>
 359                </td>
 360
 361                <td>
 362                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("ShipmentWarehouseId") ? "
 0363                        @(item.ShipmentWarehouse?.Name ?? "")
 364                    </div>
 365
 366                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("AppStatusId") ? "bg-warni
 0367                        @Html.DisplayFor(modelItem => item.FormattedLastStatusChangeDate)
 368                    </div>
 369                </td>
 370                <td>
 371                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("SupplierId") ? "bg-warnin
 0372                        @(item.Supplier?.Name ?? "")
 373                    </div>
 374
 375                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("OrderNumberToSupplier") ?
 0376                        @Html.DisplayFor(modelItem => item.OrderNumberToSupplier)
 377                    </div>
 378                </td>
 379
 380                <td>
 381                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("ProductInfoId") ? "bg-war
 0382                        @if (item.ProductInfo?.CommercialCategory != null)
 383                        {
 0384                            string сommercialCategory = item.ProductInfo!.CommercialCategory;
 0385                            if (сommercialCategory.Length > 10)
 386                            {
 0387                                сommercialCategory = сommercialCategory.Substring(0, 10) + "...";
 388                            }
 0389                            @сommercialCategory
 390                        }
 391
 392                    </div>
 393
 394                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("ProductInfoId") ? "bg-war
 0395                        @(item.ProductInfo?.VolumetricWeight)
 0396                        @if (item.ProductInfo?.Weight != 0)
 397                        {
 398                            <div style="white-space: nowrap; margin: 0; font-size: 10px; text-align: right">
 0399                                @(item.ProductInfo?.Weight)
 400                            </div>
 401                        }
 402                    </div>
 403                </td>
 404
 405                <td>
 406                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("ProductInfoId") ? "bg-war
 0407                        @Html.Raw(string.Format("{0:N0}", item.ProductInfo?.CurrentPriceWithDiscount ?? 0).Replace(",", 
 408                    </div>
 409
 410                    <div class="text-muted quantity-cell" style="text-align: right;">
 411                        <span class="@(item.Quantity > 1 ? "qty-value--multi" : "")">
 0412                            @Html.DisplayFor(modelItem => item.Quantity)
 413                        </span>
 414                    </div>
 415                </td>
 416
 417                <td>
 418
 419                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("Price") ? "bg-warning" : 
 0420                        @Html.Raw(string.Format("{0:N0}", item.Price).Replace(",", " "))
 421                    </div>
 422
 423                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("ShipmentAmount") ? "bg-wa
 0424                        @Html.Raw(string.Format("{0:N0}", item.ShipmentAmount).Replace(",", " "))
 425                    </div>
 426                </td>
 427
 428
 429
 430                <td>
 431                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("PurchasePrice") ? "bg-war
 0432                        @if (item.OriginalPurchasePrice != null)
 433                        {
 434                            <div style="white-space: nowrap; margin: 0; font-size: 10px;">
 435                                <div style="display: inline;">
 0436                                    @Html.Raw(string.Format("{0:N2}", item.OriginalPurchasePrice))
 437                                </div>
 438                                <div style="display: inline; margin-left: 5px;">
 0439                                    @(item.Supplier?.CurrencyCode.ToString() ?? "")
 440                                </div>
 441                            </div>
 442                        }
 443                        <p style="display: inline; white-space: nowrap; margin: 0;">
 0444                            @Html.Raw(string.Format("{0:N0}", item.PurchasePrice).Replace(",", " "))
 445                        </p>
 446                    </div>
 447
 448                    <div class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("CostPrice") ? "bg-warning
 0449                        @Html.Raw(string.Format("{0:N0}", item.CostPrice).Replace(",", " "))
 450                    </div>
 451
 452                </td>
 453
 454                <td class="@(item.UpdatedColumns != null && (item.UpdatedColumns.Contains("MinOzonCommission") || item.U
 0455                    @Html.Raw(string.Format("{0:N0}", item.MinOzonCommission).Replace(",", " ")) <br />
 0456                    @Html.Raw(string.Format("{0:N0}", item.MaxOzonCommission).Replace(",", " "))
 457                </td>
 458
 459                <td class="@(item.UpdatedColumns != null && (item.UpdatedColumns.Contains("MinProfit") || item.UpdatedCo
 0460                    @if (item.MaxProfit < 0)
 461                    {
 0462                        <span style="color:red">@Html.Raw(string.Format("{0:N0}", item.MaxProfit).Replace(",", " "))</sp
 463                    }
 464                    else
 465                    {
 0466                        @Html.Raw(string.Format("{0:N0}", item.MaxProfit).Replace(",", " "))
 467                    }
 468                    <br>
 0469                    @if (item.MinProfit < 0)
 470                    {
 0471                        <span style="color:red">@Html.Raw(string.Format("{0:N0}", item.MinProfit).Replace(",", " "))</sp
 472                    }
 473                    else
 474                    {
 0475                        @Html.Raw(string.Format("{0:N0}", item.MinProfit).Replace(",", " "))
 476                    }
 477                </td>
 478
 479                <td class="@(item.UpdatedColumns != null && item.UpdatedColumns.Contains("MinDiscount") ? "bg-warning" :
 0480                    @if (item.MaxDiscount < 0)
 481                    {
 0482                        <span style="color:red">@Html.Raw(string.Format("{0:N0}", item.MaxDiscount).Replace(",", " "))</
 483                    }
 484                    else
 485                    {
 0486                        @Html.Raw(string.Format("{0:N0}", item.MaxDiscount).Replace(",", " "))
 487                    }
 488                    <br>
 0489                    @if (item.MinDiscount < 0)
 490                    {
 0491                        <span style="color:red">@Html.Raw(string.Format("{0:N0}", item.MinDiscount).Replace(",", " "))</
 492                    }
 493                    else
 494                    {
 0495                        @Html.Raw(string.Format("{0:N0}", item.MinDiscount).Replace(",", " "))
 496                    }
 497                </td>
 498            </tr>
 0499        }

Methods/Properties

ExecuteAsync()