DBA Data[Home] [Help]

APPS.CSTPPACQ dependencies on CST_RCV_ACQ_COST_DETAILS

Line 1018: --'PRICE_CORRECTION' into cst_rcv_acq_cost_details for Invoice source.

1014: --AP price correction documents should NOT be restricted only
1015: --for invoice type lookup code 'PO PRICE ADJUST'. It is possible that AP price
1016: --corrections can be of invoice type lookup code 'CREDIT','DEBIT','STANDARD'.
1017: --so inserted separate lines for each line type of the DIST MATCH TYPE
1018: --'PRICE_CORRECTION' into cst_rcv_acq_cost_details for Invoice source.
1019: --------------------------------------------------------------------------------
1020:
1021:
1022:

Line 1025: select cst_rcv_acq_cost_details_s.nextval into l_details_nextvalue FROM dual ;

1021:
1022:
1023: FOR i in c_price_correction(c_inv.invoice_distribution_id) LOOP
1024:
1025: select cst_rcv_acq_cost_details_s.nextval into l_details_nextvalue FROM dual ;
1026:
1027: Insert_into_acqdtls_tables (
1028: l_header,
1029: l_details_nextvalue,

Line 1077: -- 2.4.1.1 Insert into CST_RCV_ACQ_COST_DETAILS table

1073: NULL,
1074: NULL);
1075:
1076: ---------------------------------------------------------------
1077: -- 2.4.1.1 Insert into CST_RCV_ACQ_COST_DETAILS table
1078: ---------------------------------------------------------------
1079:
1080: l_stmt_num := 100;
1081:

Line 1104: select cst_rcv_acq_cost_details_s.nextval into l_details_nextvalue

1100: END;
1101:
1102: If l_chrg_present = 0 then /* means that this has not been allocated */
1103:
1104: select cst_rcv_acq_cost_details_s.nextval into l_details_nextvalue
1105: from dual;
1106:
1107: l_stmt_num := 105;
1108:

