212: -- MOAC initialization
213: --
214: MO_GLOBAL.init('CS_CHARGES');
215:
216: If (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) then
217: fnd_log.STRING (fnd_log.level_procedure,
218: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS.BEGIN',
219: 'Entered Process Bulk Receive Items');
220: End if;
213: --
214: MO_GLOBAL.init('CS_CHARGES');
215:
216: If (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) then
217: fnd_log.STRING (fnd_log.level_procedure,
218: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS.BEGIN',
219: 'Entered Process Bulk Receive Items');
220: End if;
221:
221:
222: -- Verify the required parameter - Transaction Number
223: If ( p_transaction_number is null ) then
224:
225: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
226: fnd_log.STRING (fnd_log.level_event,
227: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
228: 'Validate Transaction Number');
229: End if;
222: -- Verify the required parameter - Transaction Number
223: If ( p_transaction_number is null ) then
224:
225: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
226: fnd_log.STRING (fnd_log.level_event,
227: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
228: 'Validate Transaction Number');
229: End if;
230:
239: -- then set the Party id of the Bulk Receive Rec
240: -- to the IB Owner Party
241: If (fnd_profile.value('CSD_BLK_RCV_CHG_IB_OWNER') = 'N') then
242:
243: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
244: fnd_log.STRING (fnd_log.level_event,
245: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
246: 'Change IB Owner Profile is No, verify Instance party and Entered Party');
247: End if;
240: -- to the IB Owner Party
241: If (fnd_profile.value('CSD_BLK_RCV_CHG_IB_OWNER') = 'N') then
242:
243: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
244: fnd_log.STRING (fnd_log.level_event,
245: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
246: 'Change IB Owner Profile is No, verify Instance party and Entered Party');
247: End if;
248:
273: -- If the IB Owner is <> Entered Party then update the
274: -- Bulk Receive Party = IB Owner
275: If ( l_ib_owner_id <> c_set_party_rec.party_id) then
276:
277: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
278: fnd_log.STRING (fnd_log.level_statement,
279: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
280: 'Update: bulk_receive_id[' || c_set_party_rec.bulk_receive_id ||
281: '] with IB owner party id - '||l_ib_owner_id);
274: -- Bulk Receive Party = IB Owner
275: If ( l_ib_owner_id <> c_set_party_rec.party_id) then
276:
277: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
278: fnd_log.STRING (fnd_log.level_statement,
279: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
280: 'Update: bulk_receive_id[' || c_set_party_rec.bulk_receive_id ||
281: '] with IB owner party id - '||l_ib_owner_id);
282: End if;
299: -- Step - B
300: -- Change IB owner for records which have IB owner different
301: -- from the entered Party/Account
302: --
303: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
304: fnd_log.STRING (fnd_log.level_event,
305: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
306: 'Change IB Owner');
307: End if;
300: -- Change IB owner for records which have IB owner different
301: -- from the entered Party/Account
302: --
303: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
304: fnd_log.STRING (fnd_log.level_event,
305: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
306: 'Change IB Owner');
307: End if;
308:
320: );
321:
322: If (l_return_status = FND_API.G_RET_STS_SUCCESS) then
323:
324: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
325: fnd_log.STRING (fnd_log.level_statement,
326: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
327: 'Change IB owner,Update : bulk_receive_id['
328: || c_change_owner_rec.bulk_receive_id ||
321:
322: If (l_return_status = FND_API.G_RET_STS_SUCCESS) then
323:
324: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
325: fnd_log.STRING (fnd_log.level_statement,
326: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
327: 'Change IB owner,Update : bulk_receive_id['
328: || c_change_owner_rec.bulk_receive_id ||
329: '] party id with orig party id');
406: If ( l_create_intr_sr ) then
407: -- Call the Create Service Request API
408: Savepoint create_intr_sr_savepoint;
409:
410: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
411: fnd_log.STRING (fnd_log.level_event,
412: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
413: 'Create Internal SR');
414: End if;
407: -- Call the Create Service Request API
408: Savepoint create_intr_sr_savepoint;
409:
410: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
411: fnd_log.STRING (fnd_log.level_event,
412: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
413: 'Create Internal SR');
414: End if;
415:
435: );
436:
437: If (l_return_status = FND_API.G_RET_STS_SUCCESS) then
438:
439: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
440: fnd_log.STRING (fnd_log.level_statement,
441: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
442: 'Created Internal SR : Incident id = '
443: ||l_incident_id );
436:
437: If (l_return_status = FND_API.G_RET_STS_SUCCESS) then
438:
439: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
440: fnd_log.STRING (fnd_log.level_statement,
441: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
442: 'Created Internal SR : Incident id = '
443: ||l_incident_id );
444: End if;
477: --
478: -- Step - D
479: -- To Reprocess Errored RO's
480: --
481: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
482: fnd_log.STRING (fnd_log.level_event,
483: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
484: 'Check and reprocess Errored Repair Orders');
485: End if;
478: -- Step - D
479: -- To Reprocess Errored RO's
480: --
481: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
482: fnd_log.STRING (fnd_log.level_event,
483: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
484: 'Check and reprocess Errored Repair Orders');
485: End if;
486:
488: Loop
489:
490: Savepoint reprocess_ro_savepoint;
491:
492: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
493: fnd_log.STRING (fnd_log.level_event,
494: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
495: 'Reprocess RO - Call Create Repair Orders');
496: End if;
489:
490: Savepoint reprocess_ro_savepoint;
491:
492: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
493: fnd_log.STRING (fnd_log.level_event,
494: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
495: 'Reprocess RO - Call Create Repair Orders');
496: End if;
497:
511:
512: -- If RO is created in Draft status then
513: -- no Logistic lines are created
514:
515: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
516: fnd_log.STRING (fnd_log.level_statement,
517: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
518: 'Reprocess RO - Created Repair Order ['||l_repair_line_id||'] in '
519: ||l_ro_status||' status' );
512: -- If RO is created in Draft status then
513: -- no Logistic lines are created
514:
515: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
516: fnd_log.STRING (fnd_log.level_statement,
517: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
518: 'Reprocess RO - Created Repair Order ['||l_repair_line_id||'] in '
519: ||l_ro_status||' status' );
520: End if;
535: where bulk_receive_id = c_reprocess_ro_rec.bulk_receive_id;
536:
537: -- Call the create default product transaction
538:
539: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
540: fnd_log.STRING (fnd_log.level_event,
541: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
542: 'Reprocess RO - Call Create Product Transactions');
543: End if;
536:
537: -- Call the create default product transaction
538:
539: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
540: fnd_log.STRING (fnd_log.level_event,
541: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
542: 'Reprocess RO - Call Create Product Transactions');
543: End if;
544:
583: x_return_status => l_return_status,
584: x_msg_count => l_msg_count,
585: x_msg_data => l_msg_data
586: );
587: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
588: fnd_log.STRING (fnd_log.level_statement,
589: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
590: 'Reprocess RO - After CSD_RO_BULLETINS_PVT.LINK_BULLETINS_TO_RO['
591: || l_repair_line_id || ']');
584: x_msg_count => l_msg_count,
585: x_msg_data => l_msg_data
586: );
587: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
588: fnd_log.STRING (fnd_log.level_statement,
589: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
590: 'Reprocess RO - After CSD_RO_BULLETINS_PVT.LINK_BULLETINS_TO_RO['
591: || l_repair_line_id || ']');
592: END IF;
629: Loop
630: -- SR Savepoint
631: Savepoint create_new_sr_savepoint;
632:
633: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
634: fnd_log.STRING (fnd_log.level_event,
635: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
636: 'Create SR');
637: End if;
630: -- SR Savepoint
631: Savepoint create_new_sr_savepoint;
632:
633: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
634: fnd_log.STRING (fnd_log.level_event,
635: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
636: 'Create SR');
637: End if;
638:
639: -- Create SR
640: l_sr_bulk_receive_rec.party_id := c_create_sr_rec.party_id;
641: l_sr_bulk_receive_rec.cust_account_id := c_create_sr_rec.cust_account_id;
642:
643: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
644: fnd_log.STRING (fnd_log.level_statement,
645: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
646: 'Create SR for Party id - '||c_create_sr_rec.party_id
647: ||',Account Id - '||c_create_sr_rec.cust_account_id);
640: l_sr_bulk_receive_rec.party_id := c_create_sr_rec.party_id;
641: l_sr_bulk_receive_rec.cust_account_id := c_create_sr_rec.cust_account_id;
642:
643: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
644: fnd_log.STRING (fnd_log.level_statement,
645: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
646: 'Create SR for Party id - '||c_create_sr_rec.party_id
647: ||',Account Id - '||c_create_sr_rec.cust_account_id);
648: End if;
706: l_c_create_ro_rowcount := c_create_ro%rowcount;
707:
708: Savepoint create_ro_savepoint;
709:
710: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
711: fnd_log.STRING (fnd_log.level_event,
712: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
713: 'New SR - Call Create Repair Order');
714: End if;
707:
708: Savepoint create_ro_savepoint;
709:
710: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
711: fnd_log.STRING (fnd_log.level_event,
712: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
713: 'New SR - Call Create Repair Order');
714: End if;
715:
729:
730: -- If the RO is created in Draft status then
731: -- no Logistic lines are created.
732:
733: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
734: fnd_log.STRING (fnd_log.level_statement,
735: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
736: 'New SR - Created Repair Order ['||l_repair_line_id||'] in '
737: ||l_ro_status||' status' );
730: -- If the RO is created in Draft status then
731: -- no Logistic lines are created.
732:
733: If (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
734: fnd_log.STRING (fnd_log.level_statement,
735: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
736: 'New SR - Created Repair Order ['||l_repair_line_id||'] in '
737: ||l_ro_status||' status' );
738: End if;
752: status = 'NEW'
753: where bulk_receive_id = c_create_ro_rec.bulk_receive_id;
754:
755: -- Call to create default product transaction
756: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
757: fnd_log.STRING (fnd_log.level_event,
758: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
759: 'New SR - Call Create Product Transactions');
760: End if;
753: where bulk_receive_id = c_create_ro_rec.bulk_receive_id;
754:
755: -- Call to create default product transaction
756: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
757: fnd_log.STRING (fnd_log.level_event,
758: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
759: 'New SR - Call Create Product Transactions');
760: End if;
761:
803: x_return_status => l_return_status,
804: x_msg_count => l_msg_count,
805: x_msg_data => l_msg_data
806: );
807: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
808: fnd_log.STRING (fnd_log.level_statement,
809: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
810: 'New SR - After CSD_RO_BULLETINS_PVT.LINK_BULLETINS_TO_RO['
811: || l_repair_line_id || ']');
804: x_msg_count => l_msg_count,
805: x_msg_data => l_msg_data
806: );
807: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
808: fnd_log.STRING (fnd_log.level_statement,
809: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
810: 'New SR - After CSD_RO_BULLETINS_PVT.LINK_BULLETINS_TO_RO['
811: || l_repair_line_id || ']');
812: END IF;
936:
937: If ( l_bulk_autorcv_tbl.count > 0 ) then
938:
939:
940: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
941: fnd_log.STRING (fnd_log.level_event,
942: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
943: 'Calling Auto Receive API');
944: End if;
937: If ( l_bulk_autorcv_tbl.count > 0 ) then
938:
939:
940: If (fnd_log.level_event >= fnd_log.g_current_runtime_level) then
941: fnd_log.STRING (fnd_log.level_event,
942: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS',
943: 'Calling Auto Receive API');
944: End if;
945:
960: ( p_transaction_number => p_transaction_number);
961:
962: retcode := c_success;
963:
964: If (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) then
965: fnd_log.STRING (fnd_log.level_procedure,
966: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS.END',
967: 'Exit - Process Bulk Receive Items');
968: End if;
961:
962: retcode := c_success;
963:
964: If (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) then
965: fnd_log.STRING (fnd_log.level_procedure,
966: 'CSD.PLSQL.CSD_BULK_RECEIVE_PVT.PROCESS_BULK_RECEIVE_ITEMS.END',
967: 'Exit - Process Bulk Receive Items');
968: End if;
969: