Advertisement
psi_mmobile

Untitled

Jun 23rd, 2020
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. CREATE OR REPLACE FORCE EDITIONABLE VIEW "OF_OWNER"."V_AGGREG1_GENERIC_KPD_V2" ("VD_POI_DAY_ID", "DATE_DAY", "VEHICLE_ID", "GUI_USER_ID", "VEHICLE_OWNER_ID", "WORK_DATE", "WORKER_CODE", "ALLOWANCE", "HR", "MOB_CODE", "KM", "ADDRESS", "PROJECT", "WORKER_ACTIVITY", "LEGAL_CATEGORY", "LEGAL_CODE", "MATERIAL_CODE", "MATERIAL_HR", "MATERIAL_ACTIVITY", "LEGAL_CATEGORY2", "LEGAL_CODE2") AS
  2. SELECT vd_poi_day_id,
  3. vd_poi_day.date_day,
  4. vd_poi_day.vehicle_id,
  5. gu_vehicle.gui_user_id,
  6. vehicle.vehicle_owner_id,
  7. TO_CHAR(vd_poi_day.date_day,'DD/MM/YYYY') WORK_DATE,
  8. null WORKER_CODE,
  9. null ALLOWANCE,
  10. null HR,
  11. null MOB_CODE,
  12. null KM,
  13. null ADDRESS,
  14. vd_poi_day.ref_number PROJECT,
  15. null WORKER_ACTIVITY,
  16. null LEGAL_CATEGORY,
  17. null LEGAL_CODE,
  18. vehicle.company_nr MATERIAL_CODE,
  19. trim(to_char(round(vd_poi_day.poi_hr*10)/10, '90.9')) MATERIAL_HR,
  20. '***********' MATERIAL_ACTIVITY,
  21. null LEGAL_CATEGORY2,
  22. null LEGAL_CODE2
  23. FROM vd_poi_day,
  24. vehicle,
  25. oc_day_aggreg,
  26. gu_vehicle,
  27. gui_users
  28. WHERE vd_poi_day.vehicle_id = vehicle.vehicle_id
  29. AND vd_poi_day.oc_day_aggreg_id = oc_day_aggreg.oc_day_aggreg_id
  30. AND ( (oc_day_aggreg.operation_center_id=101229) -- Eiffage-Sodemat
  31. or (oc_day_aggreg.operation_center_id=101738 and oc_day_aggreg.vo_vehicle_category_id=102966 ) -- TRAGECO Engin
  32. or (oc_day_aggreg.operation_center_id=101129 and oc_day_aggreg.vo_vehicle_category_id=102969 ) -- GEHLEN Engin
  33. or (oc_day_aggreg.operation_center_id=101176 and oc_day_aggreg.vo_vehicle_category_id=102537 ) -- DEFLANDRE Engin
  34. )
  35. and vehicle.vehicle_id = gu_vehicle.vehicle_id
  36. and gu_vehicle.gui_user_id = gui_users.GUI_USER_ID
  37. and gui_users.operation_center_id = oc_day_aggreg.operation_center_id
  38. and nvl(vd_poi_day.invoiced_line,'Y') <> 'N'
  39. and vd_poi_day.day_first_start_km is not null
  40. -- and date_day=to_date('22/07/2017','DD/MM/YYYY')
  41. -- and gui_users.gui_user_id=101060
  42. ORDER BY vehicle.company_nr, vd_poi_day.date_day;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement