DBA Data[Home] [Help]

APPS.PO_DOCUMENT_UPDATE_PVT dependencies on PO_DISTRIBUTIONS

Line 856: p_table_name => 'PO_DISTRIBUTIONS_ALL',

852: add_error (
853: p_api_errors => g_api_errors,
854: x_return_status => x_return_status,
855: p_message_name => 'PO_GENERIC_ERROR',
856: p_table_name => 'PO_DISTRIBUTIONS_ALL',
857: p_token_name1 => 'ERROR_TEXT',
858: p_token_value1 => 'You cannot specify both po_distribution_id and parent_distribution_id / split_shipment_num for a distribution change.',
859: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
860: p_entity_id => i

Line 868: FROM po_distributions

864: BEGIN
865: IF (g_po_header_id IS NOT NULL) THEN -- PO / PA
866: SELECT 1
867: INTO l_dummy
868: FROM po_distributions
869: WHERE po_header_id = g_po_header_id
870: AND po_distribution_id =
871: NVL(p_chg.distribution_changes.po_distribution_id(i),
872: p_chg.distribution_changes.parent_distribution_id(i));

Line 876: FROM po_distributions

872: p_chg.distribution_changes.parent_distribution_id(i));
873: ELSE -- release
874: SELECT 1
875: INTO l_dummy
876: FROM po_distributions
877: WHERE po_release_id = g_po_release_id
878: AND po_distribution_id =
879: NVL(p_chg.distribution_changes.po_distribution_id(i),
880: p_chg.distribution_changes.parent_distribution_id(i));

Line 889: p_table_name => 'PO_DISTRIBUTIONS_ALL',

885: add_error (
886: p_api_errors => g_api_errors,
887: x_return_status => x_return_status,
888: p_message_name => 'PO_INVALID_DOC_IDS',
889: p_table_name => 'PO_DISTRIBUTIONS_ALL',
890: p_column_name => 'PO_DISTRIBUTION_ID',
891: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
892: p_entity_id => i
893: );

Line 1361: l_parent_dist_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;

1357: PROCEDURE populate_dist_cached_fields (
1358: p_chg IN OUT NOCOPY PO_CHANGES_REC_TYPE,
1359: i IN NUMBER
1360: ) IS
1361: l_parent_dist_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;
1362: BEGIN
1363: l_parent_dist_id := p_chg.distribution_changes.parent_distribution_id(i);
1364:
1365: -- SQL What: Retrieve all the database field values that will be needed

Line 1443: FROM po_distributions POD, po_lines POL, po_line_types PLT,po_line_locations_all PLL --

1439: p_chg.distribution_changes.c_distribution_num(i),
1440: p_chg.distribution_changes.c_encumbered_flag(i),
1441: p_chg.distribution_changes.c_req_distribution_id(i),
1442: p_chg.distribution_changes.c_creation_date(i)
1443: FROM po_distributions POD, po_lines POL, po_line_types PLT,po_line_locations_all PLL -- 1444: WHERE POD.po_distribution_id =
1445: NVL( p_chg.distribution_changes.parent_distribution_id(i), -- split dist
1446: p_chg.distribution_changes.po_distribution_id(i) ) -- existing dist
1447: AND POL.po_line_id = POD.po_line_id -- JOIN

Line 2106: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2102: AND (p_chg.distribution_changes.amount_ordered(i) IS NULL) THEN
2103: add_error ( p_api_errors => g_api_errors,
2104: x_return_status => x_return_status,
2105: p_message_name => 'PO_CHNG_SPLIT_DIST_QTY_AMT',
2106: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2107: p_column_name => NULL,
2108: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
2109: p_entity_id => i );
2110: END IF;

Line 2126: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2122:
2123: add_error ( p_api_errors => g_api_errors,
2124: x_return_status => x_return_status,
2125: p_message_name => 'PO_CHNG_SPLIT_DIST_SHIP_NUM',
2126: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2127: p_column_name => NULL,
2128: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
2129: p_entity_id => i );
2130: END IF;

Line 2140: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2136: IF (p_chg.distribution_changes.delete_record(i) = G_PARAMETER_YES) THEN
2137: add_error ( p_api_errors => g_api_errors,
2138: x_return_status => x_return_status,
2139: p_message_name => 'PO_CHNG_SPLIT_DIST_NO_DELETE',
2140: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2141: p_column_name => NULL,
2142: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
2143: p_entity_id => i );
2144: END IF; -- delete_record

Line 2274: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2270: IF (p_chg.distribution_changes.get_count > 0) THEN
2271: add_error ( p_api_errors => g_api_errors,
2272: x_return_status => x_return_status,
2273: p_message_name => 'PO_CHNG_BLKT_NO_DISTS',
2274: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2275: p_column_name => null,
2276: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS );
2277: END IF;
2278:

Line 2551: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2547: IF (p_chg.distribution_changes.quantity_ordered(i) IS NOT NULL) THEN
2548: add_error ( p_api_errors => g_api_errors,
2549: x_return_status => x_return_status,
2550: p_message_name => 'PO_SVC_NO_QTY',
2551: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2552: p_column_name => 'QUANTITY',
2553: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
2554: p_entity_id => i );
2555: END IF;

Line 2569: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2565: IF (p_chg.distribution_changes.amount_ordered(i) IS NOT NULL) THEN
2566: add_error ( p_api_errors => g_api_errors,
2567: x_return_status => x_return_status,
2568: p_message_name => 'PO_SVC_NO_AMT',
2569: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2570: p_column_name => 'AMOUNT',
2571: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
2572: p_entity_id => i );
2573: END IF;

Line 2647: ELSE -- PO_DISTRIBUTIONS_REC_TYPE

2643: l_table_name := 'PO_LINE_LOCATIONS_ALL';
2644: l_qty_column_name := 'QUANTITY';
2645: l_price_column_name := 'PRICE_OVERRIDE';
2646: l_amt_column_name := 'AMOUNT';
2647: ELSE -- PO_DISTRIBUTIONS_REC_TYPE
2648: l_new_quantity := p_chg.distribution_changes.quantity_ordered(i);
2649: l_new_price := NULL;
2650: l_new_amount := p_chg.distribution_changes.amount_ordered(i);
2651:

Line 2652: l_table_name := 'PO_DISTRIBUTIONS_ALL';

2648: l_new_quantity := p_chg.distribution_changes.quantity_ordered(i);
2649: l_new_price := NULL;
2650: l_new_amount := p_chg.distribution_changes.amount_ordered(i);
2651:
2652: l_table_name := 'PO_DISTRIBUTIONS_ALL';
2653: l_qty_column_name := 'QUANTITY_ORDERED';
2654: l_amt_column_name := 'AMOUNT_ORDERED';
2655: END IF; -- p_entity_type
2656:

Line 4307: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4303: l_new_line_qty_amt PO_LINES.quantity%TYPE;
4304: l_cur_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4305: l_exist_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4306: l_new_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4307: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4308: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4309:
4310: --
4311: l_cur_line_amt PO_LINES.amount%type;

Line 4308: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4304: l_cur_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4305: l_exist_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4306: l_new_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4307: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4308: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4309:
4310: --
4311: l_cur_line_amt PO_LINES.amount%type;
4312: l_exist_ship_amt PO_LINE_LOCATIONS.amount%type;

Line 4658: p_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE

4654:
4655: -- SQL What: Retrieves all the distributions of a given shipment.
4656: -- SQL Why: To prorate shipment quantity/amount changes to the distributions.
4657: CURSOR po_distribution_csr (
4658: p_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE
4659: ) IS
4660: SELECT po_distribution_id, distribution_num, quantity_ordered, amount_ordered
4661: FROM po_distributions
4662: WHERE line_location_id = p_line_location_id

Line 4661: FROM po_distributions

4657: CURSOR po_distribution_csr (
4658: p_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE
4659: ) IS
4660: SELECT po_distribution_id, distribution_num, quantity_ordered, amount_ordered
4661: FROM po_distributions
4662: WHERE line_location_id = p_line_location_id
4663: ORDER by distribution_num ASC;
4664:
4665: l_po_line_id PO_LINES.po_line_id%TYPE;

Line 4668: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;

4664:
4665: l_po_line_id PO_LINES.po_line_id%TYPE;
4666: l_line_location_id PO_LINE_LOCATIONS.line_location_id%TYPE;
4667: l_parent_line_loc_id PO_LINE_LOCATIONS.line_location_id%TYPE;
4668: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;
4669:
4670: l_exist_line_qty_amt PO_LINES.quantity%TYPE;
4671: l_new_line_qty_amt PO_LINES.quantity%TYPE;
4672: l_exist_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;

Line 4676: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4672: l_exist_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4673: l_new_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4674: l_cum_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4675: l_split_shipment_num PO_LINE_LOCATIONS.shipment_num%TYPE;
4676: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4677: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4678: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4679: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4680: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

Line 4677: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;

4673: l_new_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4674: l_cum_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4675: l_split_shipment_num PO_LINE_LOCATIONS.shipment_num%TYPE;
4676: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4677: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4678: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4679: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4680: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4681: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;

Line 4678: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4674: l_cum_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4675: l_split_shipment_num PO_LINE_LOCATIONS.shipment_num%TYPE;
4676: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4677: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4678: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4679: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4680: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4681: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4682: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;

Line 4679: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4675: l_split_shipment_num PO_LINE_LOCATIONS.shipment_num%TYPE;
4676: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4677: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4678: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4679: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4680: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4681: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4682: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4683:

Line 4680: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4676: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4677: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4678: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4679: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4680: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4681: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4682: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4683:
4684: l_ship_chg_i NUMBER;

Line 4681: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;

4677: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4678: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4679: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4680: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4681: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4682: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4683:
4684: l_ship_chg_i NUMBER;
4685: l_dist_chg_i NUMBER;

Line 4682: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;

4678: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4679: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4680: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4681: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4682: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4683:
4684: l_ship_chg_i NUMBER;
4685: l_dist_chg_i NUMBER;
4686: l_amt_based BOOLEAN;

Line 4852: FROM po_distributions

4848:
4849: -- SQL What: Retrieve the maximum distribution number of this shipment.
4850: SELECT max(distribution_num)
4851: INTO l_max_dist_num
4852: FROM po_distributions
4853: WHERE line_location_id = NVL(l_parent_line_loc_id, l_line_location_id);
4854:
4855: -- Loop through the distributions of this shipment.
4856: OPEN po_distribution_csr (NVL(l_line_location_id, l_parent_line_loc_id));

Line 6251: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;

6247: ) IS
6248: l_proc_name CONSTANT VARCHAR2(30) := 'VALIDATE_DISTRIBUTION_CHANGES';
6249: l_progress VARCHAR2(3) := '000';
6250:
6251: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
6252: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6253: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6254: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6255: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;

Line 6252: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;

6248: l_proc_name CONSTANT VARCHAR2(30) := 'VALIDATE_DISTRIBUTION_CHANGES';
6249: l_progress VARCHAR2(3) := '000';
6250:
6251: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
6252: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6253: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6254: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6255: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6256: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;

Line 6253: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;

6249: l_progress VARCHAR2(3) := '000';
6250:
6251: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
6252: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6253: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6254: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6255: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6256: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;
6257:

Line 6254: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;

6250:
6251: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
6252: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6253: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6254: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6255: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6256: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;
6257:
6258: l_is_split_distribution BOOLEAN;

Line 6255: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;

6251: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
6252: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6253: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6254: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6255: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6256: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;
6257:
6258: l_is_split_distribution BOOLEAN;
6259: BEGIN

Line 6256: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;

6252: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6253: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6254: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6255: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6256: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;
6257:
6258: l_is_split_distribution BOOLEAN;
6259: BEGIN
6260: IF (g_fnd_debug = 'Y') THEN

Line 6293: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6289:
6290: add_error ( p_api_errors => g_api_errors,
6291: x_return_status => x_return_status,
6292: p_message_name => 'PO_CHNG_QTY_RESTRICTED',
6293: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6294: p_column_name => 'QUANTITY_ORDERED',
6295: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6296: p_entity_id => i );
6297: END IF; -- l_new_qty

Line 6311: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6307:
6308: add_error ( p_api_errors => g_api_errors,
6309: x_return_status => x_return_status,
6310: p_message_name => 'PO_CHNG_AMT_RESTRICTED',
6311: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6312: p_column_name => 'AMOUNT_ORDERED',
6313: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6314: p_entity_id => i );
6315: END IF; -- l_new_amt

Line 6331: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6327: IF (p_chg.distribution_changes.c_creation_date(i) <= g_approved_date) THEN
6328: add_error ( p_api_errors => g_api_errors,
6329: x_return_status => x_return_status,
6330: p_message_name => 'PO_CANT_DELETE_PB_ON_APRVD_PO',
6331: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6332: p_column_name => NULL,
6333: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6334: p_entity_id => i);
6335: END IF;

Line 6344: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6340: IF (p_chg.distribution_changes.c_req_distribution_id(i) IS NOT NULL) THEN
6341: add_error ( p_api_errors => g_api_errors,
6342: x_return_status => x_return_status,
6343: p_message_name => 'PO_PO_DEL_DIST_ONLINE_REQ_NA',
6344: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6345: p_column_name => NULL,
6346: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6347: p_entity_id => i);
6348: END IF;

Line 6357: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6353: IF (p_chg.distribution_changes.c_encumbered_flag(i) = 'Y') THEN
6354: add_error ( p_api_errors => g_api_errors,
6355: x_return_status => x_return_status,
6356: p_message_name => 'PO_PO_USE_CANCEL_ON_ENCUMB_PO',
6357: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6358: p_column_name => NULL,
6359: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6360: p_entity_id => i);
6361: END IF;

Line 6370: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6366: IF (l_qty_delivered > 0) OR (l_amt_delivered > 0) THEN -- Bug 3524527
6367: add_error ( p_api_errors => g_api_errors,
6368: x_return_status => x_return_status,
6369: p_message_name => 'PO_PO_DELETE_DEL_DIST_NA',
6370: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6371: p_column_name => NULL,
6372: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6373: p_entity_id => i);
6374: END IF;

Line 6383: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6379: IF (l_qty_billed > 0) OR (l_amt_billed > 0) THEN -- Bug 3524527
6380: add_error ( p_api_errors => g_api_errors,
6381: x_return_status => x_return_status,
6382: p_message_name => 'PO_PO_DELETE_DIST_BILLED_NA',
6383: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6384: p_column_name => NULL,
6385: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6386: p_entity_id => i);
6387: END IF;

Line 6670: -- PO_LINE_LOCATIONS_ALL, PO_DISTRIBUTIONS_ALL with the changes.

6666: --Pre-reqs:
6667: -- None.
6668: --Modifies:
6669: -- Updates PO_HEADERS_ALL, PO_RELEASES_ALL, PO_LINES_ALL,
6670: -- PO_LINE_LOCATIONS_ALL, PO_DISTRIBUTIONS_ALL with the changes.
6671: --Locks:
6672: -- None.
6673: --End of Comments
6674: -------------------------------------------------------------------------------

Line 6833: -- SQL What: Update PO_DISTRIBUTIONS with the requested/derived

6829: l_progress := '050';
6830:
6831: FORALL i IN 1..p_chg.distribution_changes.get_count
6832:
6833: -- SQL What: Update PO_DISTRIBUTIONS with the requested/derived
6834: -- distribution changes.
6835: UPDATE po_distributions
6836: SET last_update_date = sysdate,
6837: last_updated_by = g_user_id,

Line 6835: UPDATE po_distributions

6831: FORALL i IN 1..p_chg.distribution_changes.get_count
6832:
6833: -- SQL What: Update PO_DISTRIBUTIONS with the requested/derived
6834: -- distribution changes.
6835: UPDATE po_distributions
6836: SET last_update_date = sysdate,
6837: last_updated_by = g_user_id,
6838: request_id = decode(g_request_id,null,request_id,-1,request_id,g_request_id), /*bug 7278327, update the request_id with the concerned concurrent_request_id*/
6839: quantity_ordered =

Line 7493: -- Inserts the split distributions into PO_DISTRIBUTIONS_ALL.

7489: -- Creates split distributions.
7490: --Pre-reqs:
7491: -- None.
7492: --Modifies:
7493: -- Inserts the split distributions into PO_DISTRIBUTIONS_ALL.
7494: -- Updates p_chg with the new PO_DISTRIBUTION_ID for each split distribution.
7495: --Locks:
7496: -- None.
7497: --End of Comments

Line 7505: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;

7501: ) IS
7502: l_proc_name CONSTANT VARCHAR2(30) := 'CREATE_SPLIT_DISTRIBUTIONS';
7503: l_module CONSTANT VARCHAR2(80) := g_module_prefix || l_proc_name;
7504: l_progress VARCHAR2(3) := '000';
7505: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;
7506: l_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE;
7507: l_ship_chg_i NUMBER;
7508: l_dist_chg_i NUMBER;
7509: --

Line 7506: l_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE;

7502: l_proc_name CONSTANT VARCHAR2(30) := 'CREATE_SPLIT_DISTRIBUTIONS';
7503: l_module CONSTANT VARCHAR2(80) := g_module_prefix || l_proc_name;
7504: l_progress VARCHAR2(3) := '000';
7505: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;
7506: l_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE;
7507: l_ship_chg_i NUMBER;
7508: l_dist_chg_i NUMBER;
7509: --
7510: l_return_status VARCHAR2(1);

Line 7530: SELECT PO_DISTRIBUTIONS_S.nextval

7526: FOR l_split_dist_tbl_i IN 1..g_split_dist_changes_tbl.COUNT LOOP
7527: l_dist_chg_i := g_split_dist_changes_tbl(l_split_dist_tbl_i);
7528:
7529: -- Generate a new PO_DISTRIBUTION_ID from the sequence.
7530: SELECT PO_DISTRIBUTIONS_S.nextval
7531: INTO l_po_distribution_id
7532: FROM dual;
7533:
7534: -- Update the split distribution change with the new PO_DISTRIBUTION_ID.

Line 7563: -- Bulk insert all the split distributions into PO_DISTRIBUTIONS_ALL,

7559:
7560:
7561: END LOOP; -- split distribution changes
7562:
7563: -- Bulk insert all the split distributions into PO_DISTRIBUTIONS_ALL,
7564: -- by copying most of the field values from the parent distribution.
7565: l_progress := '010';
7566: FORALL i IN 1..p_chg.distribution_changes.po_distribution_id.COUNT
7567: INSERT INTO po_distributions_all (

Line 7567: INSERT INTO po_distributions_all (

7563: -- Bulk insert all the split distributions into PO_DISTRIBUTIONS_ALL,
7564: -- by copying most of the field values from the parent distribution.
7565: l_progress := '010';
7566: FORALL i IN 1..p_chg.distribution_changes.po_distribution_id.COUNT
7567: INSERT INTO po_distributions_all (
7568: PO_DISTRIBUTION_ID ,
7569: LAST_UPDATE_DATE ,
7570: LAST_UPDATED_BY ,
7571: PO_HEADER_ID ,

Line 7779: FROM po_distributions

7775: NULL , -- INVOICE_ADJUSTMENT_FLAG
7776: DEST_CHARGE_ACCOUNT_ID ,
7777: DEST_VARIANCE_ACCOUNT_ID ,
7778: nvl2(g_calculate_tax_flag, 'CREATE', null) --
7779: FROM po_distributions
7780: WHERE p_chg.distribution_changes.parent_distribution_id(i) IS NOT NULL
7781: AND po_distribution_id =
7782: p_chg.distribution_changes.parent_distribution_id(i);
7783:

Line 7856: UPDATE po_distributions

7852:
7853: l_progress := '040';
7854: -- Bulk update the distributions with the new award IDs.
7855: FORALL i IN 1..l_gms_po_obj.award_set_id_out.COUNT
7856: UPDATE po_distributions
7857: SET last_update_date = sysdate,
7858: last_updated_by = g_user_id,
7859: award_id = l_gms_po_obj.award_set_id_out(i)
7860: WHERE po_distributions.po_distribution_id

Line 7860: WHERE po_distributions.po_distribution_id

7856: UPDATE po_distributions
7857: SET last_update_date = sysdate,
7858: last_updated_by = g_user_id,
7859: award_id = l_gms_po_obj.award_set_id_out(i)
7860: WHERE po_distributions.po_distribution_id
7861: = l_gms_po_obj.distribution_id(i);
7862:
7863: END IF; -- l_gms_po_obj
7864: --

Line 7889: -- PO_LINES, PO_LINE_LOCATIONS, PO_DISTRIBUTIONS

7885: -- G_PARAMETER_YES.
7886: --Pre-reqs:
7887: -- None.
7888: --Modifies:
7889: -- PO_LINES, PO_LINE_LOCATIONS, PO_DISTRIBUTIONS
7890: --Locks:
7891: -- None.
7892: --End of Comments
7893: -------------------------------------------------------------------------------

Line 7916: FROM po_distributions

7912: FOR i IN 1..p_chg.distribution_changes.get_count LOOP
7913: IF (p_chg.distribution_changes.delete_record(i) = G_PARAMETER_YES) THEN
7914: SELECT rowid
7915: INTO l_rowid
7916: FROM po_distributions
7917: WHERE po_distribution_id
7918: = p_chg.distribution_changes.po_distribution_id(i);
7919:
7920: PO_DISTRIBUTIONS_PKG2.delete_row ( l_rowid );

Line 7920: PO_DISTRIBUTIONS_PKG2.delete_row ( l_rowid );

7916: FROM po_distributions
7917: WHERE po_distribution_id
7918: = p_chg.distribution_changes.po_distribution_id(i);
7919:
7920: PO_DISTRIBUTIONS_PKG2.delete_row ( l_rowid );
7921: END IF;
7922: END LOOP;
7923:
7924: -- Delete the requested shipments and their children.

Line 7984: -- PO_DISTRIBUTIONS_ALL.

7980: --Pre-reqs:
7981: -- None.
7982: --Modifies:
7983: -- Updates the RECOVERABLE_TAX and NONRECOVERABLE_TAX columns in
7984: -- PO_DISTRIBUTIONS_ALL.
7985: --Locks:
7986: -- None.
7987: --End of Comments
7988: -------------------------------------------------------------------------------

Line 8319: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;

8315: PROCEDURE add_dist_change_to_index (
8316: p_chg IN PO_CHANGES_REC_TYPE,
8317: i IN NUMBER
8318: ) IS
8319: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;
8320: l_line_location_id PO_LINE_LOCATIONS.line_location_id%TYPE;
8321: c NUMBER;
8322: BEGIN
8323: l_po_distribution_id := p_chg.distribution_changes.po_distribution_id(i);

Line 8489: p_po_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE

8485: -- None.
8486: --End of Comments
8487: -------------------------------------------------------------------------------
8488: FUNCTION get_dist_change (
8489: p_po_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE
8490: ) RETURN NUMBER IS
8491: i NUMBER;
8492: BEGIN
8493: IF g_dist_changes_index.EXISTS(p_po_distribution_id) THEN

Line 8517: p_po_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE

8513: --End of Comments
8514: -------------------------------------------------------------------------------
8515: FUNCTION find_dist_change (
8516: p_chg IN OUT NOCOPY PO_CHANGES_REC_TYPE,
8517: p_po_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE
8518: ) RETURN NUMBER IS
8519: i NUMBER;
8520: BEGIN
8521: i := get_dist_change(p_po_distribution_id);

Line 8591: p_parent_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE,

8587: --End of Comments
8588: -------------------------------------------------------------------------------
8589: FUNCTION get_split_dist_change (
8590: p_chg IN PO_CHANGES_REC_TYPE,
8591: p_parent_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE,
8592: p_parent_line_loc_id IN PO_LINE_LOCATIONS.line_location_id%TYPE,
8593: p_split_shipment_num IN PO_LINE_LOCATIONS.shipment_num%TYPE
8594: ) RETURN NUMBER IS
8595: l_dist_chg_i NUMBER;

Line 8633: p_parent_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE,

8629: --End of Comments
8630: -------------------------------------------------------------------------------
8631: FUNCTION find_split_dist_change (
8632: p_chg IN OUT NOCOPY PO_CHANGES_REC_TYPE,
8633: p_parent_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE,
8634: p_parent_line_loc_id IN PO_LINE_LOCATIONS.line_location_id%TYPE,
8635: p_split_shipment_num IN PO_LINE_LOCATIONS.shipment_num%TYPE
8636: ) RETURN NUMBER IS
8637: i NUMBER;

Line 9005: PO_DISTRIBUTIONS_SV.validate_delete_distribution(

9001: ELSIF p_entity = PO_CORE_S.g_doc_level_DISTRIBUTION
9002: THEN
9003: d_pos := 100;
9004: -- Validates the delete action on the distribution
9005: PO_DISTRIBUTIONS_SV.validate_delete_distribution(
9006: p_po_distribution_id => p_distribution_id
9007: ,p_line_loc_id => p_line_loc_id
9008: ,p_approved_date => l_doc_approved_date
9009: ,p_style_disp_name => l_style_disp_name

Line 9208: PO_DISTRIBUTIONS_PKG2.delete_row(x_rowid => p_entity_row_id);

9204: ELSIF p_entity = PO_CORE_S.g_doc_level_DISTRIBUTION
9205: THEN
9206: d_pos := 60;
9207: -- If all validations go thru fine we go ahead and delete the distribution
9208: PO_DISTRIBUTIONS_PKG2.delete_row(x_rowid => p_entity_row_id);
9209: END IF; -- p_entity = PO_CORE_S.g_doc_level_HEADER
9210:
9211: --
9212: d_pos := 70;