2020-12-01 14.41.sql 969 B

1234567891011121314151617181920212223
  1. USE [befri_Goldhoo]
  2. GO
  3. /****** Object: View [Discount].[V_SalesItem] Script Date: 2020/12/3 17:13:33 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. CREATE VIEW [Discount].[V_SalesItem]
  9. AS
  10. SELECT a.ItemType, a.ItemId, a.ItemNumber, a.ItemName, a.AliasName, a.Spec, a.CostPrice, a.SalesPrice, a.SearchCode,
  11. a.InventoryCategoryId, a.CategoryNumber, a.CategoryName, a.DisplayOrder, a.MasterImageUrl, a.IsCustomizable,
  12. a.Added, a.Status, a.ZHInvName, a.ZHInvNumber, a.DZInvName, a.DZInvNumber, a.HandledUrl, a.IsDiscount,
  13. b.WarehouseId, b.Quantity AS InventoryAcc, b.DiscountCoef, ii.Introduction, a.DeliveryCycle, a.DeliveryCycleStr
  14. FROM shop_order.V_SalesItem AS a INNER JOIN
  15. Discount.DiscountAcc AS b ON a.IsDiscount = 1 AND a.ItemId = b.InventoryId AND b.Quantity > 0 LEFT OUTER JOIN
  16. basedata.InventoryIntro AS ii ON a.ItemId = ii.InventoryId
  17. GO