Line 1361: INSERT INTO cst_rcv_acq_cost_details (

1357: o_err_num => l_err_num,
1358: o_err_msg => l_err_msg );
1359:
1360: l_stmt_num := 1090;
1361: INSERT INTO cst_rcv_acq_cost_details (
1362: HEADER_ID,
1363: DETAIL_ID,
1364: SOURCE_TYPE,
1365: PO_LINE_LOCATION_ID,

Line 1389: cst_rcv_acq_cost_details_s.nextval,

1385: LAST_UPDATE_LOGIN
1386: )
1387: VALUES (
1388: l_header_id,
1389: cst_rcv_acq_cost_details_s.nextval,
1390: 'LCM',
1391: l_po_line_loc,
1392: NULL,
1393: -1,

Line 1521: Delete from cst_rcv_acq_cost_details_adj cracda

1517: and period_id = i_period
1518: and cost_type_id = i_cost_type_id
1519: );
1520: l_stmt_num := 1125;
1521: Delete from cst_rcv_acq_cost_details_adj cracda
1522: where cracda.header_id = (select header_id from cst_rcv_acq_costs_adj craca
1523: where craca.rcv_transaction_id = c_rec.rcv_transaction_id
1524: and cost_group_id = i_cost_group_id
1525: and period_id = i_period

Line 1690: INSERT INTO cst_rcv_acq_cost_details_adj (

1686: o_err_num => l_err_num,
1687: o_err_msg => l_err_msg );
1688:
1689: l_stmt_num := 1230;
1690: INSERT INTO cst_rcv_acq_cost_details_adj (
1691: HEADER_ID,
1692: DETAIL_ID,
1693: SOURCE_TYPE,
1694: PO_LINE_LOCATION_ID,

Line 1718: cst_rcv_acq_cost_details_s.nextval,

1714: LAST_UPDATE_LOGIN
1715: )
1716: VALUES (
1717: l_header_id,
1718: cst_rcv_acq_cost_details_s.nextval,
1719: 'LCM',
1720: c_rec.line_location_id,
1721: NULL,
1722: -1,

Line 2393: Delete from cst_rcv_acq_cost_details_adj cracda

2389: and craca.cost_type_id = i_cost_type_id );
2390:
2391: l_stmt_num := 81;
2392:
2393: Delete from cst_rcv_acq_cost_details_adj cracda
2394: where cracda.header_id = (select header_id from cst_rcv_acq_costs_adj craca
2395: where craca.rcv_transaction_id = l_rec_transaction_id
2396: and cost_group_id = i_cost_group_id
2397: and period_id = i_period

Line 2848: --'PRICE_CORRECTION' into cst_rcv_acq_cost_details for Invoice source.

2844: --AP price correction documents should NOT be restricted only
2845: --for invoice type lookup code 'PO PRICE ADJUST'. It is possible that AP price
2846: --corrections can be of invoice type lookup code 'CREDIT','DEBIT','STANDARD'.
2847: --so inserted separate lines for each line type of the DIST MATCH TYPE
2848: --'PRICE_CORRECTION' into cst_rcv_acq_cost_details for Invoice source.
2849: --------------------------------------------------------------------------------
2850:
2851: FOR i in c_price_correction(c_inv.invoice_distribution_id) LOOP
2852:

Line 2853: select cst_rcv_acq_cost_details_s.nextval into l_details_nextvalue FROM dual ;

2849: --------------------------------------------------------------------------------
2850:
2851: FOR i in c_price_correction(c_inv.invoice_distribution_id) LOOP
2852:
2853: select cst_rcv_acq_cost_details_s.nextval into l_details_nextvalue FROM dual ;
2854:
2855: Insert_into_acqdtls_tables (
2856: l_header,
2857: l_details_nextvalue,

Line 2906: -- 2.4.1.1 Insert into CST_RCV_ACQ_COST_DETAILS table

2902: NULL,
2903: NULL);
2904:
2905: ---------------------------------------------------------------
2906: -- 2.4.1.1 Insert into CST_RCV_ACQ_COST_DETAILS table
2907: ---------------------------------------------------------------
2908:
2909: l_stmt_num := 101;
2910:

Line 2934: select cst_rcv_acq_cost_details_s.nextval into l_details_nextvalue

2930: END;
2931:
2932: If l_chrg_present = 0 then /* means that this has not been allocated */
2933:
2934: select cst_rcv_acq_cost_details_s.nextval into l_details_nextvalue
2935: from dual;
2936:
2937: l_stmt_num := 106;
2938:

Line 3423: cst_rcv_acq_cost_details ( -- cracd2

3419: charge, just examine whether the charge_applicable_to_dist_id is not null
3420: */
3421:
3422: INSERT INTO
3423: cst_rcv_acq_cost_details ( -- cracd2
3424: HEADER_ID,
3425: DETAIL_ID,
3426: SOURCE_TYPE,
3427: PO_LINE_LOCATION_ID,

Line 3451: cst_rcv_acq_cost_details_s.nextval,

3447: LAST_UPDATE_LOGIN
3448: )
3449: SELECT
3450: i_hdr,
3451: cst_rcv_acq_cost_details_s.nextval,
3452: 'INVOICE',
3453: NULL,
3454: i_item_dist,
3455: rownum + 1,

Line 3503: cst_rcv_acq_cost_details cracd3

3499: -- and update the CRACD rows just created
3500: ----------------------------------------------------------
3501:
3502: UPDATE
3503: cst_rcv_acq_cost_details cracd3
3504: SET
3505: cracd3.parent_amount = (
3506: SELECT
3507: nvl(ad7.base_amount,nvl(ad7.amount,0))

Line 3541: cst_rcv_acq_cost_details cracd4

3537:
3538: /* bug 4965847 changed query to join with parent_invoice_dist_id rather than parent_distribution_id*/
3539:
3540: UPDATE
3541: cst_rcv_acq_cost_details cracd4
3542: SET
3543: cracd4.amount = cracd4.allocated_amount -- amount in func curr
3544: WHERE
3545: cracd4.header_id = i_hdr AND

Line 3650: cst_rcv_acq_cost_details_adj ( -- cracd2

3646: charge, just examine whether the charge_applicable_to_dist_id is not null
3647: */
3648:
3649: INSERT INTO
3650: cst_rcv_acq_cost_details_adj ( -- cracd2
3651: HEADER_ID,
3652: DETAIL_ID,
3653: SOURCE_TYPE,
3654: PO_LINE_LOCATION_ID,

Line 3678: cst_rcv_acq_cost_details_s.nextval,

3674: LAST_UPDATE_LOGIN
3675: )
3676: SELECT
3677: i_hdr,
3678: cst_rcv_acq_cost_details_s.nextval,
3679: 'INVOICE',
3680: NULL,
3681: i_item_dist,
3682: rownum + 1,

Line 3729: cst_rcv_acq_cost_details_adj cracd3

3725: ----------------------------------------------------------
3726:
3727:
3728: UPDATE
3729: cst_rcv_acq_cost_details_adj cracd3
3730: SET
3731: cracd3.parent_amount = (
3732: SELECT
3733: nvl(ad7.base_amount,nvl(ad7.amount,0))

Line 3767: cst_rcv_acq_cost_details_adj cracd4

3763:
3764: /* bug 4965847 changed query to join with parent_invoice_dist_id rather than parent_distribution_id*/
3765:
3766: UPDATE
3767: cst_rcv_acq_cost_details_adj cracd4
3768: SET
3769: cracd4.amount = cracd4.allocated_amount -- amount in func curr
3770: WHERE
3771: cracd4.header_id = i_hdr AND

Line 3813: l_total_invoice_amount cst_rcv_acq_cost_details.amount%TYPE;

3809: o_err_num OUT NOCOPY NUMBER,
3810: o_err_code OUT NOCOPY VARCHAR2,
3811: o_err_msg OUT NOCOPY VARCHAR2)
3812: IS
3813: l_total_invoice_amount cst_rcv_acq_cost_details.amount%TYPE;
3814: l_qty_invoiced cst_rcv_acq_cost_details.quantity%TYPE;
3815: l_qty_at_po cst_rcv_acq_cost_details.quantity%TYPE;
3816: l_costed_quantity cst_rcv_acq_cost_details.quantity%TYPE;
3817: l_amount_at_po cst_rcv_acq_cost_details.amount%TYPE;

Line 3814: l_qty_invoiced cst_rcv_acq_cost_details.quantity%TYPE;

3810: o_err_code OUT NOCOPY VARCHAR2,
3811: o_err_msg OUT NOCOPY VARCHAR2)
3812: IS
3813: l_total_invoice_amount cst_rcv_acq_cost_details.amount%TYPE;
3814: l_qty_invoiced cst_rcv_acq_cost_details.quantity%TYPE;
3815: l_qty_at_po cst_rcv_acq_cost_details.quantity%TYPE;
3816: l_costed_quantity cst_rcv_acq_cost_details.quantity%TYPE;
3817: l_amount_at_po cst_rcv_acq_cost_details.amount%TYPE;
3818: l_total_amount cst_rcv_acq_cost_details.amount%TYPE;

Line 3815: l_qty_at_po cst_rcv_acq_cost_details.quantity%TYPE;

3811: o_err_msg OUT NOCOPY VARCHAR2)
3812: IS
3813: l_total_invoice_amount cst_rcv_acq_cost_details.amount%TYPE;
3814: l_qty_invoiced cst_rcv_acq_cost_details.quantity%TYPE;
3815: l_qty_at_po cst_rcv_acq_cost_details.quantity%TYPE;
3816: l_costed_quantity cst_rcv_acq_cost_details.quantity%TYPE;
3817: l_amount_at_po cst_rcv_acq_cost_details.amount%TYPE;
3818: l_total_amount cst_rcv_acq_cost_details.amount%TYPE;
3819: l_acq_cost cst_rcv_acq_costs.acquisition_cost%TYPE;

Line 3816: l_costed_quantity cst_rcv_acq_cost_details.quantity%TYPE;

3812: IS
3813: l_total_invoice_amount cst_rcv_acq_cost_details.amount%TYPE;
3814: l_qty_invoiced cst_rcv_acq_cost_details.quantity%TYPE;
3815: l_qty_at_po cst_rcv_acq_cost_details.quantity%TYPE;
3816: l_costed_quantity cst_rcv_acq_cost_details.quantity%TYPE;
3817: l_amount_at_po cst_rcv_acq_cost_details.amount%TYPE;
3818: l_total_amount cst_rcv_acq_cost_details.amount%TYPE;
3819: l_acq_cost cst_rcv_acq_costs.acquisition_cost%TYPE;
3820: l_cracd_count NUMBER := 0;

Line 3817: l_amount_at_po cst_rcv_acq_cost_details.amount%TYPE;

3813: l_total_invoice_amount cst_rcv_acq_cost_details.amount%TYPE;
3814: l_qty_invoiced cst_rcv_acq_cost_details.quantity%TYPE;
3815: l_qty_at_po cst_rcv_acq_cost_details.quantity%TYPE;
3816: l_costed_quantity cst_rcv_acq_cost_details.quantity%TYPE;
3817: l_amount_at_po cst_rcv_acq_cost_details.amount%TYPE;
3818: l_total_amount cst_rcv_acq_cost_details.amount%TYPE;
3819: l_acq_cost cst_rcv_acq_costs.acquisition_cost%TYPE;
3820: l_cracd_count NUMBER := 0;
3821: l_stmt_num NUMBER := 0;

Line 3818: l_total_amount cst_rcv_acq_cost_details.amount%TYPE;

3814: l_qty_invoiced cst_rcv_acq_cost_details.quantity%TYPE;
3815: l_qty_at_po cst_rcv_acq_cost_details.quantity%TYPE;
3816: l_costed_quantity cst_rcv_acq_cost_details.quantity%TYPE;
3817: l_amount_at_po cst_rcv_acq_cost_details.amount%TYPE;
3818: l_total_amount cst_rcv_acq_cost_details.amount%TYPE;
3819: l_acq_cost cst_rcv_acq_costs.acquisition_cost%TYPE;
3820: l_cracd_count NUMBER := 0;
3821: l_stmt_num NUMBER := 0;
3822: CST_NULL_ACQ_COST EXCEPTION;

Line 3845: FROM cst_rcv_acq_cost_details cracd9

3841: -----------------------------------------------------------
3842:
3843: SELECT count(header_id)
3844: INTO l_cracd_count
3845: FROM cst_rcv_acq_cost_details cracd9
3846: WHERE cracd9.header_id = i_header
3847: AND ROWNUM < 2;
3848:
3849: -------------------------------------------------------------

Line 3866: cst_rcv_acq_cost_details cracd10

3862: SUM(cracd10.amount)
3863: INTO
3864: l_total_invoice_amount
3865: FROM
3866: cst_rcv_acq_cost_details cracd10
3867: WHERE
3868: cracd10.header_id = i_header;
3869:
3870: ----------------------------------------------------------

Line 3881: cst_rcv_acq_cost_details cracd11

3877: SUM(nvl(cracd11.quantity,0))
3878: INTO
3879: l_qty_invoiced
3880: FROM
3881: cst_rcv_acq_cost_details cracd11
3882: WHERE
3883: cracd11.header_id = i_header;
3884:
3885: ELSE

Line 3959: cst_rcv_acq_cost_details ( --cracd12

3955:
3956: l_stmt_num := 40;
3957:
3958: INSERT INTO
3959: cst_rcv_acq_cost_details ( --cracd12
3960: HEADER_ID,
3961: DETAIL_ID,
3962: SOURCE_TYPE,
3963: PO_LINE_LOCATION_ID,

Line 3987: cst_rcv_acq_cost_details_s.nextval,

3983: LAST_UPDATE_LOGIN
3984: )
3985: VALUES (
3986: i_header,
3987: cst_rcv_acq_cost_details_s.nextval,
3988: 'PO',
3989: i_po_line_loc,
3990: NULL,
3991: -1,

Line 4052: l_total_invoice_amount cst_rcv_acq_cost_details_adj.amount%TYPE;

4048: o_err_num OUT NOCOPY NUMBER,
4049: o_err_code OUT NOCOPY VARCHAR2,
4050: o_err_msg OUT NOCOPY VARCHAR2)
4051: IS
4052: l_total_invoice_amount cst_rcv_acq_cost_details_adj.amount%TYPE;
4053: l_qty_invoiced cst_rcv_acq_cost_details_adj.quantity%TYPE;
4054: l_qty_at_po cst_rcv_acq_cost_details_adj.quantity%TYPE;
4055: l_costed_quantity cst_rcv_acq_cost_details_adj.quantity%TYPE;
4056: l_amount_at_po cst_rcv_acq_cost_details_adj.amount%TYPE;

Line 4053: l_qty_invoiced cst_rcv_acq_cost_details_adj.quantity%TYPE;

4049: o_err_code OUT NOCOPY VARCHAR2,
4050: o_err_msg OUT NOCOPY VARCHAR2)
4051: IS
4052: l_total_invoice_amount cst_rcv_acq_cost_details_adj.amount%TYPE;
4053: l_qty_invoiced cst_rcv_acq_cost_details_adj.quantity%TYPE;
4054: l_qty_at_po cst_rcv_acq_cost_details_adj.quantity%TYPE;
4055: l_costed_quantity cst_rcv_acq_cost_details_adj.quantity%TYPE;
4056: l_amount_at_po cst_rcv_acq_cost_details_adj.amount%TYPE;
4057: l_total_amount cst_rcv_acq_cost_details_adj.amount%TYPE;

Line 4054: l_qty_at_po cst_rcv_acq_cost_details_adj.quantity%TYPE;

4050: o_err_msg OUT NOCOPY VARCHAR2)
4051: IS
4052: l_total_invoice_amount cst_rcv_acq_cost_details_adj.amount%TYPE;
4053: l_qty_invoiced cst_rcv_acq_cost_details_adj.quantity%TYPE;
4054: l_qty_at_po cst_rcv_acq_cost_details_adj.quantity%TYPE;
4055: l_costed_quantity cst_rcv_acq_cost_details_adj.quantity%TYPE;
4056: l_amount_at_po cst_rcv_acq_cost_details_adj.amount%TYPE;
4057: l_total_amount cst_rcv_acq_cost_details_adj.amount%TYPE;
4058: l_acq_cost cst_rcv_acq_costs_adj.acquisition_cost%TYPE;

Line 4055: l_costed_quantity cst_rcv_acq_cost_details_adj.quantity%TYPE;

4051: IS
4052: l_total_invoice_amount cst_rcv_acq_cost_details_adj.amount%TYPE;
4053: l_qty_invoiced cst_rcv_acq_cost_details_adj.quantity%TYPE;
4054: l_qty_at_po cst_rcv_acq_cost_details_adj.quantity%TYPE;
4055: l_costed_quantity cst_rcv_acq_cost_details_adj.quantity%TYPE;
4056: l_amount_at_po cst_rcv_acq_cost_details_adj.amount%TYPE;
4057: l_total_amount cst_rcv_acq_cost_details_adj.amount%TYPE;
4058: l_acq_cost cst_rcv_acq_costs_adj.acquisition_cost%TYPE;
4059: l_cracd_count NUMBER := 0;

Line 4056: l_amount_at_po cst_rcv_acq_cost_details_adj.amount%TYPE;

4052: l_total_invoice_amount cst_rcv_acq_cost_details_adj.amount%TYPE;
4053: l_qty_invoiced cst_rcv_acq_cost_details_adj.quantity%TYPE;
4054: l_qty_at_po cst_rcv_acq_cost_details_adj.quantity%TYPE;
4055: l_costed_quantity cst_rcv_acq_cost_details_adj.quantity%TYPE;
4056: l_amount_at_po cst_rcv_acq_cost_details_adj.amount%TYPE;
4057: l_total_amount cst_rcv_acq_cost_details_adj.amount%TYPE;
4058: l_acq_cost cst_rcv_acq_costs_adj.acquisition_cost%TYPE;
4059: l_cracd_count NUMBER := 0;
4060: l_stmt_num NUMBER := 0;

Line 4057: l_total_amount cst_rcv_acq_cost_details_adj.amount%TYPE;

4053: l_qty_invoiced cst_rcv_acq_cost_details_adj.quantity%TYPE;
4054: l_qty_at_po cst_rcv_acq_cost_details_adj.quantity%TYPE;
4055: l_costed_quantity cst_rcv_acq_cost_details_adj.quantity%TYPE;
4056: l_amount_at_po cst_rcv_acq_cost_details_adj.amount%TYPE;
4057: l_total_amount cst_rcv_acq_cost_details_adj.amount%TYPE;
4058: l_acq_cost cst_rcv_acq_costs_adj.acquisition_cost%TYPE;
4059: l_cracd_count NUMBER := 0;
4060: l_stmt_num NUMBER := 0;
4061: l_acq_adjustment_amount NUMBER := 0;

Line 4121: FROM cst_rcv_acq_cost_details_adj cracd9

4117: -----------------------------------------------------------
4118:
4119: SELECT count(header_id)
4120: INTO l_cracd_count
4121: FROM cst_rcv_acq_cost_details_adj cracd9
4122: WHERE cracd9.header_id = i_header
4123: AND ROWNUM < 2;
4124:
4125: -------------------------------------------------------------

Line 4141: cst_rcv_acq_cost_details_adj cracd10

4137: SUM(cracd10.amount)
4138: INTO
4139: l_total_invoice_amount
4140: FROM
4141: cst_rcv_acq_cost_details_adj cracd10
4142: WHERE
4143: cracd10.header_id = i_header;
4144:
4145: ----------------------------------------------------------

Line 4156: cst_rcv_acq_cost_details_adj cracd11

4152: SUM(nvl(cracd11.quantity,0))
4153: INTO
4154: l_qty_invoiced
4155: FROM
4156: cst_rcv_acq_cost_details_adj cracd11
4157: WHERE
4158: cracd11.header_id = i_header;
4159:
4160: ELSE

Line 4231: cst_rcv_acq_cost_details_adj ( --cracd12

4227:
4228: l_stmt_num := 40;
4229:
4230: INSERT INTO
4231: cst_rcv_acq_cost_details_adj ( --cracd12
4232: HEADER_ID,
4233: DETAIL_ID,
4234: SOURCE_TYPE,
4235: PO_LINE_LOCATION_ID,

Line 4259: cst_rcv_acq_cost_details_s.nextval,

4255: LAST_UPDATE_LOGIN
4256: )
4257: VALUES (
4258: i_header,
4259: cst_rcv_acq_cost_details_s.nextval,
4260: 'PO',
4261: i_po_line_loc,
4262: NULL,
4263: -1,

Line 5537: Insert into cst_rcv_acq_cost_details(

5533: BEGIN
5534:
5535: IF i_source_flag = 1 then
5536:
5537: Insert into cst_rcv_acq_cost_details(
5538: HEADER_ID,
5539: DETAIL_ID,
5540: SOURCE_TYPE,
5541: PO_LINE_LOCATION_ID,

Line 5594: Insert into cst_rcv_acq_cost_details_adj(

5590: ELSIF i_source_flag = 2 then
5591:
5592: l_stmt_no := 20;
5593:
5594: Insert into cst_rcv_acq_cost_details_adj(
5595: HEADER_ID,
5596: DETAIL_ID,
5597: SOURCE_TYPE,
5598: PO_LINE_LOCATION_ID,