2020-12-09 15.58.sql 1022 B

1234567891011121314151617181920212223
  1. USE [befri_Goldhoo]
  2. GO
  3. /****** Object: View [clearance].[V_SalesItem] Script Date: 2020/12/9 15:57:31 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. ALTER VIEW [clearance].[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.IsClearance,
  13. b.WarehouseId, b.Quantity AS InventoryAcc, b.DiscountCoef, ii.Introduction, a.DeliveryCycle, a.DeliveryCycleStr, a.ProductionProperty, a.ProductionPropertyText
  14. FROM shop_order.V_SalesItem AS a INNER JOIN
  15. clearance.ClearanceAcc AS b ON a.IsClearance = 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