DBA Data[Home] [Help]

APPS.PO_AUTO_DIST_PROCESS_PVT dependencies on PO_AUTOCREATE_PARAMS

Line 82: WHERE pdi.interface_header_id = po_autocreate_params.g_interface_header_id

78: variance_account_id,
79: encumbered_flag,
80: budget_account_id
81: FROM po_distributions_interface pdi
82: WHERE pdi.interface_header_id = po_autocreate_params.g_interface_header_id
83: AND pdi.interface_line_id = p_intf_line_id
84: ORDER BY pdi.interface_distribution_id;
85:
86: BEGIN

Line 128: IF po_autocreate_params.g_process_code = 'ADD_FUNDS' THEN

124:
125: l_progress := '020';
126:
127: --get previous max distribution number for this shipment
128: IF po_autocreate_params.g_process_code = 'ADD_FUNDS' THEN
129: SELECT NVL(MAX(distribution_num), 0)
130: INTO x_distribution_num
131: FROM po_distributions_merge_v --Add req to mod project
132: WHERE line_location_id = p_lines.line_loc_id_tbl(i)

Line 133: AND draft_id = po_autocreate_params.g_draft_id;

129: SELECT NVL(MAX(distribution_num), 0)
130: INTO x_distribution_num
131: FROM po_distributions_merge_v --Add req to mod project
132: WHERE line_location_id = p_lines.line_loc_id_tbl(i)
133: AND draft_id = po_autocreate_params.g_draft_id;
134: ELSE
135: /*Bug 13586217 replaced base table with the merge view to cater to add to mod flow */
136: SELECT NVL(MAX(distribution_num), 0)
137: INTO x_distribution_num

Line 140: AND draft_id = po_autocreate_params.g_draft_id;

136: SELECT NVL(MAX(distribution_num), 0)
137: INTO x_distribution_num
138: FROM po_distributions_merge_v --
139: WHERE line_location_id = p_lines.line_loc_id_tbl(i)
140: AND draft_id = po_autocreate_params.g_draft_id;
141: END IF;
142:
143: l_progress:='030';
144:

Line 157: WHERE NVL(org_id, -99) = NVL(PO_AUTOCREATE_PARAMS.g_purchasing_ou_id, -99);

153: l_progress := '050';
154: SELECT set_of_books_id
155: INTO x_sob_id
156: FROM financials_system_params_all --
157: WHERE NVL(org_id, -99) = NVL(PO_AUTOCREATE_PARAMS.g_purchasing_ou_id, -99);
158:
159: IF g_debug_stmt THEN
160: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name, p_token => l_progress,
161: p_message => 'Create_distributions: Order type: '||x_order_type_lookup_code);

Line 218: IF ((PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')

214: p_message => 'l_validate_gl_period: '||l_validate_gl_period);
215: END IF;
216:
217: --The following should be done only if the po encumbrance flag is yes
218: IF ((PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')
219: AND (x_gl_date_option <> 'REQ GL DATE')
220: AND (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL)) THEN
221: l_progress := '090';
222: /*Bug13553227. eliminated the sql to derive the period name.

Line 220: AND (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL)) THEN

216:
217: --The following should be done only if the po encumbrance flag is yes
218: IF ((PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')
219: AND (x_gl_date_option <> 'REQ GL DATE')
220: AND (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL)) THEN
221: l_progress := '090';
222: /*Bug13553227. eliminated the sql to derive the period name.
223: calling PO_PERIODS_SV.get_period_name to make it consistent.
224: If the get_period_name does not return a period then we will call build_GL_Encumbered_Date in case of PO:validate GL period = 'Redefault'*/

Line 226: PO_PERIODS_SV.get_period_name( x_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id ,

222: /*Bug13553227. eliminated the sql to derive the period name.
223: calling PO_PERIODS_SV.get_period_name to make it consistent.
224: If the get_period_name does not return a period then we will call build_GL_Encumbered_Date in case of PO:validate GL period = 'Redefault'*/
225: l_progress := 50;
226: PO_PERIODS_SV.get_period_name( x_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id ,
227: x_gl_date => SYSDATE ,
228: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );
229:
230:

Line 228: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );

224: If the get_period_name does not return a period then we will call build_GL_Encumbered_Date in case of PO:validate GL period = 'Redefault'*/
225: l_progress := 50;
226: PO_PERIODS_SV.get_period_name( x_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id ,
227: x_gl_date => SYSDATE ,
228: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );
229:
230:
231:
232: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN

Line 232: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN

228: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );
229:
230:
231:
232: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
233: l_progress := 60;
234: IF l_validate_gl_period = 'R' THEN
235:
236: PO_PERIODS_SV.build_GL_Encumbered_Date(l_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id

Line 236: PO_PERIODS_SV.build_GL_Encumbered_Date(l_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id

232: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
233: l_progress := 60;
234: IF l_validate_gl_period = 'R' THEN
235:
236: PO_PERIODS_SV.build_GL_Encumbered_Date(l_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id
237: ,x_gl_date => x_gl_date
238: ,x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name);
239:
240: END IF;

Line 238: ,x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name);

234: IF l_validate_gl_period = 'R' THEN
235:
236: PO_PERIODS_SV.build_GL_Encumbered_Date(l_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id
237: ,x_gl_date => x_gl_date
238: ,x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name);
239:
240: END IF;
241: END IF;
242:

Line 246: p_message => 'PO_AUTOCREATE_PARAMS.g_sys.period_name: '||PO_AUTOCREATE_PARAMS.g_sys.period_name);

242:
243:
244: IF g_debug_stmt THEN
245: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name, p_token => l_progress,
246: p_message => 'PO_AUTOCREATE_PARAMS.g_sys.period_name: '||PO_AUTOCREATE_PARAMS.g_sys.period_name);
247: END IF;
248:
249:
250: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN

Line 250: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN

246: p_message => 'PO_AUTOCREATE_PARAMS.g_sys.period_name: '||PO_AUTOCREATE_PARAMS.g_sys.period_name);
247: END IF;
248:
249:
250: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
251: l_progress := 70;
252: IF (PO_LOG.d_exc) THEN
253: PO_LOG.exc(g_log_head||l_api_name, l_progress, 'Unable to find period name for SYSDATE');
254: END IF;

Line 280: IF (p_lines.from_line_id_tbl(i) IS NOT NULL) AND (PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD') THEN

276:
277: --Conversion of req UOM to Quotation UOM should always happen if the
278: -- source document is a quote and profile 'PO: Convert Requisition UOM to Source Document UOM'
279: -- should be ignored in that case
280: IF (p_lines.from_line_id_tbl(i) IS NOT NULL) AND (PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD') THEN
281: l_progress := '120';
282:
283: BEGIN
284: --need to check ant interface.from_line_id and intreface.from_header_id

Line 310: IF (PO_AUTOCREATE_PARAMS.g_document_subtype='STANDARD') AND (p_lines.from_line_id_tbl(i) IS NOT NULL) THEN

306:
307: END IF;
308:
309: IF (NVL(x_uom_convert,'N') = 'Y' OR (l_from_type_lookup_code = 'QUOTATION')) THEN
310: IF (PO_AUTOCREATE_PARAMS.g_document_subtype='STANDARD') AND (p_lines.from_line_id_tbl(i) IS NOT NULL) THEN
311: /* get the uom from the PO . This will be used for uom conversion */
312:
313: BEGIN
314: -- Autocreating a PO that references a GA

Line 379: IF (PO_AUTOCREATE_PARAMS.g_interface_source_code IN ('SOURCING','CONSUMPTION_ADVICE') AND -- CONSIGNED FPI

375: l_budget_account_id;
376:
377: CLOSE c_dis_accounts;
378:
379: IF (PO_AUTOCREATE_PARAMS.g_interface_source_code IN ('SOURCING','CONSUMPTION_ADVICE') AND -- CONSIGNED FPI
380: (l_charge_account_id IS NULL
381: OR l_accrual_account_id IS NULL
382: OR l_variance_account_id IS NULL
383: OR (l_encumbered_flag='Y' AND l_budget_account_id IS NULL))) THEN

Line 388: l_currency_conversion_rate := NVL(PO_AUTOCREATE_PARAMS.g_rate_for_req_fields,1); --

384: NULL;
385: ELSE
386: l_progress := '180';
387: l_uom_conversion_rate := x_conversion_rate;
388: l_currency_conversion_rate := NVL(PO_AUTOCREATE_PARAMS.g_rate_for_req_fields,1); --
389:
390: l_progress := '190';
391: --update po_distributions interface
392: UPDATE po_distributions_interface

Line 408: AND draft_id = po_autocreate_params.g_draft_id;

404: SELECT NVL(drop_ship_flag,'N')
405: INTO l_drop_ship_flag
406: FROM po_line_locations_draft_all
407: WHERE line_location_id= p_lines.line_loc_id_tbl(i)
408: AND draft_id = po_autocreate_params.g_draft_id;
409: EXCEPTION
410: WHEN OTHERS THEN
411: NULL;
412: END;

Line 423: AND poll.draft_id = po_autocreate_params.g_draft_id;

419: po_line_locations_draft_all poll
420: WHERE pdi.interface_header_id = p_lines.intf_header_id_tbl(i)
421: AND pdi.interface_line_id = p_lines.intf_line_id_tbl(i)
422: AND poll.line_location_id = p_lines.line_loc_id_tbl(i)
423: AND poll.draft_id = po_autocreate_params.g_draft_id;
424:
425: PO_DEBUG.debug_var(g_log_head||l_api_name, l_progress, 'l_amount_ordered',l_amount_ordered);
426: PO_DEBUG.debug_var(g_log_head||l_api_name, l_progress, 'x_order_type_lookup_code',x_order_type_lookup_code);
427: PO_DEBUG.debug_var(g_log_head||l_api_name, l_progress, 'l_currency_conversion_rate',l_currency_conversion_rate);

Line 454: x_rate:= PO_AUTOCREATE_PARAMS.g_rate_for_req_fields;

450: l_progress := '240';
451: IF ( x_req_currency_code = p_lines.hd_currency_code_tbl(i) ) THEN
452: x_rate :=x_req_rate;
453: ELSE
454: x_rate:= PO_AUTOCREATE_PARAMS.g_rate_for_req_fields;
455: END IF;
456:
457: l_progress := '250';
458: SELECT COUNT(*)

Line 464: AND poll.draft_id =po_autocreate_params.g_draft_id

460: FROM po_distributions_interface pdi,
461: po_line_locations_draft_all poll
462: WHERE pdi.interface_header_id = p_lines.intf_header_id_tbl(i)
463: AND pdi.interface_line_id = p_lines.intf_line_id_tbl(i)
464: AND poll.draft_id =po_autocreate_params.g_draft_id
465: AND poll.line_location_id = p_lines.line_loc_id_tbl(i);
466:
467: IF g_debug_stmt THEN
468: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name, p_token => l_progress,

Line 571: po_autocreate_params.g_draft_id,

567: clm_agency_acct_identifier,
568: change_status
569: )
570: SELECT pdi.po_distribution_id, --
571: po_autocreate_params.g_draft_id,
572: --default who columns
573: ---------------------------------------------------------------
574: NVL(p_lines.last_update_date_tbl(i), sysdate),
575: NVL(p_lines.last_updated_by_tbl(i), FND_GLOBAL.user_id),

Line 587: DECODE(PO_AUTOCREATE_PARAMS.g_document_subtype,'RELEASE',p_lines.po_release_id_tbl(i),''),

583: ---------------------------------------------------------------
584: p_lines.po_header_id_tbl(i),
585: p_lines.po_line_id_tbl(i),
586: p_lines.line_loc_id_tbl(i),
587: DECODE(PO_AUTOCREATE_PARAMS.g_document_subtype,'RELEASE',p_lines.po_release_id_tbl(i),''),
588: pdi.req_distribution_id,
589: NVL(x_sob_id, pdi.set_of_books_id), --
590: pdi.charge_account_id,
591: pdi.deliver_to_location_id,

Line 596: 'QUANTITY', ROUND(DECODE(po_autocreate_params.g_process_code,

592: -- if the drop_ship_flag is 'Y' then we
593: --need to pass null
594: DECODE(l_drop_ship_flag,'Y',NULL,pdi.deliver_to_person_id),
595: DECODE( x_order_type_lookup_code,
596: 'QUANTITY', ROUND(DECODE(po_autocreate_params.g_process_code,
597: 'ADD_FUNDS', (DECODE(poll.PRICE_OVERRIDE,
598: NULL,pdi.quantity_ordered,
599: 0,pdi.quantity_ordered,
600: pdi.funded_value/poll.PRICE_OVERRIDE)),

Line 605: 'AMOUNT', ROUND( (DECODE(po_autocreate_params.g_process_code,

601: pdi.quantity_ordered * x_conversion_rate), 15),
602: --Commenting out, as in case of grouping distribution count will exceed 1
603: /*(DECODE(l_dist_count,
604: 1, poll.quantity, pdi.quantity_ordered)) * x_conversion_rate), 15),*/
605: 'AMOUNT', ROUND( (DECODE(po_autocreate_params.g_process_code,
606: 'ADD_FUNDS',pdi.quantity_ordered,
607: pdi.quantity_ordered) * x_conversion_rate / NVL(x_rate,1)),
608: /*DECODE(l_dist_count,
609: 1, poll.quantity, pdi.quantity_ordered)) * x_conversion_rate / NVL(x_rate,1)),*/ -- <>

Line 634: NVL( DECODE( PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag ,

630: -- Otherwise, if PO enc is on, use SYSDATE.
631: -- if PO enc is not on, use NULL.
632: -- gl_encumbered_date =
633: ,
634: NVL( DECODE( PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag ,
635: 'Y', DECODE( x_gl_date_option ,
636: 'REQ GL DATE', pdi.gl_encumbered_date , NULL ) ,
637: NULL ) , DECODE( PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag , 'Y', TRUNC(SYSDATE) , NULL ) )
638: -- gl_encumbered_period_name =

Line 637: NULL ) , DECODE( PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag , 'Y', TRUNC(SYSDATE) , NULL ) )

633: ,
634: NVL( DECODE( PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag ,
635: 'Y', DECODE( x_gl_date_option ,
636: 'REQ GL DATE', pdi.gl_encumbered_date , NULL ) ,
637: NULL ) , DECODE( PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag , 'Y', TRUNC(SYSDATE) , NULL ) )
638: -- gl_encumbered_period_name =
639: ,
640: NVL( DECODE( PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag ,
641: 'Y', DECODE(x_gl_date_option ,

Line 640: NVL( DECODE( PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag ,

636: 'REQ GL DATE', pdi.gl_encumbered_date , NULL ) ,
637: NULL ) , DECODE( PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag , 'Y', TRUNC(SYSDATE) , NULL ) )
638: -- gl_encumbered_period_name =
639: ,
640: NVL( DECODE( PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag ,
641: 'Y', DECODE(x_gl_date_option ,
642: 'REQ GL DATE', pdi.gl_encumbered_period_name , NULL ) ,
643: NULL ) , DECODE( PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag , 'Y', PO_AUTOCREATE_PARAMS.g_sys.period_name , NULL ) ) ,
644: pdi.distribution_num, --

Line 643: NULL ) , DECODE( PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag , 'Y', PO_AUTOCREATE_PARAMS.g_sys.period_name , NULL ) ) ,

639: ,
640: NVL( DECODE( PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag ,
641: 'Y', DECODE(x_gl_date_option ,
642: 'REQ GL DATE', pdi.gl_encumbered_period_name , NULL ) ,
643: NULL ) , DECODE( PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag , 'Y', PO_AUTOCREATE_PARAMS.g_sys.period_name , NULL ) ) ,
644: pdi.distribution_num, --
645: pdi.destination_type_code,
646: pdi.destination_organization_id,
647: pdi.destination_subinventory,

Line 666: DECODE( pdi.destination_type_code , PO_AUTOCREATE_PARAMS.g_dest_type_code_SHOP_FLOOR, 'Y' , 'N' ) ,

662: pdi.bom_resource_id
663: --
664: -- prevent_encumbrance_flag =
665: ,
666: DECODE( pdi.destination_type_code , PO_AUTOCREATE_PARAMS.g_dest_type_code_SHOP_FLOOR, 'Y' , 'N' ) ,
667: pdi.project_id,
668: pdi.task_id,
669: pdi.end_item_unit_number,
670: pdi.expenditure_type,

Line 684: PO_AUTOCREATE_PARAMS.g_purchasing_ou_id, --

680: --togeorge 09/27/2000
681: --added oke columns
682: pdi.oke_contract_line_id,
683: pdi.oke_contract_deliverable_id,
684: PO_AUTOCREATE_PARAMS.g_purchasing_ou_id, --
685: poll.shipment_type, --
686: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL), --
687: --pdi.interface_distribution_ref --
688: --partial funding attributes

Line 686: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL), --

682: pdi.oke_contract_line_id,
683: pdi.oke_contract_deliverable_id,
684: PO_AUTOCREATE_PARAMS.g_purchasing_ou_id, --
685: poll.shipment_type, --
686: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL), --
687: --pdi.interface_distribution_ref --
688: --partial funding attributes
689: pdi.partial_funded_flag,
690: pdi.funded_value,

Line 692: 'QUANTITY', DECODE(po_autocreate_params.g_process_code,

688: --partial funding attributes
689: pdi.partial_funded_flag,
690: pdi.funded_value,
691: DECODE( x_order_type_lookup_code,
692: 'QUANTITY', DECODE(po_autocreate_params.g_process_code,
693: 'ADD_FUNDS', ROUND((DECODE(poll.PRICE_OVERRIDE,
694: NULL,pdi.quantity_funded,
695: 0,pdi.quantity_funded,
696: pdi.funded_value/poll.PRICE_OVERRIDE)), 15),

Line 710: AND poll.draft_id =po_autocreate_params.g_draft_id

706: FROM po_distributions_interface pdi,
707: po_line_locations_draft_all poll
708: WHERE pdi.interface_header_id = p_lines.intf_header_id_tbl(i)
709: AND pdi.interface_line_id = p_lines.intf_line_id_tbl(i)
710: AND poll.draft_id =po_autocreate_params.g_draft_id
711: AND poll.line_location_id = p_lines.line_loc_id_tbl(i) ; --
712:
713: --Line Type and Structure Changes Project
714: --Do not calibrate the distributions if the lines have linked PR references.

Line 721: IF ((NVL(po_autocreate_params.g_process_code,'X') <> 'ADD_FUNDS') AND (Nvl(l_orig_from_req_flag, 'N') IN ('N', 'Y'))) THEN

717: SELECT orig_from_req_flag INTO l_orig_from_req_flag
718: FROM po_lines_interface
719: WHERE interface_line_id = p_lines.intf_line_id_tbl(i);
720:
721: IF ((NVL(po_autocreate_params.g_process_code,'X') <> 'ADD_FUNDS') AND (Nvl(l_orig_from_req_flag, 'N') IN ('N', 'Y'))) THEN
722:
723: /*l_progress := '270';
724: Correct last distribution amount for any conversion and
725: rounding inaccuracies to ensure that the distribution amounts add up

Line 960: IF ((PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')

956: FND_PROFILE.GET('PO_AUTOCREATE_DATE', l_gl_date_option);
957:
958:
959:
960: IF ((PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')
961: AND (l_gl_date_option <> 'REQ GL DATE')
962: AND (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL)) THEN
963: -- derive period name if it isn't already known
964: d_progress := 40;

Line 962: AND (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL)) THEN

958:
959:
960: IF ((PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')
961: AND (l_gl_date_option <> 'REQ GL DATE')
962: AND (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL)) THEN
963: -- derive period name if it isn't already known
964: d_progress := 40;
965:
966: /*Bug13553227. eliminated the sql to derive the period name.

Line 978: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );

974:
975: d_progress := 50;
976: PO_PERIODS_SV.get_period_name( x_sob_id => l_sob_id ,
977: x_gl_date => SYSDATE ,
978: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );
979:
980: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
981: d_progress := 60;
982: IF l_validate_gl_period = 'R' THEN

Line 980: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN

976: PO_PERIODS_SV.get_period_name( x_sob_id => l_sob_id ,
977: x_gl_date => SYSDATE ,
978: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );
979:
980: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
981: d_progress := 60;
982: IF l_validate_gl_period = 'R' THEN
983:
984: PO_PERIODS_SV.build_GL_Encumbered_Date(l_sob_id => l_sob_id

Line 986: ,x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name);

982: IF l_validate_gl_period = 'R' THEN
983:
984: PO_PERIODS_SV.build_GL_Encumbered_Date(l_sob_id => l_sob_id
985: ,x_gl_date => x_gl_date
986: ,x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name);
987:
988: END IF;
989: END IF;
990:

Line 992: PO_LOG.stmt(d_module, d_progress, 'PO_AUTOCREATE_PARAMS.g_sys.period_name', PO_AUTOCREATE_PARAMS.g_sys.period_name);

988: END IF;
989: END IF;
990:
991: IF (PO_LOG.d_stmt) THEN
992: PO_LOG.stmt(d_module, d_progress, 'PO_AUTOCREATE_PARAMS.g_sys.period_name', PO_AUTOCREATE_PARAMS.g_sys.period_name);
993: END IF;
994:
995: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
996: d_progress := 70;

Line 995: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN

991: IF (PO_LOG.d_stmt) THEN
992: PO_LOG.stmt(d_module, d_progress, 'PO_AUTOCREATE_PARAMS.g_sys.period_name', PO_AUTOCREATE_PARAMS.g_sys.period_name);
993: END IF;
994:
995: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
996: d_progress := 70;
997: IF (PO_LOG.d_exc) THEN
998: PO_LOG.exc(d_module, d_progress, 'Unable to find period name for SYSDATE');
999: END IF;

Line 1070: po_autocreate_params.g_draft_id ,

1066: amount_funded ,
1067: change_in_funded_value
1068: )
1069: SELECT PO_DISTRIBUTIONS_S.NEXTVAL ,
1070: po_autocreate_params.g_draft_id ,
1071: p_lines.last_update_date_tbl(i) ,
1072: p_lines.last_updated_by_tbl(i) ,
1073: p_lines.last_update_login_tbl(i) ,
1074: p_lines.creation_date_tbl(i) ,

Line 1106: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', DECODE(poll.shipment_type, 'PREPAYMENT', 'Y', 'N'), NULL) -- prevent_encumbrance_flag

1102: 'N' -- accrued_flag
1103: ,
1104: 'N' -- encumbered_flag
1105: ,
1106: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', DECODE(poll.shipment_type, 'PREPAYMENT', 'Y', 'N'), NULL) -- prevent_encumbrance_flag
1107: ,
1108: (
1109: CASE -- gl_encumbered_date
1110: WHEN (PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag = 'Y'

Line 1110: WHEN (PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag = 'Y'

1106: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', DECODE(poll.shipment_type, 'PREPAYMENT', 'Y', 'N'), NULL) -- prevent_encumbrance_flag
1107: ,
1108: (
1109: CASE -- gl_encumbered_date
1110: WHEN (PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag = 'Y'
1111: AND l_gl_date_option = 'REQ GL DATE')
1112: THEN prd.gl_encumbered_date
1113: WHEN (PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')
1114: THEN TRUNC(SYSDATE)

Line 1113: WHEN (PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')

1109: CASE -- gl_encumbered_date
1110: WHEN (PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag = 'Y'
1111: AND l_gl_date_option = 'REQ GL DATE')
1112: THEN prd.gl_encumbered_date
1113: WHEN (PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')
1114: THEN TRUNC(SYSDATE)
1115: ELSE NULL
1116: END) ,
1117: (

Line 1119: WHEN (PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag = 'Y'

1115: ELSE NULL
1116: END) ,
1117: (
1118: CASE -- gl_encumbered_period_name
1119: WHEN (PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag = 'Y'
1120: AND l_gl_date_option = 'REQ GL DATE')
1121: THEN prd.gl_encumbered_period_name
1122: WHEN (PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')
1123: THEN PO_AUTOCREATE_PARAMS.g_sys.period_name

Line 1122: WHEN (PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')

1118: CASE -- gl_encumbered_period_name
1119: WHEN (PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag = 'Y'
1120: AND l_gl_date_option = 'REQ GL DATE')
1121: THEN prd.gl_encumbered_period_name
1122: WHEN (PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')
1123: THEN PO_AUTOCREATE_PARAMS.g_sys.period_name
1124: ELSE NULL
1125: END) ,
1126: prd.recovery_rate ,

Line 1123: THEN PO_AUTOCREATE_PARAMS.g_sys.period_name

1119: WHEN (PO_AUTOCREATE_PARAMS.g_sys.req_encumbrance_flag = 'Y'
1120: AND l_gl_date_option = 'REQ GL DATE')
1121: THEN prd.gl_encumbered_period_name
1122: WHEN (PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y')
1123: THEN PO_AUTOCREATE_PARAMS.g_sys.period_name
1124: ELSE NULL
1125: END) ,
1126: prd.recovery_rate ,
1127: poll.accrue_on_receipt_flag ,

Line 1129: PO_AUTOCREATE_PARAMS.g_purchasing_ou_id ,

1125: END) ,
1126: prd.recovery_rate ,
1127: poll.accrue_on_receipt_flag ,
1128: prl.kanban_card_id ,
1129: PO_AUTOCREATE_PARAMS.g_purchasing_ou_id ,
1130: poll.shipment_type ,
1131: (
1132: CASE -- quantity_ordered
1133: WHEN poll.value_basis <> 'QUANTITY'

Line 1146: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL) ,--

1142: WHEN poll.value_basis <> 'FIXED PRICE'
1143: THEN NULL
1144: ELSE ROUND((prd.req_line_amount / prl.amount) * poll.amount, x_precision)
1145: END) ,
1146: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL) ,--
1147: --partial funding attributes
1148: prd.partial_funded_flag,
1149: prd.funded_value,
1150: NULL, --prd.quantity_funded,

Line 1171: IF ((PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y') AND (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL)) THEN

1167: ELSE
1168: -- no backing req exists; create distributions for payitems
1169: -- from scratch. Accounts are not set here - they will
1170: -- be generated and populated later.
1171: IF ((PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y') AND (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL)) THEN
1172: -- derive period name if it isn't already known
1173: d_progress := 80;
1174: /*Bug13553227 start */
1175: PO_PERIODS_SV.get_period_name( x_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id ,

Line 1175: PO_PERIODS_SV.get_period_name( x_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id ,

1171: IF ((PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag = 'Y') AND (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL)) THEN
1172: -- derive period name if it isn't already known
1173: d_progress := 80;
1174: /*Bug13553227 start */
1175: PO_PERIODS_SV.get_period_name( x_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id ,
1176: x_gl_date => SYSDATE ,
1177: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );
1178:
1179: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN

Line 1177: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );

1173: d_progress := 80;
1174: /*Bug13553227 start */
1175: PO_PERIODS_SV.get_period_name( x_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id ,
1176: x_gl_date => SYSDATE ,
1177: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );
1178:
1179: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
1180: d_progress := 85;
1181: IF l_validate_gl_period = 'R' THEN

Line 1179: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN

1175: PO_PERIODS_SV.get_period_name( x_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id ,
1176: x_gl_date => SYSDATE ,
1177: x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name );
1178:
1179: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
1180: d_progress := 85;
1181: IF l_validate_gl_period = 'R' THEN
1182:
1183: PO_PERIODS_SV.build_GL_Encumbered_Date(l_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id

Line 1183: PO_PERIODS_SV.build_GL_Encumbered_Date(l_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id

1179: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
1180: d_progress := 85;
1181: IF l_validate_gl_period = 'R' THEN
1182:
1183: PO_PERIODS_SV.build_GL_Encumbered_Date(l_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id
1184: ,x_gl_date => x_gl_date
1185: ,x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name);
1186:
1187: END IF;

Line 1185: ,x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name);

1181: IF l_validate_gl_period = 'R' THEN
1182:
1183: PO_PERIODS_SV.build_GL_Encumbered_Date(l_sob_id => PO_AUTOCREATE_PARAMS.g_sys.sob_id
1184: ,x_gl_date => x_gl_date
1185: ,x_gl_period => PO_AUTOCREATE_PARAMS.g_sys.period_name);
1186:
1187: END IF;
1188: END IF;
1189:

Line 1191: PO_LOG.stmt(d_module, d_progress, 'PO_AUTOCREATE_PARAMS.g_sys.period_name', PO_AUTOCREATE_PARAMS.g_sys.period_name);

1187: END IF;
1188: END IF;
1189:
1190: IF (PO_LOG.d_stmt) THEN
1191: PO_LOG.stmt(d_module, d_progress, 'PO_AUTOCREATE_PARAMS.g_sys.period_name', PO_AUTOCREATE_PARAMS.g_sys.period_name);
1192: END IF;
1193:
1194: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
1195: d_progress := 90;

Line 1194: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN

1190: IF (PO_LOG.d_stmt) THEN
1191: PO_LOG.stmt(d_module, d_progress, 'PO_AUTOCREATE_PARAMS.g_sys.period_name', PO_AUTOCREATE_PARAMS.g_sys.period_name);
1192: END IF;
1193:
1194: IF (PO_AUTOCREATE_PARAMS.g_sys.period_name IS NULL) THEN
1195: d_progress := 90;
1196: IF (PO_LOG.d_exc) THEN
1197: PO_LOG.exc(d_module, d_progress, 'Unable to find period name for SYSDATE');
1198: END IF;

Line 1263: po_autocreate_params.g_draft_id ,

1259: amount_funded ,
1260: change_in_funded_value
1261: )
1262: SELECT PO_DISTRIBUTIONS_S.NEXTVAL ,
1263: po_autocreate_params.g_draft_id ,
1264: p_lines.last_update_date_tbl(i) ,
1265: p_lines.last_updated_by_tbl(i) ,
1266: p_lines.last_update_login_tbl(i) ,
1267: p_lines.creation_date_tbl(i) ,

Line 1290: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag,

1286: 'N' -- accrued_flag
1287: ,
1288: 'N' -- encumbered_flag
1289: ,
1290: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag,
1291: 'Y', DECODE(poll.shipment_type, 'PREPAYMENT', 'Y', 'N'), NULL) -- prevent_encumbrance_flag
1292: ,
1293: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', TRUNC(SYSDATE), NULL) ,
1294: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', PO_AUTOCREATE_PARAMS.g_sys.period_name, NULL) ,

Line 1293: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', TRUNC(SYSDATE), NULL) ,

1289: ,
1290: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag,
1291: 'Y', DECODE(poll.shipment_type, 'PREPAYMENT', 'Y', 'N'), NULL) -- prevent_encumbrance_flag
1292: ,
1293: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', TRUNC(SYSDATE), NULL) ,
1294: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', PO_AUTOCREATE_PARAMS.g_sys.period_name, NULL) ,
1295: poll.accrue_on_receipt_flag ,
1296: PO_AUTOCREATE_PARAMS.g_purchasing_ou_id ,
1297: poll.shipment_type ,

Line 1294: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', PO_AUTOCREATE_PARAMS.g_sys.period_name, NULL) ,

1290: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag,
1291: 'Y', DECODE(poll.shipment_type, 'PREPAYMENT', 'Y', 'N'), NULL) -- prevent_encumbrance_flag
1292: ,
1293: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', TRUNC(SYSDATE), NULL) ,
1294: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', PO_AUTOCREATE_PARAMS.g_sys.period_name, NULL) ,
1295: poll.accrue_on_receipt_flag ,
1296: PO_AUTOCREATE_PARAMS.g_purchasing_ou_id ,
1297: poll.shipment_type ,
1298: polli.project_id ,

Line 1296: PO_AUTOCREATE_PARAMS.g_purchasing_ou_id ,

1292: ,
1293: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', TRUNC(SYSDATE), NULL) ,
1294: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', PO_AUTOCREATE_PARAMS.g_sys.period_name, NULL) ,
1295: poll.accrue_on_receipt_flag ,
1296: PO_AUTOCREATE_PARAMS.g_purchasing_ou_id ,
1297: poll.shipment_type ,
1298: polli.project_id ,
1299: polli.task_id ,
1300: polli.award_id ,

Line 1312: PO_AUTOCREATE_PARAMS.g_sys.sob_id ,

1308: polli.expenditure_organization_id ,
1309: polli.expenditure_item_date ,
1310: poll.quantity ,
1311: poll.amount ,
1312: PO_AUTOCREATE_PARAMS.g_sys.sob_id ,
1313: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL) --
1314: --partial funding attributes
1315: ,
1316: 'N' ,

Line 1313: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL) --

1309: polli.expenditure_item_date ,
1310: poll.quantity ,
1311: poll.amount ,
1312: PO_AUTOCREATE_PARAMS.g_sys.sob_id ,
1313: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL) --
1314: --partial funding attributes
1315: ,
1316: 'N' ,
1317: NULL ,

Line 1387: po_autocreate_params.g_draft_id ,

1383: set_of_books_id ,
1384: tax_attribute_update_code --
1385: )
1386: SELECT PO_DISTRIBUTIONS_S.NEXTVAL ,
1387: po_autocreate_params.g_draft_id ,
1388: p_lines.last_update_date_tbl(i) ,
1389: p_lines.last_updated_by_tbl(i) ,
1390: p_lines.last_update_login_tbl(i) ,
1391: p_lines.creation_date_tbl(i) ,

Line 1409: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', 'Y', NULL) --prevent_enc_flag

1405: pod.rate ,
1406: pod.rate_date ,
1407: pod.accrued_flag ,
1408: pod.encumbered_flag ,
1409: DECODE(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'Y', 'Y', NULL) --prevent_enc_flag
1410: ,
1411: NULL -- gl_encumbered_date
1412: ,
1413: NULL -- gl_encumbered_period_name

Line 1431: PO_AUTOCREATE_PARAMS.g_sys.sob_id ,

1427: pod.project_accounting_context ,
1428: pod.destination_context ,
1429: pod.expenditure_organization_id ,
1430: pod.expenditure_item_date ,
1431: PO_AUTOCREATE_PARAMS.g_sys.sob_id ,
1432: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL) --
1433: /*Bug 13598209 : PO_LINE_LOCATIONS_ALL has still not been populated
1434: Hence PO_LINE_LOCATIONS_DRAFT_ALL needs to be used
1435: Similarly for po_distributions_all*/

Line 1432: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL) --

1428: pod.destination_context ,
1429: pod.expenditure_organization_id ,
1430: pod.expenditure_item_date ,
1431: PO_AUTOCREATE_PARAMS.g_sys.sob_id ,
1432: nvl2(PO_AUTOCREATE_PARAMS.g_calculate_tax_flag, 'CREATE', NULL) --
1433: /*Bug 13598209 : PO_LINE_LOCATIONS_ALL has still not been populated
1434: Hence PO_LINE_LOCATIONS_DRAFT_ALL needs to be used
1435: Similarly for po_distributions_all*/
1436: FROM PO_LINE_LOCATIONS_DRAFT_ALL adv,

Line 1504: l_acct_api_success := PO_WF_BUILD_ACCOUNT_INIT.Start_Workflow( x_purchasing_ou_id => PO_AUTOCREATE_PARAMS.g_purchasing_ou_id ,

1500: INTO l_agent_id
1501: FROM po_headers_draft_all
1502: WHERE po_header_id = p_lines.po_header_id_tbl(i);
1503:
1504: l_acct_api_success := PO_WF_BUILD_ACCOUNT_INIT.Start_Workflow( x_purchasing_ou_id => PO_AUTOCREATE_PARAMS.g_purchasing_ou_id ,
1505: x_transaction_flow_header_id => NULL ,
1506: x_dest_charge_success => l_dest_charge_success ,
1507: x_dest_charge_account_id => l_dest_charge_account_id ,
1508: x_dest_charge_account_desc => l_dest_charge_account_desc ,

Line 1530: x_coa_id => PO_AUTOCREATE_PARAMS.g_sys.coa_id ,

1526: x_charge_account_desc => l_charge_account_desc ,
1527: x_budget_account_desc => l_budget_account_desc ,
1528: x_accrual_account_desc => l_accrual_account_desc ,
1529: x_variance_account_desc => l_variance_account_desc ,
1530: x_coa_id => PO_AUTOCREATE_PARAMS.g_sys.coa_id ,
1531: x_bom_resource_id => NULL ,
1532: x_bom_cost_element_id => NULL ,
1533: x_category_id => p_lines.category_id_tbl(i) ,
1534: x_item_id => p_lines.item_id_tbl(i) ,

Line 1535: x_type_lookup_code => PO_AUTOCREATE_PARAMS.g_document_subtype, --interface.document_subtype

1531: x_bom_resource_id => NULL ,
1532: x_bom_cost_element_id => NULL ,
1533: x_category_id => p_lines.category_id_tbl(i) ,
1534: x_item_id => p_lines.item_id_tbl(i) ,
1535: x_type_lookup_code => PO_AUTOCREATE_PARAMS.g_document_subtype, --interface.document_subtype
1536: x_line_type_id => p_lines.line_type_id_tbl(i) ,
1537: x_agent_id => l_agent_id ,--p_lines.hd_agent_id_tbl(i)
1538: x_destination_type_code => payitem_acct_rec.destination_type_code ,
1539: x_deliver_to_location_id => payitem_acct_rec.deliver_to_location_id ,

Line 1560: x_po_encumberance_flag => PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag ,

1556: x_wip_line_id => NULL ,
1557: x_wip_repetitive_schedule_id => NULL ,
1558: x_wip_operation_seq_num => NULL ,
1559: x_wip_resource_seq_num => NULL ,
1560: x_po_encumberance_flag => PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag ,
1561: x_gl_encumbered_date => payitem_acct_rec.gl_encumbered_date ,
1562: x_result_billable_flag => NULL ,
1563: wf_itemkey => l_wf_itemkey ,
1564: x_new_combination => l_new_combination ,

Line 1645: AND (NVL(l_code_combination_id , 0) <> 0) AND l_variance_success AND l_accrual_success AND (l_budget_success OR (NVL(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'N') <> 'Y'))) THEN

1641: d_progress := 190;
1642: IF ( l_acct_api_success AND l_charge_success
1643: --Bug 5645242: Added the check to test if the charge account id generated is null or 0,
1644: --if this is the case, then we should delete the distribution record.
1645: AND (NVL(l_code_combination_id , 0) <> 0) AND l_variance_success AND l_accrual_success AND (l_budget_success OR (NVL(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'N') <> 'Y'))) THEN
1646: d_progress := 200;
1647: IF (PO_LOG.d_stmt) THEN
1648: PO_LOG.stmt(d_module, d_progress, 'Updating dist. with acct. info');
1649: END IF;

Line 1655: pod.budget_account_id = DECODE(NVL(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'N'), 'Y', l_budget_account_id, NULL) ,

1651: --SQL WHY : PO Distributions that don't have a backing req need to
1652: -- have account defaulted from account generator.
1653: UPDATE po_distributions_draft_all pod
1654: SET pod.code_combination_id = l_code_combination_id ,
1655: pod.budget_account_id = DECODE(NVL(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'N'), 'Y', l_budget_account_id, NULL) ,
1656: pod.accrual_account_id = l_accrual_account_id ,
1657: pod.variance_account_id = l_variance_account_id
1658: WHERE pod.po_distribution_id = payitem_acct_rec.po_distribution_id
1659: AND pod.draft_id =po_autocreate_params.g_draft_id;

Line 1659: AND pod.draft_id =po_autocreate_params.g_draft_id;

1655: pod.budget_account_id = DECODE(NVL(PO_AUTOCREATE_PARAMS.g_sys.po_encumbrance_flag, 'N'), 'Y', l_budget_account_id, NULL) ,
1656: pod.accrual_account_id = l_accrual_account_id ,
1657: pod.variance_account_id = l_variance_account_id
1658: WHERE pod.po_distribution_id = payitem_acct_rec.po_distribution_id
1659: AND pod.draft_id =po_autocreate_params.g_draft_id;
1660:
1661: ELSE
1662: d_progress := 210;
1663:

Line 1671: AND pod.draft_id =po_autocreate_params.g_draft_id;

1667:
1668: DELETE
1669: FROM po_distributions_draft_all pod
1670: WHERE pod.po_distribution_id = payitem_acct_rec.po_distribution_id
1671: AND pod.draft_id =po_autocreate_params.g_draft_id;
1672:
1673: END IF; -- if l_acct_api_success AND ...
1674:
1675: END LOOP; -- payitem_acct_gen_cursor loop

Line 1695: AND pod.draft_id =po_autocreate_params.g_draft_id;

1691: SELECT pod.po_distribution_id BULK COLLECT
1692: INTO l_dist_id_tbl
1693: FROM po_distributions_draft_all pod
1694: WHERE pod.po_line_id = p_lines.po_line_id_tbl(i)
1695: AND pod.draft_id =po_autocreate_params.g_draft_id;
1696:
1697: FOR i IN 1..l_dist_id_tbl.COUNT
1698: LOOP
1699: d_progress := 240;

Line 1813: AND pod.draft_id =po_autocreate_params.g_draft_id;

1809: l_gms_po_interface_obj.award_set_id_out
1810: FROM po_distributions_draft_all pod
1811: WHERE pod.po_line_id = p_po_line_id
1812: AND pod.award_id IS NOT NULL
1813: AND pod.draft_id =po_autocreate_params.g_draft_id;
1814: ELSE
1815: l_progress:='020';
1816: --SQL WHAT: For distributions with award_id references, select
1817: -- the columns that Grants needs from the

Line 1867: AND draft_id =po_autocreate_params.g_draft_id;

1863: FORALL i IN 1..l_gms_po_interface_obj.distribution_id.COUNT
1864: UPDATE po_distributions_draft_all
1865: SET award_id = l_gms_po_interface_obj.award_set_id_out(i)
1866: WHERE po_distribution_id = l_gms_po_interface_obj.distribution_id(i)
1867: AND draft_id =po_autocreate_params.g_draft_id;
1868: ELSE
1869: l_progress := '050';
1870: --SQL WHAT: Update po_distributions_interface table with the new
1871: -- award_id's

Line 1969: AND draft_id =po_autocreate_params.g_draft_id;

1965: INTO l_sum_dist_amounts ,
1966: l_last_distribution_id
1967: FROM po_distributions_draft_all
1968: WHERE line_location_id = p_line_location_id
1969: AND draft_id =po_autocreate_params.g_draft_id;
1970:
1971: l_progress:='020';
1972: PO_DEBUG.debug_var(l_log_head,l_progress,'l_sum_dist_amounts',l_sum_dist_amounts);
1973: l_progress:='030';

Line 1992: AND draft_id =po_autocreate_params.g_draft_id RETURNING amount_ordered

1988: --
1989: UPDATE po_distributions_draft_all
1990: SET amount_ordered = l_shipment_amount - (l_sum_dist_amounts - amount_ordered)
1991: WHERE po_distribution_id = l_last_distribution_id
1992: AND draft_id =po_autocreate_params.g_draft_id RETURNING amount_ordered
1993: INTO l_last_dist_amount;
1994:
1995: l_progress:='050';
1996: PO_DEBUG.debug_var(l_log_head,l_progress,'l_last_dist_amount',l_last_dist_amount);

Line 2062: AND pod.draft_id =po_autocreate_params.g_draft_id;

2058: INTO l_sum_dist_quantities,
2059: l_last_dist_id
2060: FROM po_distributions_draft_all pod
2061: WHERE pod.line_location_id = p_line_location_id
2062: AND pod.draft_id =po_autocreate_params.g_draft_id;
2063:
2064: d_progress := 20;
2065: IF (PO_LOG.d_stmt) THEN
2066: PO_LOG.stmt(d_module, d_progress, 'l_last_dist_id', l_last_dist_id);

Line 2072: AND draft_id =po_autocreate_params.g_draft_id;

2068: SELECT poll.quantity
2069: INTO l_shipment_quantity
2070: FROM po_line_locations_draft_all poll
2071: WHERE poll.line_location_id = p_line_location_id
2072: AND draft_id =po_autocreate_params.g_draft_id;
2073:
2074: d_progress := 30;
2075: UPDATE po_distributions_draft_all pod
2076: SET pod.quantity_ordered = l_shipment_quantity - (l_sum_dist_quantities - pod.quantity_ordered)

Line 2078: AND draft_id =po_autocreate_params.g_draft_id RETURNING pod.quantity_ordered

2074: d_progress := 30;
2075: UPDATE po_distributions_draft_all pod
2076: SET pod.quantity_ordered = l_shipment_quantity - (l_sum_dist_quantities - pod.quantity_ordered)
2077: WHERE pod.po_distribution_id = l_last_dist_id
2078: AND draft_id =po_autocreate_params.g_draft_id RETURNING pod.quantity_ordered
2079: INTO l_last_dist_qty;
2080: IF (PO_LOG.d_proc) THEN
2081: PO_LOG.proc_end(d_module, 'l_last_dist_qty', l_last_dist_qty);
2082: PO_LOG.proc_end(d_module);

Line 2143: WHERE pdd.po_header_id = PO_AUTOCREATE_PARAMS.g_po_header_id

2139: l_ACRN_tbl
2140: ,L_LOA_TBL,L_CHANGE_STAT_TBL
2141:
2142: FROM po_distributions_draft_all pdd
2143: WHERE pdd.po_header_id = PO_AUTOCREATE_PARAMS.g_po_header_id
2144: AND pdd.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id
2145: ORDER BY pdd.po_distribution_id ;
2146:
2147: -- Calling buil_acrn API

Line 2144: AND pdd.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id

2140: ,L_LOA_TBL,L_CHANGE_STAT_TBL
2141:
2142: FROM po_distributions_draft_all pdd
2143: WHERE pdd.po_header_id = PO_AUTOCREATE_PARAMS.g_po_header_id
2144: AND pdd.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id
2145: ORDER BY pdd.po_distribution_id ;
2146:
2147: -- Calling buil_acrn API
2148: IF (PO_LOG.d_stmt) THEN

Line 2153: po_account_helper.BUILD_ACRN (PO_AUTOCREATE_PARAMS.g_po_header_id,

2149: PO_LOG.stmt(l_module||l_api_name, l_progress, 'calling BUILD_ACRN');
2150: END IF;
2151: l_progress := '020';
2152: --ACRN Regenerate changes begin
2153: po_account_helper.BUILD_ACRN (PO_AUTOCREATE_PARAMS.g_po_header_id,
2154: l_dist_id_tbl,
2155: l_charge_acc_tbl,
2156: l_ACRN_tbl,
2157: L_LOA_TBL,