DBA Data[Home] [Help]

APPS.HZ_MERGE_ENTITY_ATTRI_PVT dependencies on HZ_ORGANIZATION_PROFILES

Line 58: FROM HZ_ORGANIZATION_PROFILES OP,HZ_DUP_SETS DS, HZ_DUP_SET_PARTIES DSP, HZ_DUP_BATCH DB

54: AND NVL(DSP.MERGE_FLAG,'Y') <> 'N'
55: AND ROWNUM = 1;
56: cursor get_OPInternalFlagPartyId_csr is
57: SELECT OP.PARTY_ID
58: FROM HZ_ORGANIZATION_PROFILES OP,HZ_DUP_SETS DS, HZ_DUP_SET_PARTIES DSP, HZ_DUP_BATCH DB
59: WHERE OP.PARTY_ID =DSP.DUP_PARTY_ID
60: AND DB.DUP_BATCH_ID = DS.DUP_BATCH_ID
61: AND DS.DUP_SET_ID = DSP.DUP_SET_ID
62: AND sysdate between op.effective_start_date and nvl(op.effective_end_date,sysdate)

Line 75: if p_entity_name = 'HZ_ORGANIZATION_PROFILES' then

71: open get_PPInternalFlagPartyId_csr;
72: fetch get_PPInternalFlagPartyId_csr into l_party_id;
73: close get_PPInternalFlagPartyId_csr;
74: end if;
75: if p_entity_name = 'HZ_ORGANIZATION_PROFILES' then
76: open get_OPInternalFlagPartyId_csr;
77: fetch get_OPInternalFlagPartyId_csr into l_party_id;
78: close get_OPInternalFlagPartyId_csr;
79: end if;

Line 97: and entity_name = 'HZ_ORGANIZATION_PROFILES'

93: cursor get_org_rec_csr is
94: select attribute_name, attribute_value, attribute_type, attribute_party_id
95: from HZ_MERGE_ENTITY_ATTRIBUTES
96: where merge_to_party_id = p_merge_to_party_id
97: and entity_name = 'HZ_ORGANIZATION_PROFILES'
98: and merge_batch_id = p_merge_batch_id;
99:
100: l_attribute_name varchar2(30);
101: l_attribute_value varchar2(2000);

Line 839: and entity_name = 'HZ_ORGANIZATION_PROFILES'

835: cursor get_attri_party_csr is
836: select attribute_party_id
837: from HZ_MERGE_ENTITY_ATTRIBUTES
838: where merge_to_party_id = p_merge_to_party_id
839: and entity_name = 'HZ_ORGANIZATION_PROFILES'
840: and merge_batch_id = p_merge_batch_id
841: and attribute_name = 'BUSINESS_REPORT';
842:
843: cursor get_automerge_flag_csr is

Line 858: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'

854: open get_automerge_flag_csr;
855: fetch get_automerge_flag_csr into l_automerge_flag;
856: close get_automerge_flag_csr;
857:
858: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'
859: then
860: if l_automerge_flag = 'N' or (l_automerge_flag = 'Y' and nvl(fnd_profile.value('HZ_PROF_ATTR_DEFAULT'), 'MASTER') <> 'MASTER')
861: then
862: open get_obj_version_csr;

Line 882: UPDATE hz_organization_profiles

878: open get_attri_party_csr;
879: fetch get_attri_party_csr into l_attribute_party_id;
880: close get_attri_party_csr;
881:
882: UPDATE hz_organization_profiles
883: SET business_report = (select business_report
884: from hz_organization_profiles
885: where party_id = l_attribute_party_id
886: and sysdate between effective_start_date and nvl(effective_end_date,sysdate)

Line 884: from hz_organization_profiles

880: close get_attri_party_csr;
881:
882: UPDATE hz_organization_profiles
883: SET business_report = (select business_report
884: from hz_organization_profiles
885: where party_id = l_attribute_party_id
886: and sysdate between effective_start_date and nvl(effective_end_date,sysdate)
887: and rownum=1),
888: last_update_date = SYSDATE,

Line 1013: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'

1009: l_attribute_name varchar2(30);
1010: l_value varchar2(2000);
1011: l_lookup_type varchar2(30);
1012: begin
1013: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'
1014: then
1015: l_lookup_type := 'ORG_PROFILE_CATEGORY';
1016: elsif p_entity_name = 'HZ_PERSON_PROFILES'
1017: then l_lookup_type := 'PERSON_PROFILE_CATEGORY';

Line 1087: from hz_organization_profiles pro, hz_merge_parties mp

1083:
1084: -- get candidate parties with desc order for last update date
1085: cursor get_org_candidate_party_csr is
1086: select mp.from_party_id, pro.last_update_date
1087: from hz_organization_profiles pro, hz_merge_parties mp
1088: where pro.party_id = mp.from_party_id
1089: and mp.batch_id = p_merge_batch_id
1090: and sysdate between pro.effective_start_date and nvl(pro.effective_end_date,sysdate)
1091: order by pro.last_update_date desc;

Line 1096: from hz_organization_profiles pro, hz_merge_parties mp

1092:
1093: -- get candidate parties with desc order for latest creation date
1094: cursor get_org_candidate_party_lc_csr is
1095: select mp.from_party_id, pro.last_update_date
1096: from hz_organization_profiles pro, hz_merge_parties mp
1097: where pro.party_id = mp.from_party_id
1098: and mp.batch_id = p_merge_batch_id
1099: and sysdate between pro.effective_start_date and nvl(pro.effective_end_date,sysdate)
1100: order by pro.creation_date desc, pro.party_id desc;

Line 1105: from hz_organization_profiles pro, hz_merge_parties mp

1101:
1102: -- get candidate parties with desc order for earlist creation date
1103: cursor get_org_candidate_party_ec_csr is
1104: select mp.from_party_id, pro.last_update_date
1105: from hz_organization_profiles pro, hz_merge_parties mp
1106: where pro.party_id = mp.from_party_id
1107: and mp.batch_id = p_merge_batch_id
1108: and sysdate between pro.effective_start_date and nvl(pro.effective_end_date,sysdate)
1109: order by pro.creation_date, pro.party_id;

Line 1152: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'

1148:
1149: -- l_attri_def_prof := nvl(fnd_profile.value('HZ_PROF_ATTR_DEFAULT'), 'MASTER');
1150: l_attri_def_next_prof := nvl(fnd_profile.value('HZ_PROF_ATTR_DEFAULT_NEXT'), 'LATEST_UPDATE_DATE');
1151:
1152: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'
1153: then
1154: open get_leader_attribute_name_csr('ORG_PROFILE_CATEGORY');
1155: loop
1156: fetch get_leader_attribute_name_csr into l_attribute_name;

Line 1356: from hz_organization_profiles

1352: p_merge_to_party_id IN NUMBER) is
1353:
1354: cursor master_business_rpt_csr is
1355: select 'x'
1356: from hz_organization_profiles
1357: where party_id = p_merge_to_party_id
1358: and business_report is not null
1359: and sysdate between effective_start_date and nvl(effective_end_date,sysdate);
1360:

Line 1364: from hz_organization_profiles pro, hz_merge_parties mp

1360:
1361: -- get candidate parties with desc order for last update date
1362: cursor get_business_report_party_csr is
1363: select mp.from_party_id, pro.last_update_date
1364: from hz_organization_profiles pro, hz_merge_parties mp
1365: where pro.party_id = mp.from_party_id
1366: and mp.batch_id = p_merge_batch_id
1367: and pro.business_report is not null
1368: and sysdate between pro.effective_start_date and nvl(pro.effective_end_date,sysdate)

Line 1393: and entity_name = 'HZ_ORGANIZATION_PROFILES'

1389: object_version_number = nvl(object_version_number,1)+1,
1390: derived_last_update_date = l_last_update_date
1391: where attribute_name = 'BUSINESS_REPORT'
1392: and merge_batch_id = p_merge_batch_id
1393: and entity_name = 'HZ_ORGANIZATION_PROFILES'
1394: and merge_to_party_id =p_merge_to_party_id;
1395:
1396: close master_business_rpt_csr;
1397: close get_business_report_party_csr;

Line 1460: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'

