The following lines contain the word 'select', 'insert', 'update' or 'delete':
Pl_Bill_To_Address_Id Number := X_Bill_To_Address_Id; --Bug 3911782 changed from null to value being passed from pa_project_pub.update_project
Pl_Ship_To_Address_Id Number := X_Ship_To_Address_Id; --Bug 3911782 changed from null to value being passed from pa_project_pub.update_project
Pl_Bill_To_Contact_Id Number := X_Bill_To_Contact_Id; --for tracking bug by aditi changed from null to value being passed from pa_project_pub.update_project
Pl_Ship_To_Contact_Id Number := X_Ship_To_Contact_Id; --for tracking bug by aditi changed from null to value being passed from pa_project_pub.update_project
SELECT a.Address_id, su.Contact_id, su.site_use_code
FROM Ra_Addresses a,
Ra_Site_Uses su
WHERE a.Address_Id = su.Address_Id
AND Nvl(a.Status,'A') = 'A'
AND a.Customer_id = X_Customer_Id
AND Nvl(su.Status, 'A') = 'A'
AND su.primary_flag = 'Y' ;
SELECT acct_site.cust_acct_site_id, su.Contact_id, su.site_use_code
FROM hz_cust_acct_sites_all acct_site,
hz_cust_site_uses su
WHERE
acct_site.cust_acct_site_id = su.cust_acct_site_id
AND Nvl(acct_site.Status,'A') = 'A'
AND acct_site.cust_account_id = X_Customer_Id
AND Nvl(su.Status, 'A') = 'A'
AND su.primary_flag = 'Y' ;
SELECT a.Address_id, su.Contact_id, su.site_use_code
FROM Ra_Addresses a,
Ra_Site_Uses su
WHERE a.Address_Id = su.Address_Id
AND Nvl(a.Status,'A') = 'A'
AND a.Customer_id = X_Bill_To_Customer_Id
AND Nvl(su.Status, 'A') = 'A'
AND su.primary_flag = 'Y'
AND su.site_use_code = 'BILL_TO';
SELECT acct_site.cust_acct_site_id, su.Contact_id, su.site_use_code
FROM
hz_cust_acct_sites_all acct_site,
hz_cust_site_uses su
WHERE
acct_site.cust_acct_site_id = su.cust_acct_site_id
AND Nvl(acct_site.Status,'A') = 'A'
AND acct_site.cust_account_id = X_Bill_To_Customer_Id
AND Nvl(su.Status, 'A') = 'A'
AND su.primary_flag = 'Y'
AND su.site_use_code = 'BILL_TO';
SELECT a.Address_id, su.Contact_id, su.site_use_code
FROM Ra_Addresses a,
Ra_Site_Uses su
WHERE a.Address_Id = su.Address_Id
AND Nvl(a.Status,'A') = 'A'
AND a.Customer_id = X_Ship_To_Customer_Id
AND Nvl(su.Status, 'A') = 'A'
AND su.primary_flag = 'Y'
AND su.site_use_code = 'SHIP_TO';
SELECT acct_site.cust_acct_site_id, su.Contact_id, su.site_use_code
FROM
hz_cust_acct_sites_all acct_site,
hz_cust_site_uses su
WHERE
acct_site.cust_acct_site_id = su.cust_acct_site_id
AND Nvl(acct_site.Status,'A') = 'A'
AND acct_site.cust_account_id = X_Ship_To_Customer_Id
AND Nvl(su.Status, 'A') = 'A'
AND su.primary_flag = 'Y'
AND su.site_use_code = 'SHIP_TO';
Select cust_acc_rel_code
From pa_implementations;
SELECT related_cust_account_id
FROM hz_cust_acct_relate
WHERE cust_account_id = X_Customer_Id
AND bill_to_flag = 'Y'
AND status = 'A'
AND related_cust_account_id = X_Bill_To_Customer_Id;
SELECT related_cust_account_id
FROM hz_cust_acct_relate
WHERE cust_account_id = X_Customer_Id
AND ship_to_flag = 'Y'
AND status = 'A'
AND related_cust_account_id = X_Ship_To_Customer_Id; */
SELECT cust_account_id
FROM hz_cust_acct_relate
WHERE related_cust_account_id = X_Customer_Id
AND bill_to_flag = 'Y'
AND status = 'A'
AND cust_account_id = X_Bill_To_Customer_Id; --Bug#5872732
SELECT cust_account_id
FROM hz_cust_acct_relate
WHERE related_cust_account_id = X_Customer_Id
AND ship_to_flag = 'Y'
AND status = 'A'
AND cust_account_id = X_Ship_To_Customer_Id; --Bug#5872732
Select pt.CC_PRVDR_FLAG
From pa_project_types pt, pa_projects pa
where pa.project_type=pt.project_type
and pa.project_id=x_project_id;
Select Nvl(status,'A')
into Pl_Status
from Ra_Customers r
Where r.customer_id = X_Customer_Id;
Select Nvl(cust_acct.status,'A')
into Pl_Status
from hz_parties party,
hz_cust_accounts cust_acct
Where
cust_acct.party_id = party.party_id
and cust_acct.cust_account_id = X_Customer_Id;
Select 'Y' FROM pa_project_customers
WHERE project_id = c_project_id
AND customer_id = c_customer_id;
Insert Into Pa_Project_Customers
( Project_Id,
Customer_Id,
Project_Relationship_Code,
Customer_Bill_Split,
bill_to_customer_id, /* For Bug 2731449 */
ship_to_customer_id, /* For Bug 2731449 */
Bill_To_Address_Id,
Ship_To_Address_Id,
Inv_Currency_Code,
Inv_Rate_Type,
Inv_Rate_Date,
Inv_Exchange_Rate,
Allow_Inv_User_Rate_Type_Flag,
Bill_Another_Project_Flag,
Receiver_Task_Id,
Creation_Date,
Created_By,
Last_Update_Date,
Last_Update_Login,
Last_Updated_By,
RECORD_VERSION_NUMBER,
DEFAULT_TOP_TASK_CUST_FLAG ) /*The top tak cust added for FPM Development */
Values (
X_Project_Id,
X_Customer_Id,
X_Project_Relation_Code,
X_Customer_Bill_Split,
X_Bill_To_Customer_Id, /* For Bug 2731449 */
X_Ship_To_Customer_Id, /* For Bug 2731449 */
X_Bill_To_Address_Id,
X_Ship_To_Address_Id,
X_Inv_Currency_Code,
X_Inv_Rate_Type,
X_Inv_Rate_Date,
X_Inv_Exchange_Rate,
X_Allow_Inv_Rate_Type_Fg,
X_Bill_Another_Project_Fg,
X_Receiver_Task_Id,
Sysdate,
X_User,
Sysdate,
X_Login,
X_User,
1,
P_default_top_task_customer) ;
SELECT 'Y'
INTO l_bill_to_contact_exists
FROM dual
WHERE EXISTS (SELECT 'Y'
FROM Pa_Project_Contacts
WHERE Project_Id = X_Project_Id
AND Customer_Id = X_Customer_Id
AND Contact_Id = X_Bill_To_Contact_Id
AND PROJECT_CONTACT_TYPE_CODE = l_billing
);
SELECT 'Y'
INTO l_ship_to_contact_exists
FROM dual
WHERE EXISTS (SELECT 'Y'
FROM Pa_Project_Contacts
WHERE Project_Id = X_Project_Id
AND Customer_Id = X_Customer_Id
AND Contact_Id = X_Ship_To_Contact_Id
AND PROJECT_CONTACT_TYPE_CODE = l_shipping
);
Insert Into Pa_Project_Contacts
( Project_Id,
Customer_Id,
bill_ship_customer_id, /* For Bug 2731449 */
Contact_Id,
Project_Contact_Type_Code,
Creation_Date,
Created_By,
Last_Update_Date,
Last_Update_Login,
Last_Updated_By,
RECORD_VERSION_NUMBER )
Values (
X_Project_Id,
X_Customer_Id,
X_Bill_To_Customer_Id, /* For Bug 2731449 */
X_Bill_To_Contact_Id,
--'BILLING', --bug 4054587
l_billing,
Sysdate,
X_User,
Sysdate,
X_Login,
X_User,
1 );
Insert Into Pa_Project_Contacts
( Project_Id,
Customer_Id,
bill_ship_customer_id, /* For Bug 2731449 */
Contact_Id,
Project_Contact_Type_Code,
Creation_Date,
Created_By,
Last_Update_Date,
Last_Update_Login,
Last_Updated_By,
RECORD_VERSION_NUMBER )
Values (
X_Project_Id,
X_Customer_Id,
X_Ship_To_Customer_Id, /* For Bug 2731449 */
X_Ship_To_Contact_Id,
--'SHIPPING', --bug 4054587
l_shipping,
Sysdate,
X_User,
Sysdate,
X_Login,
X_User,
1 );
SELECT 'Y'
INTO l_return_value
FROM Ra_Addresses a,
Ra_Site_Uses su
WHERE a.Address_Id = su.Address_Id
AND Nvl(a.Status,'A') = 'A'
AND a.Customer_id = l_Customer_Id
AND a.Address_Id = l_Address_Id
AND Nvl(su.Status, 'A') = 'A'
AND su.site_use_code = l_site_use_code;
SELECT 'Y'
INTO l_return_value
FROM
hz_cust_acct_sites_all acct_site,
hz_cust_site_uses su
WHERE
acct_site.cust_acct_site_id = su.cust_acct_site_id
AND Nvl(acct_site.Status,'A') = 'A'
AND acct_site.cust_account_id = l_Customer_Id
AND acct_site.cust_acct_site_id = l_Address_Id
AND Nvl(su.Status, 'A') = 'A'
AND su.site_use_code = l_site_use_code;
/* SELECT 'Y'
INTO l_return_value
FROM Ra_Addresses a,
Ra_Site_Uses su
WHERE a.Address_Id = su.Address_Id
AND Nvl(a.Status,'A') = 'A'
AND a.Customer_id = l_Customer_Id
AND a.Address_Id = l_Address_Id
AND su.Contact_Id = l_Contact_Id
AND Nvl(su.Status, 'A') = 'A'
AND su.site_use_code = l_site_use_code; */
SELECT 'Y'
INTO l_return_value
FROM
ra_contacts c,
ra_contact_roles cr
WHERE c.customer_id = l_Customer_Id
and c.contact_id = l_Contact_Id
and c.contact_id = cr.contact_id
and cr.usage_code = l_site_use_code
and nvl(c.status,'A') = 'A'
and c.address_id is null;
SELECT 'Y'
INTO l_return_value
FROM
hz_cust_account_roles acct_role,
hz_role_responsibility hrrep
WHERE acct_role.cust_account_id = l_Customer_Id
and acct_role.cust_account_role_id = l_Contact_Id
and acct_role.cust_account_role_id = hrrep.cust_account_role_id
and hrrep.responsibility_type = l_site_use_code
and nvl(acct_role.current_role_state,'A') = 'A'
and acct_role.cust_acct_site_id is null
and acct_role.role_type = 'CONTACT';
SELECT 'Y'
INTO l_return_value
FROM
ra_contacts c ,
ra_contact_roles cr ,
ra_addresses a
WHERE c.customer_id = l_Customer_Id
and c.contact_id = cr.contact_id
and c.contact_id = l_Contact_Id
and cr.usage_code = l_site_use_code
and nvl(c.status,'A') = 'A'
and c.address_id = a.address_id
and c.address_id = l_Address_Id;
SELECT 'Y'
INTO l_return_value
FROM
hz_cust_account_roles acct_role ,
hz_role_responsibility hrrep ,
hz_cust_acct_sites_all acct_site
WHERE acct_role.cust_account_id = l_Customer_Id
and acct_role.cust_account_role_id = hrrep.cust_account_role_id
and acct_role.cust_account_role_id = l_Contact_Id
and hrrep.responsibility_type = l_site_use_code
and nvl(acct_role.current_role_state,'A') = 'A'
and acct_role.cust_acct_site_id = acct_site.cust_acct_site_id
and acct_role.cust_acct_site_id = l_Address_Id
and acct_role.role_type = 'CONTACT';
SELECT 'x'
FROM dual
WHERE exists
(select null
from pa_draft_revenues r
where r.project_id = p_project_Id
)
or exists
(select null
from pa_draft_invoices i
where i.project_id = p_project_Id
);
select project_type_class_code,project_status_code
from pa_projects_v
where project_id = p_project_Id;
SELECT sum(pc.customer_bill_split)
FROM pa_project_customers pc
WHERE pc.project_id = p_project_Id
GROUP by pc.project_id;
SELECT '1'
FROM
pa_project_types b
WHERE b.project_type_class_code = 'CONTRACT' AND
b.project_type =
(SELECT project_type
FROM pa_projects_all
WHERE project_id = c_project_id) AND
(b.cc_prvdr_flag = 'N' OR b.cc_prvdr_flag is NULL);
SELECT '1'
FROM pa_implementations_all
WHERE customer_id = c_customer_id;
SELECT '1'
FROM pa_implementations
WHERE cc_ic_billing_prvdr_flag = 'Y';