DBA Data[Home] [Help]

APPS.PO_DOCUMENT_UPDATE_PVT dependencies on PO_DISTRIBUTIONS

Line 870: p_table_name => 'PO_DISTRIBUTIONS_ALL',

866: add_error (
867: p_api_errors => g_api_errors,
868: x_return_status => x_return_status,
869: p_message_name => 'PO_GENERIC_ERROR',
870: p_table_name => 'PO_DISTRIBUTIONS_ALL',
871: p_token_name1 => 'ERROR_TEXT',
872: p_token_value1 => 'You cannot specify both po_distribution_id and parent_distribution_id / split_shipment_num for a distribution change.',
873: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
874: p_entity_id => i

Line 882: FROM po_distributions

878: BEGIN
879: IF (g_po_header_id IS NOT NULL) THEN -- PO / PA
880: SELECT 1
881: INTO l_dummy
882: FROM po_distributions
883: WHERE po_header_id = g_po_header_id
884: AND po_distribution_id =
885: NVL(p_chg.distribution_changes.po_distribution_id(i),
886: p_chg.distribution_changes.parent_distribution_id(i));

Line 890: FROM po_distributions

886: p_chg.distribution_changes.parent_distribution_id(i));
887: ELSE -- release
888: SELECT 1
889: INTO l_dummy
890: FROM po_distributions
891: WHERE po_release_id = g_po_release_id
892: AND po_distribution_id =
893: NVL(p_chg.distribution_changes.po_distribution_id(i),
894: p_chg.distribution_changes.parent_distribution_id(i));

Line 903: p_table_name => 'PO_DISTRIBUTIONS_ALL',

899: add_error (
900: p_api_errors => g_api_errors,
901: x_return_status => x_return_status,
902: p_message_name => 'PO_INVALID_DOC_IDS',
903: p_table_name => 'PO_DISTRIBUTIONS_ALL',
904: p_column_name => 'PO_DISTRIBUTION_ID',
905: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
906: p_entity_id => i
907: );

Line 1384: l_parent_dist_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;

1380: PROCEDURE populate_dist_cached_fields (
1381: p_chg IN OUT NOCOPY PO_CHANGES_REC_TYPE,
1382: i IN NUMBER
1383: ) IS
1384: l_parent_dist_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;
1385: BEGIN
1386: l_parent_dist_id := p_chg.distribution_changes.parent_distribution_id(i);
1387:
1388: -- SQL What: Retrieve all the database field values that will be needed

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

1462: p_chg.distribution_changes.c_distribution_num(i),
1463: p_chg.distribution_changes.c_encumbered_flag(i),
1464: p_chg.distribution_changes.c_req_distribution_id(i),
1465: p_chg.distribution_changes.c_creation_date(i)
1466: FROM po_distributions POD, po_lines POL, po_line_types PLT,po_line_locations_all PLL -- 1467: WHERE POD.po_distribution_id =
1468: NVL( p_chg.distribution_changes.parent_distribution_id(i), -- split dist
1469: p_chg.distribution_changes.po_distribution_id(i) ) -- existing dist
1470: AND POL.po_line_id = POD.po_line_id -- JOIN

Line 2129: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2125: AND (p_chg.distribution_changes.amount_ordered(i) IS NULL) THEN
2126: add_error ( p_api_errors => g_api_errors,
2127: x_return_status => x_return_status,
2128: p_message_name => 'PO_CHNG_SPLIT_DIST_QTY_AMT',
2129: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2130: p_column_name => NULL,
2131: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
2132: p_entity_id => i );
2133: END IF;

Line 2149: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2145:
2146: add_error ( p_api_errors => g_api_errors,
2147: x_return_status => x_return_status,
2148: p_message_name => 'PO_CHNG_SPLIT_DIST_SHIP_NUM',
2149: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2150: p_column_name => NULL,
2151: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
2152: p_entity_id => i );
2153: END IF;

Line 2163: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2159: IF (p_chg.distribution_changes.delete_record(i) = G_PARAMETER_YES) THEN
2160: add_error ( p_api_errors => g_api_errors,
2161: x_return_status => x_return_status,
2162: p_message_name => 'PO_CHNG_SPLIT_DIST_NO_DELETE',
2163: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2164: p_column_name => NULL,
2165: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
2166: p_entity_id => i );
2167: END IF; -- delete_record

Line 2297: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2293: IF (p_chg.distribution_changes.get_count > 0) THEN
2294: add_error ( p_api_errors => g_api_errors,
2295: x_return_status => x_return_status,
2296: p_message_name => 'PO_CHNG_BLKT_NO_DISTS',
2297: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2298: p_column_name => null,
2299: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS );
2300: END IF;
2301:

Line 2574: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2570: IF (p_chg.distribution_changes.quantity_ordered(i) IS NOT NULL) THEN
2571: add_error ( p_api_errors => g_api_errors,
2572: x_return_status => x_return_status,
2573: p_message_name => 'PO_SVC_NO_QTY',
2574: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2575: p_column_name => 'QUANTITY',
2576: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
2577: p_entity_id => i );
2578: END IF;

Line 2592: p_table_name => 'PO_DISTRIBUTIONS_ALL',

2588: IF (p_chg.distribution_changes.amount_ordered(i) IS NOT NULL) THEN
2589: add_error ( p_api_errors => g_api_errors,
2590: x_return_status => x_return_status,
2591: p_message_name => 'PO_SVC_NO_AMT',
2592: p_table_name => 'PO_DISTRIBUTIONS_ALL',
2593: p_column_name => 'AMOUNT',
2594: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
2595: p_entity_id => i );
2596: END IF;

Line 2670: ELSE -- PO_DISTRIBUTIONS_REC_TYPE

2666: l_table_name := 'PO_LINE_LOCATIONS_ALL';
2667: l_qty_column_name := 'QUANTITY';
2668: l_price_column_name := 'PRICE_OVERRIDE';
2669: l_amt_column_name := 'AMOUNT';
2670: ELSE -- PO_DISTRIBUTIONS_REC_TYPE
2671: l_new_quantity := p_chg.distribution_changes.quantity_ordered(i);
2672: l_new_price := NULL;
2673: l_new_amount := p_chg.distribution_changes.amount_ordered(i);
2674:

Line 2675: l_table_name := 'PO_DISTRIBUTIONS_ALL';

2671: l_new_quantity := p_chg.distribution_changes.quantity_ordered(i);
2672: l_new_price := NULL;
2673: l_new_amount := p_chg.distribution_changes.amount_ordered(i);
2674:
2675: l_table_name := 'PO_DISTRIBUTIONS_ALL';
2676: l_qty_column_name := 'QUANTITY_ORDERED';
2677: l_amt_column_name := 'AMOUNT_ORDERED';
2678: END IF; -- p_entity_type
2679:

Line 4344: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4340: l_new_line_qty_amt PO_LINES.quantity%TYPE;
4341: l_cur_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4342: l_exist_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4343: l_new_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4344: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4345: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4346:
4347: --
4348: l_cur_line_amt PO_LINES.amount%type;

Line 4345: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4341: l_cur_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4342: l_exist_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4343: l_new_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4344: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4345: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4346:
4347: --
4348: l_cur_line_amt PO_LINES.amount%type;
4349: l_exist_ship_amt PO_LINE_LOCATIONS.amount%type;

Line 4695: p_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE

4691:
4692: -- SQL What: Retrieves all the distributions of a given shipment.
4693: -- SQL Why: To prorate shipment quantity/amount changes to the distributions.
4694: CURSOR po_distribution_csr (
4695: p_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE
4696: ) IS
4697: SELECT po_distribution_id, distribution_num, quantity_ordered, amount_ordered
4698: FROM po_distributions
4699: WHERE line_location_id = p_line_location_id

Line 4698: FROM po_distributions

4694: CURSOR po_distribution_csr (
4695: p_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE
4696: ) IS
4697: SELECT po_distribution_id, distribution_num, quantity_ordered, amount_ordered
4698: FROM po_distributions
4699: WHERE line_location_id = p_line_location_id
4700: ORDER by distribution_num ASC;
4701:
4702: l_po_line_id PO_LINES.po_line_id%TYPE;

Line 4705: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;

4701:
4702: l_po_line_id PO_LINES.po_line_id%TYPE;
4703: l_line_location_id PO_LINE_LOCATIONS.line_location_id%TYPE;
4704: l_parent_line_loc_id PO_LINE_LOCATIONS.line_location_id%TYPE;
4705: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;
4706:
4707: l_exist_line_qty_amt PO_LINES.quantity%TYPE;
4708: l_new_line_qty_amt PO_LINES.quantity%TYPE;
4709: l_exist_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;

Line 4713: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4709: l_exist_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4710: l_new_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4711: l_cum_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4712: l_split_shipment_num PO_LINE_LOCATIONS.shipment_num%TYPE;
4713: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4714: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4715: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4716: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4717: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

Line 4714: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;

4710: l_new_ship_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4711: l_cum_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4712: l_split_shipment_num PO_LINE_LOCATIONS.shipment_num%TYPE;
4713: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4714: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4715: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4716: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4717: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4718: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;

Line 4715: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4711: l_cum_qty_amt PO_LINE_LOCATIONS.quantity%TYPE;
4712: l_split_shipment_num PO_LINE_LOCATIONS.shipment_num%TYPE;
4713: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4714: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4715: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4716: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4717: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4718: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4719: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;

Line 4716: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4712: l_split_shipment_num PO_LINE_LOCATIONS.shipment_num%TYPE;
4713: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4714: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4715: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4716: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4717: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4718: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4719: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4720:

Line 4717: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;

4713: l_exist_dist_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4714: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4715: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4716: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4717: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4718: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4719: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4720:
4721: l_ship_chg_i NUMBER;

Line 4718: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;

4714: l_exist_dist_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
4715: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4716: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4717: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4718: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4719: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4720:
4721: l_ship_chg_i NUMBER;
4722: l_dist_chg_i NUMBER;

Line 4719: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;

4715: l_exist_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4716: l_new_dist_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4717: l_remain_qty_amt PO_DISTRIBUTIONS.quantity_ordered%TYPE;
4718: l_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4719: l_max_dist_num PO_DISTRIBUTIONS.distribution_num%TYPE;
4720:
4721: l_ship_chg_i NUMBER;
4722: l_dist_chg_i NUMBER;
4723: l_amt_based BOOLEAN;

Line 4889: FROM po_distributions

4885:
4886: -- SQL What: Retrieve the maximum distribution number of this shipment.
4887: SELECT max(distribution_num)
4888: INTO l_max_dist_num
4889: FROM po_distributions
4890: WHERE line_location_id = NVL(l_parent_line_loc_id, l_line_location_id);
4891:
4892: -- Loop through the distributions of this shipment.
4893: OPEN po_distribution_csr (NVL(l_line_location_id, l_parent_line_loc_id));

Line 6301: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;

6297: ) IS
6298: l_proc_name CONSTANT VARCHAR2(30) := 'VALIDATE_DISTRIBUTION_CHANGES';
6299: l_progress VARCHAR2(3) := '000';
6300:
6301: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
6302: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6303: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6304: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6305: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;

Line 6302: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;

6298: l_proc_name CONSTANT VARCHAR2(30) := 'VALIDATE_DISTRIBUTION_CHANGES';
6299: l_progress VARCHAR2(3) := '000';
6300:
6301: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
6302: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6303: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6304: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6305: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6306: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;

Line 6303: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;

6299: l_progress VARCHAR2(3) := '000';
6300:
6301: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
6302: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6303: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6304: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6305: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6306: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;
6307:

Line 6304: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;

6300:
6301: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
6302: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6303: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6304: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6305: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6306: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;
6307:
6308: l_is_split_distribution BOOLEAN;

Line 6305: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;

6301: l_new_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE;
6302: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6303: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6304: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6305: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6306: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;
6307:
6308: l_is_split_distribution BOOLEAN;
6309: l_orig_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE; --

Line 6306: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;

6302: l_new_amt PO_DISTRIBUTIONS.amount_ordered%TYPE;
6303: l_qty_delivered PO_DISTRIBUTIONS.quantity_delivered%TYPE;
6304: l_qty_billed PO_DISTRIBUTIONS.quantity_billed%TYPE;
6305: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6306: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;
6307:
6308: l_is_split_distribution BOOLEAN;
6309: l_orig_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE; --
6310:

