DBA Data[Home] [Help]

APPS.PO_LINES_SV4_832_UPDATE dependencies on PO_LINES

Line 1: PACKAGE BODY PO_LINES_SV4_832_UPDATE AS

1: PACKAGE BODY PO_LINES_SV4_832_UPDATE AS
2: /* $Header: POXPILUB.pls 120.1.12000000.2 2007/07/18 12:25:14 puppulur ship $ */
3:
4: -- Read the profile option that enables/disables the debug log
5: g_po_wf_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('PO_SET_DEBUG_WORKFLOW_ON'),'N');

Line 28: , p_unit_price IN PO_LINES.unit_price%TYPE

24: PROCEDURE delete_price_breaks (x_po_header_id NUMBER, x_po_line_id NUMBER);
25:
26: PROCEDURE update_price_discount -- <2703076>
27: ( p_po_line_id IN PO_LINE_LOCATIONS.po_line_id%TYPE
28: , p_unit_price IN PO_LINES.unit_price%TYPE
29: );
30:
31: /*===========================================================================*/
32: /*============================ BODY (PUBLIC) ================================*/

Line 247: l_retroactive_date po_lines.retroactive_date%type := null;

243: l_process_code VARCHAR2(25);
244: l_start_date date;
245: l_end_date date;
246: /* Bug 2722795 */
247: l_retroactive_date po_lines.retroactive_date%type := null;
248: l_price_break_lookup_code po_lines.price_break_lookup_code%type;
249: l_transaction_flow_header_id
250: PO_LINE_LOCATIONS_ALL.transaction_flow_header_id%TYPE; --< Shared Proc FPJ >
251: l_uom_valid boolean := TRUE; -- bug 3335027

Line 248: l_price_break_lookup_code po_lines.price_break_lookup_code%type;

244: l_start_date date;
245: l_end_date date;
246: /* Bug 2722795 */
247: l_retroactive_date po_lines.retroactive_date%type := null;
248: l_price_break_lookup_code po_lines.price_break_lookup_code%type;
249: l_transaction_flow_header_id
250: PO_LINE_LOCATIONS_ALL.transaction_flow_header_id%TYPE; --< Shared Proc FPJ >
251: l_uom_valid boolean := TRUE; -- bug 3335027
252: l_uom_different boolean := FALSE; -- bug 3335027

Line 273: -- If X_update_po_line_flag is 'Y' then update corresponding line in po_lines.

269: END IF;
270:
271: x_line_updated_flag := 'N';
272:
273: -- If X_update_po_line_flag is 'Y' then update corresponding line in po_lines.
274: -- If X_create_po_line_loc_flag is 'Y' then create a price break in po_line_locations.
275:
276: X_progress := '010';
277:

Line 286: from po_lines

282: select unit_meas_lookup_code ,
283: not_to_exceed_price
284: into x_current_line_uom_code,
285: l_current_line_price_limit
286: from po_lines
287: where po_header_id = x_current_po_header_id
288: and po_line_id = x_po_line_id;
289:
290: IF ((x_current_line_uom_code is null and p_order_type_lookup_code <> 'FIXED PRICE') or

Line 304: 'PO_LINES_INTERFACE',

300: null,
301: X_interface_header_id,
302: X_interface_line_id,
303: 'PO_PDOI_INVALID_UOM_CODE',
304: 'PO_LINES_INTERFACE',
305: 'UNIT_OF_MEASURE',
306: 'VALUE',
307: null, null, null, null, null,
308: X_unit_of_measure,

Line 360: from po_lines

356: X_progress := '021';
357:
358: if x_po_line_id is not NULL then
359: select item_description into x_current_line_item_desc
360: from po_lines
361: where po_header_id = x_current_po_header_id
362: and po_line_id = x_po_line_id;
363: end if;
364:

Line 394: update po_lines.item_description ,need not check if create_items is Yes too

390: X_progress := '022';
391: /*Bug 1267907
392: On an update action if the item description in the edi file is different from
393: the description in the catalog and the allow_item_desc_flag_update is Yes, then
394: update po_lines.item_description ,need not check if create_items is Yes too
395: bcos that is only for checking if the item_master needs to be updated too.
396: */
397: IF (X_allow_item_desc_update_flag = 'N')
398: AND

Line 420: 'PO_LINES_INTERFACE',

416: null,
417: X_interface_header_id,
418: X_interface_line_id,
419: 'PO_PDOI_DIFF_ITEM_DESC',
420: 'PO_LINES_INTERFACE',
421: 'ITEM_DESCRIPTION',
422: null, null, null, null, null, null,
423: null, null, null, null, null, null,
424: X_header_processable_flag);

Line 475: UPDATE po_lines

471: IF (g_po_pdoi_write_to_file = 'Y') THEN
472: PO_DEBUG.put_line ('Updating the desc to:' || x_item_description);
473: END IF;
474:
475: UPDATE po_lines
476: SET item_description = x_item_description,
477: last_update_date = sysdate,
478: last_updated_by = fnd_global.user_id,
479: last_update_login = fnd_global.login_id,

Line 498: from po_lines

494: X_unordered_flag := 'N';
495: X_cancel_flag := 'N';
496:
497: select trunc(expiration_date) into x_current_expiration_date
498: from po_lines
499: where po_header_id = x_current_po_header_id
500: and po_line_id = x_po_line_id;
501:
502: if (NVL(trunc(x_expiration_date), trunc(sysdate)) <> NVL(trunc(x_current_expiration_date), trunc(sysdate))

Line 521: from po_lines

517: END IF;
518:
519: select unit_price, retroactive_date,price_break_lookup_code -- 2722795
520: into x_doc_line_unit_price,l_retroactive_date,l_price_break_lookup_code --2722795
521: from po_lines
522: where po_header_id = x_current_po_header_id
523: and po_line_id = x_po_line_id;
524:
525:

Line 554: * a new unit_price, retroactive_date in po_lines must

550:
551: -- Update the price information.
552:
553: /* Bug 2722795. When we update an existing blanket with
554: * a new unit_price, retroactive_date in po_lines must
555: * be updated with the timestamp. This has to be done
556: * for non-cumulative blanket lines only.
557: */
558: IF (g_po_pdoi_write_to_file = 'Y') THEN

Line 573: UPDATE po_lines

569: PO_DEBUG.put_line ('Updating the unit price');
570: END IF;
571:
572:
573: UPDATE po_lines
574: SET unit_price = X_unit_price,
575: base_unit_price = NVL(X_base_unit_price, X_unit_price), --
576: retroactive_date = l_retroactive_date, -- 2722795
577: last_update_date = sysdate,

Line 610: update po_lines_interface

606: else
607: -- Price tolerance check failed.
608: -- Mark the line as Notified
609:
610: update po_lines_interface
611: set process_code = 'NOTIFIED'
612: where interface_line_id = X_interface_line_id
613: and interface_header_id = X_interface_header_id;
614:

Line 623: UPDATE po_lines

619: END IF; -- x_unit_price not null
620:
621: --begin bug 3335027: update expiration date
622: IF(l_update_exp_date) THEN
623: UPDATE po_lines
624: SET expiration_date = trunc(x_expiration_date),
625: last_update_date = trunc(sysdate),
626: last_updated_by = fnd_global.user_id,
627: last_update_login = fnd_global.login_id,

Line 684: 'PO_LINES_INTERFACE',

680: null,
681: X_interface_header_id,
682: X_interface_line_id,
683: 'PO_PDOI_INVALID_UOM_CODE',
684: 'PO_LINES_INTERFACE',
685: 'UNIT_OF_MEASURE',
686: 'VALUE',
687: null,null, null, null, null,
688: x_unit_of_measure,

Line 706: UPDATE po_lines

702: END IF;
703:
704: IF (X_header_processable_flag = 'Y') THEN
705:
706: UPDATE po_lines
707: SET unit_meas_lookup_code = x_unit_of_measure,
708: unit_price = l_conv_price,
709: base_unit_price = NVL(X_base_unit_price, l_conv_price),
710: retroactive_date = l_retroactive_date,

Line 746: 'PO_LINES_INTERFACE',

742: null,
743: X_interface_header_id,
744: X_interface_line_id,
745: 'PO_BLANKET_UPDATE_PRICE_BREAKS',
746: 'PO_LINES_INTERFACE',
747: 'UNIT_OF_MEASURE',
748: null,null, null, null, null, null,
749: null,null, null, null, null, null,
750: l_header_processable_flag );

Line 759: 'PO_LINES_INTERFACE',

755: null,
756: X_interface_header_id,
757: X_interface_line_id,
758: 'PO_BLANKET_UPDATE_PB_NO_CONV',
759: 'PO_LINES_INTERFACE',
760: 'UNIT_OF_MEASURE',
761: null,null, null, null, null, null,
762: null,null, null, null, null, null,
763: l_header_processable_flag );

Line 783: UPDATE po_lines

779: IF (g_po_pdoi_write_to_file = 'Y') THEN
780: PO_DEBUG.put_line ('Updating the URL to:' || X_line_attribute14);
781: END IF;
782:
783: UPDATE po_lines
784: SET ATTRIBUTE14 = X_line_attribute14,
785: last_update_date = sysdate,
786: last_updated_by = fnd_global.user_id,
787: last_update_login = fnd_global.login_id,

