Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT SocialOfficeTransaction.WORK_DATE,
- SocialOfficeTransaction.SOCIAL_OFFICE_TRANSACTION_ID,
- SocialOfficeTransaction.POI_TIN,
- Wbs.WBS_ID,
- SoTransactionStatus.NAME AS SO_TRANSACTION_STATUS_NAME,
- SoTransactionStatus.SO_TRANSACTION_STATUS_ID,
- SocialOfficeTransaction.CREATION_DATE,
- SocialOfficeTransaction.CREATION_USER_NAME,
- SocialOfficeTransaction.SO_CREATION_NUMBER,
- SocialOfficeTransaction.CANCEL_DATE,
- SocialOfficeTransaction.CANCELLATION_USER_NAME,
- SocialOfficeTransaction.SO_CANCELLATION_NUMBER,
- Person.COMPANY_NR,
- Person.PERSON_ID,
- Person.FIRST_NAME,
- Person.LAST_NAME,
- SocialOfficeTransaction.CREATION_GUI_USER_ID,
- SocialOfficeTransaction.CANCELLATION_GUI_USER_ID,
- SocialOfficeTransaction.PERSON_ID AS PERSON_ID1,
- SocialOfficeTransaction.SO_TRANSACTION_STATUS_ID AS SO_TRANSACTION_STATUS_ID1,
- SocialOfficeTransaction.WBS_ID AS WBS_ID1,
- TO_CHAR(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone),'Dy') AS VIEW_ATTR,
- TO_CHAR(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone),'dd') AS VIEW_ATTR,
- Wbs.REF_NUMBER,
- TOUSERDATE (SocialOfficeTransaction.CREATION_DATE, OPERATIONCENTER.timezone) AS VIEW_ATTR,
- TOUSERDATE (SocialOfficeTransaction.CANCEL_DATE, OPERATIONCENTER.timezone) AS VIEW_ATTR,
- OperationCenter.TIMEZONE,
- OperationCenter.OPERATION_CENTER_ID,
- VoPersonCategory.NAME AS NAME1,
- VoPersonCategory.VO_PERSON_CATEGORY_ID,
- VoPersonCategory.GRAPHICAL_SYMBOL,
- P_PERSON.list_person_group_name(Person.PERSON_ID) AS VIEW_ATTR,
- decode (SocialOfficeTransaction.is_start_time_set, 'N' , '', to_char (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone), 'HH24:mi')) AS VIEW_ATTR,
- SocialOfficeTransaction.DURATION,
- decode (SocialOfficeTransaction.is_start_time_set, 'N', '', DECODE(SIGN(TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) + SocialOfficeTransaction.duration /24 - trunc (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone)+ 1)), 1, '00:00', to_char (TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) + SocialOfficeTransaction.duration /24, 'HH24:mi'))) AS VIEW_ATTR,
- SocialOfficeTransaction.IS_START_TIME_SET,
- TOUSERDATE (SocialOfficeTransaction.work_date , OperationCenter.timezone) AS VIEW_ATTR,
- SocialOfficeTransaction.SO_COMMENT,
- SocialOfficeTransaction.PLAN_MODE,
- p_person.getCompanyName(Person.person_id) AS VIEW_ATTR,
- OcPoi.NAME,
- OcPoi.POI_ID,
- GuPerson.GUI_USER_ID,
- GuPerson.PERSON_ID AS PERSON_ID2,
- GuiUsers.GUI_USER_ID AS GUI_USER_ID1,
- to_char(SocialOfficeTransaction.WORK_DATE,'dd/MM/yyyy') AS VIEW_ATTR,
- Person.IS_ADMIN_STATUS_OK,
- NVL(Str.STR_VALUE,AdminStatusCategory.NAME) AS VIEW_ATTR,
- SoTransactionStatus.DESCRIPTION,
- P_PERSON.IsDocumentValid(Person.PERSON_ID, 100, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
- P_PERSON.IsDocumentValid(Person.PERSON_ID, 101, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
- P_PERSON.IsDocumentValid(Person.PERSON_ID, 102, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
- P_PERSON.IsDocumentValid(Person.PERSON_ID, 103, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
- P_PERSON.IsDocumentValid(Person.PERSON_ID, 104, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
- P_PERSON.IsDocumentValid(Person.PERSON_ID, 105, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
- P_PERSON.IsDocumentValid(Person.PERSON_ID, 106, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
- NVL(Str1.STR_VALUE,SoTransactionStatus.DESCRIPTION) AS VIEW_ATTR,
- P_PERSON.IsDocumentValid(Person.PERSON_ID, 107, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
- P_PERSON.IsDocumentValid(Person.PERSON_ID, 108, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR,
- P_PERSON.IsDocumentValid(Person.PERSON_ID, 109, SocialOfficeTransaction.WORK_DATE) AS VIEW_ATTR
- FROM OF_OWNER.SOCIAL_OFFICE_TRANSACTION SocialOfficeTransaction, OF_OWNER.SO_TRANSACTION_STATUS SoTransactionStatus, WBS Wbs, PERSON Person, GUI_USERS GuiUsers, OPERATION_CENTER OperationCenter, GU_PERSON GuPerson, VO_PERSON_CATEGORY VoPersonCategory, OC_POI OcPoi, OF_OWNER.ADMIN_STATUS_CATEGORY AdminStatusCategory, OF_OWNER.STR Str, OF_OWNER.STR Str1
- WHERE SocialOfficeTransaction.SO_TRANSACTION_STATUS_ID = SoTransactionStatus.SO_TRANSACTION_STATUS_ID
- AND SoTransactionStatus.STR_ID = Str1.STR_ID(+)
- AND GuiUsers.LANGUAGE = Str1.LANGUAGE(+)
- AND SocialOfficeTransaction.PERSON_ID = Person.PERSON_ID
- and Person.ADMIN_STATUS_CATEGORY_ID = AdminStatusCategory.ADMIN_STATUS_CATEGORY_ID(+)
- and AdminStatusCategory.STR_ID = Str.STR_ID(+)
- and GuiUsers.LANGUAGE = Str.LANGUAGE(+)
- and SocialOfficeTransaction.PERSON_ID = GuPerson.person_id
- and GuPerson.gui_user_id = 101494
- and GuiUsers.gui_user_id = GuPerson.gui_user_id
- and GuiUsers.Operation_Center_Id = OperationCenter.operation_center_id
- and Person.vo_person_category_id = VoPersonCategory.vo_person_category_id
- and SocialOfficeTransaction.wbs_id = Wbs.wbs_id (+)
- --AND (EXISTS
- -- (SELECT pd_poi_id
- -- FROM pd_poi
- -- WHERE pd_poi.poi_id = 1051274
- -- AND pd_poi.social_office_transaction_id=SocialOfficeTransaction.social_office_transaction_id)
- -- OR EXISTS
- -- (SELECT w.wbs_id
- -- FROM wbs w
- -- WHERE w.poi_id = 1051274
- -- AND w.wbs_id = SocialOfficeTransaction.wbs_id)
- -- )
- and OcPoi.poi_id = 1051274
- AND SocialOfficeTransaction.work_date BETWEEN toutcdate( trunc(sysdate) + 1 ,timezone) AND toutcdate( trunc(sysdate) + 44 ,timezone)
- and ((NVL(null,'N') = 'N' AND NVL(null,'N') = 'N') OR INSTR(DECODE(NVL(null,'N'),'N','','6') || DECODE(NVL(null,'N'),'N','','25'),SoTransactionStatus.SO_TRANSACTION_STATUS_ID) > 0)
- and ( -1 = -1 or Person.VO_PERSON_CATEGORY_ID = -1)
- and upper(NVL(Str.STR_VALUE,AdminStatusCategory.NAME) || ' ' ||
- SocialOfficeTransaction.CANCELLATION_USER_NAME || ' ' ||
- P_PERSON.getCompanyName(Person.PERSON_ID) || ' ' ||
- Person.COMPANY_NR || ' ' ||
- SocialOfficeTransaction.CREATION_USER_NAME || ' ' ||
- NVL(Str1.STR_VALUE,SoTransactionStatus.DESCRIPTION) || ' ' ||
- SocialOfficeTransaction.DURATION || ' ' ||
- Person.FIRST_NAME || ' ' ||
- Person.LAST_NAME || ' ' ||
- VoPersonCategory.NAME || ' ' ||
- P_PERSON.list_person_group_name(Person.PERSON_ID) || ' ' ||
- SocialOfficeTransaction.PLAN_MODE || ' ' ||
- OcPoi.NAME || ' ' ||
- SocialOfficeTransaction.POI_TIN || ' ' ||
- Wbs.REF_NUMBER || ' ' ||
- SocialOfficeTransaction.SO_CANCELLATION_NUMBER || ' ' ||
- SocialOfficeTransaction.SO_COMMENT || ' ' ||
- SocialOfficeTransaction.SO_CREATION_NUMBER || ' ' ||
- SoTransactionStatus.NAME) like '%' || upper('BE FLOBECQ 1200178') || '%'
- and (NVL(null,'N') = 'N' or NVL(Person.IS_ADMIN_STATUS_OK,'N') = 'N')
- and SoTransactionStatus.SO_TRANSACTION_STATUS_ID = 7
- ORDER BY SocialOfficeTransaction.WORK_DATE, Person.COMPANY_NR, Person.LAST_NAME, Person.FIRST_NAME;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement