(SELECT c.code_value_name FROM sys_code_values_v c where c.code='DATA_CLASSIFICATION' and c.code_value = t1.archive_type) archive_type_desc,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='YES_NO' and c.code_value = 'Y') suppl_trans_flag, t1.hly_req_number as post_batch_num,
t1.e_archives_id,
(SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id) workflow_id,
(SELECT e.je_check_flag
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) je_check_flag,
(SELECT e.base_archive_id
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) base_archive_id,
nvl((SELECT gps.monthly_closed_flag
FROM gld_periods gp,
gld_period_status gps
WHERE REPLACE(gp.period_name,
'-',
'') = t1.internal_period_num
AND gps.company_id = ${ / session / @company_id}
AND gp.internal_period_num = gps.internal_period_num
AND gps.period_set_code = gp.period_set_code),
'N') monthly_closed_flag,
(SELECT c.code_value_name
FROM sys_code_values_v c
WHERE c.code = 'DATA_CLASSIFICATION'
AND c.code_value = t1.archive_type) archive_type_desc,
nvl((select gps.monthly_closed_flag from gld_periods gp,gld_period_status gps where replace(gp.period_name,'-','')=t1.internal_period_num and gps.company_id = ${/session/@company_id} and gp.internal_period_num=gps.internal_period_num and gps.period_set_code=gp.period_set_code),'N') monthly_closed_flag ,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='DATA_CLASSIFICATION' and c.code_value = t1.archive_type) archive_type_desc,
(SELECT c.code_value_name FROM sys_code_values_v c where c.code='YES_NO' and c.code_value = 'Y') suppl_trans_flag,
t1.hly_req_number as post_batch_num,
t1.e_archives_id,
(SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id) workflow_id,
(SELECT e.je_check_flag
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) je_check_flag,
(SELECT e.base_archive_id
FROM e_archives_define e
WHERE e.base_archive_code = t1.base_archive_code
AND e.workflow_id = (SELECT DISTINCT zwi.workflow_id
FROM zj_wfl_workflow_instance zwi,
zj_wfl_workflow zww
WHERE zww.workflow_id = zwi.workflow_id
AND zwi.instance_id = t1.document_id)) base_archive_id,
nvl((SELECT gps.monthly_closed_flag
FROM gld_periods gp,
gld_period_status gps
WHERE REPLACE(gp.period_name,
'-',
'') = t1.internal_period_num
AND gps.company_id = ${ / session / @company_id}
AND gp.internal_period_num = gps.internal_period_num
AND gps.period_set_code = gp.period_set_code),
'N') monthly_closed_flag,
(SELECT c.code_value_name
FROM sys_code_values_v c
WHERE c.code = 'DATA_CLASSIFICATION'
AND c.code_value = t1.archive_type) archive_type_desc,