Advertisement
psi_mmobile

Untitled

Aug 8th, 2019
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 14.90 KB | None | 0 0
  1. --Person activity control
  2. SELECT VFmxPdDay.VO_PERSON_CATEGORY_ID,
  3.        VFmxPdDay.PERSON_ID,
  4.        VFmxPdDay.WORK_CODE_ID,
  5.        VFmxPdDay.DATE_DAY,
  6.        VFmxPdDay.WORK_DURATION,
  7.        VFmxPdDay.PLANNED_WORK_DURATION,
  8.        VFmxPdDay.HP_DESTINATION_POI_ID,
  9.        VFmxPdDay.HP_DRIVER_ALONE_KM,
  10.        VFmxPdDay.HP_DRIVER_WITH_P_KM,
  11.        VFmxPdDay.HP_PASSENGER_KM,
  12.        VFmxPdDay.HP_PRIVATE_KM,
  13.        VFmxPdDay.PH_ORIGIN_POI_ID,
  14.        VFmxPdDay.PH_DRIVER_ALONE_KM,
  15.        VFmxPdDay.PH_DRIVER_WITH_P_KM,
  16.        VFmxPdDay.PH_PASSENGER_KM,
  17.        VFmxPdDay.PH_PRIVATE_KM,
  18.        VFmxPdDay.TOT_PASSENGER_KM,
  19.        VFmxPdDay.TOT_DRIVER_WITH_P_KM,
  20.        VFmxPdDay.AGGREG_COMMENT,
  21.        VFmxPdDay.LM_COMMENT,
  22.        VFmxPdDay.LM_DATE,
  23.        VFmxPdDay.IS_MODIFIED_BY_USER,
  24.        VFmxPdDay.OC_AGGREG_ADMIN_STATUS_ID,
  25.        VFmxPdDay.TOT_HP_CALCULATED,
  26.        VFmxPdDay.TOT_PH_CALCULATED,
  27.        VFmxPdDay.TOT_HP,
  28.        VFmxPdDay.TOT_PH,
  29.        VFmxPdDay.REPORTED_WORK_DURATION,
  30.        VFmxPdDay.REPORTED_PASSENGER_KM,
  31.        VFmxPdDay.REPORTED_DRIVER_KM,
  32.        VFmxPdDay.IS_LOCKED,
  33.        VFmxPdDay.TOT_DRIVER_WITH_P_KM_PRICE,
  34.        VFmxPdDay.TOT_PASSENGER_PRICE,
  35.        VFmxPdDay.IS_MODIFIED_BY_LOAD_REP,
  36.        VFmxPdDay.STATUS_NAME,
  37.        VFmxPdDay.FLAG_COLOUR,
  38.        VFmxPdDay.PH_ORIGIN_POI_NAME,
  39.        VFmxPdDay.HP_DESTINATION_POI_NAME,
  40.        VFmxPdDay.PERSON_NAME,
  41.        VFmxPdDay.DAY_STR,
  42.        VFmxPdDay.DAY_NR,
  43.        VFmxPdDay.WORK_CODE_NAME,
  44.        VFmxPdDay.PERSON_COMPANY_NR,
  45.        VFmxPdDay.POI_SHORT_NAME,
  46.        VFmxPdDay.PERSON_LAST_NAME,
  47.        VFmxPdDay.PERSON_FIRST_NAME,
  48.        VFmxPdDay.CAN_DRIVE_WITH_PASSENGERS,
  49.        VFmxPdDay.ASSOCIATED_POI_SHORT_NAME,
  50.        VFmxPdDay.WBS_NAME,
  51.        VFmxPdDay.WBS_ID,
  52.        VFmxPdDay.PD_DAY_ID,
  53.        UPPER(VFmxPdDay.STATUS_NAME||' '||VFmxPdDay.WBS_NAME||' '||VFmxPdDay.DATE_DAY||' '||VFmxPdDay.PERSON_NAME) AS IDSTRING,
  54.        VFmxPdDay.TOT_PRIVATE_KM,
  55.        VFmxPdDay.TOT_PRIVATE_PRICE,
  56.        VFmxPdDay.IS_WORKING_DAY,
  57.        Person.HOME_POI_ID,
  58.        Person.PERSON_ID AS PERSON_ID1,
  59.        OperationCenter.OPERATION_CENTER_ID,
  60.        VFmxPdDay.WORK_CODE_STD_ID,
  61.        VFmxPdDay.IS_HR_EDITABLE,
  62.        VFmxPdDay.IS_HRMGT_PROFILE,
  63.        DECODE(OperationMode.short_name,'NW','#223c4a','CO','#f75414','') AS OM_COLOR,
  64.        OperationMode.NAME AS OM_NAME,
  65.        OperationMode.SHORT_NAME AS OM_SHORT_NAME,
  66.        OperationMode.OPERATION_MODE_ID,
  67.        VFmxPdDay.ACTIVITY_CHART,
  68.        VFmxPdDay.ACTIVITY_CHART_CLOB,
  69.        VFmxPdDay.TRF_DHR,
  70.        VFmxPdDay.SUMMARY_KM_FORMULA,
  71.        (OcPoi.NAME) AS VIEW_ATTR,
  72.        (VFmxPdDay.WBS_NAME) AS VIEW_ATTR,
  73.        (VFmxPdDay.STATUS_NAME) AS VIEW_ATTR,
  74.        (VFmxPdDay.work_code_name) AS VIEW_ATTR,
  75.        VFmxPdDay.TOT_PUBLIC_TRANSPORT_PRICE,
  76.        VFmxPdDay.WORKER_REPORT_COMMENT
  77. FROM V_FMX_PD_DAY VFmxPdDay, PERSON Person, OC_POI OcPoi, OPERATION_CENTER OperationCenter, OPERATION_MODE OperationMode, GU_PERSON GuPerson
  78. WHERE VFmxPdDay.PERSON_ID = Person.PERSON_ID
  79. AND Person.HOME_POI_ID = OcPoi.POI_ID(+)
  80. AND (Person.PERSON_ID = ? OR ? = 0) -- i na 2te mesta 0
  81. AND Person.VO_PERSON_CATEGORY_ID = ? --100752
  82. AND date_day BETWEEN ? AND ? --vkarvash dati tuka
  83. AND ((NVL(tot_passenger_km,0)+NVL(tot_driver_with_p_km,0)
  84.       +NVL(reported_passenger_km,0)+NVL(reported_driver_km,0)+NVL(tot_private_km,0)+NVL(work_duration,0)>0)
  85.      OR ?='true') -- 'true'
  86. AND (?='true' OR (TO_CHAR(date_day,'d')IN(TO_CHAR(TO_DATE('05/01/09','DD/MM/YY'),'D'), --'true'
  87. TO_CHAR(TO_DATE('06/01/09','DD/MM/YY'),'D'),
  88. TO_CHAR(TO_DATE('07/01/09','DD/MM/YY'),'D'),
  89. TO_CHAR(TO_DATE('08/01/09','DD/MM/YY'),'D'),
  90. TO_CHAR(TO_DATE('09/01/09','DD/MM/YY'),'D'))) OR NVL(tot_hp,0)+NVL(tot_ph,0)>0)
  91. AND (? = 'false' OR status_name != 'Normal')
  92. AND (? = 'false' OR NVL(tot_driver_with_p_km,0)>0) --'true'
  93. AND ((? = 'false') OR (NVL(is_locked,'N')='N'))
  94. AND ((? = 'false') OR (OperationMode.OPERATION_MODE_ID=2))
  95.  
  96. AND OperationCenter.OPERATION_CENTER_ID = ? --operation center na user-a AB
  97. AND VFmxPdDay.OPERATION_MODE_ID = OperationMode.OPERATION_MODE_ID(+)
  98. AND Person.PERSON_ID = GuPerson.Person_id
  99. AND GuPerson.gui_user_id = ? --101943 USER:AB
  100. AND NVL (GuPerson.caw_limited, 'N') <> 'Y'
  101. ORDER BY person_company_nr, person_last_name, person_first_name, date_day;
  102.  
  103. --Payroll lines
  104. SELECT PdTrfDay.DATE_DAY,
  105.        PdTrfDay.PD_TRF_DAY_ID,
  106.        PdTrfDay.DESTINATION_POI_ID,
  107.        PdTrfDay.IS_LOCKED,
  108.        PdTrfDay.IS_MODIFIED_BY_USER,
  109.        PdTrfDay.OC_AGGREG_ADMIN_STATUS_ID,
  110.        PdTrfDay.OC_DAY_AGGREG_ID,
  111.        PdTrfDay.OPERATION_MODE_ID,
  112.        PdTrfDay.PD_TRF_TYPE_ID,
  113.        PdTrfDay.PD_TRF_USER_COMMENT,
  114.        PdTrfDay.PERSON_ID,
  115.        PdTrfDay.REF_NUMBER,
  116.        CAST(PdTrfDay.START_TIME AS TIMESTAMP) AS STARTTIME,
  117.        CAST(PdTrfDay.STOP_TIME AS TIMESTAMP) AS STOPTIME,
  118.        PdTrfDay.TRF_DHR,
  119.        PdTrfDay.TRF_PHR,
  120.        PdTrfDay.WBS_ID,
  121.        PdTrfDay.WORK_CODE_ID,
  122.        PdTrfDay.VEHICLE_ID,
  123.        WorkCode.WORK_CODE_ID AS WORK_CODE_ID1,
  124.        GuPerson.GUI_USER_ID,
  125.        GuPerson.PERSON_ID AS PERSON_ID1,
  126.        OperationMode.NAME,
  127.        OperationMode.OPERATION_MODE_ID AS OPERATION_MODE_ID1,
  128.        OperationMode.SHORT_NAME,
  129.        OcAggregAdminStatus.OC_AGGREG_ADMIN_STATUS_ID AS OC_AGGREG_ADMIN_STATUS_ID1,
  130.        OcDayAggreg.OC_DAY_AGGREG_ID AS OC_DAY_AGGREG_ID1,
  131.        OcPoi.POI_ID,
  132.        VoPersonCategory.VO_PERSON_CATEGORY_ID,
  133.        Person.PERSON_ID AS PERSON_ID2,
  134.        (Person.Last_name || ' ' || Person.First_Name) AS VIEW_ATTR,
  135.        TO_CHAR(PdTrfDay.date_day, 'Dy', 'nls_date_language=' ||  (SELECT CASE WHEN language = 'DU' THEN  'Dutch' WHEN language = 'FR' THEN 'French' ELSE 'English' END FROM gui_users gu WHERE gu.gui_user_id = GuPerson.gui_user_id)) AS VIEW_ATTR,
  136.        TO_CHAR( PdTrfDay.date_day,'dd') AS VIEW_ATTR,
  137.        TO_CHAR ( PdTrfDay.DATE_DAY , 'dd/MM/yyyy' ) AS VIEW_ATTR,
  138.        DECODE(PdTrfDay.start_poi_id,NULL,PdTrfDay.start_location_name, DECODE(OcPoi.oc_poi_status_id,4, '[' || OcPoi.short_name || '].'|| p_vd_poi.getVehicleDataAddress(PdTrfDay.start_vehicle_data_id), p_wbs.getWbsName(PdTrfDay.wbs_Id, PdTrfDay.start_poi_id))) AS VIEW_ATTR,
  139.        MOD(DENSE_RANK () OVER (ORDER BY Person.company_nr, person.last_name, person.person_id,  PdTrfDay.date_day), 2) AS VIEW_ATTR,
  140.        PdTrfDay.START_POI_ID,
  141.        PdTrfDay.TOT_PRIVATE_KM,
  142.        PdTrfDay.TOT_DRIVER_WITH_P_KM,
  143.        PdTrfDay.TOT_PASSENGER_KM,
  144.        OcAggregAdminStatus.FLAG_COLOUR,
  145.        VoPersonCategory.VEHICLE_OWNER_ID,
  146.        DECODE(OperationMode.short_name,'NW','#223c4a','CO','#f75414','') AS VIEW_ATTR,
  147.        PdTrfDay.USER_COMMENT,
  148.        UPPER (PdTrfDay.PD_TRF_USER_COMMENT   || ' ' || UPPER(NVL(PdTrfDay.EXPORT_FILE_NAME,'')) || ' ' || PdTrfDay.ref_number  || ' '  || OcPoi.name || ' ' || USER_COMMENT  || ' '  || OperationMode.SHORT_NAME  || ' '  || OcAggregAdminStatus.NAME  || ' '  || Person.Last_name  || ' '  || Person.First_Name  || ' '  || DECODE(PdTrfDay.start_poi_id,NULL,PdTrfDay.start_location_name, DECODE(OcPoi.oc_poi_status_id,4, '['  || OcPoi.short_name  || '].'  || p_vd_poi.getVehicleDataAddress(PdTrfDay.start_vehicle_data_id), p_wbs.getWbsName(NULL, OcPoi.poi_id)))  || ' '  || Person.COMPANY_NR  || ' '  || WorkCode.SHORT_CODE || ' ' || ACTIVITY.ACTIVITY_CODE  || ' ' || ACTIVITY.ACTIVITY_NAME || ' ' || VEHICLE.COMPANY_NR || ' ' || VEHICLE.NUMBERPLATE || ' ' || P_WBS.getWBSPathWithNames(PdTrfDay.wbs_Id) || ' ' || P_WBS.getWBSPathWithREF_number(PdTrfDay.WBS_ID)  || ' ' || P_WBS.getWBSPathWithShortName(PdTrfDay.WBS_ID)) AS VIEW_ATTR,
  149.        (SELECT work_code_id FROM work_code WHERE vehicle_owner_id = VoPersonCategory.vehicle_owner_id AND work_code_std_id=110 AND order_num = ( SELECT MIN(order_num) FROM work_code WHERE vehicle_owner_id = VoPersonCategory.vehicle_owner_id AND work_code_std_id=110)) AS VIEW_ATTR,
  150.        (VoPersonCategory.VEHICLE_OWNER_ID) AS VIEW_ATTR,
  151.        (Person.Company_nr) AS VIEW_ATTR,
  152.        (VoPersonCategory.Name) AS VIEW_ATTR,
  153.        (VehicleOwner.Company_name) AS VIEW_ATTR,
  154.        PdTrfDay.ACTIVITY_ID,
  155.        PdDay.PD_DAY_ID,
  156.        (PdDay.TRF_DHR_SUPP_TO_STORE) AS VIEW_ATTR,
  157.        ROW_NUMBER () over (PARTITION BY pdday.pd_day_id ORDER BY PdTrfDay.order_num, PdTrfDay.START_TIME) AS ROW_NUM,
  158.        (PdDay.TRF_DHR_SUPP_TO_PAY) AS VIEW_ATTR,
  159.        (PdDay.MOBILITY_ZONE_ID) AS VIEW_ATTR,
  160.        (Pdday.MOBILITY_COMPENSATION) AS VIEW_ATTR,
  161.        (PdDay.MEAL_ALLOWANCE) AS VIEW_ATTR,
  162.        (Vehicle.COMPANY_NR || ' ' || Vehicle.NUMBERPLATE) AS VIEW_ATTR,
  163.        PdTrfDay.START_LOCATION_ADDRESS,
  164.        (Vehicle.NUMBERPLATE) AS VIEW_ATTR,
  165.        (Vehicle.COMPANY_NR) AS VIEW_ATTR,
  166.        PdTrfDay.TRF_IHR,
  167.        (PDDAY.Declared_Vehicle_Km) AS VIEW_ATTR,
  168.        (PDDAY.Declared_Vehicle_Ref) AS VIEW_ATTR,
  169.        (PDDAY.pause) AS VIEW_ATTR,
  170.        (PDDAY.Declared_Private_Km) AS VIEW_ATTR,
  171.        PdTrfDay.START_LOCATION_NAME,
  172.        PdTrfDay.ERP_SIGN_ATTACHED_DOC_ID,
  173.        PdTrfDay.VALIDATED_BY_EMAIL,
  174.        PdTrfDay.VALIDATED_BY_NAME,
  175.        PdTrfDay.VALIDATION_COMMENT,
  176.        (PDDAY.Declared_On_Foot_Km) AS VIEW_ATTR,
  177.        (PDDAY.Declared_Bicycle_Km) AS VIEW_ATTR,
  178.        (PDDAY.public_transport) AS VIEW_ATTR,
  179.        (Private_Vehicle) AS VIEW_ATTR,
  180.        (PDDAY.Company_Vehicle) AS VIEW_ATTR,
  181.        (PDDAY.long_distance) AS VIEW_ATTR,
  182.        (PDDAY.TRAJECT) AS VIEW_ATTR,
  183.        (PDDAY.Transport) AS VIEW_ATTR,
  184.        (PDDAY.DECLARED_JOURNEY_TYPE_ID) AS VIEW_ATTR,
  185.        (PDDAY.WORK_LOCATION_CATEGORY) AS VIEW_ATTR,
  186.        (PDDAY.WORK_LOCATION_POST_CODE) AS VIEW_ATTR,
  187.        (PDDAY.MEETING_POINT_POST_CODE) AS VIEW_ATTR,
  188.        SUM( CASE WHEN  WorkCode.work_code_std_type_id = 1 THEN PdTrfDay.TRF_DHR ELSE 0 END) OVER (PARTITION BY PdTrfDay.date_day,PdTrfDay.person_id) AS VIEW_ATTR,
  189.        GraphicalSymbol.GRAPHICAL_SYMBOL_ID,
  190.        (GraphicalSymbol.NAME) AS VIEW_ATTR,
  191.        P_WBS.getWBSPathWithNames(PdTrfDay.wbs_Id) AS VIEW_ATTR,
  192.        P_WBS.getWBSPathWithREF_number(PdTrfDay.WBS_ID) AS VIEW_ATTR,
  193.        P_WBS.getWBSPathWithShortName(PdTrfDay.WBS_ID) AS VIEW_ATTR,
  194.        (PDDAY.WORK_LOCATION_CITY) AS VIEW_ATTR,
  195.        (PDDAY.MEETING_POINT_CITY) AS VIEW_ATTR,
  196.        (PDDAY.PLANNED_WORK_DURATION) AS VIEW_ATTR,
  197.        WorkCode.WORK_CODE_STD_TYPE_ID,
  198.        PdTrfDay.HEAVY_WORK,
  199.        NVL(PdTrfDay.is_exported, 'N') AS Is_Exported,
  200.        P_WBS.getlvl0WbsRefNumber(PdTrfDay.WBS_ID) AS VIEW_ATTR,
  201.        P_WBS.getlvl1WbsRefNumber(PdTrfDay.WBS_ID) AS VIEW_ATTR,
  202.        P_WBS.getlvl2WbsRefNumber(PdTrfDay.WBS_ID) AS VIEW_ATTR,
  203.        (OcAggregAdminStatus.NAME) AS VIEW_ATTR,
  204.        (WorkCode.short_code) AS VIEW_ATTR,
  205.        PdTrfDay.REF_NUMBER_TASK_CODE,
  206.        (Vehicle1.COMPANY_NR || ' ' || Vehicle1.NUMBERPLATE) AS VIEW_ATTR,
  207.        (PdTrfDay.Person_id) AS VIEW_ATTR,
  208.        PdTrfDay.ORDER_NUM,
  209.        PdTrfDay.EXPORT_FILE_NAME,
  210.        PdTrfDay.TRF_PRICE,
  211.        (WorkCode.WORK_CODE_NAME) AS VIEW_ATTR,
  212.        PdTrfDay.TRF_KM_ROUTE,
  213.        PdTrfDay.TRF_KM_ESTIMATED,
  214.        DECODE (IVehicle.vehicle_id, NULL, DECODE (PdTrfVehicle.vehicle_id, NULL, NULL, TRIM(DECODE(PdTrfVehicle.company_nr, NULL, '', PdTrfVehicle.company_nr || ' - ') || PdTrfVehicle.numberplate)), TRIM(DECODE(IVehicle.company_nr, NULL, '', IVehicle.company_nr || ' - ') || IVehicle.numberplate)) AS VIEW_ATTR,
  215.        (PDDAY.MAINTENANCE) AS VIEW_ATTR,
  216.        (PDDAY.LAUNDRY) AS VIEW_ATTR,
  217.        (PDDAY.DAY_JOURNEY_ROLE) AS VIEW_ATTR,
  218.        (OcPoi.name) AS POI_NAME,
  219.        PdTrfDay.SUBMITTED_BY_PERSON_ID,
  220.        PdTrfDay.SUBMITTED_BY_DATE_DAY,
  221.        PdTrfDay.VALIDATION_STATUS_ID,
  222.        (OperationMode.SHORT_NAME) AS VIEW_ATTR,
  223.        (OperationMode.NAME) AS VIEW_ATTR,
  224.        (PDDAY.WORK_DURATION) AS VIEW_ATTR
  225. FROM PD_TRF_DAY PdTrfDay, PERSON Person, VO_PERSON_CATEGORY VoPersonCategory, OC_POI OcPoi, OC_DAY_AGGREG OcDayAggreg, OC_AGGREG_ADMIN_STATUS OcAggregAdminStatus, OPERATION_MODE OperationMode, GU_PERSON GuPerson, WORK_CODE WorkCode, VEHICLE_OWNER VehicleOwner, PD_DAY PdDay, VEHICLE Vehicle, OF_OWNER.ACTIVITY Activity, OF_OWNER.GRAPHICAL_SYMBOL GraphicalSymbol, VEHICLE Vehicle1, VEHICLE IVehicle, VEHICLE PdTrfVehicle
  226. WHERE PdTrfDay.start_poi_id = OcPoi.poi_id (+)
  227. AND PdTrfDay.oc_day_aggreg_id = OcDayAggreg.oc_day_aggreg_id (+)
  228. AND PdTrfDay.OC_AGGREG_ADMIN_STATUS_ID = OcAggregAdminStatus.OC_AGGREG_ADMIN_STATUS_ID (+)
  229. AND PdTrfDay.Operation_mode_id = OperationMode.Operation_mode_id (+)
  230. AND PdTrfDay.work_code_id = WorkCode.work_code_id (+)
  231. AND WorkCode.GRAPHICAL_SYMBOL_ID = GraphicalSymbol.GRAPHICAL_SYMBOL_ID (+)
  232. AND PdTrfDay.person_id = Person.person_id
  233. AND Person.Vo_Person_Category_id = VoPersonCategory.Vo_Person_Category_id
  234. AND VoPersonCategory.Vehicle_owner_id = VehicleOwner.vehicle_owner_id
  235. AND Person.PERSON_ID = GuPerson.PERSON_ID
  236. AND PdTrfDay.date_day = PdDay.date_day
  237. AND PdTrfDay.person_id = PdDay.person_id
  238. AND PdTrfDay.activity_id = activity.activity_id(+)
  239. AND pdday.vehicle_id = vehicle.vehicle_id (+)
  240. AND pdday.vehicle2_id = vehicle1.vehicle_id (+)
  241. AND PdTrfDay.TRF_I_VEHICLE_ID = IVehicle.vehicle_id (+)
  242. AND PdTrfDay.VEHICLE_ID = PdTrfVehicle.VEHICLE_ID (+)
  243. AND NVL (GuPerson.caw_limited, 'N') <> 'Y'
  244. AND GuPerson.gui_user_id = ? --101943 USER:AB
  245. AND (Person.vo_person_category_id = ? OR ? = -1) --100752
  246. AND PdTrfDay.date_day >= ? AND  PdTrfDay.date_day <= ? --kakvito dati iskash
  247. AND (Person.PERSON_ID = ? OR ? = 0) -- i na 2te 0
  248. AND ((NVL (PdTrfDay.TRF_DHR, 0) + NVL (PdTrfDay.TRF_PHR, 0)) > 0 OR ? = 'true')  --'true'
  249. AND (?='true' OR TO_CHAR (PdTrfDay.date_day, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH')  NOT IN ('SAT', 'SUN')
  250.     OR (NVL (PdTrfDay.TRF_DHR, 0) + NVL (PdTrfDay.TRF_PHR, 0)) > 0) --'true'
  251. AND (? = 'false' OR OcAggregAdminStatus.name != 'Normal') --'false'
  252. AND ((? = 'false') OR (NVL(PdTrfDay.is_locked,'N')='N')) --'false'
  253. AND ((? = 'false') OR (OperationMode.OPERATION_MODE_ID=2)) --'false'
  254. AND (? = '-1' OR Person.Person_ID IN (SELECT person_id FROM vo_group_person WHERE vo_group_id IN ( SELECT regexp_substr( ? ,'[^,]+', 1, LEVEL) FROM dual
  255.     CONNECT BY regexp_substr( ?, '[^,]+', 1, LEVEL) IS NOT NULL ))) --'-1'
  256. AND  (? = '-1'  OR P_WBS.getlvl0WbsRefNumber(PdTrfDay.WBS_ID) = ? ) --'-1'
  257. AND Person.Vo_Person_category_id IN (
  258. SELECT VFmxPc.VO_PERSON_CATEGORY_ID FROM V_FMX_PC VFmxPc
  259. WHERE VFmxPc.OPERATION_CENTER_ID IN
  260. (
  261.  SELECT OPERATION_CENTER_ID FROM GUI_USERS WHERE GUI_USER_ID = ? --101943 USER:AB
  262. )
  263. AND VFmxPc.VO_PERSON_CATEGORY_ID IN (SELECT DISTINCT VO_PERSON_CATEGORY_ID FROM GU_PERSON gu, PERSON p WHERE gu.PERSON_ID = p.PERSON_ID AND gu.GUI_USER_ID = ?)) --101943 USER:AB
  264. AND INSTR(?,TO_CHAR(WorkCode.WORK_CODE_STD_TYPE_ID)) > 0 -- vmesto da ima '1'
  265. AND INSTR(?,TO_CHAR(WorkCode.WORK_CODE_STD_CATEGORY_ID)) > 0 --vmesto ? da ima '1,2,3'
  266. AND ((? = 'false') OR (NVL(PdTrfDay.is_exported,'N')='N'))--false
  267. AND (? = 'false' OR NVL(VoPersonCategory.IS_EXPORTED_TO_PAYROLL,'Y')='Y') --'true'
  268. ORDER BY Person.COMPANY_NR, Person.Last_name, PdTrfDay.date_day, PdTrfDay.START_TIME, row_num;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement