DBA Data[Home] [Help]

APPS.FV_CCR_UTIL_PVT SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 16

    SELECT DECODE(
                  SUBSTRB(USERENV('CLIENT_INFO'),1,1),' ',
                  NULL,SUBSTRB(USERENV('CLIENT_INFO'),1,10)
                 )
    INTO l_ret_value
    FROM dual;
Line: 30

PROCEDURE insert_for_report
(
p_duns 		IN VARCHAR2,
p_record_type	IN NUMBER,
p_reference1	IN VARCHAR2,
p_reference2	IN VARCHAR2,
p_reference3	IN VARCHAR2,
p_reference4	IN VARCHAR2,
p_reference5	IN VARCHAR2
)
IS
	l_module_name VARCHAR2(60);
Line: 43

  l_module_name := 'fv.plsql.FV_CCR_UTIL_PVT.insert_for_report';
Line: 46

  INSERT INTO fv_ccr_process_report
  (duns_info,record_type,reference1,reference2,reference3,reference4,reference5)
  VALUES
  (p_duns,p_record_type,p_reference1,p_reference2,p_reference3,p_reference4,
   p_reference5);
Line: 110

    SELECT ext_payee_id
      FROM iby_external_payees_all payee
     WHERE payee.PAYEE_PARTY_ID = ci_party_id
       AND payee.PAYMENT_FUNCTION = ci_pmt_function
       AND ((ci_party_site_id is NULL and payee.PARTY_SITE_ID is NULL) OR
            (payee.PARTY_SITE_ID = ci_party_site_id))
       AND ((ci_supplier_site_id is NULL and payee.SUPPLIER_SITE_ID is NULL) OR
            (payee.SUPPLIER_SITE_ID = ci_supplier_site_id))
       AND ((ci_org_id is NULL and payee.ORG_ID is NULL) OR
            (payee.ORG_ID = ci_org_id AND payee.ORG_TYPE = ci_org_type));
Line: 155

SELECT hzp.party_name, NVL(pav.num_1099, pav.individual_1099),
       pav.organization_type_lookup_code
INTO x_vendor_name,x_num_1099, x_org_type_lkup
FROM hz_parties hzp, ap_suppliers pav
WHERE hzp.party_id = pav.party_id
AND pav.vendor_id = p_vendor_id;
Line: 170

PROCEDURE update_vendor_org_type
(
p_vendor_id IN NUMBER,
p_vend_org_type IN VARCHAR2,
x_status        OUT NOCOPY VARCHAR2,
x_exception_msg OUT NOCOPY VARCHAR2
)
IS

BEGIN
fnd_file.put_line(fnd_file.log, 'p_vendor_id: '||p_vendor_id);
Line: 185

	UPDATE ap_suppliers
	SET organization_type_lookup_code = p_vend_org_type
	WHERE vendor_id = p_vendor_id;
Line: 201

END update_vendor_org_type;
Line: 222

SELECT pavs.vendor_site_id, hps.duns_number_c
FROM ap_supplier_sites_all pavs, hz_party_sites hps
WHERE pavs.vendor_id = p_supp_id
AND pavs.vendor_site_code = p_site_name
AND pavs.org_id = p_org
AND pavs.party_site_id = hps.party_site_id;
Line: 255

SELECT vendor_site_code INTO x_site_code
--FROM po_vendor_sites_all
FROM ap_supplier_sites_all
WHERE vendor_site_id = p_vendor_site_id;
Line: 280

SELECT pav.vendor_id, hzp.party_name
FROM hz_parties hzp, ap_suppliers pav
WHERE (pav.num_1099 = p_taxpayer OR
       pav.individual_1099 = p_taxpayer)
AND hzp.party_id = pav.party_id;
Line: 289

SELECT pav.vendor_id, hzp.party_name
FROM hz_parties hzp, ap_suppliers pav
WHERE hzp.party_name = p_legal_bus
AND hzp.party_id = pav.party_id;
Line: 295

SELECT segment1
--FROM po_vendors
FROM ap_suppliers
where segment1 = p_supp_num;
Line: 386

SELECT bank_account_id,aba.bank_branch_id
INTO x_bank_account_id,l_bank_branch_id
FROM ap_bank_branches abb,ap_bank_accounts_all aba
		WHERE abb.bank_name = p_bank_name
		AND abb.bank_branch_name =p_bank_branch_name
		AND abb.bank_num = p_routing_num
		AND aba.bank_account_num = p_bank_account_number
		AND aba.org_id = p_org_id
		AND aba.account_type = 'SUPPLIER'
		AND nvl(aba.currency_code,'~^')  = nvl(p_base_currency,'~^')
		AND aba.bank_branch_id = abb.bank_branch_id;
Line: 428

SELECT branch_party_id, bank_name, bank_branch_name
FROM ce_bank_branches_v
WHERE branch_number = p_routing
AND branch_number IS NOT NULL;
Line: 439

	SELECT bank_name,bank_branch_name,branch_number
	INTO l_bank_name,l_bank_branch_name,
	l_routing_num FROM ce_bank_branches_v
	WHERE branch_party_id = p_bank_branch_id;
Line: 493

x_update_account		OUT NOCOPY VARCHAR2
)
IS
CURSOR bank_acct_csr(p_branch_id NUMBER,p_acct_number VARCHAR2,
p_currency VARCHAR2) IS
SELECT ext_bank_account_id,bank_account_type
FROM iby_ext_bank_accounts
WHERE branch_id = p_branch_id
AND bank_account_num = p_acct_number
AND currency_code  = p_currency
AND country_code = p_country_code;
Line: 510

x_update_account:='N';
Line: 517

	SELECT bank_account_num,branch_id,bank_account_type
	INTO l_bank_acct_num,l_bank_branch_id,l_bank_account_type
	FROM iby_ext_bank_accounts
	WHERE ext_bank_account_id=p_bank_account_id;
Line: 535

		x_update_account:='Y';
Line: 543

		x_update_account:='Y';
Line: 633

/* Procedure used to create or update vendor
create or update vendor site and update bank_acct_uses table*/

PROCEDURE fv_process_vendor
(
p_ccr_id	   	IN	NUMBER				,
p_prev_ccr_id		IN	VARCHAR2 	,
p_update_type	    IN 	VARCHAR2 ,
x_return_status		OUT	NOCOPY VARCHAR2		  	,
x_msg_count		OUT	NOCOPY NUMBER				,
x_msg_data		OUT	NOCOPY VARCHAR2			,
p_bank_branch_id	IN 	NUMBER		,
p_vendor_id		IN NUMBER,
p_pay_site_id		IN NUMBER,
p_main_add_site_id	IN NUMBER,
p_enabled_flag		IN VARCHAR2,
p_main_address_flag	IN VARCHAR2,
p_taxpayer_number	IN VARCHAR2,
p_legal_bus_name	IN VARCHAR2,
p_duns			IN VARCHAR2,
p_plus4			IN VARCHAR2,
p_main_address_line1	IN VARCHAR2,
p_main_address_line2	IN VARCHAR2,
p_main_address_city		IN VARCHAR2,
p_main_address_state	IN VARCHAR2,
p_main_address_zip		IN VARCHAR2,
p_main_address_country	IN VARCHAR2,
p_pay_address_line1		IN VARCHAR2,
p_pay_address_line2		IN VARCHAR2,
p_pay_address_line3		IN VARCHAR2,
p_pay_address_city		IN VARCHAR2,
p_pay_address_state		IN VARCHAR2,
p_pay_address_zip		IN VARCHAR2,
p_pay_address_country	IN VARCHAR2,
p_old_bank_account_id	IN NUMBER,
p_new_bank_account_id	IN NUMBER,
p_bank_name			IN VARCHAR2,
p_bank_branch_name		IN VARCHAR2,
p_bank_num			IN VARCHAR2,
p_bank_account_num		IN VARCHAR2,
p_org_id			IN NUMBER,
p_update_vendor_flag	IN VARCHAR2,
p_org_name 			IN varchar2,
p_ccr_status			IN varchar2,
p_insert_vendor_flag	IN VARCHAR2,
p_prev_vendor_id		IN NUMBER,
p_file_date			IN DATE,
p_bank_conc_req_status	IN VARCHAR2,
p_header_conc_req_status IN VARCHAR2,
p_assgn_conc_req_status	IN VARCHAR2,
p_base_currency			IN VARCHAR2,
p_valid_bank_info		IN VARCHAR2,
p_federal_vendor		IN VARCHAR2,
p_created_bank_branch_id IN NUMBER,
p_created_bank_account_id IN NUMBER,
x_vendor_id			OUT NOCOPY NUMBER,
x_output			OUT NOCOPY VARCHAR2,
x_react_pay_site_code	OUT NOCOPY VARCHAR2,
x_react_main_site_code	OUT NOCOPY VARCHAR2,
x_tp_changed			OUT NOCOPY VARCHAR2,
x_vendor_name			OUT NOCOPY VARCHAR2,
p_org_type_lookup 	IN VARCHAR2,
p_remit_poc        IN VARCHAR2,
p_mail_poc IN VARCHAR2,
p_ar_us_phone IN VARCHAR2,
p_ar_fax IN VARCHAR2,
p_ar_email IN VARCHAR2,
p_ar_non_us_phone IN VARCHAR2
)
IS


l_api_name			CONSTANT VARCHAR2(30)	:= 'FV_PROCESS_VENDORS';
Line: 713

l_update_bank_flag varchar2(1);
Line: 714

l_account_uses_insert_flag varchar2(1);
Line: 761

        SELECT 1
        INTO   l_count
        FROM   ap_suppliers
        WHERE  vendor_name = l_legal_bus_name
        AND    num_1099 <> p_taxpayer_number;
Line: 781

           insert_for_report(l_duns_for_report,19,l_msg_text||nvl(l_excp_msg,''),null,null,null,null);
Line: 792

l_account_uses_insert_flag := 'N'; --  Do not insert bank acct uses
Line: 793

l_account_uses_upd_flag := 'N';    -- Do not update bank acct uses
Line: 846

	    l_account_uses_insert_flag := 'I';
Line: 847

	    insert_for_report(l_duns_for_report,15,null,'CCR SUPPLIER BANK '
		|| l_duns_for_report,p_bank_branch_name,null,null);
Line: 852

  	  l_account_uses_insert_flag := 'U'; -- Update bank acct uses if relation already exist
Line: 868

		insert_for_report(l_duns_for_report,14,null,p_bank_branch_name,
		p_bank_num,null,null);
Line: 871

	UPDATE fv_ccr_vendors
	SET bank_branch_id = l_bank_branch_id
	,enabled ='Y',last_update_date=sysdate,
	last_updated_by=l_user_id,last_update_login=l_login_id
	WHERE ccr_id = p_ccr_id;
Line: 889

  IF (p_update_vendor_flag = 'Y') THEN

-- Get the vendor id if it already exists

	IF(p_vendor_id <> 0) THEN

		/* Changed the reference to US from USA */
		IF(p_main_address_country = 'US' AND
		(p_taxpayer_number IS NULL or length(p_taxpayer_number)<>9)) THEN
			get_vendor_name(p_vendor_id,l_vendor_name,l_num_1099,l_org_type_lookup);
Line: 902

		    	insert_for_report(p_duns,18,l_msg_text,null,null,null,null);
Line: 914

			  insert_for_report(p_duns,16,l_msg_text,null,
				null,null,null);
Line: 922

			    insert_for_report(p_duns,16,l_msg_text,null,
				null,null,null);
Line: 942

			    insert_for_report(p_duns,16,l_msg_text,null,
				null,null,null);
Line: 946

        update_vendor_org_type(
                               p_vendor_id => l_vendor_id,
                               p_vend_org_type => p_org_type_lookup,
                               x_status => l_status,
                               x_exception_msg => l_msg);
Line: 962

                            FV_CCR_UTIL_PVT.update_vendor(
                                p_vendor_id=>l_vendor_id,
                                p_taxpayer_id=>p_taxpayer_number,
                                x_status =>l_status,
                                x_exception_msg=>l_msg);
Line: 980

				FND_MESSAGE.SET_NAME('FV','FV_CCR_VENDOR_UPDATE');
Line: 986

			        insert_for_report(p_duns,19,l_msg_text||nvl(l_excp_msg,''),null,null
				,null,null);
Line: 1000

			UPDATE fv_ccr_vendors
			SET vendor_id = p_vendor_id,
			last_update_date=sysdate,
			last_updated_by =l_user_id,
                    last_update_login=l_login_id
			WHERE DUNS=p_duns;
Line: 1020

		IF(p_insert_vendor_flag = 'N' AND p_prev_vendor_id <> 0) THEN
		 	l_vendor_id := p_prev_vendor_id;
Line: 1028

			insert_for_report(p_duns,16,l_msg_text,null,null,null,null);
Line: 1047

				insert_for_report(p_duns,18,l_msg_text,null,
				null,null,null);
Line: 1059

				insert_for_report(p_duns,16,l_msg_text,null,null
				,null,null);
Line: 1066

		/*** If vendor id does not exist create the vendor else update the vendor ***/
		if(l_vendor_id IS NULL OR l_vendor_id = 0 ) THEN

		  BEGIN
			l_msg := null;
Line: 1071

fv_utility.log_mesg('before calling insert_vendor');
Line: 1072

                    FV_CCR_UTIL_PVT.insert_vendor
                   (
                        --p_vendor_name => p_legal_bus_name,
                        p_vendor_name => l_legal_bus_name,
                        p_taxpayer_id => p_taxpayer_number,
                        p_supplier_number=>l_supplier_number,
		                    p_org_type_lookup_code => p_org_type_lookup,
                        x_vendor_id =>l_vendor_id,
                        x_status=>l_status,
                        x_exception_msg=>l_msg);
Line: 1083

fv_utility.log_mesg('after calling insert_vendor');
Line: 1093

			--insert_for_report(p_duns,12,null,p_legal_bus_name,
      insert_for_report(p_duns,12,null,l_legal_bus_name,
			p_taxpayer_number,null,null);
Line: 1097

				UPDATE fv_ccr_vendors
				SET vendor_id =l_vendor_id,
				last_update_date=sysdate,
				last_updated_by=l_user_id,
				last_update_login=l_login_id
				WHERE DUNS = p_duns;
Line: 1112

			FND_MESSAGE.SET_NAME('FV','FV_CCR_VENDOR_INSERT');
Line: 1119

			insert_for_report(p_duns,19,l_msg_text||nvl(l_excp_msg,''),null,null,null,null);
Line: 1122

				UPDATE fv_ccr_orgs
				SET bank_account_id = l_new_bank_account_id,
				last_update_date=sysdate,
				last_updated_by=l_user_id,
				last_update_login=l_login_id
				WHERE ccr_id = p_ccr_id
				AND org_id=p_org_id;
Line: 1131

					UPDATE fv_ccr_vendors
					SET conc_request_status=l_header_conc_req_status,
					last_update_date=sysdate,
					last_updated_by=l_user_id,
  					last_update_login=l_login_id
					WHERE ccr_id=p_ccr_id;
Line: 1142

			UPDATE fv_ccr_vendors
			SET vendor_id =l_vendor_id,
			last_update_date=sysdate,
			last_updated_by=l_user_id,
			last_update_login=l_login_id
			WHERE DUNS = p_duns;
Line: 1161

	--This is the case where DUNS4 is newly inserted and
	--does not have vendor_id update it with DUNS/DUNS4
	--vendor id
	IF(nvl(p_vendor_id,0)<>0) THEN
		l_vendor_id:=p_vendor_id;
Line: 1213

	insert_for_report(p_duns,16,l_msg_text,null,null
				,null,null);
Line: 1218

     FV_CCR_UTIL_PVT.insert_vendor_site(
      p_vendor_site_code=>l_plus4,
      p_vendor_id=>l_vendor_id ,
      p_org_id =>p_org_id,
      p_address_line1=>p_main_address_line1,
      p_address_line2=>p_main_address_line2,
      p_address_line3=>null,
      p_address_line4=>null,
      p_city=>p_main_address_city,
      p_state=>l_state,
      p_zip=>p_main_address_zip,
      p_province=>l_province,
      p_country=>p_main_address_country,
      p_duns_number=>p_duns,
      p_pay_site_flag=> NULL,
      p_hold_unvalidated_inv_flag=>'N',
      p_hold_all_payments_flag=>'N',
      p_us_phone => NULL,
      p_fax => NULL,
      p_email => NULL,
      p_non_us_phone => NULL,
      p_purchasing_site_flag => 'Y',
      x_vendor_site_id=>l_main_add_site_id,
      x_party_site_id => l_party_site_id,
      x_status=>l_status,
      x_exception_msg=>l_msg);
Line: 1253

            UPDATE hz_party_sites
            SET    addressee = p_mail_poc
            WHERE  party_site_id = l_party_site_id;
Line: 1262

       insert_for_report(l_duns_for_report,13,null,l_plus4,l_vendor_name,'M',null);
Line: 1268

    FV_CCR_UTIL_PVT.update_vendor_site(
    p_vendor_site_code =>null,
    p_vendor_site_id=>l_main_add_site_id,
    p_org_id => p_org_id,
    p_address_line1=>p_main_address_line1,
    p_address_line2=>p_main_address_line2,
    p_address_line3=>null,
    p_address_line4=>null,
    p_city=>p_main_address_city,
    p_state=>l_state,
    p_zip=>p_main_address_zip,
    p_province=>l_province, --To be populated for canadian vendors.
    p_country=>p_main_address_country,
    p_duns_number=>p_duns,
    p_pay_site_flag => NULL,
    p_hold_unvalidated_inv_flag=>l_hold_unmatched_invoices_flag,
    p_hold_all_payments_flag=>l_hold_all_payments_flag,
    p_us_phone => NULL,
    p_fax =>  NULL,
    p_email => NULL,
    p_non_us_phone => NULL,
    p_purchasing_site_flag => 'Y',
    x_party_site_id => l_party_site_id,
    x_status=>l_status,
    x_exception_msg=>l_msg);
Line: 1303

          UPDATE hz_party_sites
          SET    addressee = p_mail_poc
          WHERE  party_site_id = l_party_site_id;
Line: 1324

      FND_MESSAGE.SET_NAME('FV','FV_CCR_MAIN_SITE_INSERT');
Line: 1329

      insert_for_report(l_duns_for_report,19,l_msg_text||nvl(l_excp_msg,''),null,null,null,null);
Line: 1331

      FND_MESSAGE.SET_NAME('FV','FV_CCR_MAIN_SITE_UPDATE');
Line: 1337

      insert_for_report(l_duns_for_report,19,l_msg_text||nvl(l_excp_msg,''),null,null,null,null);
Line: 1373

	insert_for_report(p_duns,16,l_msg_text,null,null
				,null,null);
Line: 1375

	l_account_uses_insert_flag := 'N';
Line: 1381

    FV_CCR_UTIL_PVT.insert_vendor_site(
     p_vendor_site_code=>l_plus4,
     p_vendor_id=>l_vendor_id ,
     p_org_id =>p_org_id,
     p_address_line1=>p_pay_address_line1,
     p_address_line2=>p_pay_address_line2,
     p_address_line3=>p_pay_address_line3,
     p_address_line4=>null,
     p_city=>p_pay_address_city,
     p_state=>l_state,
     p_zip=>p_pay_address_zip,
     p_province=>l_province,
     p_country=>p_pay_address_country,
     p_duns_number=>p_duns,
     p_pay_site_flag=>l_pay_site_flag,
     p_hold_unvalidated_inv_flag=>'N',
     p_hold_all_payments_flag=>'N',
     p_us_phone => p_ar_us_phone,
     p_fax =>  p_ar_fax,
     p_email => p_ar_email,
     p_non_us_phone => p_ar_non_us_phone,
     --p_purchasing_site_flag => NULL,
     p_purchasing_site_flag => 'Y',
     x_vendor_site_id=>l_pay_site_id,
     x_party_site_id => l_party_site_id,
     x_status=>l_status,
     x_exception_msg=>l_msg);
Line: 1417

            UPDATE hz_party_sites
            SET    addressee = p_remit_poc
            WHERE  party_site_id = l_party_site_id;
Line: 1423

     l_account_uses_insert_flag := 'I';
Line: 1427

       insert_for_report(l_duns_for_report,13,null,l_plus4,l_vendor_name,'P',null);
Line: 1437

    FND_MESSAGE.SET_NAME('FV','FV_CCR_PAY_SITE_INSERT');
Line: 1442

    insert_for_report(l_duns_for_report,19,l_msg_text||nvl(l_excp_msg,''),null,null,null,null);
Line: 1443

    l_account_uses_insert_flag := 'N';
Line: 1459

   IF(l_account_uses_insert_flag <> 'I' AND l_account_uses_insert_flag<>'N') THEN
	l_account_uses_insert_flag := 'U';
Line: 1464

  FV_CCR_UTIL_PVT.update_vendor_site(
    p_vendor_site_code =>null,
    p_vendor_site_id=>p_pay_site_id,
    p_org_id => p_org_id,
    p_address_line1=>p_pay_address_line1,
    p_address_line2=>p_pay_address_line2,
    p_address_line3=>p_pay_address_line3,
    p_address_line4=>null,
    p_city=>p_pay_address_city,
    p_state=>l_state,
    p_zip=>p_pay_address_zip,
    p_province=>l_province,
    p_country=>p_pay_address_country,
    p_duns_number=>p_duns,
    --p_pay_site_flag => NULL, mod for bug 6348043
    p_pay_site_flag => 'Y',
    p_hold_unvalidated_inv_flag=>l_hold_unmatched_invoices_flag,
    p_hold_all_payments_flag=>l_hold_all_payments_flag,
    p_us_phone => p_ar_us_phone,
    p_fax =>  p_ar_fax,
    p_email => p_ar_email,
    p_non_us_phone => p_ar_non_us_phone,
    --p_purchasing_site_flag => NULL,
    p_purchasing_site_flag => 'Y',
    x_party_site_id => l_party_site_id,
    x_status=>l_status,
    x_exception_msg=>l_msg);
Line: 1501

         UPDATE hz_party_sites
         SET    addressee = p_remit_poc
         WHERE  party_site_id = l_party_site_id;
Line: 1516

     FND_MESSAGE.SET_NAME('FV','FV_CCR_PAY_SITE_UPDATE');
Line: 1521

     insert_for_report(l_duns_for_report,19,l_msg_text||nvl(l_excp_msg,''),null,null,null,null);
Line: 1544

    l_account_uses_insert_flag,
    p_org_id );
Line: 1562

	UPDATE fv_ccr_vendors
	SET conc_request_status=l_header_conc_req_status,
	last_update_date=sysdate,
	last_updated_by=l_user_id,
  	last_update_login=l_login_id
	WHERE ccr_id=p_ccr_id;
Line: 1574

  UPDATE FV_CCR_ORGS
  SET pay_site_id = l_pay_site_id,
  main_address_site_id = l_main_add_site_id,
  bank_account_id = l_new_bank_account_id,
  conc_request_status=l_assgn_conc_req_status,
  last_update_date=sysdate,
  last_updated_by=l_user_id,
  last_update_login=l_login_id
  WHERE ccr_id = p_ccr_id
  AND org_id = p_org_id;
Line: 1599

        FV_CCR_UTIL_PVT.update_vendor_site(
        p_vendor_site_code =>null,
        p_vendor_site_id=>p_pay_site_id,
        p_org_id => p_org_id,
        p_address_line1=>p_pay_address_line1,
        p_address_line2=>p_pay_address_line2,
        p_address_line3=>p_pay_address_line3,
        p_address_line4=>null,
        p_city=>p_pay_address_city,
        p_state=>l_state,
        p_zip=>p_pay_address_zip,
        p_province=>l_province,
        p_country=>p_pay_address_country,
        p_duns_number=>p_duns,
        --p_pay_site_flag => NULL, mod for bug 6348043
        p_pay_site_flag => NULL,
        p_hold_unvalidated_inv_flag=>'Y',
        p_hold_all_payments_flag=>'Y',
        p_us_phone => p_ar_us_phone,
        p_fax =>  p_ar_fax,
        p_email => p_ar_email,
        p_non_us_phone => p_ar_non_us_phone,
        p_purchasing_site_flag => NULL,
        x_party_site_id => l_party_site_id,
        x_status=>l_status,
        x_exception_msg=>l_msg);
Line: 1640

     FND_MESSAGE.SET_NAME('FV','FV_CCR_PAY_SITE_UPDATE');
Line: 1645

     insert_for_report(l_duns_for_report,19,l_msg_text||nvl(l_excp_msg,''),null,null,null,null);
Line: 1659

        FV_CCR_UTIL_PVT.update_vendor_site(
        p_vendor_site_code =>null,
        p_vendor_site_id=>p_main_add_site_id,
        p_org_id => p_org_id,
        p_address_line1=>p_main_address_line1,
        p_address_line2=>p_main_address_line2,
        p_address_line3=>null,
        p_address_line4=>null,
        p_city=>p_main_address_city,
        p_state=>l_state,
        p_zip=>p_main_address_zip,
        p_province=>l_province,
        p_country=>p_main_address_country,
        p_duns_number=>p_duns,
        p_pay_site_flag => NULL,
        p_hold_unvalidated_inv_flag=>'Y',
        p_hold_all_payments_flag=>'Y',
        p_us_phone => NULL,
        p_fax =>  NULL,
        p_email => NULL,
        p_non_us_phone => NULL,
        p_purchasing_site_flag => NULL,
        x_party_site_id => l_party_site_id,
        x_status=>l_status,
        x_exception_msg=>l_msg);
Line: 1698

     FND_MESSAGE.SET_NAME('FV','FV_CCR_MAIN_SITE_UPDATE');
Line: 1703

     insert_for_report(l_duns_for_report,19,l_msg_text||nvl(l_excp_msg,''),null,null,null,null);
Line: 1707

	UPDATE fv_ccr_vendors
	SET conc_request_status=l_header_conc_req_status,
	last_update_date=sysdate,
	last_updated_by=l_user_id,
  	last_update_login=l_login_id
	WHERE ccr_id=p_ccr_id;
Line: 1715

	UPDATE fv_ccr_orgs
	SET conc_request_status=l_assgn_conc_req_status,
	last_update_date=sysdate,
	last_updated_by=l_user_id,
  	last_update_login=l_login_id
	WHERE ccr_id=p_ccr_id
	AND org_id=p_org_id;
Line: 1785

PROCEDURE delete_plusfour_assignments(p_ccrid number)
as
v_plus_four varchar2(100);
Line: 1790

  l_module_name := 'fv.plsql.FV_CCR_UTIL_PVT.delete_plusfour_assignments';
Line: 1793

  update fv_ccr_vendors
  set vendor_id = null
  where duns = (select duns from fv_ccr_vendors where ccr_id = p_ccrid)
  and plus_four is not null;
Line: 1799

  select plus_four into v_plus_four
  from fv_ccr_vendors
  where ccr_id = p_ccrid;
Line: 1804

     delete from fv_ccr_orgs
     where ccr_id in (
        select ccr_id
        from fv_ccr_vendors
        where duns = (select duns from fv_ccr_vendors where ccr_id =
p_ccrid)
        and plus_four is not null);
Line: 1816

END delete_plusfour_assignments;
Line: 1829

  for crec in (select pay_site_id
             from fv_ccr_orgs o, hr_organization_units ou, ap_supplier_sites_all vs
			 where o.pay_site_id is not null
			 and o.pay_site_id = vs.VENDOR_SITE_ID
			 and vs.ORG_ID = ou.organization_id
			 and ou.organization_id = nvl(p_org_id,ou.organization_id)
			 and ccr_id=p_ccrid)
  loop
    v_count := v_count + 1;
Line: 1861

  for crec in (select main_address_site_id
             from fv_ccr_orgs o, hr_organization_units ou, po_vendor_sites_all vs
			 where o.main_address_site_id is not null
			 and o.main_address_site_flag = 'Y'
			 and o.main_address_site_id = vs.VENDOR_SITE_ID
			 and vs.ORG_ID = ou.organization_id
			 and ou.organization_id = nvl(v_org_id,ou.organization_id)
			 and ccr_id=p_ccrid)
  loop
    v_count := v_count + 1;