1456: -- attribute_value(table column value) from profile table
1457:
1458: fetch get_entity_attri_csr into l_col_name,l_col_type;
1459: exit when get_entity_attri_csr %NOTFOUND;
1460: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'
1461: then
1462: if l_col_name <> 'BUSINESS_REPORT'
1463: then
1464: l_str := 'select party_id, decode('''||l_col_type||''',''D'',to_char(attri_value,''YYYY/MM/DD''),attri_value) from '||

Line 1467: ' from HZ_ORGANIZATION_PROFILES OP,HZ_PARTIES PARTY, HZ_DUP_SETS DS, HZ_DUP_SET_PARTIES DSP, HZ_DUP_BATCH DB '||

1463: then
1464: l_str := 'select party_id, decode('''||l_col_type||''',''D'',to_char(attri_value,''YYYY/MM/DD''),attri_value) from '||
1465: '(SELECT party_id, attri_value, rank() over (order by cntAttri desc) rank, '||l_date_clause || ' from '||
1466: '(SELECT OP.PARTY_ID, OP.'||l_col_name||' attri_value, count(*) over (partition by OP.'||l_col_name||') as cntAttri, '||'op.'||l_date_clause||
1467: ' from HZ_ORGANIZATION_PROFILES OP,HZ_PARTIES PARTY, HZ_DUP_SETS DS, HZ_DUP_SET_PARTIES DSP, HZ_DUP_BATCH DB '||
1468: 'WHERE OP.PARTY_ID =DSP.DUP_PARTY_ID AND DB.DUP_BATCH_ID = DS.DUP_BATCH_ID '||
1469: 'AND DS.DUP_SET_ID = DSP.DUP_SET_ID AND OP.PARTY_ID = PARTY.PARTY_ID '||
1470: 'AND sysdate between effective_start_date and nvl(effective_end_date,sysdate) '||
1471: 'AND OP.'||l_col_name||' is not null '||

Line 1613: if p_entity_name not in ('HZ_ORGANIZATION_PROFILES','HZ_PERSON_PROFILES')

1609: savepoint create_merge_attributes_pvt;
1610: -- Initialize return status to SUCCESS
1611: x_return_status := FND_API.G_RET_STS_SUCCESS;
1612:
1613: if p_entity_name not in ('HZ_ORGANIZATION_PROFILES','HZ_PERSON_PROFILES')
1614: then
1615: FND_MESSAGE.SET_NAME( 'AR', 'HZ_INVALID_ENTITY_NAME' );
1616: FND_MSG_PUB.ADD;
1617: RAISE FND_API.G_EXC_ERROR;

Line 1701: from HZ_ORGANIZATION_PROFILES

1697: sysdate,
1698: nvl(fnd_global.user_id,-1),
1699: nvl(fnd_global.login_id,-1),
1700: sysdate
1701: from HZ_ORGANIZATION_PROFILES
1702: where party_id = l_selected_party_id
1703: and sysdate between effective_start_date and nvl(effective_end_date,sysdate);
1704:
1705: default_business_report(

Line 1710: -- ex. select to_char(SIC_CODE) from hz_organization_profiles to get attribute_value

1706: p_merge_batch_id=>p_merge_batch_id,
1707: p_merge_to_party_id => p_merge_to_party_id);
1708: else
1709: -- need to use d-sql to get to_char(l_col_name) from entity table
1710: -- ex. select to_char(SIC_CODE) from hz_organization_profiles to get attribute_value
1711:
1712: str := 'insert into hz_merge_entity_attributes( '||
1713: 'MERGE_BATCH_ID,'||
1714: 'MERGE_TO_PARTY_ID,'||

Line 1872: from hz_organization_profiles

1868: and attribute_name = p_attribute_name;
1869:
1870: cursor get_org_last_update_date_csr is
1871: select last_update_date
1872: from hz_organization_profiles
1873: where party_id = p_attribute_party_id
1874: and sysdate between effective_start_date and nvl(effective_end_date,sysdate);
1875:
1876: cursor get_per_last_update_date_csr is

Line 1892: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'

1888: savepoint update_merge_attributes_pvt;
1889: -- Initialize return status to SUCCESS
1890: x_return_status := FND_API.G_RET_STS_SUCCESS;
1891:
1892: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'
1893: then
1894: l_lookup_type := 'ORG_PROFILE_CATEGORY';
1895: elsif p_entity_name = 'HZ_PERSON_PROFILES'
1896: then l_lookup_type := 'PERSON_PROFILE_CATEGORY';

Line 1922: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'

1918: END IF;
1919:
1920: px_object_version_number := nvl(l_object_version_number,1)+1;
1921:
1922: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'
1923: then
1924: open get_org_last_update_date_csr;
1925: fetch get_org_last_update_date_csr into l_last_update_date;
1926: close get_org_last_update_date_csr;

Line 2086: from hz_organization_profiles

2082: function get_party_last_upd_date(p_attribute_party_id in number, p_entity_name in varchar2) return date is
2083:
2084: cursor get_org_last_update_date_csr is
2085: select last_update_date
2086: from hz_organization_profiles
2087: where party_id = p_attribute_party_id
2088: and sysdate between effective_start_date and nvl(effective_end_date,sysdate);
2089:
2090: cursor get_per_last_update_date_csr is

Line 2097: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'

2093: where party_id = p_attribute_party_id
2094: and sysdate between effective_start_date and nvl(effective_end_date,sysdate);
2095: l_last_update_date date;
2096: begin
2097: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'
2098: then
2099: open get_org_last_update_date_csr;
2100: fetch get_org_last_update_date_csr into l_last_update_date;
2101: close get_org_last_update_date_csr;

Line 2120: from hz_organization_profiles

2116: where merge_batch_id = p_merge_batch_id
2117: and attribute_name <> 'BUSINESS_REPORT'
2118: and attribute_party_id = l_attribute_party_id and rownum = 1
2119: and derived_last_update_date <> (select last_update_date
2120: from hz_organization_profiles
2121: where party_Id =l_attribute_party_id
2122: and sysdate between effective_start_date and nvl(effective_end_date,sysdate));
2123:
2124: cursor person_party_data_changed_csr(l_attribute_party_id number) is

Line 2146: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'

2142: loop
2143: fetch get_attri_party_id_csr into l_attribute_party_id;
2144: exit when get_attri_party_id_csr%NOTFOUND;
2145:
2146: if p_entity_name = 'HZ_ORGANIZATION_PROFILES'
2147: then
2148: open org_party_data_changed_csr(l_attribute_party_id);
2149: fetch org_party_data_changed_csr into l_tmp;
2150: if org_party_data_changed_csr%FOUND