< Summary

Information
Class: AspNetCoreGeneratedDocument.Areas_Studio2_Views_Shared__OrderRow
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Studio2/Views/Shared/_OrderRow.cshtml
Line coverage
0%
Covered lines: 0
Uncovered lines: 121
Coverable lines: 121
Total lines: 429
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 152
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%226501500%

File(s)

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

#LineLine coverage
 1@using OzonOrdersWeb.ViewModels.OrderViewModels
 2@using OzonOrdersWeb.Areas.Studio2.ViewHelpers
 3@model OrderRowViewModel
 4
 5@{
 06    string rowClass = "custom-white";
 07    if ((Model.Order.AppStatus?.Name == "Отменен" && (Model.Order.ClientStatus?.Name == "Отменён" || Model.Order.ClientS
 08        Model.Order.ClientStatus?.Name is "Отменен" or "Отменён")
 9    {
 010        rowClass = "table-danger";
 11    }
 012    else if (Model.Order.IsReturnable == true)
 13    {
 014        rowClass = "custom-red";
 15    }
 16    else
 17    {
 018        rowClass = Model.Order.AppStatus?.Name switch
 019        {
 020            "Заказан поставщику" => "table-success",
 021            "Отгружен поставщиком" => "table-info",
 022            "Отгружен реализатору" => "table-warning",
 023            "Заказан реализатору" => "table-secondary",
 024            _ => rowClass
 025        };
 26    }
 27}
 28
 29
 030<tr class="@rowClass system-order-row system-order-row-in-group" data-order-id="@Model.Order.Id" data-order-index="@Mode
 031    data-order-quantity="@Model.Order.Quantity">
 32    <td>
 33        <div class="d-flex align-items-center">
 34            <span class="ml-2">
 035                @Html.DisplayFor(modelItem => Model.Order.ShipmentNumber)
 36            </span>
 37        </div>
 38    </td>
 39    <td>
 40        <div title="@Model.Order.OzonClient">
 041            @if (Model.Order.OzonClient != null && !string.IsNullOrEmpty(Model.Order.OzonClient.Name))
 42            {
 043                string ozonClient = Model.Order.OzonClient.Name;
 044                if (ozonClient.Length > 18)
 45                {
 046                    ozonClient = ozonClient.Substring(0, 18) + "...";
 47                }
 48
 049                @ozonClient
 50            }
 51        </div>
 52
 053        @if (Model.Order.DeliveryCity != null && Model.Order.DeliveryCity != "")
 54        {
 55            <div style="white-space: nowrap;" title="@Model.Order.DeliveryCity">
 56                @{
 057                    string deliveryCity = Model.Order.DeliveryCity;
 058                    if (deliveryCity.Length > 11)
 59                    {
 060                        deliveryCity = deliveryCity.Substring(0, 11) + "...";
 61                    }
 62
 063                    @deliveryCity
 64                }
 65            </div>
 66        }
 067        @if (!string.IsNullOrEmpty(Model.Order.TrackingNumber))
 68        {
 69            <div class="text-muted" style="white-space: nowrap;" title="@Model.Order.TrackingNumber">
 070                <small>@Model.Order.TrackingNumber</small>
 71            </div>
 72        }
 73    </td>
 74
 75    <td>
 76        <div id="td2ProcessingDate"
 77             title="@Model.Order.FullFormattedProcessingDate">
 078            @(Model.Order.ProcessingDate?.ToString("dd.MM.yyyy") ?? "")
 79        </div>
 80
 81        <div class="text-muted"
 82             title="@Model.Order.FullFormattedShippingDate">
 083            @(Model.Order.ShippingDate?.ToString("dd.MM.yyyy") ?? "")
 84        </div>
 85    </td>
 86
 87    <td>
 88        <div style="white-space: nowrap; text-align: right;">
 89            <div
 090                title="@Html.DisplayFor(modelItem => Model.Order.FormattedDeliveryDay) @Html.DisplayFor(modelItem => Mod
 91        </div>
 92
 93        <div style="white-space: nowrap; text-align: right;" class="text-muted">
 094            @Html.DisplayFor(modelItem => Model.Order.FormattedTimeLeftDay)
 95        </div>
 96    </td>
 97
 98    <td>
 99        <div class="nowrap" title="@Model.Order.ClientStatus?.Name">
 0100            @if (Model.Order.ClientStatus?.Name != null)
 101            {
 0102                string status = Model.Order.ClientStatus.Name;
 0103                if (status.Length > 14)
 104                {
 0105                    status = status.Substring(0, 14) + "...";
 106                }
 107
 0108                var bgClientStatusColor = Model.Order.ClientStatus?.StatusColor?.ColorCode ?? "transparent";
 0109                var textColor = StatusColorContrast.GetTextColor(bgClientStatusColor);
 110
 111                <div class="status-color-badge" style="font-size: 13px;
 112                             --status-badge-bg:@bgClientStatusColor;
 113                             --status-badge-fg:@textColor;
 114                             background-color:@bgClientStatusColor;
 115                             color:@textColor;
 116                             padding: 2px 5px;
 117                             border-radius: 4px;
 118                             font-weight: normal;
 119                             display: inline-block;">
 0120                    @status
 121                </div>
 122            }
 123            else
 124            {
 125                <br/>
 126            }
 127
 128        </div>
 129
 130        <div class="text-muted nowrap" title="@(Model.Order.AppStatus?.Name ?? "")">
 131            @{
 0132                string appStatus = Model.Order.AppStatus?.Name ?? "";
 0133                if (!string.IsNullOrEmpty(appStatus) && appStatus.Length > 14)
 134                {
 0135                    appStatus = appStatus.Substring(0, 14) + "...";
 136                }
 137            }
 0138            @appStatus
 139        </div>
 140    </td>
 141
 142    <td class="orders-product-col" data-column="productInfo">
 143        <div class="d-flex orders-product-cell">
 144            <div class="orders-product-text-grid" style="min-width:0;flex:1;overflow:hidden;display:grid;grid-template-r
 145                <div class="orders-product-top-row">
 146                    <div id="thArticle" title="@(Model.Order.ProductKey ?? "")" class="product-key-cell d-flex align-ite
 147                        @{
 0148                            string productKey = Model.Order.ProductKey ?? "";
 0149                            string displayText = productKey;
 0150                            if (!string.IsNullOrEmpty(productKey))
 151                            {
 0152                                var pkMatch = System.Text.RegularExpressions.Regex.Match(productKey, @"\[(\d+)\]$");
 0153                                if (pkMatch.Success)
 154                                {
 0155                                    string mainPart = productKey.Substring(0, pkMatch.Index);
 0156                                    string numPart = pkMatch.Value;
 0157                                    if (mainPart.Length > 17) { mainPart = mainPart.Substring(0, 17) + "..."; }
 0158                                    displayText = $"{mainPart}<span class='text-danger fw-bold product-key-multiplier'>{
 159                                }
 0160                                else if (productKey.Length > 17)
 161                                {
 0162                                    displayText = productKey.Substring(0, 17) + "...";
 163                                }
 164                            }
 165                        }
 0166                        <span class="custom-product-link">@Html.Raw(displayText)</span>
 167                    </div>
 168                    <div class="product-manufacturer-cell nowrap text-center">
 0169                        @if (Model.Order.Manufacturer != null)
 170                        {
 0171                            @Html.DisplayFor(modelItem => Model.Order.Manufacturer.Name)
 172                        }
 173                    </div>
 174                    <div class="article-and-replacement-cell nowrap text-end">
 0175                        @if (Model.Order.Article != null)
 176                        {
 0177                            @Html.DisplayFor(modelItem => Model.Order.Article)
 178                        }
 179                    </div>
 180                </div>
 181                <div id="thProductName" class="text-muted" title="@Html.DisplayFor(modelItem => Model.Order.ProductName)
 0182                    <span>@Html.DisplayFor(modelItem => Model.Order.ProductName)</span>
 183                </div>
 184            </div>
 185        </div>
 186    </td>
 187
 188
 189    <td class="checkbox-column" data-column="actionsCol">
 0190        @if (Model.CheckedCase4)
 191        {
 192            <input type="checkbox" class="record-checkbox" disabled>
 193        }
 0194        else if (Model.CheckedCase5)
 195        {
 196            <input type="checkbox" class="record-checkbox" disabled>
 197        }
 0198        else if (!Model.UnavailableStatuses.Any(status => Model.Order.ClientStatus?.Name != null && status.Contains(Mode
 199        {
 0200            @if (Model.OrderWithOneMatches)
 201            {
 202                <input type="checkbox"
 203                       class="record-checkbox"
 0204                       data-order-id="@Model.Order.Id"
 0205                       data-order="@(Model.Order.ShipmentNumber ?? "")@(Model.Order.ProductKey ?? "")"
 0206                       data-quantity="@Model.Order.Quantity"
 0207                       data-product-key="@(Model.Order.ProductKey ?? "")"
 0208                       data-index="@Model.Index-@Model.Order.Id"
 209                       data-one-matches="true"
 210                       name="NotFullOrders[@Model.Index].OrderIds"
 211                       value="@Model.Order.Id"
 212                       onchange="updateOrderIds(this, @Model.Index); updateColumnValuesFromMainOrder(this);">
 213            }
 214            else
 215            {
 216                <input type="checkbox"
 217                       class="record-checkbox"
 0218                       data-order-id="@Model.Order.Id"
 0219                       data-order="@(Model.Order.ShipmentNumber ?? "")@(Model.Order.ProductKey ?? "")"
 0220                       data-quantity="@Model.Order.Quantity"
 0221                       data-product-key="@(Model.Order.ProductKey ?? "")"
 0222                       data-index="@Model.Index-@Model.Order.Id"
 223                       data-one-matches="false"
 224                       name="NotFullOrders[@Model.Index].OrderIds"
 225                       value="@Model.Order.Id"
 226                       onchange="updateOrderIds(this, @Model.Index); updateColumnValuesFromMainOrder(this);">
 227            }
 228
 229            <input type="hidden" id="orderIds" name="NotFullOrders[@Model.Index].OrderIds" value="">
 230        }
 231        else
 232        {
 233            <input type="checkbox" class="record-checkbox" disabled>
 234        }
 235    </td>
 236
 237    <td>
 0238        @if (Model.Order.ShipmentWarehouse != null)
 239        {
 0240            @Html.DisplayFor(modelItem => Model.Order.ShipmentWarehouse.Name)
 241        }
 242    </td>
 243
 244    <td>
 245
 246        <div>
 0247            @if (Model.Order.Supplier != null)
 248            {
 0249                @Html.DisplayFor(modelItem => Model.Order.Supplier.Name)
 250            }
 251        </div>
 252
 253        <div class="text-muted">
 0254            @Html.DisplayFor(modelItem => Model.Order.OrderNumberToSupplier)
 255        </div>
 256    </td>
 257
 258    <td>
 259        <div>
 0260            @if (Model.Order.ProductInfo != null && Model.Order.ProductInfo.CommercialCategory != null)
 261            {
 0262                string сommercialCategory = Model.Order.ProductInfo.CommercialCategory;
 0263                if (!string.IsNullOrEmpty(сommercialCategory) && сommercialCategory.Length > 10)
 264                {
 0265                    сommercialCategory = сommercialCategory.Substring(0, 10) + "...";
 266                }
 267
 0268                @сommercialCategory
 269            }
 270
 271        </div>
 272
 273        <div class="text-muted">
 0274            @if (Model.Order.ProductInfo != null)
 275            {
 0276                @Html.DisplayFor(modelItem => Model.Order.ProductInfo.VolumetricWeight)
 277            }
 278        </div>
 279    </td>
 280
 281    <td>
 282        <div id="currentPriceWithDiscount_@Model.Index-@Model.Order.Id" style="text-align: right;">
 0283            @if (Model.Order.ProductInfo != null)
 284            {
 0285                @Html.Raw(string.Format("{0:N0}", Model.Order.ProductInfo.CurrentPriceWithDiscount).Replace(",", " "))
 286            }
 287        </div>
 288
 289        <div class="text-muted" style="text-align: right;">
 0290            @if (Model.Order.Quantity > 1)
 291            {
 292                <span id="quantity_@Model.Index-@Model.Order.Id" class="qty-value--multi">
 0293                    @Html.DisplayFor(modelItem => Model.Order.Quantity)
 294                </span>
 295            }
 296            else
 297            {
 298                <span id="quantity_@Model.Index-@Model.Order.Id">
 0299                    @Html.DisplayFor(modelItem => Model.Order.Quantity)
 300                </span>
 301            }
 302        </div>
 303    </td>
 304
 305    <td>
 306        <div id="price_@Model.Index-@Model.Order.Id" style="text-align: right;">
 0307            @Html.Raw(string.Format("{0:N0}", Model.Order.Price).Replace(",", " "))
 308        </div>
 309
 310        <div id="shipmentAmount_@Model.Index-@Model.Order.Id" class="text-muted" style="text-align: right;">
 0311            @Html.Raw(string.Format("{0:N0}", Model.Order.ShipmentAmount).Replace(",", " "))
 312        </div>
 313    </td>
 314
 315    <td>
 316        <div id="originalPriceContainer_@Model.Index-@Model.Order.Id" style="text-align: right; white-space: nowrap;">
 0317            @if (Model.Order.OriginalPurchasePrice != null)
 318            {
 319                <div style="white-space: nowrap; margin: 0; font-size: 10px;">
 320                    <div style="display: inline;">
 321                        <span id="originalPurchasePrice_@Model.Index-@Model.Order.Id">
 0322                            @(Model.Order.OriginalPurchasePrice.HasValue ? Model.Order.OriginalPurchasePrice.Value.ToStr
 323                        </span>
 324                    </div>
 325                    <div style="display: inline; margin-left: 5px;">
 326                        <span id="currencyCode_@Model.Index-@Model.Order.Id">
 0327                            @(Model.Order.Supplier?.CurrencyCode)
 328                        </span>
 329                    </div>
 330                </div>
 331            }
 332
 333            <p style="display: inline; white-space: nowrap; margin: 0;">
 334                <span class="purchasePrice"
 335                      id="purchasePrice_@Model.Index-@Model.Order.Id">
 0336                    @Html.Raw(string.Format("{0:N0}", Model.Order.PurchasePrice).Replace(",", " "))
 337                </span>
 338            </p>
 339        </div>
 340
 341        <!-- Себестоимость и исходные значения только в скрытых элементах -->
 342        <div id="costPriceContainer_@Model.Index-@Model.Order.Id" style="display:none;">
 343            <span id="costPrice_@Model.Index-@Model.Order.Id">
 0344                @Html.Raw(string.Format("{0:N0}", Model.Order.CostPrice).Replace(",", " "))
 345            </span>
 346        </div>
 347
 348        <!-- Элементы для скрытых значений -->
 349        <div id="originalPurchasePrice_origin_row_@Model.Index-@Model.Order.Id"
 350             style="display: none;">
 0351            @(Model.Order.OriginalPurchasePrice.HasValue ? Model.Order.OriginalPurchasePrice.Value.ToString("F2") : "")
 352        </div>
 353        <div id="currencyCode_origin_row_@Model.Index-@Model.Order.Id"
 354             style="display: none;">
 0355            @(Model.Order.Supplier?.CurrencyCode)
 356        </div>
 357        <div id="purchasePrice_origin_row_@Model.Index-@Model.Order.Id"
 358             style="display: none;">
 0359            @Html.Raw(string.Format("{0:N0}", Model.Order.PurchasePrice).Replace(",", " "))
 360        </div>
 361        <div id="costPrice_origin_row_@Model.Index-@Model.Order.Id"
 362             style="display: none;">
 0363            @Html.Raw(string.Format("{0:N0}", Model.Order.CostPrice).Replace(",", " "))
 364        </div>
 365    </td>
 366
 367    <td style="text-align: right;">
 368        <span
 0369            id="minOzonCommission_@Model.Index-@Model.Order.Id">@Html.Raw(string.Format("{0:N0}", Model.Order.MinOzonCom
 370        <span
 0371            id="maxOzonCommission_@Model.Index-@Model.Order.Id">@Html.Raw(string.Format("{0:N0}", Model.Order.MaxOzonCom
 372    </td>
 373
 374    <td style="text-align: right;">
 0375        @if (Model.Order.MaxProfit < 0)
 376        {
 377            <span id="maxProfit_@Model.Index-@Model.Order.Id"
 0378                  style="color:red">@Html.Raw(string.Format("{0:N0}", Model.Order.MaxProfit).Replace(",", " "))</span>
 379        }
 380        else
 381        {
 382            <span
 0383                id="maxProfit_@Model.Index-@Model.Order.Id">@Html.Raw(string.Format("{0:N0}", Model.Order.MaxProfit).Rep
 384        }
 385        <br>
 0386        @if (Model.Order.MinProfit < 0)
 387        {
 388            <span id="minProfit_@Model.Index-@Model.Order.Id"
 0389                  style="color:red">@Html.Raw(string.Format("{0:N0}", Model.Order.MinProfit).Replace(",", " "))</span>
 390        }
 391        else
 392        {
 393            <span
 0394                id="minProfit_@Model.Index-@Model.Order.Id">@Html.Raw(string.Format("{0:N0}", Model.Order.MinProfit).Rep
 395        }
 396        <div id="maxProfit_origin_row_@Model.Index-@Model.Order.Id"
 0397             style="display: none;">@Html.Raw(string.Format("{0:N0}", Model.Order.MaxProfit).Replace(",", " "))</div>
 398        <div id="minProfit_origin_row_@Model.Index-@Model.Order.Id"
 0399             style="display: none;">@Html.Raw(string.Format("{0:N0}", Model.Order.MinProfit).Replace(",", " "))</div>
 400    </td>
 401
 402    <td style="text-align: right;">
 0403        @if (Model.Order.MaxDiscount < 0)
 404        {
 405            <span id="maxDiscount_@Model.Index-@Model.Order.Id"
 0406                  style="color:red">@Html.Raw(string.Format("{0:N0}", Model.Order.MaxDiscount).Replace(",", " "))</span>
 407        }
 408        else
 409        {
 410            <span
 0411                id="maxDiscount_@Model.Index-@Model.Order.Id">@Html.Raw(string.Format("{0:N0}", Model.Order.MaxDiscount)
 412        }
 413        <br>
 0414        @if (Model.Order.MinDiscount < 0)
 415        {
 416            <span id="minDiscount_@Model.Index-@Model.Order.Id"
 0417                  style="color:red">@Html.Raw(string.Format("{0:N0}", Model.Order.MinDiscount).Replace(",", " "))</span>
 418        }
 419        else
 420        {
 421            <span
 0422                id="minDiscount_@Model.Index-@Model.Order.Id">@Html.Raw(string.Format("{0:N0}", Model.Order.MinDiscount)
 423        }
 424        <div id="maxDiscount_origin_row_@Model.Index-@Model.Order.Id"
 0425             style="display: none;">@Html.Raw(string.Format("{0:N0}", Model.Order.MaxDiscount).Replace(",", " "))</div>
 426        <div id="minDiscount_origin_row_@Model.Index-@Model.Order.Id"
 0427             style="display: none;">@Html.Raw(string.Format("{0:N0}", Model.Order.MinDiscount).Replace(",", " "))</div>
 428    </td>
 429</tr>

Methods/Properties

ExecuteAsync()