| | | 1 | | using OzonDomains.Models.ArmtekEtp; |
| | | 2 | | using OzonOrdersWeb.WebServices.Grid; |
| | | 3 | | |
| | | 4 | | namespace OzonOrdersWeb.WebServices.ArmtekEtp; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// Whitelist колонок серверных гридов раздела «Взаиморасчёты Armtek» (/Settlements/Armtek): |
| | | 8 | | /// colId грида → EF-выражение. Фильтры, сортировка и счётчики значений считаются по всему набору в БД. |
| | | 9 | | /// </summary> |
| | | 10 | | public static class ArmtekEtpGridDefinitions |
| | | 11 | | { |
| | 1 | 12 | | public static readonly ServerGridDefinition<ArmtekSettlement> Settlements = |
| | 1 | 13 | | new ServerGridDefinition<ArmtekSettlement> |
| | 1 | 14 | | { |
| | 0 | 15 | | DefaultOrder = q => q.OrderByDescending(x => x.DocDate).ThenByDescending(x => x.Id), |
| | 1 | 16 | | TieBreaker = x => x.Id |
| | 1 | 17 | | } |
| | 1 | 18 | | .Col("id", x => x.Id) |
| | 1 | 19 | | .Col("kunnr", x => x.Kunnr) |
| | 1 | 20 | | .Col("clientName", x => x.ClientName) |
| | 1 | 21 | | .Col("docDate", x => x.DocDate) |
| | 1 | 22 | | .Col("vbeln", x => x.Vbeln) |
| | 1 | 23 | | .Col("docType", x => x.DocType) |
| | 1 | 24 | | .Col("docTypeName", x => x.DocTypeName) |
| | 1 | 25 | | .Col("docNumber", x => x.DocNumber) |
| | 1 | 26 | | .Col("printNumber", x => x.PrintNumber) |
| | 1 | 27 | | .Col("paymentMethodName", x => x.PaymentMethodName) |
| | 1 | 28 | | .Col("amount", x => x.Amount) |
| | 1 | 29 | | .Col("payUntil", x => x.PayUntil) |
| | 1 | 30 | | .Col("returnAmount", x => x.ReturnAmount) |
| | 1 | 31 | | .Col("paymentAmount", x => x.PaymentAmount) |
| | 1 | 32 | | .Col("remainderAmount", x => x.RemainderAmount) |
| | 1 | 33 | | .Col("balance", x => x.Balance) |
| | 1 | 34 | | .Col("contract", x => x.Contract) |
| | 1 | 35 | | .Col("currency", x => x.Currency) |
| | 1 | 36 | | .Col("divisionName", x => x.DivisionName) |
| | 1 | 37 | | .Col("companyName", x => x.CompanyName) |
| | 1 | 38 | | .Col("updatedAtUtc", x => x.UpdatedAtUtc) |
| | 1 | 39 | | .Search(x => x.Vbeln, x => x.DocNumber, x => x.PrintNumber, x => x.DocTypeName, x => x.ClientName, |
| | 1 | 40 | | x => x.Contract, x => x.Kunnr); |
| | | 41 | | |
| | 1 | 42 | | public static readonly ServerGridDefinition<ArmtekInvoice> Invoices = |
| | 1 | 43 | | new ServerGridDefinition<ArmtekInvoice> |
| | 1 | 44 | | { |
| | 0 | 45 | | DefaultOrder = q => q.OrderByDescending(x => x.InvoiceDate).ThenByDescending(x => x.Id), |
| | 1 | 46 | | TieBreaker = x => x.Id |
| | 1 | 47 | | } |
| | 1 | 48 | | .Col("id", x => x.Id) |
| | 1 | 49 | | .Col("kunnr", x => x.Kunnr) |
| | 1 | 50 | | .Col("vbeln", x => x.Vbeln) |
| | 1 | 51 | | .Col("invoiceDate", x => x.InvoiceDate) |
| | 1 | 52 | | .Col("createdAt", x => x.CreatedAt) |
| | 1 | 53 | | .Col("createdBy", x => x.CreatedBy) |
| | 1 | 54 | | .Col("buyerName", x => x.BuyerName) |
| | 1 | 55 | | .Col("unloadingPointName", x => x.UnloadingPointName) |
| | 1 | 56 | | .Col("deliveryAddress", x => x.DeliveryAddress) |
| | 1 | 57 | | .Col("contact", x => x.Contact) |
| | 1 | 58 | | .Col("receiveMethod", x => x.ReceiveMethod) |
| | 1 | 59 | | .Col("deliveryStatus", x => x.DeliveryStatus) |
| | 1 | 60 | | .Col("updNumber", x => x.UpdNumber) |
| | 1 | 61 | | .Col("ttnNumber", x => x.TtnNumber) |
| | 1 | 62 | | .Col("totalAmount", x => x.TotalAmount) |
| | 1 | 63 | | .Col("totalQuantity", x => x.TotalQuantity) |
| | 1 | 64 | | .Col("returnedQuantity", x => x.ReturnedQuantity) |
| | 1 | 65 | | .Col("orderNumber", x => x.OrderNumber) |
| | 1 | 66 | | .Col("orderType", x => x.OrderType) |
| | 1 | 67 | | .Col("orderStatus", x => x.OrderStatus) |
| | 1 | 68 | | .Col("returnReason", x => x.ReturnReason) |
| | 1 | 69 | | .Col("pickupPointName", x => x.PickupPointName) |
| | 1 | 70 | | .Col("payment", x => x.Payment) |
| | 1 | 71 | | .Col("contract", x => x.Contract) |
| | 1 | 72 | | .Col("maxReturnSum", x => x.MaxReturnSum) |
| | 1 | 73 | | .Col("source", x => x.Source == "api" ? "API" : "Кабинет") |
| | 1 | 74 | | .Col("loadedAtUtc", x => x.LoadedAtUtc) |
| | 1 | 75 | | .Search(x => x.Vbeln, x => x.UpdNumber, x => x.TtnNumber, x => x.BuyerName, x => x.CreatedBy, |
| | 1 | 76 | | x => x.DeliveryAddress, x => x.Contact, x => x.OrderNumber, x => x.ReturnReason); |
| | | 77 | | |
| | 1 | 78 | | public static readonly ServerGridDefinition<ArmtekInvoiceItem> Items = |
| | 1 | 79 | | new ServerGridDefinition<ArmtekInvoiceItem> |
| | 1 | 80 | | { |
| | 0 | 81 | | DefaultOrder = q => q.OrderByDescending(x => x.Invoice!.InvoiceDate).ThenByDescending(x => x.InvoiceId) |
| | 0 | 82 | | .ThenBy(x => x.Position), |
| | 1 | 83 | | TieBreaker = x => x.Id |
| | 1 | 84 | | } |
| | 1 | 85 | | .Col("id", x => x.Id) |
| | 1 | 86 | | .Col("invoiceId", x => x.InvoiceId) |
| | 1 | 87 | | .Col("vbeln", x => x.Invoice!.Vbeln) |
| | 1 | 88 | | .Col("kunnr", x => x.Invoice!.Kunnr) |
| | 1 | 89 | | .Col("invoiceDate", x => x.Invoice!.InvoiceDate) |
| | 1 | 90 | | .Col("position", x => x.Position) |
| | 1 | 91 | | .Col("armtekCode", x => x.ArmtekCode, normalizeText: true) |
| | 1 | 92 | | .Col("article", x => x.Article, normalizeText: true) |
| | 1 | 93 | | .Col("brand", x => x.Brand) |
| | 1 | 94 | | .Col("name", x => x.Name) |
| | 1 | 95 | | .Col("fullName", x => x.FullName) |
| | 1 | 96 | | .Col("price", x => x.Price) |
| | 1 | 97 | | .Col("quantity", x => x.Quantity) |
| | 1 | 98 | | .Col("returned", x => x.Returned) |
| | 1 | 99 | | .Col("amount", x => x.Amount) |
| | 1 | 100 | | .Col("orderNumber", x => x.OrderNumber) |
| | 1 | 101 | | .Col("orderPosition", x => x.OrderPosition) |
| | 1 | 102 | | .Col("note", x => x.Note) |
| | 1 | 103 | | .Col("gtd", x => x.Gtd) |
| | 1 | 104 | | .Col("country", x => x.Country) |
| | 1 | 105 | | .Col("maxReturnDate", x => x.MaxReturnDate) |
| | 1 | 106 | | .Col("noReturn", x => x.NoReturn) |
| | 1 | 107 | | .Col("returnDays", x => x.ReturnDays) |
| | 1 | 108 | | .Col("vatRate", x => x.VatRate) |
| | 1 | 109 | | .Col("vatAmount", x => x.VatAmount) |
| | 1 | 110 | | .Col("ean", x => x.Ean) |
| | 1 | 111 | | .Col("tnved", x => x.Tnved) |
| | 1 | 112 | | .Col("weight", x => x.Weight) |
| | 1 | 113 | | .Col("orderType", x => x.Invoice!.OrderType) |
| | 1 | 114 | | .Col("returnReason", x => x.Invoice!.ReturnReason) |
| | 1 | 115 | | .Search(x => x.Article, x => x.ArmtekCode, x => x.Brand, x => x.Name, x => x.FullName, x => x.OrderNumber, |
| | 1 | 116 | | x => x.Gtd, x => x.Invoice!.Vbeln, x => x.Ean, x => x.Tnved, x => x.Note) |
| | 1 | 117 | | // Артикул ищем без разделителей: «1020479SX» = «10-20479-SX» = код Армтек «1020479_SX». |
| | 1 | 118 | | .SearchNormalized(x => x.Article, x => x.ArmtekCode); |
| | | 119 | | } |