DBA Data[Home] [Help]

APPS.PO_AUTOCREATE_DOC dependencies on PO_HEADERS

Line 337: l_consume_req_demand_doc_id po_headers.po_header_id%type;

333: authorization_status = 'APPROVED' AND
334: poh.requisition_header_id = pol.requisition_header_id;
335:
336: --
337: l_consume_req_demand_doc_id po_headers.po_header_id%type;
338: --sql what: get all the req lines which have the same bid/negotiation info as
339: -- those on the lines of the current blanket po approval workflow
340: -- just approved.
341: --sql why : This cursor fetches all these eligible requisition lines and lauches

Line 848: from po_headers_all

844:
845: if x_source_doc_po_header_id is not null then
846: select global_agreement_flag
847: into x_ga_flag
848: from po_headers_all
849: where po_header_id = x_source_doc_po_header_id;
850: end if;
851:
852: po_wf_util_pkg.SetItemAttrText (itemtype => itemtype,

Line 1420: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;

1416: x_progress varchar2(300) := '000';
1417:
1418: --
1419:
1420: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
1421: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1422: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1423: l_rate PO_HEADERS_ALL.rate%TYPE;
1424: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;

Line 1421: l_currency PO_HEADERS_ALL.currency_code%TYPE;

1417:
1418: --
1419:
1420: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
1421: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1422: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1423: l_rate PO_HEADERS_ALL.rate%TYPE;
1424: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;
1425: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;

Line 1422: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;

1418: --
1419:
1420: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
1421: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1422: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1423: l_rate PO_HEADERS_ALL.rate%TYPE;
1424: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;
1425: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;
1426:

Line 1423: l_rate PO_HEADERS_ALL.rate%TYPE;

1419:
1420: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
1421: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1422: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1423: l_rate PO_HEADERS_ALL.rate%TYPE;
1424: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;
1425: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;
1426:
1427: -- bug4198095

Line 1424: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;

1420: l_gc_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
1421: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1422: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1423: l_rate PO_HEADERS_ALL.rate%TYPE;
1424: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;
1425: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;
1426:
1427: -- bug4198095
1428: -- No need to match local contract anymore after R12

Line 1425: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;

1421: l_currency PO_HEADERS_ALL.currency_code%TYPE;
1422: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
1423: l_rate PO_HEADERS_ALL.rate%TYPE;
1424: l_rate_date PO_HEADERS_ALL.rate_date%TYPE;
1425: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;
1426:
1427: -- bug4198095
1428: -- No need to match local contract anymore after R12
1429: l_current_org_id PO_HEADERS_ALL.org_id%TYPE;

Line 1429: l_current_org_id PO_HEADERS_ALL.org_id%TYPE;

1425: l_rate_type PO_HEADERS_ALL.rate_type%TYPE;
1426:
1427: -- bug4198095
1428: -- No need to match local contract anymore after R12
1429: l_current_org_id PO_HEADERS_ALL.org_id%TYPE;
1430:
1431: -- SQL What: Find available contract that is valid. First it
1432: -- finds local contracts; if none exists then find global contracts.
1433: -- Also, latest contract takes priority

Line 1442: FROM po_headers_all POH

1438: CURSOR c_contract_currency IS
1439: SELECT POH.po_header_id,
1440: POH.global_agreement_flag,
1441: POH.currency_code
1442: FROM po_headers_all POH
1443: WHERE POH.vendor_id = x_supplier_id
1444: AND POH.currency_code = nvl(x_item_currency, l_base_currency)
1445: AND POH.type_lookup_code = 'CONTRACT'
1446: /* R12 GCPA

Line 1474: FROM po_headers_all POH

1470: CURSOR c_contract IS
1471: SELECT POH.po_header_id,
1472: POH.global_agreement_flag,
1473: POH.currency_code
1474: FROM po_headers_all POH
1475: WHERE POH.vendor_id = x_supplier_id
1476: AND POH.type_lookup_code = 'CONTRACT'
1477: /* R12 GCPA
1478: + If Profile ALLOW_REFERENCING_CPA_UNDER_AMENDMENT is Y, then we can refer any Contract Which is approved Once

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

1805: x_progress varchar2(300);
1806:
1807: -- bug2821542
1808: l_validate_result VARCHAR2(1) := FND_API.G_TRUE;
1809: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE; --
1810:
1811: begin
1812:
1813: x_org_id := po_wf_util_pkg.GetItemAttrNumber (itemtype => itemtype,

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

2077: itemkey => itemkey,
2078: aname => 'SOURCE_DOCUMENT_ID');
2079: if( x_source_doc_type_code = 'BLANKET' or
2080: x_source_doc_type_code = 'QUOTATION') then
2081: /* Get the buyer from the PO headers table.
2082: */
2083: begin
2084: /*Bug 928568-removed the _all reference and used the striped table
2085: table instead */

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

2084: /*Bug 928568-removed the _all reference and used the striped table
2085: table instead */
2086:
2087: --
2088: -- Modified the query to select from po_headers_all instead of po_headers.
2089: select agent_id
2090: into x_agent_id
2091: from po_headers_all
2092: where po_header_id = x_source_doc_po_header_id;

Line 2091: from po_headers_all

2087: --
2088: -- Modified the query to select from po_headers_all instead of po_headers.
2089: select agent_id
2090: into x_agent_id
2091: from po_headers_all
2092: where po_header_id = x_source_doc_po_header_id;
2093: exception
2094: when NO_DATA_FOUND then
2095: x_agent_id := NULL;

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

2174:
2175: begin
2176:
2177: --
2178: --Modified the query to select from po_headers_all instead of po_headers
2179: select agent_id
2180: into x_agent_id
2181: from po_headers_all
2182: where po_header_id = x_contract_id;

Line 2181: from po_headers_all

2177: --
2178: --Modified the query to select from po_headers_all instead of po_headers
2179: select agent_id
2180: into x_agent_id
2181: from po_headers_all
2182: where po_header_id = x_contract_id;
2183:
2184: exception
2185:

Line 3156: from po_headers_all

3152: /* FPI GA start */
3153: if (c1_source_doc_id is not null) then
3154: select global_agreement_flag
3155: into c1_ga_flag
3156: from po_headers_all
3157: where po_header_id = c1_source_doc_id;
3158: end if;
3159:
3160: /* FPI GA End */

Line 3320: from po_headers_all

3316: /* FPI GA start */
3317: if (c2_source_doc_id is not null) then
3318: select global_agreement_flag
3319: into c2_ga_flag
3320: from po_headers_all
3321: where po_header_id = c2_source_doc_id;
3322: end if;
3323:
3324: /* FPI GA End */

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

3388: When you initiate the create doc workflow from requisition import
3389: for a batch of 5000 requisitions or more, the process
3390: failed to create the po for one or two requisitions bcos
3391: we were not truncating the sysdate before a comparison in the following
3392: if logic and thereby not creating records in the po_headers_interface
3393: table for the autocreate logic to process the req to a PO.
3394: */
3395:
3396:

Line 3515: from po_headers_all

3511: if ((NVL(c1_source_doc_type_code,'BLANKET')='CONTRACT') ) then
3512:
3513: select vendor_contact_id
3514: into x_source_contact_id
3515: from po_headers_all
3516: where po_header_id=c2_contract_id;
3517:
3518: elsif (NVL(c2_ga_flag,'N')='Y') then -- For Global Aggrement.
3519:

Line 3522: from po_headers_all -- To take care of GAs in Diff Operating unit

3518: elsif (NVL(c2_ga_flag,'N')='Y') then -- For Global Aggrement.
3519:
3520: select vendor_contact_id
3521: into x_source_contact_id
3522: from po_headers_all -- To take care of GAs in Diff Operating unit
3523: where po_header_id=c2_source_doc_id;
3524: else
3525: x_source_contact_id := null;
3526: end if;

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

3535: IF (g_po_wf_debug = 'Y') THEN
3536: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
3537: END IF;
3538: /* bug 2656323
3539: Added code to update vendor_contact_id when po_headers is inserted for first time. */
3540: if (x_carry_contact_to_po_flag = 'TRUE' and
3541: valid_contact(c2_suggested_vendor_site_id, x_suggested_vendor_contact_id)) then
3542: begin
3543: update po_headers_interface

Line 3543: update po_headers_interface

3539: Added code to update vendor_contact_id when po_headers is inserted for first time. */
3540: if (x_carry_contact_to_po_flag = 'TRUE' and
3541: valid_contact(c2_suggested_vendor_site_id, x_suggested_vendor_contact_id)) then
3542: begin
3543: update po_headers_interface
3544: set vendor_contact_id = x_suggested_vendor_contact_id
3545: where interface_header_id = x_interface_header_id;
3546: exception
3547: when others then

Line 3627: update po_headers_interface

3623: if (x_carry_contact_to_po_flag = 'TRUE' and
3624: valid_contact(c2_suggested_vendor_site_id, x_suggested_vendor_contact_id)) then
3625: begin
3626: x_progress := '55: group_req_lines: updating header with vendor contact :'||x_interface_header_id;
3627: update po_headers_interface
3628: set vendor_contact_id = x_suggested_vendor_contact_id
3629: where interface_header_id = x_interface_header_id;
3630: exception
3631: when others then

Line 3648: update po_headers_interface

3644: if (c2_found='Y') then
3645: Begin
3646:
3647: if ( x_source_contact_id is not null) then
3648: update po_headers_interface
3649: set vendor_contact_id = x_source_contact_id
3650: where interface_header_id = x_interface_header_id;
3651:
3652: elsif (x_carry_contact_to_po_flag = 'FALSE') then -- Implies contacts in Req lines are different

Line 3653: update po_headers_interface

3649: set vendor_contact_id = x_source_contact_id
3650: where interface_header_id = x_interface_header_id;
3651:
3652: elsif (x_carry_contact_to_po_flag = 'FALSE') then -- Implies contacts in Req lines are different
3653: update po_headers_interface
3654: set vendor_contact_id = NULL
3655: where interface_header_id = x_interface_header_id;
3656: elsif (x_carry_contact_to_po_flag = 'TRUE') and (x_prev_sug_vendor_contact_id is not null) then
3657: update po_headers_interface

Line 3657: update po_headers_interface

3653: update po_headers_interface
3654: set vendor_contact_id = NULL
3655: where interface_header_id = x_interface_header_id;
3656: elsif (x_carry_contact_to_po_flag = 'TRUE') and (x_prev_sug_vendor_contact_id is not null) then
3657: update po_headers_interface
3658: set vendor_contact_id = x_prev_sug_vendor_contact_id
3659: where interface_header_id = x_interface_header_id;
3660:
3661: end if;

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

3697: /***************************************************************************
3698: *
3699: * Procedure: insert_into_headers_interface
3700: *
3701: * Description: Inserts a row into the po_headers_interface
3702: * Returns false if creating PO header fails, and true otherwise (bug 3401653)
3703: *
3704: **************************************************************************/
3705: function insert_into_headers_interface (itemtype IN VARCHAR2,

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

3738: x_ga_flag varchar2(1); -- FPI GA
3739: x_progress varchar2(300);
3740:
3741: x_grouping_allowed varchar2(1); /* Bug 2974129 */
3742: x_group_code po_headers_interface.group_code%TYPE; /* Bug 2974129 */
3743: l_purchasing_org_id po_headers_all.org_id%TYPE; --
3744:
3745: --begin bug 3401653
3746: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;

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

3739: x_progress varchar2(300);
3740:
3741: x_grouping_allowed varchar2(1); /* Bug 2974129 */
3742: x_group_code po_headers_interface.group_code%TYPE; /* Bug 2974129 */
3743: l_purchasing_org_id po_headers_all.org_id%TYPE; --
3744:
3745: --begin bug 3401653
3746: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;
3747: l_pou_currency_code po_headers_all.currency_code%TYPE;

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

3742: x_group_code po_headers_interface.group_code%TYPE; /* Bug 2974129 */
3743: l_purchasing_org_id po_headers_all.org_id%TYPE; --
3744:
3745: --begin bug 3401653
3746: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;
3747: l_pou_currency_code po_headers_all.currency_code%TYPE;
3748: l_rou_currency_code po_headers_all.currency_code%TYPE;
3749: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
3750: l_pou_default_rate_type po_headers_all.rate_type%TYPE;

Line 3747: l_pou_currency_code po_headers_all.currency_code%TYPE;

3743: l_purchasing_org_id po_headers_all.org_id%TYPE; --
3744:
3745: --begin bug 3401653
3746: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;
3747: l_pou_currency_code po_headers_all.currency_code%TYPE;
3748: l_rou_currency_code po_headers_all.currency_code%TYPE;
3749: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
3750: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
3751: l_interface_rate po_headers_all.rate%TYPE := NULL;

Line 3748: l_rou_currency_code po_headers_all.currency_code%TYPE;

3744:
3745: --begin bug 3401653
3746: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;
3747: l_pou_currency_code po_headers_all.currency_code%TYPE;
3748: l_rou_currency_code po_headers_all.currency_code%TYPE;
3749: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
3750: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
3751: l_interface_rate po_headers_all.rate%TYPE := NULL;
3752: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;

Line 3750: l_pou_default_rate_type po_headers_all.rate_type%TYPE;

3746: l_source_doc_currency_code po_headers_all.currency_code%TYPE := NULL;
3747: l_pou_currency_code po_headers_all.currency_code%TYPE;
3748: l_rou_currency_code po_headers_all.currency_code%TYPE;
3749: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
3750: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
3751: l_interface_rate po_headers_all.rate%TYPE := NULL;
3752: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;
3753: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;
3754: l_display_rate po_headers_all.rate%TYPE := NULL;

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

3747: l_pou_currency_code po_headers_all.currency_code%TYPE;
3748: l_rou_currency_code po_headers_all.currency_code%TYPE;
3749: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
3750: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
3751: l_interface_rate po_headers_all.rate%TYPE := NULL;
3752: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;
3753: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;
3754: l_display_rate po_headers_all.rate%TYPE := NULL;
3755: --end bug 3401653

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

3748: l_rou_currency_code po_headers_all.currency_code%TYPE;
3749: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
3750: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
3751: l_interface_rate po_headers_all.rate%TYPE := NULL;
3752: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;
3753: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;
3754: l_display_rate po_headers_all.rate%TYPE := NULL;
3755: --end bug 3401653
3756:

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

3749: l_pou_sob_id gl_sets_of_books.set_of_books_id%TYPE;
3750: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
3751: l_interface_rate po_headers_all.rate%TYPE := NULL;
3752: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;
3753: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;
3754: l_display_rate po_headers_all.rate%TYPE := NULL;
3755: --end bug 3401653
3756:
3757: begin

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

3750: l_pou_default_rate_type po_headers_all.rate_type%TYPE;
3751: l_interface_rate po_headers_all.rate%TYPE := NULL;
3752: l_interface_rate_type po_headers_all.rate_type%TYPE := NULL;
3753: l_interface_rate_date po_headers_all.rate_date%TYPE := NULL;
3754: l_display_rate po_headers_all.rate%TYPE := NULL;
3755: --end bug 3401653
3756:
3757: begin
3758:

Line 3816: select po_headers_interface_s.nextval

3812:
3813:
3814: /* Get the interface_header_id from the sequence */
3815:
3816: select po_headers_interface_s.nextval
3817: into x_interface_header_id
3818: from sys.dual;
3819:
3820: /* Set the batch id which can be the same as

Line 3839: from po_headers_all

3835:
3836: if x_source_doc_id is not null then
3837: select global_agreement_flag, currency_code
3838: into x_ga_flag, l_source_doc_currency_code
3839: from po_headers_all
3840: where po_header_id = x_source_doc_id;
3841: end if;
3842:
3843: /* Bug 2735730.

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

3914: /* Check to make sure the doc num is not a duplicate */
3915:
3916: begin
3917: --
3918: --Modified the query to select from po_headers_all instead of po_headers.
3919: select 'PO EXISTS'
3920: into x_found
3921: from po_headers_all
3922: where segment1 = x_document_num

Line 3921: from po_headers_all

3917: --
3918: --Modified the query to select from po_headers_all instead of po_headers.
3919: select 'PO EXISTS'
3920: into x_found
3921: from po_headers_all
3922: where segment1 = x_document_num
3923: and org_id = l_purchasing_org_id --
3924: and type_lookup_code IN ('STANDARD', 'PLANNED', 'BLANKET', 'CONTRACT');
3925:

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

3929: when others then
3930: /* We have found a duplicate so raise the exception */
3931:
3932: x_progress := '45: insert_into_headers_interface: document_num is a ' ||
3933: 'duplicate - not going to insert into po_headers_interface';
3934: IF (g_po_wf_debug = 'Y') THEN
3935: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
3936: END IF;
3937:

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

3964: --end bug 3401653
3965:
3966: /* Bug:565623. gtummala. 10/17/97
3967: * The backend also needs the currency_code to be populated in the
3968: * the po_headers_interface table. Should use functional currency if
3969: * its null.
3970: */
3971: if (x_currency_code is NULL) then
3972: x_currency_code_doc := l_pou_currency_code;

Line 4063: from po_headers

4059: l_interface_rate := x_rate; --bug 3401653
4060:
4061: select segment1
4062: into x_document_num
4063: from po_headers
4064: where po_header_id = x_source_doc_id;
4065:
4066: /* Get the release number as the next release in sequence */
4067:

Line 4071: po_headers poh

4067:
4068: select nvl(max(release_num),0)+1
4069: into x_release_num
4070: from po_releases_all por, --
4071: po_headers poh
4072: where poh.po_header_id = x_source_doc_id
4073: and poh.po_header_id = por.po_header_id;
4074:
4075: /* Bug565530. gtummala. 10/23/97.

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

4074:
4075: /* Bug565530. gtummala. 10/23/97.
4076: * Even if the po_releases table gives us the next one in sequence,
4077: * this could conflict with a release_num that we have inserted into
4078: * the po_headers_interface table previously that has yet to converted
4079: * into a release eg. when we have two req lines that will be created
4080: * onto two diff. releases.
4081: */
4082:

Line 4088: from po_headers_interface phi

4084: -- Commented out the release_num filters for the next 2 queries.
4085:
4086: select count (*)
4087: into x_no_releases
4088: from po_headers_interface phi
4089: where phi.document_num = x_document_num;
4090: -- and phi.release_num = x_release_num;
4091:
4092: if (x_no_releases <> 0) then

Line 4095: from po_headers_interface phi

4091:
4092: if (x_no_releases <> 0) then
4093: select max(release_num)+1
4094: into x_release_num1
4095: from po_headers_interface phi
4096: where phi.document_num = x_document_num;
4097: -- and phi.release_num = x_release_num;
4098: end if;
4099:

Line 4124: /* Insert into po_headers_inteface */

4120: if (x_release_num1 >= x_release_num) then
4121: x_release_num := x_release_num1;
4122: end if;
4123:
4124: /* Insert into po_headers_inteface */
4125:
4126: x_progress := '50: insert_into_headers_interface: Just about to insert into ' ||
4127: 'po_headers_interface';
4128: IF (g_po_wf_debug = 'Y') THEN

Line 4127: 'po_headers_interface';

4123:
4124: /* Insert into po_headers_inteface */
4125:
4126: x_progress := '50: insert_into_headers_interface: Just about to insert into ' ||
4127: 'po_headers_interface';
4128: IF (g_po_wf_debug = 'Y') THEN
4129: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
4130: END IF;
4131:

Line 4139: insert into po_headers_interface

4135: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
4136: END IF;
4137:
4138: begin
4139: insert into po_headers_interface
4140: (wf_group_id,
4141: interface_header_id,
4142: interface_source_code,
4143: batch_id,

Line 4199: 'inserting into po_headers_interface';

4195:
4196: exception
4197: when others then
4198: x_progress := '55: insert_into_headers_interface: IN EXCEPTION when '||
4199: 'inserting into po_headers_interface';
4200: IF (g_po_wf_debug = 'Y') THEN
4201: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
4202: END IF;
4203:

Line 4208: 'po_headers_interface';

4204: raise;
4205: end;
4206:
4207: x_progress := '60: insert_into_headers_interface: Inserted into ' ||
4208: 'po_headers_interface';
4209: IF (g_po_wf_debug = 'Y') THEN
4210: po_wf_debug_pkg.insert_debug(itemtype,itemkey,x_progress);
4211: END IF;
4212:

Line 4281: from po_headers_all

4277:
4278: if x_source_doc_id is not null then
4279: select global_agreement_flag
4280: into x_ga_flag
4281: from po_headers_all
4282: where po_header_id = x_source_doc_id;
4283: end if;
4284:
4285: /* Bug 2735730.

Line 4315: -- from po_headers

4311: --if (x_contract_id is not null) then
4312: --
4313: -- select max(segment1)
4314: -- into x_contract_num
4315: -- from po_headers
4316: -- where po_header_id = x_contract_id;
4317: --
4318: --end if;
4319:

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

4446: x_agent_id number;
4447: x_org_id number;
4448: l_purchasing_org_id number; --
4449: x_progress varchar2(300);
4450: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE := NULL; --
4451:
4452: cursor c1 is /* x_group_id is a parameter */
4453: select interface_header_id,
4454: document_subtype,

Line 4457: from po_headers_interface

4453: select interface_header_id,
4454: document_subtype,
4455: agent_id,
4456: vendor_site_id --
4457: from po_headers_interface
4458: where wf_group_id = x_group_id
4459: order by interface_header_id;
4460:
4461:

Line 4716: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;

4712: x_org_id number;
4713: x_progress varchar2(300);
4714:
4715: --
4716: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;
4717: l_return_status VARCHAR2(1);
4718: l_msg_count NUMBER;
4719: l_msg_data FND_NEW_MESSAGES.message_text%TYPE;
4720: l_doc_number PO_HEADERS_ALL.segment1%TYPE;

Line 4720: l_doc_number PO_HEADERS_ALL.segment1%TYPE;

4716: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;
4717: l_return_status VARCHAR2(1);
4718: l_msg_count NUMBER;
4719: l_msg_data FND_NEW_MESSAGES.message_text%TYPE;
4720: l_doc_number PO_HEADERS_ALL.segment1%TYPE;
4721: --
4722:
4723: begin
4724:

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

4856: x_autocreated_doc_id number;
4857: l_open_form varchar2(200); --Bug#2982867
4858: l_view_po_url varchar2(1000); -- HTML Orders R12
4859: l_edit_po_url varchar2(1000); -- HTML Orders R12
4860: l_style_id po_headers_all.style_id%TYPE; -- HTML Orders R12
4861:
4862: x_progress varchar2(300);
4863:
4864: begin

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

4906:
4907: if (x_doc_type_to_create = 'STANDARD') then
4908:
4909: --
4910: --Modified the query to select from po_headers_all instead of
4911: --po_headers.
4912: --< HTML Orders R12>
4913: -- selected style id
4914: select segment1,

Line 4911: --po_headers.

4907: if (x_doc_type_to_create = 'STANDARD') then
4908:
4909: --
4910: --Modified the query to select from po_headers_all instead of
4911: --po_headers.
4912: --< HTML Orders R12>
4913: -- selected style id
4914: select segment1,
4915: style_id

Line 4918: from po_headers_all

4914: select segment1,
4915: style_id
4916: into x_segment1,
4917: l_style_id
4918: from po_headers_all
4919: where po_header_id = x_autocreated_doc_id;
4920:
4921:
4922: po_wf_util_pkg.SetItemAttrText (itemtype => itemtype,

Line 4958: from po_headers_all poh, --

4954: select poh.segment1,
4955: por.release_num
4956: into x_segment1,
4957: x_release_num
4958: from po_headers_all poh, --
4959: po_releases por
4960: where por.po_release_id = x_autocreated_doc_id
4961: and por.po_header_id = poh.po_header_id;
4962:

Line 5054: l_doc_type_to_create po_headers_all.type_lookup_code%TYPE;

5050: x_auto_approve_doc varchar2(1);
5051: x_progress varchar2(300);
5052:
5053: --
5054: l_doc_type_to_create po_headers_all.type_lookup_code%TYPE;
5055: l_doc_type po_document_types_all_b.document_type_code%TYPE;
5056: l_doc_subtype po_document_types_all_b.document_subtype%TYPE;
5057: l_po_header_id po_headers_all.po_header_id%TYPE;
5058: l_po_release_id po_releases_all.po_release_id%TYPE;

Line 5057: l_po_header_id po_headers_all.po_header_id%TYPE;

5053: --
5054: l_doc_type_to_create po_headers_all.type_lookup_code%TYPE;
5055: l_doc_type po_document_types_all_b.document_type_code%TYPE;
5056: l_doc_subtype po_document_types_all_b.document_subtype%TYPE;
5057: l_po_header_id po_headers_all.po_header_id%TYPE;
5058: l_po_release_id po_releases_all.po_release_id%TYPE;
5059: l_return_status VARCHAR2(1);
5060: --
5061:

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

5162: x_ItemKey varchar2(60) := null;
5163: x_workflow_process varchar2(40) := null;
5164: x_action_orig_from varchar2(30) := null;
5165: x_doc_id number := null;
5166: x_doc_num po_headers.segment1%type := null; -- Bug 3152167
5167: x_preparer_id number := null;
5168: x_doc_type varchar2(25) := null;
5169: x_doc_subtype varchar2(25) := null;
5170: x_submitter_action varchar2(25) := null;

Line 5189: l_document_num po_headers.segment1%type;

5185: x_default_method varchar2(25) := null;
5186:
5187:
5188: /* RETROACTIVE FPI START */
5189: l_document_num po_headers.segment1%type;
5190: /* RETROACTIVE FPI END */
5191:
5192: /* */
5193: l_consigned_consumption_flag po_headers_all.consigned_consumption_flag%TYPE;

Line 5193: l_consigned_consumption_flag po_headers_all.consigned_consumption_flag%TYPE;

5189: l_document_num po_headers.segment1%type;
5190: /* RETROACTIVE FPI END */
5191:
5192: /* */
5193: l_consigned_consumption_flag po_headers_all.consigned_consumption_flag%TYPE;
5194: /* */
5195:
5196: l_purchasing_org_id po_headers_all.org_id%TYPE; --
5197:

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

5192: /* */
5193: l_consigned_consumption_flag po_headers_all.consigned_consumption_flag%TYPE;
5194: /* */
5195:
5196: l_purchasing_org_id po_headers_all.org_id%TYPE; --
5197:
5198: /* BUG 4638656 */
5199: l_tp_header_id ece_tp_details.tp_header_id%TYPE;
5200: l_edi_flag ece_tp_details.edi_flag%TYPE;

Line 5297: -- from po_headers into x_doc_num

5293: Check if the supplier site on the PO/Release has email as the default notification method.
5294: if so set the email flag and address from the site */
5295:
5296: -- included bug fix 2342323. Modified changes are to retrieve segment1
5297: -- from po_headers into x_doc_num
5298: -- for release, PO or PA
5299: -- Bug 2567900 Included fax number in the select
5300:
5301: /* bug 4638656 - start */

Line 5322: po_headers ph

5318: x_preparer_id
5319: from ece_tp_details etd,
5320: po_vendor_sites pvs,
5321: po_vendors pv,
5322: po_headers ph
5323: where pv.vendor_id = pvs.vendor_id
5324: and pvs.tp_header_id = etd.tp_header_id
5325: and etd.document_id = l_transaction_subtype
5326: and ph.vendor_id = pv.vendor_id

Line 5350: po_headers ph ,

5346: x_preparer_id
5347: from ece_tp_details etd,
5348: po_vendor_sites pvs,
5349: po_vendors pv,
5350: po_headers ph ,
5351: po_releases pr
5352: where pv.vendor_id = pvs.vendor_id
5353: and pvs.tp_header_id = etd.tp_header_id
5354: and etd.document_id = l_transaction_subtype

Line 5878: update po_headers_interface

5874: valid_contact(c_suggested_vendor_site_id, x_suggested_vendor_contact_id)) then
5875: begin
5876: x_progress := '55: group_req_lines: updating header with vendor contact :'||x_interface_header_id;
5877:
5878: update po_headers_interface
5879: set vendor_contact_id = x_suggested_vendor_contact_id
5880: where interface_header_id = x_interface_header_id;
5881:
5882: exception

Line 6245: ( p_table_name => 'PO_HEADERS',

6241: -- bug5176308
6242: -- Call API to get the next document num
6243: x_document_num :=
6244: PO_CORE_SV1.default_po_unique_identifier
6245: ( p_table_name => 'PO_HEADERS',
6246: p_org_id => p_purchasing_org_id
6247: );
6248:
6249:

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

6415: x_progress varchar2(300) := '000';
6416: x_contract_id_valid number;
6417: x_contract_currency_code varchar2(25);
6418: x_source_currency_code PO_REQUISITION_LINES_ALL.currency_code%TYPE;
6419: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE; --
6420: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
6421: begin
6422:
6423: /* When the source doc and source line was put onto the req line

Line 6420: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;

6416: x_contract_id_valid number;
6417: x_contract_currency_code varchar2(25);
6418: x_source_currency_code PO_REQUISITION_LINES_ALL.currency_code%TYPE;
6419: l_vendor_site_id PO_HEADERS_ALL.vendor_site_id%TYPE; --
6420: l_base_currency PO_HEADERS_ALL.currency_code%TYPE;
6421: begin
6422:
6423: /* When the source doc and source line was put onto the req line
6424: * it was all validated to make sure it was ok.

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

6471: -- SQL Why: The reference cannot be used if it is not valid
6472:
6473: select POH.po_header_id, poh.currency_code
6474: into x_contract_id_valid, x_contract_currency_code
6475: from po_headers_all POH -- : Use ALL table
6476: where
6477: POH.po_header_id = x_source_doc_po_header_id
6478: and POH.type_lookup_code = 'CONTRACT'
6479: and nvl(POH.cancel_flag,'N') = 'N'

Line 6706: from po_headers_all

6702:
6703: if x_source_doc_po_header_id is not null then
6704: select org_id
6705: into x_owning_org_id
6706: from po_headers_all
6707: where po_header_id = x_source_doc_po_header_id;
6708: end if;
6709:
6710: if nvl(x_ga_flag,'N') = 'Y' and

Line 6744: from po_headers_all poh

6740:
6741: --Check the referenced GA for cancel/finally closed status
6742: select 'Y'
6743: into x_ref_is_valid
6744: from po_headers_all poh
6745: where poh.po_header_id = p_ga_po_header_id and
6746: nvl(poh.cancel_flag, 'N') = 'N' and
6747: nvl(poh.closed_code, 'OPEN') <> 'FINALLY CLOSED';
6748:

Line 6840: x_org_id PO_HEADERS_ALL.org_id%TYPE;

6836: actid IN NUMBER,
6837: funcmode IN VARCHAR2,
6838: resultout OUT NOCOPY VARCHAR2
6839: ) IS
6840: x_org_id PO_HEADERS_ALL.org_id%TYPE;
6841: x_progress VARCHAR2(300);
6842: x_source_doc_po_header_id PO_HEADERS_ALL.po_header_id%TYPE;
6843: x_source_doc_type_code PO_HEADERS_ALL.from_type_lookup_code%TYPE;
6844: x_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;

Line 6842: x_source_doc_po_header_id PO_HEADERS_ALL.po_header_id%TYPE;

6838: resultout OUT NOCOPY VARCHAR2
6839: ) IS
6840: x_org_id PO_HEADERS_ALL.org_id%TYPE;
6841: x_progress VARCHAR2(300);
6842: x_source_doc_po_header_id PO_HEADERS_ALL.po_header_id%TYPE;
6843: x_source_doc_type_code PO_HEADERS_ALL.from_type_lookup_code%TYPE;
6844: x_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
6845: l_return_status VARCHAR2(1) := 'N';
6846:

Line 6843: x_source_doc_type_code PO_HEADERS_ALL.from_type_lookup_code%TYPE;

6839: ) IS
6840: x_org_id PO_HEADERS_ALL.org_id%TYPE;
6841: x_progress VARCHAR2(300);
6842: x_source_doc_po_header_id PO_HEADERS_ALL.po_header_id%TYPE;
6843: x_source_doc_type_code PO_HEADERS_ALL.from_type_lookup_code%TYPE;
6844: x_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
6845: l_return_status VARCHAR2(1) := 'N';
6846:
6847: BEGIN

Line 6844: x_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;

6840: x_org_id PO_HEADERS_ALL.org_id%TYPE;
6841: x_progress VARCHAR2(300);
6842: x_source_doc_po_header_id PO_HEADERS_ALL.po_header_id%TYPE;
6843: x_source_doc_type_code PO_HEADERS_ALL.from_type_lookup_code%TYPE;
6844: x_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
6845: l_return_status VARCHAR2(1) := 'N';
6846:
6847: BEGIN
6848: --Set org context

Line 6888: FROM po_headers_all poh,

6884: BEGIN
6885:
6886: SELECT 'Y'
6887: INTO l_return_status
6888: FROM po_headers_all poh,
6889: per_people_f ppf,
6890: financials_system_parameters fsp
6891: WHERE poh.agent_id = ppf.person_id
6892: AND ppf.business_group_id = fsp.business_group_id

Line 6972: x_org_id PO_HEADERS_ALL.org_id%TYPE;

6968: actid IN NUMBER,
6969: funcmode IN VARCHAR2,
6970: resultout OUT NOCOPY VARCHAR2
6971: ) IS
6972: x_org_id PO_HEADERS_ALL.org_id%TYPE;
6973: x_progress VARCHAR2(300);
6974: x_contract_id NUMBER;
6975: l_return_status VARCHAR2(1) := 'N';
6976:

Line 7000: FROM po_headers_all poh,

6996: IF x_contract_id IS NOT NULL THEN
6997: BEGIN
6998: SELECT 'Y'
6999: INTO l_return_status
7000: FROM po_headers_all poh,
7001: per_people_f ppf,
7002: financials_system_parameters fsp
7003: WHERE poh.agent_id = ppf.person_id
7004: AND ppf.business_group_id = fsp.business_group_id

Line 7088: l_org_id PO_HEADERS_ALL.org_id%TYPE;

7084: funcmode IN VARCHAR2,
7085: resultout OUT NOCOPY VARCHAR2
7086: ) IS
7087:
7088: l_org_id PO_HEADERS_ALL.org_id%TYPE;
7089: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;
7090: x_progress VARCHAR2(300);
7091:
7092: BEGIN

Line 7089: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;

7085: resultout OUT NOCOPY VARCHAR2
7086: ) IS
7087:
7088: l_org_id PO_HEADERS_ALL.org_id%TYPE;
7089: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;
7090: x_progress VARCHAR2(300);
7091:
7092: BEGIN
7093:

Line 7337: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;

7333: p_suggested_vendor_site_id IN NUMBER
7334: )
7335: IS
7336:
7337: l_purchasing_org_id PO_HEADERS_ALL.org_id%TYPE;
7338: l_progress VARCHAR2(300);
7339:
7340: BEGIN
7341: