| | | 1 | | using Clave.Expressionify; |
| | | 2 | | using System; |
| | | 3 | | using System.Collections.Generic; |
| | | 4 | | using System.Linq; |
| | | 5 | | using System.Text; |
| | | 6 | | using WinSolutions.Sveta.Server.Data.DataModel.Entities; |
| | | 7 | | |
| | | 8 | | namespace WinSolutions.Sveta.Server.Data.DataModel.Extensions |
| | | 9 | | { |
| | | 10 | | public static class DepartmentCategoryRatioExtensions |
| | | 11 | | { |
| | | 12 | | /// <summary> |
| | | 13 | | /// Возвращает актуальный торговый коэффициент для расчетов |
| | | 14 | | /// </summary> |
| | | 15 | | /// <param name="warehouseId">Id склада-владельца</param> |
| | | 16 | | [Expressionify] |
| | | 17 | | public static decimal ActualRatioForCalculations(this IEnumerable<DepartmentCategoryRatio> ratios, long departme |
| | 0 | 18 | | ratios.Any(x => !x.IsDeleted && x.DepartmentId == departmentId) |
| | 0 | 19 | | ? ratios.First(x => !x.IsDeleted && x.DepartmentId == departmentId).TradeRatio / 100 |
| | 145 | 20 | | : 1; |
| | | 21 | | } |
| | | 22 | | } |