DBA Data[Home] [Help]

APPS.PO_AUTOCREATE_DOC dependencies on PO_HEADERS

Line 383: l_consume_req_demand_doc_id po_headers.po_header_id%type;

379: authorization_status = 'APPROVED' AND
380: poh.requisition_header_id = pol.requisition_header_id;
381: --end 10243160
382: --
383: l_consume_req_demand_doc_id po_headers.po_header_id%type;
384: --sql what: get all the req lines which have the same bid/negotiation info as
385: -- those on the lines of the current blanket po approval workflow
386: -- just approved.
387: --sql why : This cursor fetches all these eligible requisition lines and lauches

Line 1042: from po_headers_all

1038:
1039: if x_source_doc_po_header_id is not null then
1040: select global_agreement_flag
1041: into x_ga_flag
1042: from po_headers_all
1043: where po_header_id = x_source_doc_po_header_id;
1044: end if;
1045:
1046: po_wf_util_pkg.SetItemAttrText (itemtype => itemtype,

Line 1637: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;

1633: x_progress varchar2(300) := '000';
1634:
1635: --
1636:
1637: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
1638: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1639: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1640: l_rate PO_HEADERS_ALL.rate%TYPE;
1641: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;

Line 1638: l_currency PO_HEADERS_ALL.currency_code%TYPE;

1634:
1635: --
1636:
1637: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
1638: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1639: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1640: l_rate PO_HEADERS_ALL.rate%TYPE;
1641: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;
1642: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;

Line 1639: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;

1635: --
1636:
1637: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
1638: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1639: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1640: l_rate PO_HEADERS_ALL.rate%TYPE;
1641: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;
1642: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;
1643:

Line 1640: l_rate PO_HEADERS_ALL.rate%TYPE;

1636:
1637: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
1638: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1639: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1640: l_rate PO_HEADERS_ALL.rate%TYPE;
1641: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;
1642: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;
1643:
1644: -- bug4198095

Line 1641: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;

1637: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
1638: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1639: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1640: l_rate PO_HEADERS_ALL.rate%TYPE;
1641: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;
1642: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;
1643:
1644: -- bug4198095
1645: -- No need to match local contract anymore after R12

Line 1642: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;

1638: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1639: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1640: l_rate PO_HEADERS_ALL.rate%TYPE;
1641: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;
1642: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;
1643:
1644: -- bug4198095
1645: -- No need to match local contract anymore after R12
1646: l_current_org_id PO_HEADERS_ALL.org_id%TYPE;

Line 1646: l_current_org_id PO_HEADERS_ALL.org_id%TYPE;

1642: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;
1643:
1644: -- bug4198095
1645: -- No need to match local contract anymore after R12
1646: l_current_org_id PO_HEADERS_ALL.org_id%TYPE;
1647:
1648: -- SQL What: Find available contract that is valid. First it
1649: -- finds local contracts; if none exists then find global contracts.
1650: -- Also, latest contract takes priority

Line 1659: FROM po_headers_all POH

1655: CURSOR c_contract_currency IS
1656: SELECT POH.po_header_id,
1657: POH.global_agreement_flag,
1658: POH.currency_code
1659: FROM po_headers_all POH
1660: WHERE POH.vendor_id = x_supplier_id
1661: AND POH.currency_code = nvl(x_item_currency, l_base_currency)
1662: AND POH.type_lookup_code = 'CONTRACT'
1663: /* R12 GCPA

Line 1691: FROM po_headers_all POH

1687: CURSOR c_contract IS
1688: SELECT POH.po_header_id,
1689: POH.global_agreement_flag,
1690: POH.currency_code
1691: FROM po_headers_all POH
1692: WHERE POH.vendor_id = x_supplier_id
1693: AND POH.type_lookup_code = 'CONTRACT'
1694: /* R12 GCPA
1695: + If Profile ALLOW_REFERENCING_CPA_UNDER_AMENDMENT is Y, then we can refer any Contract Which is approved Once

Line 2026: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE; --

2022: x_progress varchar2(300);
2023:
2024: -- bug2821542
2025: l_validate_result VARCHAR2(1) := FND_API.G_TRUE;
2026: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE; --
2027:
2028: begin
2029:
2030: x_org_id := po_wf_util_pkg.GetItemAttrNumber (itemtype => itemtype,

Line 2300: /* Get the buyer from the PO headers table.

2296: itemkey => itemkey,
2297: aname => 'SOURCE_DOCUMENT_ID');
2298: if( x_source_doc_type_code = 'BLANKET' or
2299: x_source_doc_type_code = 'QUOTATION') then
2300: /* Get the buyer from the PO headers table.
2301: */
2302: begin
2303: /*Bug 928568-removed the _all reference and used the striped table
2304: table instead */

Line 2307: -- Modified the query to select from po_headers_all instead of po_headers.

2303: /*Bug 928568-removed the _all reference and used the striped table
2304: table instead */
2305:
2306: --
2307: -- Modified the query to select from po_headers_all instead of po_headers.
2308: select agent_id
2309: into x_agent_id
2310: from po_headers_all
2311: where po_header_id = x_source_doc_po_header_id;

Line 2310: from po_headers_all

2306: --
2307: -- Modified the query to select from po_headers_all instead of po_headers.
2308: select agent_id
2309: into x_agent_id
2310: from po_headers_all
2311: where po_header_id = x_source_doc_po_header_id;
2312: exception
2313: when NO_DATA_FOUND then
2314: x_agent_id := NULL;

Line 2397: --Modified the query to select from po_headers_all instead of po_headers

2393:
2394: begin
2395:
2396: --
2397: --Modified the query to select from po_headers_all instead of po_headers
2398: select agent_id
2399: into x_agent_id
2400: from po_headers_all
2401: where po_header_id = x_contract_id;

Line 2400: from po_headers_all

2396: --
2397: --Modified the query to select from po_headers_all instead of po_headers
2398: select agent_id
2399: into x_agent_id
2400: from po_headers_all
2401: where po_header_id = x_contract_id;
2402:
2403: exception
2404:

Line 3406: from po_headers_all

3402: /* FPI GA start */
3403: if (c1_source_doc_id is not null) then
3404: select global_agreement_flag
3405: into c1_ga_flag
3406: from po_headers_all
3407: where po_header_id = c1_source_doc_id;
3408: --
3409: -- Reset c1_ga_flag to NULL if there is no sourcing BPA.
3410: else

Line 3597: from po_headers_all

3593: /* FPI GA start */
3594: if (c2_source_doc_id is not null) then
3595: select global_agreement_flag
3596: into c2_ga_flag
3597: from po_headers_all
3598: where po_header_id = c2_source_doc_id;
3599: --
3600: -- Reset c2_ga_flag to NULL if there is no sourcing BPA.
3601: else

Line 3694: if logic and thereby not creating records in the po_headers_interface

3690: When you initiate the create doc workflow from requisition import
3691: for a batch of 5000 requisitions or more, the process
3692: failed to create the po for one or two requisitions bcos
3693: we were not truncating the sysdate before a comparison in the following
3694: if logic and thereby not creating records in the po_headers_interface
3695: table for the autocreate logic to process the req to a PO.
3696: */
3697:
3698:

Line 3831: FROM po_headers_all

3827: BEGIN
3828: IF ((NVL(c1_source_doc_type_code,'BLANKET')='CONTRACT')) THEN
3829: SELECT vendor_contact_id
3830: INTO x_source_contact_id
3831: FROM po_headers_all
3832: WHERE po_header_id=c2_contract_id;
3833:
3834: elsif (NVL(c2_ga_flag,'N')='Y') THEN -- For Global Aggrement.
3835: SELECT vendor_contact_id

Line 3837: FROM po_headers_all -- To take care of GAs in Diff Operating unit

3833:
3834: elsif (NVL(c2_ga_flag,'N')='Y') THEN -- For Global Aggrement.
3835: SELECT vendor_contact_id
3836: INTO x_source_contact_id
3837: FROM po_headers_all -- To take care of GAs in Diff Operating unit
3838: WHERE po_header_id=c2_source_doc_id;
3839:
3840: ELSE
3841: x_source_contact_id := NULL;

Line 3864: Added code to update vendor_contact_id when po_headers is inserted for first time. */

3860: IF (g_po_wf_debug = 'Y') THEN
3861: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
3862: END IF;
3863: /* bug 2656323
3864: Added code to update vendor_contact_id when po_headers is inserted for first time. */
3865: if (x_carry_contact_to_po_flag = 'TRUE' and
3866: valid_contact(c2_suggested_vendor_site_id, x_suggested_vendor_contact_id)) then
3867: begin
3868: update po_headers_interface

Line 3868: update po_headers_interface

3864: Added code to update vendor_contact_id when po_headers is inserted for first time. */
3865: if (x_carry_contact_to_po_flag = 'TRUE' and
3866: valid_contact(c2_suggested_vendor_site_id, x_suggested_vendor_contact_id)) then
3867: begin
3868: update po_headers_interface
3869: set vendor_contact_id = x_suggested_vendor_contact_id
3870: where interface_header_id = x_interface_header_id;
3871: exception
3872: when others then

Line 3952: update po_headers_interface

3948: if (x_carry_contact_to_po_flag = 'TRUE' and
3949: valid_contact(c2_suggested_vendor_site_id, x_suggested_vendor_contact_id)) then
3950: begin
3951: x_progress := '55: group_req_lines: updating header with vendor contact :'||x_interface_header_id;
3952: update po_headers_interface
3953: set vendor_contact_id = x_suggested_vendor_contact_id
3954: where interface_header_id = x_interface_header_id;
3955: exception
3956: when others then

Line 3973: update po_headers_interface

3969: if (c2_found='Y') then
3970: Begin
3971:
3972: if ( x_source_contact_id is not null) then
3973: update po_headers_interface
3974: set vendor_contact_id = x_source_contact_id
3975: where interface_header_id = x_interface_header_id;
3976:
3977: elsif (x_carry_contact_to_po_flag = 'FALSE') then -- Implies contacts in Req lines are different

Line 3978: update po_headers_interface

3974: set vendor_contact_id = x_source_contact_id
3975: where interface_header_id = x_interface_header_id;
3976:
3977: elsif (x_carry_contact_to_po_flag = 'FALSE') then -- Implies contacts in Req lines are different
3978: update po_headers_interface
3979: set vendor_contact_id = NULL
3980: where interface_header_id = x_interface_header_id;
3981: elsif (x_carry_contact_to_po_flag = 'TRUE') and (x_prev_sug_vendor_contact_id is not null) then
3982: update po_headers_interface

Line 3982: update po_headers_interface

3978: update po_headers_interface
3979: set vendor_contact_id = NULL
3980: where interface_header_id = x_interface_header_id;
3981: elsif (x_carry_contact_to_po_flag = 'TRUE') and (x_prev_sug_vendor_contact_id is not null) then
3982: update po_headers_interface
3983: set vendor_contact_id = x_prev_sug_vendor_contact_id
3984: where interface_header_id = x_interface_header_id;
3985:
3986: end if;

Line 4026: * Description: Inserts a row into the po_headers_interface

4022: /***************************************************************************
4023: *
4024: * Procedure: insert_into_headers_interface
4025: *
4026: * Description: Inserts a row into the po_headers_interface
4027: * Returns false if creating PO header fails, and true otherwise (bug 3401653)
4028: *
4029: **************************************************************************/
4030: function insert_into_headers_interface (itemtype IN VARCHAR2,

Line 4067: x_group_code po_headers_interface.group_code%TYPE; /* Bug 2974129 */

4063: x_ga_flag varchar2(1); -- FPI GA
4064: x_progress varchar2(300);
4065:
4066: x_grouping_allowed varchar2(1); /* Bug 2974129 */
4067: x_group_code po_headers_interface.group_code%TYPE; /* Bug 2974129 */
4068: l_purchasing_org_id po_headers_all.org_id%TYPE; --
4069:
4070: --begin bug 3401653
4071: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;

Line 4068: l_purchasing_org_id po_headers_all.org_id%TYPE; --

4064: x_progress varchar2(300);
4065:
4066: x_grouping_allowed varchar2(1); /* Bug 2974129 */
4067: x_group_code po_headers_interface.group_code%TYPE; /* Bug 2974129 */
4068: l_purchasing_org_id po_headers_all.org_id%TYPE; --
4069:
4070: --begin bug 3401653
4071: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;
4072: l_pou_currency_code po_headers_all.currency_code%TYPE;

Line 4071: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;

4067: x_group_code po_headers_interface.group_code%TYPE; /* Bug 2974129 */
4068: l_purchasing_org_id po_headers_all.org_id%TYPE; --
4069:
4070: --begin bug 3401653
4071: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;
4072: l_pou_currency_code po_headers_all.currency_code%TYPE;
4073: l_rou_currency_code po_headers_all.currency_code%TYPE;
4074: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
4075: l_pou_default_rate_type po_headers_all.rate_type%TYPE;

Line 4072: l_pou_currency_code po_headers_all.currency_code%TYPE;

4068: l_purchasing_org_id po_headers_all.org_id%TYPE; --
4069:
4070: --begin bug 3401653
4071: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;
4072: l_pou_currency_code po_headers_all.currency_code%TYPE;
4073: l_rou_currency_code po_headers_all.currency_code%TYPE;
4074: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
4075: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
4076: l_interface_rate po_headers_all.rate%TYPE := NULL;

Line 4073: l_rou_currency_code po_headers_all.currency_code%TYPE;

4069:
4070: --begin bug 3401653
4071: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;
4072: l_pou_currency_code po_headers_all.currency_code%TYPE;
4073: l_rou_currency_code po_headers_all.currency_code%TYPE;
4074: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
4075: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
4076: l_interface_rate po_headers_all.rate%TYPE := NULL;
4077: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;

Line 4075: l_pou_default_rate_type po_headers_all.rate_type%TYPE;

4071: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;
4072: l_pou_currency_code po_headers_all.currency_code%TYPE;
4073: l_rou_currency_code po_headers_all.currency_code%TYPE;
4074: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
4075: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
4076: l_interface_rate po_headers_all.rate%TYPE := NULL;
4077: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;
4078: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;
4079: l_display_rate po_headers_all.rate%TYPE := NULL;

Line 4076: l_interface_rate po_headers_all.rate%TYPE := NULL;

4072: l_pou_currency_code po_headers_all.currency_code%TYPE;
4073: l_rou_currency_code po_headers_all.currency_code%TYPE;
4074: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
4075: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
4076: l_interface_rate po_headers_all.rate%TYPE := NULL;
4077: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;
4078: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;
4079: l_display_rate po_headers_all.rate%TYPE := NULL;
4080: --end bug 3401653

Line 4077: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;

4073: l_rou_currency_code po_headers_all.currency_code%TYPE;
4074: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
4075: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
4076: l_interface_rate po_headers_all.rate%TYPE := NULL;
4077: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;
4078: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;
4079: l_display_rate po_headers_all.rate%TYPE := NULL;
4080: --end bug 3401653
4081:

Line 4078: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;

4074: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
4075: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
4076: l_interface_rate po_headers_all.rate%TYPE := NULL;
4077: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;
4078: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;
4079: l_display_rate po_headers_all.rate%TYPE := NULL;
4080: --end bug 3401653
4081:
4082: begin

Line 4079: l_display_rate po_headers_all.rate%TYPE := NULL;

4075: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
4076: l_interface_rate po_headers_all.rate%TYPE := NULL;
4077: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;
4078: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;
4079: l_display_rate po_headers_all.rate%TYPE := NULL;
4080: --end bug 3401653
4081:
4082: begin
4083:

Line 4141: select po_headers_interface_s.nextval

4137:
4138:
4139: /* Get the interface_header_id from the sequence */
4140:
4141: select po_headers_interface_s.nextval
4142: into x_interface_header_id
4143: from sys.dual;
4144:
4145: /* Set the batch id which can be the same as

Line 4164: from po_headers_all

4160:
4161: if x_source_doc_id is not null then
4162: select global_agreement_flag, currency_code
4163: into x_ga_flag, l_source_doc_currency_code
4164: from po_headers_all
4165: where po_header_id = x_source_doc_id;
4166: end if;
4167:
4168: /* Bug 2735730.

Line 4243: --Modified the query to select from po_headers_all instead of po_headers.

4239: /* Check to make sure the doc num is not a duplicate */
4240:
4241: begin
4242: --
4243: --Modified the query to select from po_headers_all instead of po_headers.
4244: select 'PO EXISTS'
4245: into x_found
4246: from po_headers_all
4247: where segment1 = x_document_num

Line 4246: from po_headers_all

4242: --
4243: --Modified the query to select from po_headers_all instead of po_headers.
4244: select 'PO EXISTS'
4245: into x_found
4246: from po_headers_all
4247: where segment1 = x_document_num
4248: and org_id = l_purchasing_org_id --
4249: and type_lookup_code IN ('STANDARD', 'PLANNED', 'BLANKET', 'CONTRACT');
4250:

Line 4258: 'duplicate - not going to insert into po_headers_interface';

4254: when others then
4255: /* We have found a duplicate so raise the exception */
4256:
4257: x_progress := '45: insert_into_headers_interface: document_num is a ' ||
4258: 'duplicate - not going to insert into po_headers_interface';
4259: IF (g_po_wf_debug = 'Y') THEN
4260: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
4261: END IF;
4262:

Line 4293: * the po_headers_interface table. Should use functional currency if

4289: --end bug 3401653
4290:
4291: /* Bug:565623. gtummala. 10/17/97
4292: * The backend also needs the currency_code to be populated in the
4293: * the po_headers_interface table. Should use functional currency if
4294: * its null.
4295: */
4296: if (x_currency_code is NULL) then
4297: x_currency_code_doc := l_pou_currency_code;

Line 4388: from po_headers

4384: l_interface_rate := x_rate; --bug 3401653
4385:
4386: select segment1
4387: into x_document_num
4388: from po_headers
4389: where po_header_id = x_source_doc_id;
4390:
4391: /* Get the release number as the next release in sequence */
4392:

Line 4396: po_headers poh

4392:
4393: select nvl(max(release_num),0)+1
4394: into x_release_num
4395: from po_releases_all por, --
4396: po_headers poh
4397: where poh.po_header_id = x_source_doc_id
4398: and poh.po_header_id = por.po_header_id;
4399:
4400: /* Bug565530. gtummala. 10/23/97.

Line 4403: * the po_headers_interface table previously that has yet to converted

4399:
4400: /* Bug565530. gtummala. 10/23/97.
4401: * Even if the po_releases table gives us the next one in sequence,
4402: * this could conflict with a release_num that we have inserted into
4403: * the po_headers_interface table previously that has yet to converted
4404: * into a release eg. when we have two req lines that will be created
4405: * onto two diff. releases.
4406: */
4407:

Line 4413: from po_headers_interface phi

4409: -- Commented out the release_num filters for the next 2 queries.
4410:
4411: select count (*)
4412: into x_no_releases
4413: from po_headers_interface phi
4414: where phi.document_num = x_document_num;
4415: -- and phi.release_num = x_release_num;
4416:
4417: if (x_no_releases <> 0) then

Line 4420: from po_headers_interface phi

4416:
4417: if (x_no_releases <> 0) then
4418: select max(release_num)+1
4419: into x_release_num1
4420: from po_headers_interface phi
4421: where phi.document_num = x_document_num;
4422: -- and phi.release_num = x_release_num;
4423: end if;
4424:

Line 4449: /* Insert into po_headers_inteface */

4445: if (x_release_num1 >= x_release_num) then
4446: x_release_num := x_release_num1;
4447: end if;
4448:
4449: /* Insert into po_headers_inteface */
4450:
4451: x_progress := '50: insert_into_headers_interface: Just about to insert into ' ||
4452: 'po_headers_interface';
4453: IF (g_po_wf_debug = 'Y') THEN

Line 4452: 'po_headers_interface';

4448:
4449: /* Insert into po_headers_inteface */
4450:
4451: x_progress := '50: insert_into_headers_interface: Just about to insert into ' ||
4452: 'po_headers_interface';
4453: IF (g_po_wf_debug = 'Y') THEN
4454: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
4455: END IF;
4456:

Line 4464: insert into po_headers_interface

4460: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
4461: END IF;
4462:
4463: begin
4464: insert into po_headers_interface
4465: (wf_group_id,
4466: interface_header_id,
4467: interface_source_code,
4468: batch_id,

Line 4524: 'inserting into po_headers_interface';

4520:
4521: exception
4522: when others then
4523: x_progress := '55: insert_into_headers_interface: IN EXCEPTION when '||
4524: 'inserting into po_headers_interface';
4525: IF (g_po_wf_debug = 'Y') THEN
4526: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
4527: END IF;
4528:

Line 4533: 'po_headers_interface';

4529: raise;
4530: end;
4531:
4532: x_progress := '60: insert_into_headers_interface: Inserted into ' ||
4533: 'po_headers_interface';
4534: IF (g_po_wf_debug = 'Y') THEN
4535: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
4536: END IF;
4537:

Line 4606: from po_headers_all

4602:
4603: if x_source_doc_id is not null then
4604: select global_agreement_flag
4605: into x_ga_flag
4606: from po_headers_all
4607: where po_header_id = x_source_doc_id;
4608: end if;
4609:
4610: /* Bug 2735730.

Line 4640: -- from po_headers

4636: --if (x_contract_id is not null) then
4637: --
4638: -- select max(segment1)
4639: -- into x_contract_num
4640: -- from po_headers
4641: -- where po_header_id = x_contract_id;
4642: --
4643: --end if;
4644:

Line 4775: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE := NULL; --

4771: x_agent_id number;
4772: x_org_id number;
4773: l_purchasing_org_id number; --
4774: x_progress varchar2(300);
4775: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE := NULL; --
4776:
4777: cursor c1 is /* x_group_id is a parameter */
4778: select interface_header_id,
4779: document_subtype,

Line 4782: from po_headers_interface

4778: select interface_header_id,
4779: document_subtype,
4780: agent_id,
4781: vendor_site_id --
4782: from po_headers_interface
4783: where wf_group_id = x_group_id
4784: order by interface_header_id;
4785:
4786:

Line 5041: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;

5037: x_org_id number;
5038: x_progress varchar2(300);
5039:
5040: --
5041: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;
5042: l_return_status VARCHAR2(1);
5043: l_msg_count NUMBER;
5044: l_msg_data FND_NEW_MESSAGES.message_text%TYPE;
5045: l_doc_number PO_HEADERS_ALL.segment1%TYPE;

Line 5045: l_doc_number PO_HEADERS_ALL.segment1%TYPE;

5041: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;
5042: l_return_status VARCHAR2(1);
5043: l_msg_count NUMBER;
5044: l_msg_data FND_NEW_MESSAGES.message_text%TYPE;
5045: l_doc_number PO_HEADERS_ALL.segment1%TYPE;
5046: --
5047: x_group_shipments varchar2(1); --
5048: x_operting_unit_id Number; --
5049:

Line 5198: l_style_id po_headers_all.style_id%TYPE; -- HTML Orders R12

5194: x_autocreated_doc_id number;
5195: l_open_form varchar2(200); --Bug#2982867
5196: l_view_po_url varchar2(1000); -- HTML Orders R12
5197: l_edit_po_url varchar2(1000); -- HTML Orders R12
5198: l_style_id po_headers_all.style_id%TYPE; -- HTML Orders R12
5199:
5200: x_progress varchar2(300);
5201:
5202: begin

Line 5248: --Modified the query to select from po_headers_all instead of

5244:
5245: if (x_doc_type_to_create = 'STANDARD') then
5246:
5247: --
5248: --Modified the query to select from po_headers_all instead of
5249: --po_headers.
5250: --< HTML Orders R12>
5251: -- selected style id
5252: select segment1,

Line 5249: --po_headers.

5245: if (x_doc_type_to_create = 'STANDARD') then
5246:
5247: --
5248: --Modified the query to select from po_headers_all instead of
5249: --po_headers.
5250: --< HTML Orders R12>
5251: -- selected style id
5252: select segment1,
5253: style_id

Line 5256: from po_headers_all

5252: select segment1,
5253: style_id
5254: into x_segment1,
5255: l_style_id
5256: from po_headers_all
5257: where po_header_id = x_autocreated_doc_id;
5258:
5259:
5260: po_wf_util_pkg.SetItemAttrText (itemtype => itemtype,

Line 5296: from po_headers_all poh, --

5292: select poh.segment1,
5293: por.release_num
5294: into x_segment1,
5295: x_release_num
5296: from po_headers_all poh, --
5297: po_releases por
5298: where por.po_release_id = x_autocreated_doc_id
5299: and por.po_header_id = poh.po_header_id;
5300:

Line 5392: l_doc_type_to_create po_headers_all.type_lookup_code%TYPE;

5388: x_auto_approve_doc varchar2(1);
5389: x_progress varchar2(300);
5390:
5391: --
5392: l_doc_type_to_create po_headers_all.type_lookup_code%TYPE;
5393: l_doc_type po_document_types_all_b.document_type_code%TYPE;
5394: l_doc_subtype po_document_types_all_b.document_subtype%TYPE;
5395: l_po_header_id po_headers_all.po_header_id%TYPE;
5396: l_po_release_id po_releases_all.po_release_id%TYPE;

Line 5395: l_po_header_id po_headers_all.po_header_id%TYPE;

5391: --
5392: l_doc_type_to_create po_headers_all.type_lookup_code%TYPE;
5393: l_doc_type po_document_types_all_b.document_type_code%TYPE;
5394: l_doc_subtype po_document_types_all_b.document_subtype%TYPE;
5395: l_po_header_id po_headers_all.po_header_id%TYPE;
5396: l_po_release_id po_releases_all.po_release_id%TYPE;
5397: l_return_status VARCHAR2(1);
5398: --
5399:

Line 5547: x_doc_num po_headers.segment1%type := null; -- Bug 3152167

5543: x_workflow_process varchar2(40) := null;
5544: /*Bug8937846 Set the action_orig_from parameter as "CREATEDOC" */
5545: x_action_orig_from varchar2(30) := 'CREATEDOC';
5546: x_doc_id number := null;
5547: x_doc_num po_headers.segment1%type := null; -- Bug 3152167
5548: x_preparer_id number := null;
5549: x_doc_type varchar2(25) := null;
5550: x_doc_subtype varchar2(25) := null;
5551: x_submitter_action varchar2(25) := null;

Line 5570: l_document_num po_headers.segment1%type;

5566: x_default_method varchar2(25) := null;
5567:
5568:
5569: /* RETROACTIVE FPI START */
5570: l_document_num po_headers.segment1%type;
5571: /* RETROACTIVE FPI END */
5572:
5573: /* */
5574: l_consigned_consumption_flag po_headers_all.consigned_consumption_flag%TYPE;

Line 5574: l_consigned_consumption_flag po_headers_all.consigned_consumption_flag%TYPE;

5570: l_document_num po_headers.segment1%type;
5571: /* RETROACTIVE FPI END */
5572:
5573: /* */
5574: l_consigned_consumption_flag po_headers_all.consigned_consumption_flag%TYPE;
5575: /* */
5576:
5577: l_purchasing_org_id po_headers_all.org_id%TYPE; --
5578:

Line 5577: l_purchasing_org_id po_headers_all.org_id%TYPE; --

5573: /* */
5574: l_consigned_consumption_flag po_headers_all.consigned_consumption_flag%TYPE;
5575: /* */
5576:
5577: l_purchasing_org_id po_headers_all.org_id%TYPE; --
5578:
5579: /* BUG 4638656 */
5580: l_tp_header_id ece_tp_details.tp_header_id%TYPE;
5581: l_edi_flag ece_tp_details.edi_flag%TYPE;

Line 5678: -- from po_headers into x_doc_num

5674: Check if the supplier site on the PO/Release has email as the default notification method.
5675: if so set the email flag and address from the site */
5676:
5677: -- included bug fix 2342323. Modified changes are to retrieve segment1
5678: -- from po_headers into x_doc_num
5679: -- for release, PO or PA
5680: -- Bug 2567900 Included fax number in the select
5681:
5682: /* bug 4638656 - start */

Line 5703: po_headers ph

5699: x_preparer_id
5700: from ece_tp_details etd,
5701: po_vendor_sites pvs,
5702: po_vendors pv,
5703: po_headers ph
5704: where pv.vendor_id = pvs.vendor_id
5705: and pvs.tp_header_id = etd.tp_header_id
5706: and etd.document_id = l_transaction_subtype
5707: and ph.vendor_id = pv.vendor_id

Line 5731: po_headers ph ,

5727: x_preparer_id
5728: from ece_tp_details etd,
5729: po_vendor_sites pvs,
5730: po_vendors pv,
5731: po_headers ph ,
5732: po_releases pr
5733: where pv.vendor_id = pvs.vendor_id
5734: and pvs.tp_header_id = etd.tp_header_id
5735: and etd.document_id = l_transaction_subtype

Line 6154: from po_headers_all

6150: THEN
6151: Begin
6152: select NVL(global_agreement_flag,'N')
6153: into x_ga_flag
6154: from po_headers_all
6155: where po_header_id = c_source_doc_id;
6156: Exception
6157: when others then
6158: x_ga_flag := 'N';

Line 6296: update po_headers_interface

6292: valid_contact(c_suggested_vendor_site_id, x_suggested_vendor_contact_id)) then
6293: begin
6294: x_progress := '55: group_req_lines: updating header with vendor contact :'||x_interface_header_id;
6295:
6296: update po_headers_interface
6297: set vendor_contact_id = x_suggested_vendor_contact_id
6298: where interface_header_id = x_interface_header_id;
6299:
6300: exception

Line 6681: ( p_table_name => 'PO_HEADERS',

6677: -- bug5176308
6678: -- Call API to get the next document num
6679: x_document_num :=
6680: PO_CORE_SV1.default_po_unique_identifier
6681: ( p_table_name => 'PO_HEADERS',
6682: p_org_id => p_purchasing_org_id
6683: );
6684:
6685:

Line 6855: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE; --

6851: x_progress varchar2(300) := '000';
6852: x_contract_id_valid number;
6853: x_contract_currency_code varchar2(25);
6854: x_source_currency_code PO_REQUISITION_LINES_ALL.currency_code%TYPE;
6855: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE; --
6856: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
6857: x_is_clm_flow VARCHAR2(1);
6858: begin
6859:

Line 6856: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;

6852: x_contract_id_valid number;
6853: x_contract_currency_code varchar2(25);
6854: x_source_currency_code PO_REQUISITION_LINES_ALL.currency_code%TYPE;
6855: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE; --
6856: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
6857: x_is_clm_flow VARCHAR2(1);
6858: begin
6859:
6860: /* When the source doc and source line was put onto the req line

Line 6927: from po_headers_all POH -- : Use ALL table

6923: -- SQL Why: The reference cannot be used if it is not valid
6924:
6925: select POH.po_header_id, poh.currency_code
6926: into x_contract_id_valid, x_contract_currency_code
6927: from po_headers_all POH -- : Use ALL table
6928: where
6929: POH.po_header_id = x_source_doc_po_header_id
6930: and POH.type_lookup_code = 'CONTRACT'
6931: and nvl(POH.cancel_flag,'N') = 'N'

Line 7158: from po_headers_all

7154:
7155: if x_source_doc_po_header_id is not null then
7156: select org_id
7157: into x_owning_org_id
7158: from po_headers_all
7159: where po_header_id = x_source_doc_po_header_id;
7160: end if;
7161:
7162: if nvl(x_ga_flag,'N') = 'Y' and

Line 7196: from po_headers_all poh

7192:
7193: --Check the referenced GA for cancel/finally closed status
7194: select 'Y'
7195: into x_ref_is_valid
7196: from po_headers_all poh
7197: where poh.po_header_id = p_ga_po_header_id and
7198: nvl(poh.cancel_flag, 'N') = 'N' and
7199: nvl(poh.closed_code, 'OPEN') <> 'FINALLY CLOSED';
7200:

Line 7292: x_org_id PO_HEADERS_ALL.org_id%TYPE;

7288: actid IN NUMBER,
7289: funcmode IN VARCHAR2,
7290: resultout OUT NOCOPY VARCHAR2
7291: ) IS
7292: x_org_id PO_HEADERS_ALL.org_id%TYPE;
7293: x_progress VARCHAR2(300);
7294: x_source_doc_po_header_id PO_HEADERS_ALL.po_header_id%TYPE;
7295: x_source_doc_type_code PO_HEADERS_ALL.from_type_lookup_code%TYPE;
7296: x_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;

Line 7294: x_source_doc_po_header_id PO_HEADERS_ALL.po_header_id%TYPE;

7290: resultout OUT NOCOPY VARCHAR2
7291: ) IS
7292: x_org_id PO_HEADERS_ALL.org_id%TYPE;
7293: x_progress VARCHAR2(300);
7294: x_source_doc_po_header_id PO_HEADERS_ALL.po_header_id%TYPE;
7295: x_source_doc_type_code PO_HEADERS_ALL.from_type_lookup_code%TYPE;
7296: x_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
7297: l_return_status VARCHAR2(1) := 'N';
7298:

Line 7295: x_source_doc_type_code PO_HEADERS_ALL.from_type_lookup_code%TYPE;

7291: ) IS
7292: x_org_id PO_HEADERS_ALL.org_id%TYPE;
7293: x_progress VARCHAR2(300);
7294: x_source_doc_po_header_id PO_HEADERS_ALL.po_header_id%TYPE;
7295: x_source_doc_type_code PO_HEADERS_ALL.from_type_lookup_code%TYPE;
7296: x_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
7297: l_return_status VARCHAR2(1) := 'N';
7298:
7299: BEGIN

Line 7296: x_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;

7292: x_org_id PO_HEADERS_ALL.org_id%TYPE;
7293: x_progress VARCHAR2(300);
7294: x_source_doc_po_header_id PO_HEADERS_ALL.po_header_id%TYPE;
7295: x_source_doc_type_code PO_HEADERS_ALL.from_type_lookup_code%TYPE;
7296: x_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
7297: l_return_status VARCHAR2(1) := 'N';
7298:
7299: BEGIN
7300: --Set org context

Line 7340: FROM po_headers_all poh,

7336: BEGIN
7337:
7338: SELECT 'Y'
7339: INTO l_return_status
7340: FROM po_headers_all poh,
7341: per_all_people_f ppf, --Bug 16249921. Changed per_people_f ppf to per_all_people_f
7342: financials_system_parameters fsp
7343: WHERE poh.agent_id = ppf.person_id
7344: AND ppf.business_group_id = fsp.business_group_id

Line 7424: x_org_id PO_HEADERS_ALL.org_id%TYPE;

7420: actid IN NUMBER,
7421: funcmode IN VARCHAR2,
7422: resultout OUT NOCOPY VARCHAR2
7423: ) IS
7424: x_org_id PO_HEADERS_ALL.org_id%TYPE;
7425: x_progress VARCHAR2(300);
7426: x_contract_id NUMBER;
7427: l_return_status VARCHAR2(1) := 'N';
7428:

Line 7452: FROM po_headers_all poh,

7448: IF x_contract_id IS NOT NULL THEN
7449: BEGIN
7450: SELECT 'Y'
7451: INTO l_return_status
7452: FROM po_headers_all poh,
7453: per_all_people_f ppf,----Bug16249921 Changed per_people_f to per_all_people_f
7454: --as per_people_f is security profile restricted.
7455: financials_system_parameters fsp
7456: WHERE poh.agent_id = ppf.person_id

Line 7541: l_org_id PO_HEADERS_ALL.org_id%TYPE;

7537: funcmode IN VARCHAR2,
7538: resultout OUT NOCOPY VARCHAR2
7539: ) IS
7540:
7541: l_org_id PO_HEADERS_ALL.org_id%TYPE;
7542: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;
7543: x_progress VARCHAR2(300);
7544:
7545: BEGIN

Line 7542: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;

7538: resultout OUT NOCOPY VARCHAR2
7539: ) IS
7540:
7541: l_org_id PO_HEADERS_ALL.org_id%TYPE;
7542: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;
7543: x_progress VARCHAR2(300);
7544:
7545: BEGIN
7546:

Line 7790: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;

7786: p_suggested_vendor_site_id IN NUMBER
7787: )
7788: IS
7789:
7790: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;
7791: l_progress VARCHAR2(300);
7792:
7793: BEGIN
7794:

Line 8107: FROM po_headers_all

8103: SELECT clm_flag
8104: INTO l_clm_flag
8105: FROM po_doc_style_headers
8106: WHERE style_id = (SELECT style_id
8107: FROM po_headers_all
8108: WHERE po_header_id = l_po_header_id );
8109: EXCEPTION
8110: WHEN No_Data_Found THEN
8111: NULL;