예제 #1
0
 public static InventoryItemVO ToInventoryItemVo(this stCatalogue stCatalogue, StockItemGroups itemGroup)
 {
     return(new InventoryItemVO()
     {
         Id = stCatalogue.InventoryId,
         DateCreated = stCatalogue.Created,
         DateLastModified = stCatalogue.Modified,
         BaseItemCode = stCatalogue.BaseItemCode,
         ItemCode = stCatalogue.ItemCode,
         ALPCategory = stCatalogue.ALPCategory,
         Colour = stCatalogue.Colour,
         Size = stCatalogue.Size,
         DangerousGoods = stCatalogue.DangerouGoods,
         Description = stCatalogue.Description,
         HasSampleQuantityException = stCatalogue.SampleShopQuantityExeption,
         HighValue = stCatalogue.HighValue,
         InventoryType = (InventoryType)stCatalogue.InventoryType,
         InvoiceVisible = stCatalogue.InvoiceItem,
         OnPromotion = stCatalogue.OnPromotion,
         QuoteVisible = stCatalogue.QuoteItem,
         WarehouseItem = stCatalogue.WarehouseItem,
         Flags = (StockInventoryMasterFlags)stCatalogue.InventoryFlags,
         Group = itemGroup?.ToGroupVo(),
         Brands = Newtonsoft.Json.JsonConvert.DeserializeObject <List <BrandVO> >(stCatalogue.Brands)
     });
 }
예제 #2
0
        private InventoryItemVO GetInventoryItemVO(stCatalogue catalugueItem, bool setStockInfo)
        {
            var stockItemGroup = _lazyLoaderController.StockItemGroups.Value.GetValue(catalugueItem.InventoryGroupId);

            var inventoryItemVO = catalugueItem.ToInventoryItemVo(stockItemGroup);

            if (!(inventoryItemVO.IsComponent || inventoryItemVO.IsSet))
            {
                inventoryItemVO.Prices = GetInventoryPricingVO(catalugueItem.ItemCode);
            }

            if (setStockInfo)
            {
                var inventorySetVO = GetInventorySetVO(catalugueItem.ItemCode);

                if (inventorySetVO != null)
                {
                    inventoryItemVO.SetInfo = inventorySetVO;
                }
            }

            return(inventoryItemVO);
        }