72: BEGIN
73:
74: x_progress := '010';
75: if x_po_distribution_id is null then
76: po_interface_errors_sv1.handle_interface_errors(
77: 'PO_DOCS_OPEN_INTERFACE',
78: 'FATAL',
79: null,
80: x_interface_header_id,
90:
91: x_progress := '020';
92:
93: if x_charge_account_id is null then
94: po_interface_errors_sv1.handle_interface_errors(
95: 'PO_DOCS_OPEN_INTERFACE',
96: 'FATAL',
97: null,
98: x_interface_header_id,
110:
111: --
112: IF (p_order_type_lookup_code IN ('RATE', 'FIXED PRICE')) THEN
113: IF (NVL(p_amount, 0) <= 0) THEN
114: PO_INTERFACE_ERRORS_SV1.handle_interface_errors(
115: X_interface_type => 'PO_DOCS_OPEN_INTERFACE',
116: X_Error_type => 'FATAL',
117: X_Batch_id => NULL,
118: X_Interface_Header_Id => X_interface_header_id,
135: X_header_processable_flag => x_header_processable_flag);
136: END IF;
137:
138: IF (NVL(x_quantity_ordered, 0) <> 0) THEN
139: PO_INTERFACE_ERRORS_SV1.handle_interface_errors(
140: X_interface_type => 'PO_DOCS_OPEN_INTERFACE',
141: X_Error_type => 'FATAL',
142: X_Batch_id => NULL,
143: X_Interface_Header_Id => X_interface_header_id,
162:
163: ELSE --if p_order_type_lookup_code not in ('RATE', 'FIXED PRICE')
164: --
165: if (x_quantity_ordered <= 0) OR (x_quantity_ordered is null) then
166: po_interface_errors_sv1.handle_interface_errors(
167: 'PO_DOCS_OPEN_INTERFACE',
168: 'FATAL',
169: null,
170: x_interface_header_id,
179: end if;
180:
181: --
182: IF (NVL(p_amount,0) <> 0) THEN
183: PO_INTERFACE_ERRORS_SV1.handle_interface_errors(
184: X_interface_type => 'PO_DOCS_OPEN_INTERFACE',
185: X_Error_type => 'FATAL',
186: X_Batch_id => NULL,
187: X_Interface_Header_Id => X_interface_header_id,
208:
209: x_progress := '040';
210:
211: if (x_distribution_num is null) then
212: po_interface_errors_sv1.handle_interface_errors(
213: 'PO_DOCS_OPEN_INTERFACE',
214: 'FATAL',
215: null,
216: x_interface_header_id,
229: -- Fixed Bug 2681256 draising
230: -- if (x_quantity_delivered <> 0) OR (x_quantity_delivered is not null) then
231:
232: if nvl(x_quantity_delivered,0) <> 0 then
233: po_interface_errors_sv1.handle_interface_errors(
234: 'PO_DOCS_OPEN_INTERFACE',
235: 'FATAL',
236: null,
237: x_interface_header_id,
248: x_progress := '070';
249:
250: -- if (x_quantity_billed <> 0) OR (x_quantity_billed is not null) then
251: if nvl(x_quantity_billed,0) <> 0 then
252: po_interface_errors_sv1.handle_interface_errors(
253: 'PO_DOCS_OPEN_INTERFACE',
254: 'FATAL',
255: null,
256: x_interface_header_id,
268:
269: -- if (x_quantity_cancelled <> 0) OR (x_quantity_cancelled is not null) then
270:
271: if nvl(x_quantity_cancelled,0) <> 0 then
272: po_interface_errors_sv1.handle_interface_errors(
273: 'PO_DOCS_OPEN_INTERFACE',
274: 'FATAL',
275: null,
276: x_interface_header_id,
294: -- Destination org must be equal to ship-to org.
295: IF NVL(x_destination_organization_id, -11) <>
296: NVL(x_ship_to_organization_id, -99)
297: THEN
298: po_interface_errors_sv1.handle_interface_errors(
299: 'PO_DOCS_OPEN_INTERFACE',
300: 'FATAL',
301: null,
302: x_interface_header_id,
319: x_item_status );
320: x_valid := validate_destination_type_code(x_destination_type_code, x_item_status,
321: x_accrue_on_receipt_flag, p_transaction_flow_header_id); --
322: if x_valid <> 'Y' then
323: po_interface_errors_sv1.handle_interface_errors(
324: 'PO_DOCS_OPEN_INTERFACE',
325: 'FATAL',
326: null,
327: x_interface_header_id,
340:
341: if x_deliver_to_location_id is not null then
342: x_valid := validate_deliver_to_loc_id(x_deliver_to_location_id, x_ship_to_organization_id);
343: if x_valid <> 'Y' then
344: po_interface_errors_sv1.handle_interface_errors(
345: 'PO_DOCS_OPEN_INTERFACE',
346: 'FATAL',
347: null,
348: x_interface_header_id,
361:
362: if x_deliver_to_person_id is not null then
363: x_valid := validate_deliver_to_person_id(x_deliver_to_person_id);
364: if x_valid <> 'Y' then
365: po_interface_errors_sv1.handle_interface_errors(
366: 'PO_DOCS_OPEN_INTERFACE',
367: 'FATAL',
368: null,
369: x_interface_header_id,
380:
381: x_progress := '120';
382:
383: IF (x_item_id is NULL) AND ( x_destination_type_code = 'INVENTORY' ) THEN
384: po_interface_errors_sv1.handle_interface_errors(
385: 'PO_DOCS_OPEN_INTERFACE',
386: 'FATAL',
387: null,
388: x_interface_header_id,
400:
401: if (x_destination_TYPE_CODE = 'INVENTORY') and (x_destination_subinventory is not null) then
402: x_valid := validate_dest_subinventory(x_destination_subinventory, x_ship_to_organization_id, x_item_id);
403: if x_valid <> 'Y' then
404: po_interface_errors_sv1.handle_interface_errors(
405: 'PO_DOCS_OPEN_INTERFACE',
406: 'FATAL',
407: null,
408: x_interface_header_id,
419:
420: x_progress := '140';
421:
422: if (x_destination_type_code in ('SHOP FLOOR','EXPENSE')) and (x_destination_subinventory is not null) then
423: po_interface_errors_sv1.handle_interface_errors(
424: 'PO_DOCS_OPEN_INTERFACE',
425: 'FATAL',
426: null,
427: x_interface_header_id,
445: if (x_wip_entity_id is not null) then
446: x_valid := validate_wip(x_wip_entity_id, x_destination_organization_id, x_wip_repetitive_schedule_id);
447: if x_valid <> 'Y' then
448: if x_wip_repetitive_schedule_id is not null then
449: po_interface_errors_sv1.handle_interface_errors(
450: 'PO_DOCS_OPEN_INTERFACE',
451: 'FATAL',
452: null,
453: x_interface_header_id,
460: x_WIP_REPETITIVE_SCHEDULE_ID,null,null,null,null,null,
461: x_header_processable_flag, x_interface_distribution_id);
462: else
463: /* Bug 3083961 */
464: po_interface_errors_sv1.handle_interface_errors(
465: 'PO_DOCS_OPEN_INTERFACE',
466: 'FATAL',
467: null,
468: x_interface_header_id,
476: end if;
477: end if; /* x_valid */
478: else -- x_wip_entity_id is null
479: /* Bug 3083961 */
480: po_interface_errors_sv1.handle_interface_errors(
481: 'PO_DOCS_OPEN_INTERFACE',
482: 'FATAL',
483: null,
484: X_interface_header_id,
498:
499: IF x_destination_type_code = 'SHOP FLOOR' THEN
500:
501: if x_Prevent_Encumbrance_Flag = 'N' then
502: po_interface_errors_sv1.handle_interface_errors(
503: 'PO_DOCS_OPEN_INTERFACE',
504: 'FATAL',
505: null,
506: x_interface_header_id,
514: x_header_processable_flag, x_interface_distribution_id);
515: end if;
516: else --other dest
517: if x_Prevent_Encumbrance_Flag = 'Y' then
518: po_interface_errors_sv1.handle_interface_errors(
519: 'PO_DOCS_OPEN_INTERFACE',
520: 'FATAL',
521: null,
522: x_interface_header_id,
535:
536: if x_charge_account_id is not null then
537: x_valid := validate_account(x_charge_account_id, x_gl_date, x_chart_of_accounts_id);
538: if x_valid <> 'Y' then
539: po_interface_errors_sv1.handle_interface_errors(
540: 'PO_DOCS_OPEN_INTERFACE',
541: 'FATAL',
542: null,
543: x_interface_header_id,
556:
557: if x_budget_account_id is not null then
558: x_valid := validate_account(x_budget_account_id, x_gl_date, x_chart_of_accounts_id);
559: if x_valid <> 'Y' then
560: po_interface_errors_sv1.handle_interface_errors(
561: 'PO_DOCS_OPEN_INTERFACE',
562: 'FATAL',
563: null,
564: x_interface_header_id,
583: from financials_system_parameters ;
584:
585: if (x_enc_flag = 'Y') then
586:
587: po_interface_errors_sv1.handle_interface_errors(
588: 'PO_DOCS_OPEN_INTERFACE',
589: 'FATAL',
590: null,
591: x_interface_header_id,
604:
605: if x_variance_account_id is not null then
606: x_valid := validate_account(x_variance_account_id, x_gl_date, x_chart_of_accounts_id);
607: if x_valid <> 'Y' then
608: po_interface_errors_sv1.handle_interface_errors(
609: 'PO_DOCS_OPEN_INTERFACE',
610: 'FATAL',
611: null,
612: x_interface_header_id,
625:
626: if x_accrual_account_id is not null then
627: x_valid := validate_account(x_accrual_account_id, x_gl_date, x_chart_of_accounts_id);
628: if x_valid <> 'Y' then
629: po_interface_errors_sv1.handle_interface_errors(
630: 'PO_DOCS_OPEN_INTERFACE',
631: 'FATAL',
632: null,
633: x_interface_header_id,
647: if (x_project_account_context = 'N' or x_project_account_context is null)
648: and (x_project_id is not null) and (x_task_id is not null)
649: and (x_expenditure_type is not null)
650: and (x_expenditure_organization_id is not null) then
651: po_interface_errors_sv1.handle_interface_errors(
652: 'PO_DOCS_OPEN_INTERFACE',
653: 'FATAL',
654: null,
655: x_interface_header_id,
688: x_msg_name --
689: );
690: -- Bug 2892199 Added expenditure_item_date
691: if x_valid <> 'Y' then
692: po_interface_errors_sv1.handle_interface_errors(
693: 'PO_DOCS_OPEN_INTERFACE',
694: 'FATAL',
695: null,
696: x_interface_header_id,
715: x_progress := '235';
716: IF (x_destination_type_code = 'EXPENSE')
717: AND (p_transaction_flow_header_id IS NOT NULL)
718: AND (x_project_id IS NOT NULL) THEN
719: PO_INTERFACE_ERRORS_SV1.handle_interface_errors(
720: x_interface_type => 'PO_DOCS_OPEN_INTERFACE',
721: x_error_type => 'FATAL',
722: x_batch_id => null,
723: x_interface_header_id => x_interface_header_id,