Line 6309: l_orig_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE; --

6305: l_amt_delivered PO_DISTRIBUTIONS.amount_delivered%TYPE;
6306: l_amt_billed PO_DISTRIBUTIONS.amount_billed%TYPE;
6307:
6308: l_is_split_distribution BOOLEAN;
6309: l_orig_qty PO_DISTRIBUTIONS.quantity_ordered%TYPE; --
6310:
6311: BEGIN
6312: IF (g_fnd_debug = 'Y') THEN
6313: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_PROCEDURE) THEN

Line 6349: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6345:
6346: add_error ( p_api_errors => g_api_errors,
6347: x_return_status => x_return_status,
6348: p_message_name => 'PO_CHNG_QTY_RESTRICTED',
6349: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6350: p_column_name => 'QUANTITY_ORDERED',
6351: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6352: p_entity_id => i );
6353: END IF; -- l_new_qty

Line 6367: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6363:
6364: add_error ( p_api_errors => g_api_errors,
6365: x_return_status => x_return_status,
6366: p_message_name => 'PO_CHNG_AMT_RESTRICTED',
6367: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6368: p_column_name => 'AMOUNT_ORDERED',
6369: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6370: p_entity_id => i );
6371: END IF; -- l_new_amt

Line 6387: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6383: IF (p_chg.distribution_changes.c_creation_date(i) <= g_approved_date) THEN
6384: add_error ( p_api_errors => g_api_errors,
6385: x_return_status => x_return_status,
6386: p_message_name => 'PO_CANT_DELETE_PB_ON_APRVD_PO',
6387: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6388: p_column_name => NULL,
6389: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6390: p_entity_id => i);
6391: END IF;

Line 6400: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6396: IF (p_chg.distribution_changes.c_req_distribution_id(i) IS NOT NULL) THEN
6397: add_error ( p_api_errors => g_api_errors,
6398: x_return_status => x_return_status,
6399: p_message_name => 'PO_PO_DEL_DIST_ONLINE_REQ_NA',
6400: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6401: p_column_name => NULL,
6402: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6403: p_entity_id => i);
6404: END IF;

Line 6413: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6409: IF (p_chg.distribution_changes.c_encumbered_flag(i) = 'Y') THEN
6410: add_error ( p_api_errors => g_api_errors,
6411: x_return_status => x_return_status,
6412: p_message_name => 'PO_PO_USE_CANCEL_ON_ENCUMB_PO',
6413: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6414: p_column_name => NULL,
6415: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6416: p_entity_id => i);
6417: END IF;

Line 6426: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6422: IF (l_qty_delivered > 0) OR (l_amt_delivered > 0) THEN -- Bug 3524527
6423: add_error ( p_api_errors => g_api_errors,
6424: x_return_status => x_return_status,
6425: p_message_name => 'PO_PO_DELETE_DEL_DIST_NA',
6426: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6427: p_column_name => NULL,
6428: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6429: p_entity_id => i);
6430: END IF;

Line 6439: p_table_name => 'PO_DISTRIBUTIONS_ALL',

6435: IF (l_qty_billed > 0) OR (l_amt_billed > 0) THEN -- Bug 3524527
6436: add_error ( p_api_errors => g_api_errors,
6437: x_return_status => x_return_status,
6438: p_message_name => 'PO_PO_DELETE_DIST_BILLED_NA',
6439: p_table_name => 'PO_DISTRIBUTIONS_ALL',
6440: p_column_name => NULL,
6441: p_entity_type => G_ENTITY_TYPE_DISTRIBUTIONS,
6442: p_entity_id => i);
6443: END IF;

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

6722: --Pre-reqs:
6723: -- None.
6724: --Modifies:
6725: -- Updates PO_HEADERS_ALL, PO_RELEASES_ALL, PO_LINES_ALL,
6726: -- PO_LINE_LOCATIONS_ALL, PO_DISTRIBUTIONS_ALL with the changes.
6727: --Locks:
6728: -- None.
6729: --End of Comments
6730: -------------------------------------------------------------------------------

Line 6858: UPDATE po_distributions_all /* Changed po_distributions to po_distributions_all */

6854: -- <13503748: Edit without unreserve ER START>
6855: -- update the amount_changted_flag to 'Y' for changed distributions which are already not changed.
6856: IF l_clm_doc_flag = 'N' THEN
6857: FORALL i IN 1..p_chg.line_changes.get_count
6858: UPDATE po_distributions_all /* Changed po_distributions to po_distributions_all */
6859: SET amount_changed_flag = 'Y'
6860: WHERE po_line_id = p_chg.line_changes.po_line_id(i)
6861: AND Nvl(amount_changed_flag, 'N') <> 'Y'
6862: AND distribution_type = 'STANDARD';

Line 6918: UPDATE po_distributions_all

6914: -- <13503748: Edit without unreserve ER START>
6915: -- update the amount_changted_flag to 'Y' for changed distributions which are already not changed.
6916: IF l_clm_doc_flag = 'N' THEN
6917: FORALL i IN 1..p_chg.shipment_changes.get_count
6918: UPDATE po_distributions_all
6919: SET amount_changed_flag = 'Y'
6920: WHERE line_location_id = p_chg.shipment_changes.po_line_location_id(i)
6921: AND Nvl(amount_changed_flag, 'N') <> 'Y'
6922: AND distribution_type = 'STANDARD';

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

6928: l_progress := '050';
6929:
6930: FORALL i IN 1..p_chg.distribution_changes.get_count
6931:
6932: -- SQL What: Update PO_DISTRIBUTIONS with the requested/derived
6933: -- distribution changes.
6934: UPDATE po_distributions_all
6935: SET last_update_date = sysdate,
6936: last_updated_by = g_user_id,

Line 6934: UPDATE po_distributions_all

6930: FORALL i IN 1..p_chg.distribution_changes.get_count
6931:
6932: -- SQL What: Update PO_DISTRIBUTIONS with the requested/derived
6933: -- distribution changes.
6934: UPDATE po_distributions_all
6935: SET last_update_date = sysdate,
6936: last_updated_by = g_user_id,
6937: 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*/
6938: quantity_ordered =

Line 6951: UPDATE po_distributions_all

6947: -- <13503748: Edit without unreserve ER START>
6948: -- update the amount_changted_flag to 'Y' for changed distributions which are already not changed.
6949: IF l_clm_doc_flag = 'N' THEN
6950: FORALL i IN 1..p_chg.distribution_changes.get_count
6951: UPDATE po_distributions_all
6952: SET amount_changed_flag = 'Y'
6953: WHERE po_distribution_id = p_chg.distribution_changes.po_distribution_id(i)
6954: AND Nvl(amount_changed_flag, 'N') <> 'Y'
6955: AND distribution_type = 'STANDARD';

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

7601: -- Creates split distributions.
7602: --Pre-reqs:
7603: -- None.
7604: --Modifies:
7605: -- Inserts the split distributions into PO_DISTRIBUTIONS_ALL.
7606: -- Updates p_chg with the new PO_DISTRIBUTION_ID for each split distribution.
7607: --Locks:
7608: -- None.
7609: --End of Comments

Line 7617: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;

7613: ) IS
7614: l_proc_name CONSTANT VARCHAR2(30) := 'CREATE_SPLIT_DISTRIBUTIONS';
7615: l_module CONSTANT VARCHAR2(80) := g_module_prefix || l_proc_name;
7616: l_progress VARCHAR2(3) := '000';
7617: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;
7618: l_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE;
7619: l_ship_chg_i NUMBER;
7620: l_dist_chg_i NUMBER;
7621: --

Line 7618: l_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE;

7614: l_proc_name CONSTANT VARCHAR2(30) := 'CREATE_SPLIT_DISTRIBUTIONS';
7615: l_module CONSTANT VARCHAR2(80) := g_module_prefix || l_proc_name;
7616: l_progress VARCHAR2(3) := '000';
7617: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;
7618: l_line_location_id PO_DISTRIBUTIONS.line_location_id%TYPE;
7619: l_ship_chg_i NUMBER;
7620: l_dist_chg_i NUMBER;
7621: --
7622: l_return_status VARCHAR2(1);

Line 7642: SELECT PO_DISTRIBUTIONS_S.nextval

7638: FOR l_split_dist_tbl_i IN 1..g_split_dist_changes_tbl.COUNT LOOP
7639: l_dist_chg_i := g_split_dist_changes_tbl(l_split_dist_tbl_i);
7640:
7641: -- Generate a new PO_DISTRIBUTION_ID from the sequence.
7642: SELECT PO_DISTRIBUTIONS_S.nextval
7643: INTO l_po_distribution_id
7644: FROM dual;
7645:
7646: -- Update the split distribution change with the new PO_DISTRIBUTION_ID.

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

7671:
7672:
7673: END LOOP; -- split distribution changes
7674:
7675: -- Bulk insert all the split distributions into PO_DISTRIBUTIONS_ALL,
7676: -- by copying most of the field values from the parent distribution.
7677: l_progress := '010';
7678: FORALL i IN 1..p_chg.distribution_changes.po_distribution_id.COUNT
7679: INSERT INTO po_distributions_all (

Line 7679: INSERT INTO po_distributions_all (

7675: -- Bulk insert all the split distributions into PO_DISTRIBUTIONS_ALL,
7676: -- by copying most of the field values from the parent distribution.
7677: l_progress := '010';
7678: FORALL i IN 1..p_chg.distribution_changes.po_distribution_id.COUNT
7679: INSERT INTO po_distributions_all (
7680: PO_DISTRIBUTION_ID ,
7681: LAST_UPDATE_DATE ,
7682: LAST_UPDATED_BY ,
7683: PO_HEADER_ID ,

Line 7891: FROM po_distributions

7887: NULL , -- INVOICE_ADJUSTMENT_FLAG
7888: DEST_CHARGE_ACCOUNT_ID ,
7889: DEST_VARIANCE_ACCOUNT_ID ,
7890: nvl2(g_calculate_tax_flag, 'CREATE', null) --
7891: FROM po_distributions
7892: WHERE p_chg.distribution_changes.parent_distribution_id(i) IS NOT NULL
7893: AND po_distribution_id =
7894: p_chg.distribution_changes.parent_distribution_id(i);
7895:

Line 7968: UPDATE po_distributions

7964:
7965: l_progress := '040';
7966: -- Bulk update the distributions with the new award IDs.
7967: FORALL i IN 1..l_gms_po_obj.award_set_id_out.COUNT
7968: UPDATE po_distributions
7969: SET last_update_date = sysdate,
7970: last_updated_by = g_user_id,
7971: award_id = l_gms_po_obj.award_set_id_out(i)
7972: WHERE po_distributions.po_distribution_id

Line 7972: WHERE po_distributions.po_distribution_id

7968: UPDATE po_distributions
7969: SET last_update_date = sysdate,
7970: last_updated_by = g_user_id,
7971: award_id = l_gms_po_obj.award_set_id_out(i)
7972: WHERE po_distributions.po_distribution_id
7973: = l_gms_po_obj.distribution_id(i);
7974:
7975: END IF; -- l_gms_po_obj
7976: --

Line 8001: -- PO_LINES, PO_LINE_LOCATIONS, PO_DISTRIBUTIONS

7997: -- G_PARAMETER_YES.
7998: --Pre-reqs:
7999: -- None.
8000: --Modifies:
8001: -- PO_LINES, PO_LINE_LOCATIONS, PO_DISTRIBUTIONS
8002: --Locks:
8003: -- None.
8004: --End of Comments
8005: -------------------------------------------------------------------------------

Line 8031: FROM po_distributions

8027: FOR i IN 1..p_chg.distribution_changes.get_count LOOP
8028: IF (p_chg.distribution_changes.delete_record(i) = G_PARAMETER_YES) THEN
8029: SELECT rowid
8030: INTO l_rowid
8031: FROM po_distributions
8032: WHERE po_distribution_id
8033: = p_chg.distribution_changes.po_distribution_id(i);
8034:
8035: PO_DISTRIBUTIONS_PKG2.delete_row ( l_rowid );

Line 8035: PO_DISTRIBUTIONS_PKG2.delete_row ( l_rowid );

8031: FROM po_distributions
8032: WHERE po_distribution_id
8033: = p_chg.distribution_changes.po_distribution_id(i);
8034:
8035: PO_DISTRIBUTIONS_PKG2.delete_row ( l_rowid );
8036: END IF;
8037: END LOOP;
8038:
8039: -- Delete the requested shipments and their children.

Line 8119: -- PO_DISTRIBUTIONS_ALL.

8115: --Pre-reqs:
8116: -- None.
8117: --Modifies:
8118: -- Updates the RECOVERABLE_TAX and NONRECOVERABLE_TAX columns in
8119: -- PO_DISTRIBUTIONS_ALL.
8120: --Locks:
8121: -- None.
8122: --End of Comments
8123: -------------------------------------------------------------------------------

Line 8454: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;

8450: PROCEDURE add_dist_change_to_index (
8451: p_chg IN PO_CHANGES_REC_TYPE,
8452: i IN NUMBER
8453: ) IS
8454: l_po_distribution_id PO_DISTRIBUTIONS.po_distribution_id%TYPE;
8455: l_line_location_id PO_LINE_LOCATIONS.line_location_id%TYPE;
8456: c NUMBER;
8457: BEGIN
8458: l_po_distribution_id := p_chg.distribution_changes.po_distribution_id(i);

Line 8624: p_po_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE

8620: -- None.
8621: --End of Comments
8622: -------------------------------------------------------------------------------
8623: FUNCTION get_dist_change (
8624: p_po_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE
8625: ) RETURN NUMBER IS
8626: i NUMBER;
8627: BEGIN
8628: IF g_dist_changes_index.EXISTS(p_po_distribution_id) THEN

Line 8652: p_po_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE

8648: --End of Comments
8649: -------------------------------------------------------------------------------
8650: FUNCTION find_dist_change (
8651: p_chg IN OUT NOCOPY PO_CHANGES_REC_TYPE,
8652: p_po_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE
8653: ) RETURN NUMBER IS
8654: i NUMBER;
8655: BEGIN
8656: i := get_dist_change(p_po_distribution_id);

Line 8726: p_parent_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE,

8722: --End of Comments
8723: -------------------------------------------------------------------------------
8724: FUNCTION get_split_dist_change (
8725: p_chg IN PO_CHANGES_REC_TYPE,
8726: p_parent_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE,
8727: p_parent_line_loc_id IN PO_LINE_LOCATIONS.line_location_id%TYPE,
8728: p_split_shipment_num IN PO_LINE_LOCATIONS.shipment_num%TYPE
8729: ) RETURN NUMBER IS
8730: l_dist_chg_i NUMBER;

Line 8768: p_parent_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE,

8764: --End of Comments
8765: -------------------------------------------------------------------------------
8766: FUNCTION find_split_dist_change (
8767: p_chg IN OUT NOCOPY PO_CHANGES_REC_TYPE,
8768: p_parent_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE,
8769: p_parent_line_loc_id IN PO_LINE_LOCATIONS.line_location_id%TYPE,
8770: p_split_shipment_num IN PO_LINE_LOCATIONS.shipment_num%TYPE
8771: ) RETURN NUMBER IS
8772: i NUMBER;

Line 9140: PO_DISTRIBUTIONS_SV.validate_delete_distribution(

9136: ELSIF p_entity = PO_CORE_S.g_doc_level_DISTRIBUTION
9137: THEN
9138: d_pos := 100;
9139: -- Validates the delete action on the distribution
9140: PO_DISTRIBUTIONS_SV.validate_delete_distribution(
9141: p_po_distribution_id => p_distribution_id
9142: ,p_line_loc_id => p_line_loc_id
9143: ,p_approved_date => l_doc_approved_date
9144: ,p_style_disp_name => l_style_disp_name

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

9339: ELSIF p_entity = PO_CORE_S.g_doc_level_DISTRIBUTION
9340: THEN
9341: d_pos := 60;
9342: -- If all validations go thru fine we go ahead and delete the distribution
9343: PO_DISTRIBUTIONS_PKG2.delete_row(x_rowid => p_entity_row_id);
9344: END IF; -- p_entity = PO_CORE_S.g_doc_level_HEADER
9345:
9346: --
9347: d_pos := 70;