NJC__Documentation::DB

dbo.vw_ms_production_retur_header

Description

Properties

Name Value
Collation SQL_Latin1_General_CP1_CI_AS
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Schema Bound

False

Created 9/19/2017 03:11:37
Last Modified 9/19/2017 03:11:37

Columns

Key Name Description
ms_production_retur_id
status_production_retur_name
retur_no
retur_date
receive_no
receive_date
count_item
count_adjusment_avg
status_info
status_production_retur_id
ms_production_retur_h_status_id
status_date
status_by
create_date
create_by
modify_date
modify_by
max_doc_date
ms_date_business_id
ms_date_business
is_move_business_date
ms_date_business_id_from
ms_date_business_from
cancel_ms_cost_final_avg_id
approve_ms_cost_final_avg_id

SQL Script

SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
create view dbo.vw_ms_production_retur_header
---XencX---with encryption
as  
 
SELECT        
dt_ms_production_retur.ms_production_retur_id
, enum_status_production_retur.status_production_retur_name
, dt_ms_production_retur.retur_no
, dt_ms_production_retur.retur_date
, dt_ms_production_retur.receive_no
, dt_ms_production_retur.receive_date
, isnull(vw_ms_production_retur_header_count_detail.count_item,0) as  count_item
, isnull(vw_ms_production_retur_header_count_detail.count_adjusment_avg,0)  as count_adjusment_avg
, dt_ms_production_retur_h_status.status_info
, enum_status_production_retur.status_production_retur_id
, dt_ms_production_retur.ms_production_retur_h_status_id
, dt_ms_production_retur_h_status.create_date AS status_date
, users_status.username AS status_by
, dt_ms_production_retur.create_date
, users_create.username AS create_by
, dt_ms_production_retur.modify_date
, user_modify.username AS modify_by 
, convert(varchar(10),vw_ms_production_retur_header_count_detail.max_doc_date,121) as max_doc_date
, dt_ms_production_retur.ms_date_business_id
, isnull(dt_ms_date_business.ms_date_business,dt_ms_production_retur.receive_date  ) as ms_date_business
, dt_ms_production_retur.is_move_business_date
, dt_ms_production_retur.ms_date_business_id_from
, isnull(dt_ms_date_business_from.ms_date_business,dt_ms_production_retur.receive_date  )  AS ms_date_business_from
, dt_ms_production_retur.cancel_ms_cost_final_avg_id
, dt_ms_production_retur.approve_ms_cost_final_avg_id

FROM            users AS users_status INNER JOIN
                         users AS user_modify INNER JOIN
                         dt_ms_production_retur INNER JOIN
                         dt_ms_production_retur_h_status ON dt_ms_production_retur.ms_production_retur_h_status_id = dt_ms_production_retur_h_status.ms_production_retur_h_status_id INNER JOIN
                         enum_status_production_retur ON dt_ms_production_retur_h_status.status_production_retur_id = enum_status_production_retur.status_production_retur_id INNER JOIN
                         users AS users_create ON dt_ms_production_retur.create_by = users_create.id ON user_modify.id = dt_ms_production_retur.modify_by ON users_status.id = dt_ms_production_retur_h_status.create_by LEFT OUTER JOIN
                         dt_ms_date_business AS dt_ms_date_business_from ON dt_ms_production_retur.ms_date_business_id_from = dt_ms_date_business_from.ms_date_business_id LEFT OUTER JOIN
                         dt_ms_date_business ON dt_ms_production_retur.ms_date_business_id = dt_ms_date_business.ms_date_business_id LEFT OUTER JOIN
                         vw_ms_production_retur_header_count_detail ON dt_ms_production_retur.ms_production_retur_id = vw_ms_production_retur_header_count_detail.ms_production_retur_id


GO