Line 805: UPDATE PO_LINES

801: PO_DEBUG.put_line ('Start updating amount');
802: END IF;
803:
804: IF (NVL(p_amount, 0) <> 0) THEN
805: UPDATE PO_LINES
806: SET amount = p_amount,
807: last_update_date = sysdate,
808: last_updated_by = FND_GLOBAL.user_id,
809: last_update_login = FND_GLOBAL.login_id,

Line 892: find a coordinated match in po_lines

888: END IF;
889:
890: /* call this procedure to make sure that for each po_line_location
891: record that we are going to create, we will always be able to
892: find a coordinated match in po_lines
893: */
894:
895: --
896: -- We derive the shipment number and line_location_id at this stage as the original price breaks

Line 1079: -- for which we are creating the price break does not exist in po_lines table.

1075: -- UPDATE THE PRICE BREAK INFORMATION HERE - note that any old price breaks,if any,
1076: -- would have been deleted by now.
1077: -- ASSUMPTION - We always update a line before updating the price breaks for that line.
1078: -- this is a safe assumption as the price break creation will fail if the line
1079: -- for which we are creating the price break does not exist in po_lines table.
1080: -- Coordination check will fail.
1081: --
1082:
1083: /* */

Line 1104: /* Bug 2722795. Insert retroactive_Date in po_lines with the timestamp

1100: END;
1101: --Bug#4040677 End
1102: /* */
1103:
1104: /* Bug 2722795. Insert retroactive_Date in po_lines with the timestamp
1105: * if a price break row is inserted.
1106: */
1107:
1108: IF ((X_document_type = 'BLANKET') and

Line 1111: po_lines_sv2.retroactive_change(X_po_Line_id);

1107:
1108: IF ((X_document_type = 'BLANKET') and
1109: (nvl(l_price_break_lookup_code,'NON CUMULATIVE') =
1110: 'NON CUMULATIVE')) THEN
1111: po_lines_sv2.retroactive_change(X_po_Line_id);
1112: END IF;
1113:
1114: po_line_locations_sv6.insert_po_line_locations(
1115: X_line_location_id,

Line 1289: -- We can use a soft_cancel_line flag (po_lines table) that when enabled, the line

1285: IS
1286: x_progress VARCHAR2(100) := NULL;
1287: BEGIN
1288:
1289: -- We can use a soft_cancel_line flag (po_lines table) that when enabled, the line
1290: -- will not show up in the blanket/quotation or appear when creating releases.
1291: -- Would also need to modify sourcing, auto-create, ASL etc. and add this column to
1292: -- the PO_LINES_ALL table and PO_LINES view.
1293:

Line 1292: -- the PO_LINES_ALL table and PO_LINES view.

1288:
1289: -- We can use a soft_cancel_line flag (po_lines table) that when enabled, the line
1290: -- will not show up in the blanket/quotation or appear when creating releases.
1291: -- Would also need to modify sourcing, auto-create, ASL etc. and add this column to
1292: -- the PO_LINES_ALL table and PO_LINES view.
1293:
1294: -- Can use expiration date as well. That is the item would not show up in any of the
1295: -- above after that expiration date.
1296:

Line 1299: update po_lines

1295: -- above after that expiration date.
1296:
1297: -- Cannot cancel item if open releases.
1298: /*
1299: update po_lines
1300: set deleted_item_flag = 'Y'
1301: -- set expiration_date = (select sysdate from sys.dual) or X_expiration_date
1302: last_update_date = sysdate,
1303: last_updated_by = fnd_global.user_id,

Line 1335: l_progress := 'PO_LINES_SV4_832_UPDATE.Item_Exists: 01';

1331: l_progress VARCHAR2(300) := NULL;
1332:
1333: BEGIN
1334:
1335: l_progress := 'PO_LINES_SV4_832_UPDATE.Item_Exists: 01';
1336: -- /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(X_itemtype,X_itemkey,l_progress);
1337:
1338: -- initialize the return variables
1339: X_item_exist := NULL;

Line 1349: l_progress := 'PO_LINES_SV4_832_UPDATE.Item_Exists: 900 ';

1345: WHERE WI.ITEM_TYPE = X_ItemType
1346: AND WI.ITEM_KEY = X_ItemKey;
1347:
1348:
1349: l_progress := 'PO_LINES_SV4_832_UPDATE.Item_Exists: 900 ';
1350: -- /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(X_itemtype,X_itemkey,l_progress);
1351:
1352: EXCEPTION
1353: WHEN NO_DATA_FOUND THEN

Line 1361: wf_core.context ('PO_LINES_SV4_832_UPDATE','Item_exists','SQL error ' || sqlcode);

1357: X_item_end_date := NULL;
1358:
1359: WHEN OTHERS THEN
1360:
1361: wf_core.context ('PO_LINES_SV4_832_UPDATE','Item_exists','SQL error ' || sqlcode);
1362: l_progress := 'PO_LINES_SV4_832_UPDATE.Item_Exists: 990 - ' ||
1363: 'EXCEPTION - sql error: ' || sqlcode;
1364: IF (g_po_wf_debug = 'Y') THEN
1365: /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(X_itemtype,X_itemkey,l_progress);

Line 1362: l_progress := 'PO_LINES_SV4_832_UPDATE.Item_Exists: 990 - ' ||

1358:
1359: WHEN OTHERS THEN
1360:
1361: wf_core.context ('PO_LINES_SV4_832_UPDATE','Item_exists','SQL error ' || sqlcode);
1362: l_progress := 'PO_LINES_SV4_832_UPDATE.Item_Exists: 990 - ' ||
1363: 'EXCEPTION - sql error: ' || sqlcode;
1364: IF (g_po_wf_debug = 'Y') THEN
1365: /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(X_itemtype,X_itemkey,l_progress);
1366: END IF;

Line 1409: from po_lines_interface

1405: END IF;
1406:
1407: begin
1408: select count(*) into l_number_of_items
1409: from po_lines_interface
1410: where interface_header_id = X_interface_header_id
1411: and process_code = 'NOTIFIED'
1412: and nvl(price_break_flag,'N') = 'N';
1413:

Line 1560: wf_core.context ('PO_LINES_SV4_832_UPDATE','Start_Pricat_WF','SQL error ' || sqlcode);

1556:
1557: EXCEPTION
1558: WHEN OTHERS THEN
1559:
1560: wf_core.context ('PO_LINES_SV4_832_UPDATE','Start_Pricat_WF','SQL error ' || sqlcode);
1561: l_progress := 'PO_LINES_SV4_832_UPDATE.Start_Pricat_WF: 990 - ' || 'EXCEPTION - sql error: ' || sqlcode;
1562: IF (g_po_wf_debug = 'Y') THEN
1563: /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(X_itemtype,X_itemkey,l_progress);
1564: END IF;

Line 1561: l_progress := 'PO_LINES_SV4_832_UPDATE.Start_Pricat_WF: 990 - ' || 'EXCEPTION - sql error: ' || sqlcode;

1557: EXCEPTION
1558: WHEN OTHERS THEN
1559:
1560: wf_core.context ('PO_LINES_SV4_832_UPDATE','Start_Pricat_WF','SQL error ' || sqlcode);
1561: l_progress := 'PO_LINES_SV4_832_UPDATE.Start_Pricat_WF: 990 - ' || 'EXCEPTION - sql error: ' || sqlcode;
1562: IF (g_po_wf_debug = 'Y') THEN
1563: /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(X_itemtype,X_itemkey,l_progress);
1564: END IF;
1565:

Line 1627: from po_lines_interface

1623: from po_headers_interface
1624: where interface_header_id = p_interface_header_id;
1625:
1626: select price_chg_accept_flag into l_acceptance_flag
1627: from po_lines_interface
1628: where interface_header_id = p_interface_header_id
1629: and interface_line_id = p_interface_line_id;
1630:
1631: IF (g_po_pdoi_write_to_file = 'Y') THEN

Line 1710: update po_lines_interface

1706: END IF;
1707:
1708: -- need to save the tolerance value at the line level as we would have to display it in the PRICAT form
1709:
1710: update po_lines_interface
1711: set price_update_tolerance = l_price_update_tolerance
1712: where interface_header_id = p_interface_header_id
1713: and interface_line_id = p_interface_line_id;
1714:

Line 1716: from po_lines

1712: where interface_header_id = p_interface_header_id
1713: and interface_line_id = p_interface_line_id;
1714:
1715: select unit_price into l_original_price
1716: from po_lines
1717: where po_header_id = p_document_id
1718: and po_line_id = p_po_line_id;
1719:
1720: If (((1 + (l_price_update_tolerance/100)) * l_original_price) >= p_unit_price) then

Line 1786: p_unit_price IN PO_LINES.unit_price%TYPE

1782: =============================================================================*/
1783: PROCEDURE update_price_discount
1784: (
1785: p_po_line_id IN PO_LINE_LOCATIONS.po_line_id%TYPE,
1786: p_unit_price IN PO_LINES.unit_price%TYPE
1787: )
1788: IS BEGIN
1789:
1790: UPDATE PO_LINE_LOCATIONS

Line 1803: END PO_LINES_SV4_832_UPDATE;

1799:
1800: END update_price_discount;
1801:
1802:
1803: END PO_LINES_SV4_832_UPDATE;