2021-03-17 16.20.sql 1.5 KB

123456789101112131415161718192021222324252627282930
  1. USE [befri_Goldhoo]
  2. GO
  3. /****** Object: View [replenish].[V_ReplenishOrderLine] Script Date: 2021/3/17 16:19:45 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. CREATE VIEW [replenish].[V_ReplenishOrderLine]
  9. AS
  10. SELECT rol.ReplenishOrderLineId, rol.ReplenishOrderId, rol.CusRepNumber, rol.InventoryId, rol.InventoryNumber,
  11. rol.InventoryName, rol.Spec, rol.ReplenishType, rol.ReplenishId, rol.ReplenishName, rol.ReplenishCycle,
  12. rol.ReplenishReasonId, rol.ReplenishReasonMemo, rol.RepPosition, rol.RepMemo, rol.Quantity, rol.BearPrice, rol.IsFree,
  13. rol.ApprovedBy, rol.ApprovedOn, rol.ApprovedIdea, rol.ProduceReceivingBy, rol.ProduceReceivingOn,
  14. rol.ExpFinishOn, rol.FinishOnBy, rol.FinishOn, rol.LineStatus, rol.Memo, repType.Text AS ReplenishTypeText,
  15. linstu.Text AS LineStatusText
  16. FROM replenish.ReplenishOrderLine AS rol LEFT OUTER JOIN
  17. dbo.ValueTextMap AS repType ON repType.TableName = 'replenish.ReplenishOrderLine' AND
  18. repType.FieldName = 'ReplenishType' AND repType.Value = rol.ReplenishType LEFT OUTER JOIN
  19. dbo.ValueTextMap AS linstu ON linstu.TableName = 'replenish.ReplenishOrderLine' AND
  20. linstu.FieldName = 'LineStatus' AND linstu.Value = rol.LineStatus
  21. GO
  22. EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'replenish', @level1type=N'VIEW',@level1name=N'V_ReplenishOrderLine'
  23. GO