DBA Data[Home] [Help]

APPS.PA_SEARCH_PVT dependencies on PA_FORECAST_ITEMS

Line 916: -- pa_forecast_items table does not store unassigned time

912: -- bulk collect the resources who passed the mandatory competence
913: -- check and their availability into plsql tables.
914:
915: -- need to know the number of assignment days because the
916: -- pa_forecast_items table does not store unassigned time
917: -- resource records with 0 hours.
918: -- This will be used in the following sql statement...
919: --
920: -- hr_utility.trace('SEARCH MODE IS' || p_search_mode);

Line 925: FROM pa_forecast_items

921: -- hr_utility.trace('assignment_id is : ' || to_char(p_search_criteria.assignment_id));
922:
923: IF p_search_mode = 'RESOURCE' THEN
924: SELECT count(*) INTO l_assignment_days
925: FROM pa_forecast_items
926: WHERE assignment_id = p_search_criteria.assignment_id
927: AND delete_flag = 'N'
928: AND error_flag IN ('Y','N')
929: AND item_date >= trunc(SYSDATE)

Line 956: FROM pa_forecast_items asgmt

952: INSERT INTO PA_FI_ASSIG_TEMP
953: (
954: SELECT asgmt.item_date ,
955: asgmt.item_quantity
956: FROM pa_forecast_items asgmt
957: WHERE asgmt.assignment_id = p_search_criteria.assignment_id
958: AND asgmt.delete_flag = 'N'
959: AND asgmt.error_flag IN ('Y','N')
960: AND asgmt.item_date >= trunc(SYSDATE)

Line 970: -- Bug Ref # 7457064, Removed multiple joins of PA_FORECAST_ITEMS

966: l_availability_tbl(k) := 0;
967: l_pot_availability_tbl(k) := 0;
968: END LOOP;
969: END IF;
970: -- Bug Ref # 7457064, Removed multiple joins of PA_FORECAST_ITEMS
971: -- Using the temp table instead.
972: --Bug 6911907: Changed the index to PA_FORECAST_ITEMS_N5 from PA_FORECAST_ITEMS_N3
973: --Bug 6911907: Changed the index back to PA_FORECAST_ITEMS_N3
974: -- Added filter condition

Line 972: --Bug 6911907: Changed the index to PA_FORECAST_ITEMS_N5 from PA_FORECAST_ITEMS_N3

968: END LOOP;
969: END IF;
970: -- Bug Ref # 7457064, Removed multiple joins of PA_FORECAST_ITEMS
971: -- Using the temp table instead.
972: --Bug 6911907: Changed the index to PA_FORECAST_ITEMS_N5 from PA_FORECAST_ITEMS_N3
973: --Bug 6911907: Changed the index back to PA_FORECAST_ITEMS_N3
974: -- Added filter condition
975: stmt_select := 'SELECT /*+ INDEX (res, PA_FORECAST_ITEMS_N3) */ ' ||
976: ' res.person_id, ' ||

Line 973: --Bug 6911907: Changed the index back to PA_FORECAST_ITEMS_N3

969: END IF;
970: -- Bug Ref # 7457064, Removed multiple joins of PA_FORECAST_ITEMS
971: -- Using the temp table instead.
972: --Bug 6911907: Changed the index to PA_FORECAST_ITEMS_N5 from PA_FORECAST_ITEMS_N3
973: --Bug 6911907: Changed the index back to PA_FORECAST_ITEMS_N3
974: -- Added filter condition
975: stmt_select := 'SELECT /*+ INDEX (res, PA_FORECAST_ITEMS_N3) */ ' ||
976: ' res.person_id, ' ||
977: ' TRUNC(SUM(DECODE(SIGN( ' ||

Line 975: stmt_select := 'SELECT /*+ INDEX (res, PA_FORECAST_ITEMS_N3) */ ' ||

971: -- Using the temp table instead.
972: --Bug 6911907: Changed the index to PA_FORECAST_ITEMS_N5 from PA_FORECAST_ITEMS_N3
973: --Bug 6911907: Changed the index back to PA_FORECAST_ITEMS_N3
974: -- Added filter condition
975: stmt_select := 'SELECT /*+ INDEX (res, PA_FORECAST_ITEMS_N3) */ ' ||
976: ' res.person_id, ' ||
977: ' TRUNC(SUM(DECODE(SIGN( ' ||
978: ' (nvl(res.capacity_quantity, 0) - nvl(res.confirmed_qty, 0) - ' ||
979: ' nvl(res.provisional_qty,0)) / asgmt.item_quantity-1),1, 1, ' ||

Line 989: ' PA_FORECAST_ITEMS res, ' ||

985: ' greatest((nvl(res.capacity_quantity, 0) - ' ||
986: ' nvl(res.confirmed_qty, 0)), 0)/ asgmt.item_quantity))/ :1 ' || '* 100) ';
987:
988: stmt_from := ' FROM ' ||
989: ' PA_FORECAST_ITEMS res, ' ||
990: ' PA_FI_ASSIG_TEMP asgmt ';
991:
992: stmt_where := ' WHERE ' ||
993: ' res.forecast_item_type = ''U'' ' ||

Line 1048: SELECT /*+ ORDERED USE_NL(srt res) INDEX (res, PA_FORECAST_ITEMS_N3)*/srt.person_id, count(res.resource_id)

1044: -- hr_utility.trace('end_date is ' || to_char(p_search_criteria.end_date, 'DD-MON-YYYY'));
1045: --
1046: -- Caculation from forecast items until new table solution
1047: --
1048: SELECT /*+ ORDERED USE_NL(srt res) INDEX (res, PA_FORECAST_ITEMS_N3)*/srt.person_id, count(res.resource_id)
1049: BULK COLLECT INTO l_person_id_tbl, l_days_in_period_tbl
1050: FROM PA_SEARCH_RESULTS_TEMP srt,
1051: PA_FORECAST_ITEMS res
1052: WHERE srt.resource_id = res.resource_id

Line 1051: PA_FORECAST_ITEMS res

1047: --
1048: SELECT /*+ ORDERED USE_NL(srt res) INDEX (res, PA_FORECAST_ITEMS_N3)*/srt.person_id, count(res.resource_id)
1049: BULK COLLECT INTO l_person_id_tbl, l_days_in_period_tbl
1050: FROM PA_SEARCH_RESULTS_TEMP srt,
1051: PA_FORECAST_ITEMS res
1052: WHERE srt.resource_id = res.resource_id
1053: AND res.forecast_item_type = 'U'
1054: AND res.delete_flag = 'N'
1055: AND res.error_flag IN ('Y','N')

Line 1082: PA_FORECAST_ITEMS res

1078: l_days_in_period_tbl(i) * 100)
1079: INTO l_pot_availability_tbl(i),
1080: l_availability_tbl(i)
1081: FROM PA_SEARCH_RESULTS_TEMP srt,
1082: PA_FORECAST_ITEMS res
1083: WHERE srt.person_id = l_person_id_tbl(i)
1084: AND srt.resource_id = res.resource_id
1085: AND res.forecast_item_type = 'U'
1086: AND res.delete_flag = 'N'

Line 1232: -- do not exist in the pa_forecast_items table.

1228: -- that some people in the denorm table meet the criteria but
1229: -- were not updated in the above update statement because they
1230: -- were not in l_person_id_tbl(k) because they were not available
1231: -- on ANY of the requirement days. Resource records with 0 hours
1232: -- do not exist in the pa_forecast_items table.
1233: -- In that case we need to update the availability to 0 and update
1234: -- the resource org name and candidate score.
1235: -- NOTE that the update only happens if
1236: -- p_search_criteria.min_availability = 0 AND