Line: 1901

       SELECT p_lookup_code||' - '||meaning meaning
       INTO   l_lookup_meaning
       FROM   fnd_lookup_values
       WHERE  lookup_type = p_lookup_type
       AND    lookup_code = p_lookup_code
       AND    language = userenv('LANG');
Line: 1938

   SELECT COUNT(*)
   INTO   l_count
   FROM   fv_ccr_orgs fco
   WHERE  fco.ccr_id = p_ccr_id
   AND    mo_global.check_access(fco.org_id)<>'Y';
Line: 1973

   SELECT COUNT(*)
   INTO   l_count
   FROM   ap_duplicate_vendors_all
   WHERE  duplicate_vendor_id = p_vendor_id
   AND    process_flag <> 'Y';
Line: 1991

PROCEDURE insert_vendor
(
p_vendor_name     IN varchar2,
p_taxpayer_id     IN varchar2,
p_supplier_number IN varchar2,
p_org_type_lookup_code IN VARCHAR2,
x_vendor_id       OUT NOCOPY NUMBER,
x_status          OUT NOCOPY VARCHAR2,
x_exception_msg   OUT NOCOPY VARCHAR2
)
IS
	l_vendor_rec  AP_VENDOR_PUB_PKG.r_vendor_rec_type;
Line: 2055

       fv_utility.log_mesg('Exception in fv_ccr_util_pvt.insert_vendor.');
Line: 2058

END insert_vendor;
Line: 2061

PROCEDURE update_vendor
(
p_vendor_id     IN NUMBER,
p_taxpayer_id   IN VARCHAR2,
x_status        OUT NOCOPY VARCHAR2,
x_exception_msg OUT NOCOPY VARCHAR2
)
IS
	l_party_id number;
Line: 2074

	SELECT party_id INTO l_party_id
	FROM ap_suppliers
	WHERE vendor_id = p_vendor_id;
Line: 2078

	UPDATE hz_parties
	SET JGZZ_FISCAL_CODE = p_taxpayer_id
	where party_id = l_party_id;
Line: 2082

	UPDATE ap_suppliers
	SET num_1099 = p_taxpayer_id
	WHERE vendor_id = p_vendor_id;
Line: 2097

END update_vendor;
Line: 2100

PROCEDURE insert_vendor_site
(
p_vendor_site_code IN VARCHAR2,
p_vendor_id        IN NUMBER,
p_org_id           IN NUMBER,
p_address_line1    IN VARCHAR2,
p_address_line2    IN VARCHAR2,
p_address_line3    IN VARCHAR2,
p_address_line4    IN VARCHAR2,
p_city             IN VARCHAR2,
p_state		 IN VARCHAR2,
p_zip		   IN VARCHAR2,
p_province	   IN VARCHAR2,
p_country	   IN VARCHAR2,
p_duns_number	   IN VARCHAR2,
p_pay_site_flag    IN VARCHAR2,
p_hold_unvalidated_inv_flag IN VARCHAR2,
p_hold_all_payments_flag    IN VARCHAR2,
p_us_phone                  IN VARCHAR2,
p_fax                       IN VARCHAR2,
p_email                     IN VARCHAR2,
p_non_us_phone              IN VARCHAR2,
p_purchasing_site_flag      IN VARCHAR2,
x_vendor_site_id            OUT NOCOPY NUMBER,
x_party_site_id             OUT NOCOPY NUMBER,
x_status                    OUT NOCOPY VARCHAR2,
x_exception_msg             OUT NOCOPY VARCHAR2
)
IS
	l_vendor_site_rec  AP_VENDOR_PUB_PKG.r_vendor_site_rec_type;
Line: 2202

END insert_vendor_site;
Line: 2205

PROCEDURE update_vendor_site
	(
	p_vendor_site_code IN VARCHAR2,
	p_vendor_site_id   IN NUMBER,
	p_org_id           IN NUMBER,
	p_address_line1    IN VARCHAR2,
	p_address_line2    IN VARCHAR2,
	p_address_line3    IN VARCHAR2,
	p_address_line4    IN VARCHAR2,
	p_city             IN VARCHAR2,
	p_state		   IN VARCHAR2,
	p_zip		   IN VARCHAR2,
	p_province	   IN VARCHAR2,
	p_country	   IN VARCHAR2,
	p_duns_number	   IN VARCHAR2,
	p_pay_site_flag    IN VARCHAR2,
	p_hold_unvalidated_inv_flag IN VARCHAR2,
	p_hold_all_payments_flag    IN VARCHAR2,
  p_us_phone                  IN VARCHAR2,
  p_fax                       IN VARCHAR2,
  p_email                     IN VARCHAR2,
  p_non_us_phone              IN VARCHAR2,
  p_purchasing_site_flag      IN VARCHAR2,
  x_party_site_id             OUT NOCOPY NUMBER,
	x_status                    OUT NOCOPY VARCHAR2,
	x_exception_msg             OUT NOCOPY VARCHAR2
	)

	IS
	l_vendor_site_rec  AP_VENDOR_PUB_PKG.r_vendor_site_rec_type;
Line: 2285

	AP_VENDOR_PUB_PKG.update_vendor_site(
	p_api_version => l_version,
	p_init_msg_list => FND_API.G_TRUE,
	p_commit=> FND_API.G_FALSE,
	p_validation_level=> FND_API.G_VALID_LEVEL_FULL,
	x_return_status => l_ret_stat,
	x_msg_count=>l_msg_count,
	x_msg_data=>l_msg_data,
	p_vendor_site_rec=>l_vendor_site_rec,
	p_vendor_site_id=>p_vendor_site_id,
	p_calling_prog=>'CCRImport');            --Bug 6519638
Line: 2312

	SELECT party_site_id,location_id
	INTO  l_party_site_id,l_location_id
	FROM ap_supplier_sites_all
	WHERE vendor_site_id = p_vendor_site_id;
Line: 2326

	-- Update the location information

	BEGIN


	select object_version_number
	into l_object_version_number
	from hz_locations
	where location_id = l_location_id;
Line: 2339

	hz_location_v2pub.update_location(
	FND_API.G_TRUE,
	l_location_rec,
	l_object_version_number,
	l_ret_stat,
	l_msg_count,
	l_msg_data);
Line: 2365

	-- Update party site information

	BEGIN

	l_party_site_rec.party_site_id := l_party_site_id;
Line: 2371

	select object_version_number
	into l_object_version_number
	from hz_party_sites
	where party_site_id = l_party_site_id;
Line: 2377

	hz_party_site_v2pub.update_party_site(
	FND_API.G_TRUE,
	l_party_site_rec,
	l_object_version_number,
	l_ret_stat,
	l_msg_count,
	l_msg_data);
Line: 2402

END update_vendor_site;
Line: 2672

PROCEDURE update_bank_account
(
 p_bank_account_id NUMBER,
 p_bank_account_type VARCHAR2,
 x_return_status OUT NOCOPY VARCHAR2
)
IS
l_bank_account_type iby_ext_bank_accounts.bank_account_type%TYPE;
Line: 2689

  UPDATE iby_ext_bank_accounts
  set BANK_ACCOUNT_TYPE = l_bank_account_type
  where EXT_BANK_ACCOUNT_ID = p_bank_account_id;
Line: 2698

  fv_utility.log_mesg('When others error in update_bank_account.');
Line: 2699

END update_bank_account;
Line: 2712

	p_account_uses_insert_flag IN VARCHAR2,
	p_org_id IN NUMBER
)
IS
	l_api_version CONSTANT NUMBER:= 1.0;
Line: 2742

	SELECT party_id,vendor_type_lookup_code
	INTO l_party_id,l_vendor_type_lookup_code
	FROM ap_suppliers
	WHERE vendor_id=p_vendor_id;
Line: 2747

	SELECT party_site_id INTO l_party_site_id
	FROM ap_supplier_sites_all
	WHERE vendor_site_id = p_pay_site_id;
Line: 2809

		UPDATE iby_pmt_instr_uses_all
		SET END_DATE=nvl(START_DATE,p_file_date-1),
	          last_update_date=sysdate,
	          last_updated_by=l_user_id,
	          last_update_login=l_login_id
	        WHERE instrument_id <> p_new_bank_account_id
	        AND EXT_PMT_PARTY_ID = l_payee_id
	        AND (END_DATE IS NULL OR END_DATE>(p_file_date-1));
Line: 2820

		(p_account_uses_insert_flag = 'I' OR p_account_uses_insert_flag = 'U') AND
		 (p_valid_bank_info='Y' OR p_federal_vendor='N')) THEN

	        l_uses_reln_exists := 'N';
Line: 2824

	        IF(p_account_uses_insert_flag = 'U') THEN

			IBY_DISBURSEMENT_SETUP_PUB.Get_Payee_Instr_Assignments(
			p_api_version => l_api_version,
			p_init_msg_list => FND_API.G_FALSE,
			x_return_status => l_return_status,
			x_msg_count => l_msg_count,
			x_msg_data => l_msg_data,
			p_payee => l_payee,
			x_assignments => l_assignment_tab,
			x_response => l_response);
Line: 2861

					UPDATE iby_pmt_instr_uses_all
					SET end_date=null,
					 start_date=p_file_date,
					 last_update_date = sysdate,
					 last_updated_by = l_user_id,
				       last_update_login=l_user_id
				WHERE (l_assign_id IS NOT NULL AND INSTRUMENT_PAYMENT_USE_ID=l_assign_id);
Line: 2873

		IF (l_uses_reln_exists = 'N' OR p_account_uses_insert_flag = 'I') THEN

			l_assignment.Instrument.instrument_Type := 'BANKACCOUNT';