39:
40:
41: -- Debugging
42:
43: g_debug_stmt BOOLEAN := PO_DEBUG.is_debug_stmt_on;
44: g_debug_unexp BOOLEAN := PO_DEBUG.is_debug_unexp_on;
45: -- Read the profile option that enables/disables the debug log
46: g_fnd_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
47:
40:
41: -- Debugging
42:
43: g_debug_stmt BOOLEAN := PO_DEBUG.is_debug_stmt_on;
44: g_debug_unexp BOOLEAN := PO_DEBUG.is_debug_unexp_on;
45: -- Read the profile option that enables/disables the debug log
46: g_fnd_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
47:
48: -- Bug 3231062
637:
638: -- Setup for writing the concurrent logs based on
639: -- the concurrent log Profile
640: IF g_log_mode = 'Y' THEN
641: po_debug.set_file_io(TRUE);
642: ELSE
643: po_debug.set_file_io(null);
644: END IF;
645:
639: -- the concurrent log Profile
640: IF g_log_mode = 'Y' THEN
641: po_debug.set_file_io(TRUE);
642: ELSE
643: po_debug.set_file_io(null);
644: END IF;
645:
646: PO_DEBUG.put_line('Starting the Retroactive concurrent Program');
647:
642: ELSE
643: po_debug.set_file_io(null);
644: END IF;
645:
646: PO_DEBUG.put_line('Starting the Retroactive concurrent Program');
647:
648: /* Logic :
649: * Get the GA function security to check whether the user
650: * has the function security for Global agreements set up.
720: --
721: l_retroactive_update := Get_Retro_Mode;
722: --
723:
724: PO_DEBUG.put_line('Setting the Retroactive Pricing Mode from Profile');
725: PO_DEBUG.put_line('Retro Mode :' || l_retroactive_update);
726:
727: IF (l_retroactive_update = 'NEVER') THEN
728: PO_DEBUG.put_line('Retroactive Profile is set to Never or Financials patchset is not at the right level');
721: l_retroactive_update := Get_Retro_Mode;
722: --
723:
724: PO_DEBUG.put_line('Setting the Retroactive Pricing Mode from Profile');
725: PO_DEBUG.put_line('Retro Mode :' || l_retroactive_update);
726:
727: IF (l_retroactive_update = 'NEVER') THEN
728: PO_DEBUG.put_line('Retroactive Profile is set to Never or Financials patchset is not at the right level');
729: RETURN;
724: PO_DEBUG.put_line('Setting the Retroactive Pricing Mode from Profile');
725: PO_DEBUG.put_line('Retro Mode :' || l_retroactive_update);
726:
727: IF (l_retroactive_update = 'NEVER') THEN
728: PO_DEBUG.put_line('Retroactive Profile is set to Never or Financials patchset is not at the right level');
729: RETURN;
730: END IF;
731:
732: --
868:
869: -- bug2935437
870: -- call a procedure to do all var binding and l_agreement_cur opening
871:
872: PO_DEBUG.put_line('Getting all the Agreements ');
873: open_agreement_cur(p_sql_str => l_sql_str,
874: p_po_header_id => p_po_header_id,
875: p_vendor_id => p_vendor_id,
876: p_vendor_site_id => p_vendor_site_id,
906: l_error_message := 'Did not find any agreements to process. '||
907: 'Make sure that the Cumulative Flag on the Blanket '||
908: 'Price Breaks is set to OFF. Retro pricing does not '||
909: 'work with cumulative price breaks.';
910: PO_DEBUG.put_line(l_error_message);
911: IF g_debug_stmt then
912: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
913: FND_LOG.string(FND_LOG.LEVEL_STATEMENT, l_module, l_error_message);
914: END IF;
958: if l_po_line_id_table(i) IS NOT NULL then -- Blankets
959:
960: if (l_global_agreement_flag_table(i) = 'Y') then
961:
962: PO_DEBUG.put_line('Type of agreement being processes: Global Agreement');
963:
964: IF g_debug_stmt then
965: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
966: FND_LOG.string(FND_LOG.LEVEL_STATEMENT,l_module,
967: 'Global Agreement ');
968: END IF;
969: end if;
970:
971: PO_DEBUG.put_line('Get all Std POs referencing the GA');
972:
973: --
974: IF (l_retroactive_update = 'OPEN_RELEASES') THEN
975: OPEN select_open_stdpo(l_po_line_id_table(i),
1020: END IF; /* IF (l_retroactive_update = 'OPEN_RELEASES') */
1021: --
1022:
1023: IF l_po_header_id_table.COUNT = 0 THEN
1024: PO_DEBUG.put_line('Did not find any Std POs');
1025: PO_DEBUG.put_line('Check for encumbrance setup and Archive mode in the PO creation OU');
1026: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1027: PO_DEBUG.put_line('Retroactive Pricing is not supported in OU with archive set to communicate');
1028: END IF;
1021: --
1022:
1023: IF l_po_header_id_table.COUNT = 0 THEN
1024: PO_DEBUG.put_line('Did not find any Std POs');
1025: PO_DEBUG.put_line('Check for encumbrance setup and Archive mode in the PO creation OU');
1026: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1027: PO_DEBUG.put_line('Retroactive Pricing is not supported in OU with archive set to communicate');
1028: END IF;
1029:
1022:
1023: IF l_po_header_id_table.COUNT = 0 THEN
1024: PO_DEBUG.put_line('Did not find any Std POs');
1025: PO_DEBUG.put_line('Check for encumbrance setup and Archive mode in the PO creation OU');
1026: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1027: PO_DEBUG.put_line('Retroactive Pricing is not supported in OU with archive set to communicate');
1028: END IF;
1029:
1030: if l_po_header_id_table.COUNT <> 0 then
1023: IF l_po_header_id_table.COUNT = 0 THEN
1024: PO_DEBUG.put_line('Did not find any Std POs');
1025: PO_DEBUG.put_line('Check for encumbrance setup and Archive mode in the PO creation OU');
1026: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1027: PO_DEBUG.put_line('Retroactive Pricing is not supported in OU with archive set to communicate');
1028: END IF;
1029:
1030: if l_po_header_id_table.COUNT <> 0 then
1031:
1174: CLOSE select_all_stdpo;
1175: END IF; /* IF (l_retroactive_update = 'OPEN_RELEASES') */
1176: --
1177:
1178: PO_DEBUG.put_line('Completed Processsing of Std POs ');
1179: PO_DEBUG.put_line('If price did not change - Check for encumbrance setup and
1180: Archive mode in the PO creation OU');
1181: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1182: PO_DEBUG.put_line('Retroactive Pricing of invoiced/Received releases is not supported in OU
1175: END IF; /* IF (l_retroactive_update = 'OPEN_RELEASES') */
1176: --
1177:
1178: PO_DEBUG.put_line('Completed Processsing of Std POs ');
1179: PO_DEBUG.put_line('If price did not change - Check for encumbrance setup and
1180: Archive mode in the PO creation OU');
1181: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1182: PO_DEBUG.put_line('Retroactive Pricing of invoiced/Received releases is not supported in OU
1183: with archive set to communicate');
1177:
1178: PO_DEBUG.put_line('Completed Processsing of Std POs ');
1179: PO_DEBUG.put_line('If price did not change - Check for encumbrance setup and
1180: Archive mode in the PO creation OU');
1181: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1182: PO_DEBUG.put_line('Retroactive Pricing of invoiced/Received releases is not supported in OU
1183: with archive set to communicate');
1184:
1185: else
1178: PO_DEBUG.put_line('Completed Processsing of Std POs ');
1179: PO_DEBUG.put_line('If price did not change - Check for encumbrance setup and
1180: Archive mode in the PO creation OU');
1181: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1182: PO_DEBUG.put_line('Retroactive Pricing of invoiced/Received releases is not supported in OU
1183: with archive set to communicate');
1184:
1185: else
1186:
1183: with archive set to communicate');
1184:
1185: else
1186:
1187: PO_DEBUG.put_line('Type of agreement being processed : Blanket Agreement');
1188:
1189: IF g_debug_stmt THEN
1190: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
1191: FND_LOG.string(FND_LOG.LEVEL_STATEMENT,l_module,'Blanket Agreement');
1196: -- OU is ON
1197: IF (PO_CORE_S.is_encumbrance_on(p_doc_type => 'RELEASE',
1198: p_org_id => l_current_org_id))
1199: THEN
1200: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1201: IF g_debug_stmt THEN
1202: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_STATEMENT) THEN
1203: FND_LOG.string(FND_LOG.LEVEL_STATEMENT,l_module,'Encumbrance ON');
1204: END IF;
1212: (l_retroactive_update = 'ALL_RELEASES' AND
1213: l_archive_mode_rel <> 'APPROVE') -- Bug 3565522
1214: THEN
1215:
1216: PO_DEBUG.put_line('Getting all open releases');
1217: PO_DEBUG.put_line('Profile is set to OPEN RELEASES or archive mode is set to communicate');
1218:
1219: OPEN select_open_releases(l_po_line_id_table(i),
1220: l_retroactive_date_table(i),
1213: l_archive_mode_rel <> 'APPROVE') -- Bug 3565522
1214: THEN
1215:
1216: PO_DEBUG.put_line('Getting all open releases');
1217: PO_DEBUG.put_line('Profile is set to OPEN RELEASES or archive mode is set to communicate');
1218:
1219: OPEN select_open_releases(l_po_line_id_table(i),
1220: l_retroactive_date_table(i),
1221: p_date,
1221: p_date,
1222: --Bug 4176111: Pass in the variable for Adv Pricing API
1223: l_qp_license_on);
1224: ELSE
1225: PO_DEBUG.put_line('Getting all releases including invoiced and received');
1226:
1227: OPEN select_all_releases( l_po_line_id_table(i),
1228: l_retroactive_date_table(i),
1229: p_date,
1431: CLOSE select_all_releases;
1432: END IF; /* IF (l_retroactive_update = 'OPEN_RELEASES') */
1433: --
1434:
1435: PO_DEBUG.put_line('Completed Processing blanket releases ');
1436:
1437: end if; /*l_global_agreement_flag = 'Y' */
1438:
1439: --
1486: LIMIT G_BULK_LIMIT;
1487: END IF;
1488:
1489: IF l_po_header_id_table.COUNT = 0 THEN
1490: PO_DEBUG.put_line('Did not find any Std POs');
1491: PO_DEBUG.put_line('Check for encumbrance setup and Archive mode in the PO creation OU');
1492: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1493: PO_DEBUG.put_line('Retroactive Pricing is not supported in OU with archive set to communicate');
1494: END IF;
1487: END IF;
1488:
1489: IF l_po_header_id_table.COUNT = 0 THEN
1490: PO_DEBUG.put_line('Did not find any Std POs');
1491: PO_DEBUG.put_line('Check for encumbrance setup and Archive mode in the PO creation OU');
1492: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1493: PO_DEBUG.put_line('Retroactive Pricing is not supported in OU with archive set to communicate');
1494: END IF;
1495:
1488:
1489: IF l_po_header_id_table.COUNT = 0 THEN
1490: PO_DEBUG.put_line('Did not find any Std POs');
1491: PO_DEBUG.put_line('Check for encumbrance setup and Archive mode in the PO creation OU');
1492: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1493: PO_DEBUG.put_line('Retroactive Pricing is not supported in OU with archive set to communicate');
1494: END IF;
1495:
1496: if l_po_header_id_table.COUNT <> 0 then
1489: IF l_po_header_id_table.COUNT = 0 THEN
1490: PO_DEBUG.put_line('Did not find any Std POs');
1491: PO_DEBUG.put_line('Check for encumbrance setup and Archive mode in the PO creation OU');
1492: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1493: PO_DEBUG.put_line('Retroactive Pricing is not supported in OU with archive set to communicate');
1494: END IF;
1495:
1496: if l_po_header_id_table.COUNT <> 0 then
1497:
1595: ELSE
1596: CLOSE select_all_contract_exec_docs;
1597: END IF; /* IF (l_retroactive_update = 'OPEN_RELEASES') */
1598:
1599: PO_DEBUG.put_line('Completed Processsing of Std POs ');
1600: PO_DEBUG.put_line('If price did not change - Check for encumbrance setup and
1601: Archive mode in the PO creation OU');
1602: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1603: PO_DEBUG.put_line('Retroactive Pricing of invoiced/Received releases is not supported in OU with archive set to communicate');
1596: CLOSE select_all_contract_exec_docs;
1597: END IF; /* IF (l_retroactive_update = 'OPEN_RELEASES') */
1598:
1599: PO_DEBUG.put_line('Completed Processsing of Std POs ');
1600: PO_DEBUG.put_line('If price did not change - Check for encumbrance setup and
1601: Archive mode in the PO creation OU');
1602: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1603: PO_DEBUG.put_line('Retroactive Pricing of invoiced/Received releases is not supported in OU with archive set to communicate');
1604: --
1598:
1599: PO_DEBUG.put_line('Completed Processsing of Std POs ');
1600: PO_DEBUG.put_line('If price did not change - Check for encumbrance setup and
1601: Archive mode in the PO creation OU');
1602: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1603: PO_DEBUG.put_line('Retroactive Pricing of invoiced/Received releases is not supported in OU with archive set to communicate');
1604: --
1605:
1606: END IF; /* l_po_line_id_table(i) IS NOT NULL */
1599: PO_DEBUG.put_line('Completed Processsing of Std POs ');
1600: PO_DEBUG.put_line('If price did not change - Check for encumbrance setup and
1601: Archive mode in the PO creation OU');
1602: PO_DEBUG.put_line('Retroactive Pricing is not supported in encumbered OUs ');
1603: PO_DEBUG.put_line('Retroactive Pricing of invoiced/Received releases is not supported in OU with archive set to communicate');
1604: --
1605:
1606: END IF; /* l_po_line_id_table(i) IS NOT NULL */
1607:
1738:
1739: l_module := g_log_head||l_api_name||'.'||'160'||'.';
1740: PO_RETROACTIVE_PRICING_PVT.Launch_REL_Approval;
1741:
1742: PO_DEBUG.put_line('End of Retroactive Pricing Program');
1743:
1744: EXCEPTION
1745: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1746: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1960:
1961: -- Setup for writing the concurrent logs based on
1962: -- the concurrent log Profile
1963: IF g_log_mode = 'Y' THEN
1964: po_debug.set_file_io(TRUE);
1965: ELSE
1966: po_debug.set_file_io(null);
1967: END IF;
1968:
1962: -- the concurrent log Profile
1963: IF g_log_mode = 'Y' THEN
1964: po_debug.set_file_io(TRUE);
1965: ELSE
1966: po_debug.set_file_io(null);
1967: END IF;
1968:
1969: /* Increment Document Revision */
1970: -- Bulk Select
2107: begin
2108: -- Setup for writing the concurrent logs based on
2109: -- the concurrent log Profile
2110: IF g_log_mode = 'Y' THEN
2111: po_debug.set_file_io(TRUE);
2112: ELSE
2113: po_debug.set_file_io(null);
2114: END IF;
2115:
2109: -- the concurrent log Profile
2110: IF g_log_mode = 'Y' THEN
2111: po_debug.set_file_io(TRUE);
2112: ELSE
2113: po_debug.set_file_io(null);
2114: END IF;
2115:
2116: /* Increment Document Revision */
2117:
2297: begin
2298: -- Setup for writing the concurrent logs based on
2299: -- the concurrent log Profile
2300: IF g_log_mode = 'Y' THEN
2301: po_debug.set_file_io(TRUE);
2302: ELSE
2303: po_debug.set_file_io(null);
2304: END IF;
2305:
2299: -- the concurrent log Profile
2300: IF g_log_mode = 'Y' THEN
2301: po_debug.set_file_io(TRUE);
2302: ELSE
2303: po_debug.set_file_io(null);
2304: END IF;
2305:
2306:
2307:
2357: FND_LOG.string(FND_LOG.LEVEL_EXCEPTION, l_module, l_error_message);
2358: END IF;
2359: END IF;
2360:
2361: PO_DEBUG.put_line(l_error_message);
2362:
2363: g_exclude_index := g_exclude_index + 1;
2364: g_exclude_row_id_table(g_exclude_index) := p_row_id ;
2365:
2378: l_error_message := FND_MESSAGE.get;
2379: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_EXCEPTION) THEN
2380: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,l_module,l_error_message);
2381: END IF;
2382: PO_DEBUG.put_line(l_error_message);
2383:
2384: g_exclude_index := g_exclude_index + 1;
2385: g_exclude_row_id_table(g_exclude_index) := p_row_id ;
2386:
2398: IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_EXCEPTION) THEN
2399: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,l_module,
2400: 'Can not update price since project 11i10 is not enabled');
2401: END IF;
2402: PO_DEBUG.put_line('Can not update price since project 11i10 is not enabled');
2403:
2404: g_exclude_index := g_exclude_index + 1;
2405: g_exclude_row_id_table(g_exclude_index) := p_row_id ;
2406:
2706: FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,
2707: l_module,l_msg_buf);
2708: END IF;
2709: --
2710: PO_DEBUG.put_line('submission check failed for PO id '
2711: ||TO_CHAR(g_po_header_id_table(i)));
2712: PO_DEBUG.put_line('Reason(s) :');
2713: SELECT MAX(sequence)
2714: INTO max_sequence_num
2708: END IF;
2709: --
2710: PO_DEBUG.put_line('submission check failed for PO id '
2711: ||TO_CHAR(g_po_header_id_table(i)));
2712: PO_DEBUG.put_line('Reason(s) :');
2713: SELECT MAX(sequence)
2714: INTO max_sequence_num
2715: FROM po_online_report_text_gt
2716: WHERE online_report_id = x_online_report_id ;
2722: FROM po_online_report_text_gt
2723: WHERE online_report_id = x_online_report_id
2724: AND sequence = i;
2725:
2726: PO_DEBUG.put_line(x_text_line);
2727: END LOOP;
2728:
2729: --
2730: end if;
2853: l_module,l_msg_buf);
2854: END IF;
2855: --
2856:
2857: PO_DEBUG.put_line('submission check failed for RELEASE id '
2858: ||TO_CHAR(g_po_release_id_table(i)));
2859: PO_DEBUG.put_line('Reason(s) :');
2860: SELECT MAX(sequence)
2861: INTO max_sequence_num
2855: --
2856:
2857: PO_DEBUG.put_line('submission check failed for RELEASE id '
2858: ||TO_CHAR(g_po_release_id_table(i)));
2859: PO_DEBUG.put_line('Reason(s) :');
2860: SELECT MAX(sequence)
2861: INTO max_sequence_num
2862: FROM po_online_report_text_gt
2863: WHERE online_report_id = x_online_report_id ;
2869: FROM po_online_report_text_gt
2870: WHERE online_report_id = x_online_report_id
2871: AND sequence = i;
2872:
2873: PO_DEBUG.put_line(x_text_line);
2874: END LOOP;
2875: --
2876: end if;
2877:
3185: BEGIN
3186:
3187: l_progress := '000';
3188: IF g_debug_stmt THEN
3189: PO_DEBUG.debug_begin(l_log_head);
3190: END IF;
3191:
3192: FND_PROFILE.get('PO_ALLOW_RETROPRICING_OF_PO',l_retroactive_update);
3193: IF (l_retroactive_update IS NULL) THEN
3195: END IF; /* IF (l_retroactive_update IS NULL) */
3196:
3197: l_progress := '020';
3198: IF g_debug_stmt THEN
3199: PO_DEBUG.debug_var(l_log_head,l_progress,'l_retroactive_update', l_retroactive_update);
3200: END IF;
3201:
3202: IF (l_retroactive_update = 'NEVER') THEN
3203: RETURN l_retroactive_update;
3204: END IF; /* IF (l_retroactive_update = 'NEVER') */
3205:
3206: l_progress := '060';
3207: IF g_debug_stmt THEN
3208: PO_DEBUG.debug_var(l_log_head,l_progress,'l_retroactive_update', l_retroactive_update);
3209: END IF;
3210:
3211: IF (l_retroactive_update = 'ALL_RELEASES') THEN
3212:
3219: );
3220:
3221: l_progress := '080';
3222: IF g_debug_stmt THEN
3223: PO_DEBUG.debug_var(l_log_head,l_progress,'l_ap_family_pack', l_ap_family_pack);
3224: END IF;
3225:
3226: IF (l_ap_family_pack < '11i.AP.L') THEN
3227: l_retroactive_update := 'OPEN_RELEASES';
3231: END IF; /* IF (l_retroactive_update = 'ALL_RELEASES') */
3232:
3233: l_progress := '100';
3234: IF g_debug_stmt THEN
3235: PO_DEBUG.debug_end(l_log_head);
3236: PO_DEBUG.debug_var(l_log_head,l_progress,'l_retroactive_update', l_retroactive_update);
3237: END IF;
3238:
3239: return l_retroactive_update;
3232:
3233: l_progress := '100';
3234: IF g_debug_stmt THEN
3235: PO_DEBUG.debug_end(l_log_head);
3236: PO_DEBUG.debug_var(l_log_head,l_progress,'l_retroactive_update', l_retroactive_update);
3237: END IF;
3238:
3239: return l_retroactive_update;
3240: EXCEPTION
3363: BEGIN
3364:
3365: l_progress := '000';
3366: IF g_debug_stmt THEN
3367: PO_DEBUG.debug_begin(l_log_head);
3368: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_id', p_document_id);
3369: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_type', p_document_type);
3370: END IF;
3371:
3364:
3365: l_progress := '000';
3366: IF g_debug_stmt THEN
3367: PO_DEBUG.debug_begin(l_log_head);
3368: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_id', p_document_id);
3369: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_type', p_document_type);
3370: END IF;
3371:
3372: IF (p_document_type = 'PO') THEN
3365: l_progress := '000';
3366: IF g_debug_stmt THEN
3367: PO_DEBUG.debug_begin(l_log_head);
3368: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_id', p_document_id);
3369: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_type', p_document_type);
3370: END IF;
3371:
3372: IF (p_document_type = 'PO') THEN
3373: l_progress := '100';
3371:
3372: IF (p_document_type = 'PO') THEN
3373: l_progress := '100';
3374: IF g_debug_stmt THEN
3375: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Reset retroactive_date for PO');
3376: END IF; /* IF g_debug_stmt */
3377:
3378: -- SQL What: Reset retroactive_date for this PO
3379: -- SQL Why : For Standard PO, column po_lines.retroactive_date will
3395: RETURN;
3396:
3397: l_progress := '200';
3398: IF g_debug_stmt THEN
3399: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Reset retroactive_date for Release');
3400: END IF; /* IF g_debug_stmt */
3401:
3402: -- SQL What: Find out any retroactive pricing change for this Release
3403: -- SQL Why : For Release, column po_line_locations.retroactive_date will
3414: END IF; /* IF (p_document_type = 'PO') */
3415:
3416: l_progress := '300';
3417: IF g_debug_stmt THEN
3418: PO_DEBUG.debug_end(l_log_head);
3419: END IF;
3420:
3421: COMMIT; --
3422:
3422:
3423: EXCEPTION
3424: WHEN OTHERS THEN
3425: IF g_debug_unexp THEN
3426: PO_DEBUG.debug_exc(l_log_head,l_progress);
3427: END IF;
3428:
3429: RAISE;
3430:
3721:
3722: -- Setup for writing the concurrent logs based on
3723: -- the concurrent log Profile
3724: IF g_log_mode = 'Y' THEN
3725: po_debug.set_file_io(TRUE);
3726: ELSE
3727: po_debug.set_file_io(null);
3728: END IF;
3729:
3723: -- the concurrent log Profile
3724: IF g_log_mode = 'Y' THEN
3725: po_debug.set_file_io(TRUE);
3726: ELSE
3727: po_debug.set_file_io(null);
3728: END IF;
3729:
3730: x_return_status := FND_API.G_RET_STS_SUCCESS;
3731: x_msg_count := 0;
3731: x_msg_count := 0;
3732: x_msg_data := NULL;
3733:
3734: IF g_debug_stmt THEN
3735: PO_DEBUG.debug_begin(l_log_head);
3736: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_id', p_document_id);
3737: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_type', p_document_type);
3738: END IF;
3739:
3732: x_msg_data := NULL;
3733:
3734: IF g_debug_stmt THEN
3735: PO_DEBUG.debug_begin(l_log_head);
3736: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_id', p_document_id);
3737: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_type', p_document_type);
3738: END IF;
3739:
3740: -- Standard call to check for call compatibility
3733:
3734: IF g_debug_stmt THEN
3735: PO_DEBUG.debug_begin(l_log_head);
3736: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_id', p_document_id);
3737: PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_type', p_document_type);
3738: END IF;
3739:
3740: -- Standard call to check for call compatibility
3741: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name, G_PKG_NAME)
3753: FND.currency_code = GSB.currency_code;
3754:
3755: l_progress := '010';
3756: IF g_debug_stmt THEN
3757: PO_DEBUG.debug_var(l_log_head,l_progress,
3758: 'l_base_curr_precision', l_base_curr_precision);
3759: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3760: 'Check Consigned Consumption flag');
3761: END IF; /* IF g_debug_stmt */
3755: l_progress := '010';
3756: IF g_debug_stmt THEN
3757: PO_DEBUG.debug_var(l_log_head,l_progress,
3758: 'l_base_curr_precision', l_base_curr_precision);
3759: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3760: 'Check Consigned Consumption flag');
3761: END IF; /* IF g_debug_stmt */
3762:
3763: l_progress := '020';
3774: END IF; /* IF (p_document_type = 'PO') */
3775:
3776: l_progress := '030';
3777: IF g_debug_stmt THEN
3778: PO_DEBUG.debug_var(l_log_head,l_progress,'l_consigned_flag', l_consigned_flag);
3779: END IF; /* IF g_debug_stmt */
3780:
3781: IF (l_consigned_flag = 'N') THEN
3782: -- For standard POs and PO releases(not consigned),
3782: -- For standard POs and PO releases(not consigned),
3783: -- call the new accounting events API
3784: l_progress := '040';
3785: IF g_debug_stmt THEN
3786: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3787: 'Open Cursor for Not Consigned PO/RELEASE');
3788: END IF; /* IF g_debug_stmt */
3789:
3790: l_progress := '050';
3795: END IF; /* IF (p_document_type = 'PO') */
3796:
3797: l_progress := '060';
3798: IF g_debug_stmt THEN
3799: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Fetch from Cursor');
3800: END IF; /* IF g_debug_stmt */
3801:
3802: LOOP
3803: IF (p_document_type = 'PO') THEN
3824:
3825: l_progress := '070';
3826: IF l_po_header_ids_tbl.COUNT > 0 THEN
3827: IF g_debug_stmt THEN
3828: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_header_ids_tbl', l_po_header_ids_tbl);
3829: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
3830: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
3831: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
3832: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
3825: l_progress := '070';
3826: IF l_po_header_ids_tbl.COUNT > 0 THEN
3827: IF g_debug_stmt THEN
3828: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_header_ids_tbl', l_po_header_ids_tbl);
3829: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
3830: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
3831: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
3832: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
3833: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
3826: IF l_po_header_ids_tbl.COUNT > 0 THEN
3827: IF g_debug_stmt THEN
3828: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_header_ids_tbl', l_po_header_ids_tbl);
3829: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
3830: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
3831: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
3832: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
3833: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
3834: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
3827: IF g_debug_stmt THEN
3828: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_header_ids_tbl', l_po_header_ids_tbl);
3829: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
3830: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
3831: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
3832: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
3833: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
3834: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
3835: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3828: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_header_ids_tbl', l_po_header_ids_tbl);
3829: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
3830: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
3831: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
3832: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
3833: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
3834: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
3835: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3836: 'Before updating the invoice_adjustment_flag to R');
3829: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
3830: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
3831: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
3832: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
3833: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
3834: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
3835: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3836: 'Before updating the invoice_adjustment_flag to R');
3837: END IF; /* IF g_debug_stmt */
3830: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
3831: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
3832: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
3833: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
3834: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
3835: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3836: 'Before updating the invoice_adjustment_flag to R');
3837: END IF; /* IF g_debug_stmt */
3838:
3831: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
3832: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
3833: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
3834: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
3835: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3836: 'Before updating the invoice_adjustment_flag to R');
3837: END IF; /* IF g_debug_stmt */
3838:
3839: l_progress := '080';
3844: AND l_quantity_billeds_tbl(i) > 0;
3845:
3846: l_progress := '090';
3847: IF g_debug_stmt THEN
3848: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3849: 'updated the invoice_adjustment_flag to R -- Rowcount: ' || SQL%ROWCOUNT);
3850: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3851: 'Before Calling Create_AccountingEvents()');
3852: END IF; /* IF g_debug_stmt */
3846: l_progress := '090';
3847: IF g_debug_stmt THEN
3848: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3849: 'updated the invoice_adjustment_flag to R -- Rowcount: ' || SQL%ROWCOUNT);
3850: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3851: 'Before Calling Create_AccountingEvents()');
3852: END IF; /* IF g_debug_stmt */
3853:
3854: FOR i IN l_po_header_ids_tbl.FIRST..l_po_header_ids_tbl.LAST LOOP
3854: FOR i IN l_po_header_ids_tbl.FIRST..l_po_header_ids_tbl.LAST LOOP
3855:
3856: l_progress := '100';
3857: IF g_debug_stmt THEN
3858: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3859: 'Call RCV_AccrualAccounting_GRP.Create_AccountingEvents()');
3860: END IF;
3861: PO_DEBUG.put_line('Call RCV_AccrualAccounting_GRP.Create_AccountingEvents');
3862:
3857: IF g_debug_stmt THEN
3858: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3859: 'Call RCV_AccrualAccounting_GRP.Create_AccountingEvents()');
3860: END IF;
3861: PO_DEBUG.put_line('Call RCV_AccrualAccounting_GRP.Create_AccountingEvents');
3862:
3863: RCV_AccrualAccounting_GRP.Create_AccountingEvents(
3864: p_api_version => 1.0,
3865: p_source_type => 'RETROPRICE',
3874: x_msg_data => l_msg_data);
3875:
3876: l_progress := '105';
3877: IF g_debug_stmt THEN
3878: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status', l_return_status);
3879: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', l_msg_count);
3880: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', l_msg_data);
3881: END IF; /* IF g_debug_stmt */
3882:
3875:
3876: l_progress := '105';
3877: IF g_debug_stmt THEN
3878: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status', l_return_status);
3879: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', l_msg_count);
3880: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', l_msg_data);
3881: END IF; /* IF g_debug_stmt */
3882:
3883: PO_DEBUG.put_line('Return status : ' || l_return_status);
3876: l_progress := '105';
3877: IF g_debug_stmt THEN
3878: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status', l_return_status);
3879: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', l_msg_count);
3880: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', l_msg_data);
3881: END IF; /* IF g_debug_stmt */
3882:
3883: PO_DEBUG.put_line('Return status : ' || l_return_status);
3884: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
3879: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', l_msg_count);
3880: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', l_msg_data);
3881: END IF; /* IF g_debug_stmt */
3882:
3883: PO_DEBUG.put_line('Return status : ' || l_return_status);
3884: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
3885: PO_DEBUG.put_line('Message data : '|| l_msg_data);
3886:
3887: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) Then
3880: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', l_msg_data);
3881: END IF; /* IF g_debug_stmt */
3882:
3883: PO_DEBUG.put_line('Return status : ' || l_return_status);
3884: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
3885: PO_DEBUG.put_line('Message data : '|| l_msg_data);
3886:
3887: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) Then
3888: IF (l_return_status = FND_API.G_RET_STS_ERROR) Then
3881: END IF; /* IF g_debug_stmt */
3882:
3883: PO_DEBUG.put_line('Return status : ' || l_return_status);
3884: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
3885: PO_DEBUG.put_line('Message data : '|| l_msg_data);
3886:
3887: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) Then
3888: IF (l_return_status = FND_API.G_RET_STS_ERROR) Then
3889: RAISE FND_API.G_EXC_ERROR;
3894:
3895: /** INVCONV rseshadr - call OPM API for process organizations **/
3896: l_progress := '106';
3897: IF g_debug_stmt THEN
3898: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3899: 'Call GMF_Rcv_Accounting_Pkg.Create_Adjust_Txns()');
3900: END IF;
3901: PO_DEBUG.put_line('Call GMF_Rcv_Accounting_Pkg.Create_Adjust_Txns');
3902:
3897: IF g_debug_stmt THEN
3898: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3899: 'Call GMF_Rcv_Accounting_Pkg.Create_Adjust_Txns()');
3900: END IF;
3901: PO_DEBUG.put_line('Call GMF_Rcv_Accounting_Pkg.Create_Adjust_Txns');
3902:
3903: GMF_Rcv_Accounting_Pkg.Create_Adjust_Txns(
3904: p_api_version => 1.0,
3905: p_init_msg_list => FND_API.G_FALSE,
3916: x_msg_data => l_msg_data);
3917:
3918: l_progress := '108';
3919: IF g_debug_stmt THEN
3920: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status', l_return_status);
3921: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', l_msg_count);
3922: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', l_msg_data);
3923: END IF; /* IF g_debug_stmt */
3924:
3917:
3918: l_progress := '108';
3919: IF g_debug_stmt THEN
3920: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status', l_return_status);
3921: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', l_msg_count);
3922: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', l_msg_data);
3923: END IF; /* IF g_debug_stmt */
3924:
3925: PO_DEBUG.put_line('Return status : ' || l_return_status);
3918: l_progress := '108';
3919: IF g_debug_stmt THEN
3920: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status', l_return_status);
3921: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', l_msg_count);
3922: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', l_msg_data);
3923: END IF; /* IF g_debug_stmt */
3924:
3925: PO_DEBUG.put_line('Return status : ' || l_return_status);
3926: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
3921: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', l_msg_count);
3922: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', l_msg_data);
3923: END IF; /* IF g_debug_stmt */
3924:
3925: PO_DEBUG.put_line('Return status : ' || l_return_status);
3926: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
3927: PO_DEBUG.put_line('Message data : '|| l_msg_data);
3928:
3929: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) Then
3922: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', l_msg_data);
3923: END IF; /* IF g_debug_stmt */
3924:
3925: PO_DEBUG.put_line('Return status : ' || l_return_status);
3926: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
3927: PO_DEBUG.put_line('Message data : '|| l_msg_data);
3928:
3929: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) Then
3930: IF (l_return_status = FND_API.G_RET_STS_ERROR) Then
3923: END IF; /* IF g_debug_stmt */
3924:
3925: PO_DEBUG.put_line('Return status : ' || l_return_status);
3926: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
3927: PO_DEBUG.put_line('Message data : '|| l_msg_data);
3928:
3929: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) Then
3930: IF (l_return_status = FND_API.G_RET_STS_ERROR) Then
3931: RAISE FND_API.G_EXC_ERROR;
3938: END LOOP;
3939:
3940: l_progress := '110';
3941: IF g_debug_stmt THEN
3942: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3943: 'After Calling Create_AccountingEvents()');
3944: END IF; /* IF g_debug_stmt */
3945:
3946: END IF; /* IF l_po_header_ids_tbl.COUNT > 0 */
3946: END IF; /* IF l_po_header_ids_tbl.COUNT > 0 */
3947:
3948: l_progress := '120';
3949: IF g_debug_stmt THEN
3950: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Check EXIT condition');
3951: END IF; /* IF g_debug_stmt */
3952:
3953: IF (p_document_type = 'PO') THEN
3954: EXIT WHEN c_stdpo%NOTFOUND;
3957: END IF; /* IF (p_document_type = 'PO') */
3958:
3959: l_progress := '125';
3960: IF g_debug_stmt THEN
3961: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Clear PL/SQL tables');
3962: END IF; /* IF g_debug_stmt */
3963:
3964: l_po_header_ids_tbl.DELETE;
3965: l_po_release_ids_tbl.DELETE;
3972: END LOOP; /* c_stdpo / c_release */
3973:
3974: l_progress := '130';
3975: IF g_debug_stmt THEN
3976: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Close Cursor');
3977: END IF; /* IF g_debug_stmt */
3978:
3979: IF (p_document_type = 'PO') THEN
3980: CLOSE c_stdpo;
3986: -- For consumption advices, call the Inventory API
3987:
3988: l_progress := '140';
3989: IF g_debug_stmt THEN
3990: PO_DEBUG.debug_stmt(l_log_head,l_progress,
3991: 'Open Cursor for Consigned PO/RELEASE');
3992: END IF; /* IF g_debug_stmt */
3993:
3994: l_progress := '150';
3999: END IF; /* IF (p_document_type = 'PO') */
4000:
4001: l_progress := '160';
4002: IF g_debug_stmt THEN
4003: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Fetch from Cursor');
4004: END IF; /* IF g_debug_stmt */
4005:
4006: LOOP
4007: l_mtl_index := 1;
4058:
4059: l_progress := '170';
4060: IF l_po_header_ids_tbl.COUNT > 0 THEN
4061: IF g_debug_stmt THEN
4062: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_header_ids_tbl', l_po_header_ids_tbl);
4063: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
4064: PO_DEBUG.debug_var(l_log_head,l_progress,'l_from_header_ids_tbl', l_from_header_ids_tbl);
4065: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_codes_tbl', l_currency_codes_tbl);
4066: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_types_tbl', l_rate_types_tbl);
4059: l_progress := '170';
4060: IF l_po_header_ids_tbl.COUNT > 0 THEN
4061: IF g_debug_stmt THEN
4062: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_header_ids_tbl', l_po_header_ids_tbl);
4063: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
4064: PO_DEBUG.debug_var(l_log_head,l_progress,'l_from_header_ids_tbl', l_from_header_ids_tbl);
4065: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_codes_tbl', l_currency_codes_tbl);
4066: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_types_tbl', l_rate_types_tbl);
4067: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_dates_tbl', l_rate_dates_tbl);
4060: IF l_po_header_ids_tbl.COUNT > 0 THEN
4061: IF g_debug_stmt THEN
4062: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_header_ids_tbl', l_po_header_ids_tbl);
4063: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
4064: PO_DEBUG.debug_var(l_log_head,l_progress,'l_from_header_ids_tbl', l_from_header_ids_tbl);
4065: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_codes_tbl', l_currency_codes_tbl);
4066: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_types_tbl', l_rate_types_tbl);
4067: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_dates_tbl', l_rate_dates_tbl);
4068: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rates_tbl', l_rates_tbl);
4061: IF g_debug_stmt THEN
4062: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_header_ids_tbl', l_po_header_ids_tbl);
4063: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
4064: PO_DEBUG.debug_var(l_log_head,l_progress,'l_from_header_ids_tbl', l_from_header_ids_tbl);
4065: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_codes_tbl', l_currency_codes_tbl);
4066: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_types_tbl', l_rate_types_tbl);
4067: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_dates_tbl', l_rate_dates_tbl);
4068: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rates_tbl', l_rates_tbl);
4069: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
4062: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_header_ids_tbl', l_po_header_ids_tbl);
4063: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
4064: PO_DEBUG.debug_var(l_log_head,l_progress,'l_from_header_ids_tbl', l_from_header_ids_tbl);
4065: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_codes_tbl', l_currency_codes_tbl);
4066: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_types_tbl', l_rate_types_tbl);
4067: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_dates_tbl', l_rate_dates_tbl);
4068: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rates_tbl', l_rates_tbl);
4069: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
4070: PO_DEBUG.debug_var(l_log_head,l_progress,'l_inventory_item_ids_tbl', l_inventory_item_ids_tbl);
4063: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_release_ids_tbl', l_po_release_ids_tbl);
4064: PO_DEBUG.debug_var(l_log_head,l_progress,'l_from_header_ids_tbl', l_from_header_ids_tbl);
4065: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_codes_tbl', l_currency_codes_tbl);
4066: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_types_tbl', l_rate_types_tbl);
4067: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_dates_tbl', l_rate_dates_tbl);
4068: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rates_tbl', l_rates_tbl);
4069: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
4070: PO_DEBUG.debug_var(l_log_head,l_progress,'l_inventory_item_ids_tbl', l_inventory_item_ids_tbl);
4071: PO_DEBUG.debug_var(l_log_head,l_progress,'l_organization_ids_tbl', l_organization_ids_tbl);
4064: PO_DEBUG.debug_var(l_log_head,l_progress,'l_from_header_ids_tbl', l_from_header_ids_tbl);
4065: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_codes_tbl', l_currency_codes_tbl);
4066: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_types_tbl', l_rate_types_tbl);
4067: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_dates_tbl', l_rate_dates_tbl);
4068: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rates_tbl', l_rates_tbl);
4069: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
4070: PO_DEBUG.debug_var(l_log_head,l_progress,'l_inventory_item_ids_tbl', l_inventory_item_ids_tbl);
4071: PO_DEBUG.debug_var(l_log_head,l_progress,'l_organization_ids_tbl', l_organization_ids_tbl);
4072: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
4065: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_codes_tbl', l_currency_codes_tbl);
4066: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_types_tbl', l_rate_types_tbl);
4067: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_dates_tbl', l_rate_dates_tbl);
4068: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rates_tbl', l_rates_tbl);
4069: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
4070: PO_DEBUG.debug_var(l_log_head,l_progress,'l_inventory_item_ids_tbl', l_inventory_item_ids_tbl);
4071: PO_DEBUG.debug_var(l_log_head,l_progress,'l_organization_ids_tbl', l_organization_ids_tbl);
4072: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
4073: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
4066: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_types_tbl', l_rate_types_tbl);
4067: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_dates_tbl', l_rate_dates_tbl);
4068: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rates_tbl', l_rates_tbl);
4069: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
4070: PO_DEBUG.debug_var(l_log_head,l_progress,'l_inventory_item_ids_tbl', l_inventory_item_ids_tbl);
4071: PO_DEBUG.debug_var(l_log_head,l_progress,'l_organization_ids_tbl', l_organization_ids_tbl);
4072: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
4073: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
4074: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_uoms_tbl', l_transaction_uoms_tbl);
4067: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rate_dates_tbl', l_rate_dates_tbl);
4068: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rates_tbl', l_rates_tbl);
4069: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
4070: PO_DEBUG.debug_var(l_log_head,l_progress,'l_inventory_item_ids_tbl', l_inventory_item_ids_tbl);
4071: PO_DEBUG.debug_var(l_log_head,l_progress,'l_organization_ids_tbl', l_organization_ids_tbl);
4072: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
4073: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
4074: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_uoms_tbl', l_transaction_uoms_tbl);
4075: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
4068: PO_DEBUG.debug_var(l_log_head,l_progress,'l_rates_tbl', l_rates_tbl);
4069: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
4070: PO_DEBUG.debug_var(l_log_head,l_progress,'l_inventory_item_ids_tbl', l_inventory_item_ids_tbl);
4071: PO_DEBUG.debug_var(l_log_head,l_progress,'l_organization_ids_tbl', l_organization_ids_tbl);
4072: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
4073: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
4074: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_uoms_tbl', l_transaction_uoms_tbl);
4075: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
4076: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
4069: PO_DEBUG.debug_var(l_log_head,l_progress,'l_po_line_ids_tbl', l_po_line_ids_tbl);
4070: PO_DEBUG.debug_var(l_log_head,l_progress,'l_inventory_item_ids_tbl', l_inventory_item_ids_tbl);
4071: PO_DEBUG.debug_var(l_log_head,l_progress,'l_organization_ids_tbl', l_organization_ids_tbl);
4072: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
4073: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
4074: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_uoms_tbl', l_transaction_uoms_tbl);
4075: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
4076: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
4077: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_quantitys_tbl', l_transaction_quantitys_tbl);
4070: PO_DEBUG.debug_var(l_log_head,l_progress,'l_inventory_item_ids_tbl', l_inventory_item_ids_tbl);
4071: PO_DEBUG.debug_var(l_log_head,l_progress,'l_organization_ids_tbl', l_organization_ids_tbl);
4072: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
4073: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
4074: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_uoms_tbl', l_transaction_uoms_tbl);
4075: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
4076: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
4077: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_quantitys_tbl', l_transaction_quantitys_tbl);
4078: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_costs_tbl', l_transaction_costs_tbl);
4071: PO_DEBUG.debug_var(l_log_head,l_progress,'l_organization_ids_tbl', l_organization_ids_tbl);
4072: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
4073: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
4074: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_uoms_tbl', l_transaction_uoms_tbl);
4075: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
4076: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
4077: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_quantitys_tbl', l_transaction_quantitys_tbl);
4078: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_costs_tbl', l_transaction_costs_tbl);
4079: PO_DEBUG.debug_var(l_log_head,l_progress,'l_distribution_ids_tbl', l_distribution_ids_tbl);
4072: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_location_ids_tbl', l_line_location_ids_tbl);
4073: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
4074: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_uoms_tbl', l_transaction_uoms_tbl);
4075: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
4076: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
4077: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_quantitys_tbl', l_transaction_quantitys_tbl);
4078: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_costs_tbl', l_transaction_costs_tbl);
4079: PO_DEBUG.debug_var(l_log_head,l_progress,'l_distribution_ids_tbl', l_distribution_ids_tbl);
4080: PO_DEBUG.debug_var(l_log_head,l_progress,'l_project_ids_tbl', l_project_ids_tbl);
4073: PO_DEBUG.debug_var(l_log_head,l_progress,'l_quantity_billeds_tbl', l_quantity_billeds_tbl);
4074: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_uoms_tbl', l_transaction_uoms_tbl);
4075: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
4076: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
4077: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_quantitys_tbl', l_transaction_quantitys_tbl);
4078: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_costs_tbl', l_transaction_costs_tbl);
4079: PO_DEBUG.debug_var(l_log_head,l_progress,'l_distribution_ids_tbl', l_distribution_ids_tbl);
4080: PO_DEBUG.debug_var(l_log_head,l_progress,'l_project_ids_tbl', l_project_ids_tbl);
4081: PO_DEBUG.debug_var(l_log_head,l_progress,'l_task_ids_tbl', l_task_ids_tbl);
4074: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_uoms_tbl', l_transaction_uoms_tbl);
4075: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
4076: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
4077: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_quantitys_tbl', l_transaction_quantitys_tbl);
4078: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_costs_tbl', l_transaction_costs_tbl);
4079: PO_DEBUG.debug_var(l_log_head,l_progress,'l_distribution_ids_tbl', l_distribution_ids_tbl);
4080: PO_DEBUG.debug_var(l_log_head,l_progress,'l_project_ids_tbl', l_project_ids_tbl);
4081: PO_DEBUG.debug_var(l_log_head,l_progress,'l_task_ids_tbl', l_task_ids_tbl);
4082: PO_DEBUG.debug_var(l_log_head,l_progress,'l_dist_account_ids_tbl', l_dist_account_ids_tbl);
4075: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_prices_tbl', l_new_prices_tbl);
4076: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
4077: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_quantitys_tbl', l_transaction_quantitys_tbl);
4078: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_costs_tbl', l_transaction_costs_tbl);
4079: PO_DEBUG.debug_var(l_log_head,l_progress,'l_distribution_ids_tbl', l_distribution_ids_tbl);
4080: PO_DEBUG.debug_var(l_log_head,l_progress,'l_project_ids_tbl', l_project_ids_tbl);
4081: PO_DEBUG.debug_var(l_log_head,l_progress,'l_task_ids_tbl', l_task_ids_tbl);
4082: PO_DEBUG.debug_var(l_log_head,l_progress,'l_dist_account_ids_tbl', l_dist_account_ids_tbl);
4083: PO_DEBUG.debug_stmt(l_log_head,l_progress,
4076: PO_DEBUG.debug_var(l_log_head,l_progress,'l_old_prices_tbl', l_old_prices_tbl);
4077: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_quantitys_tbl', l_transaction_quantitys_tbl);
4078: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_costs_tbl', l_transaction_costs_tbl);
4079: PO_DEBUG.debug_var(l_log_head,l_progress,'l_distribution_ids_tbl', l_distribution_ids_tbl);
4080: PO_DEBUG.debug_var(l_log_head,l_progress,'l_project_ids_tbl', l_project_ids_tbl);
4081: PO_DEBUG.debug_var(l_log_head,l_progress,'l_task_ids_tbl', l_task_ids_tbl);
4082: PO_DEBUG.debug_var(l_log_head,l_progress,'l_dist_account_ids_tbl', l_dist_account_ids_tbl);
4083: PO_DEBUG.debug_stmt(l_log_head,l_progress,
4084: 'Before updating the invoice_adjustment_flag to R');
4077: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_quantitys_tbl', l_transaction_quantitys_tbl);
4078: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_costs_tbl', l_transaction_costs_tbl);
4079: PO_DEBUG.debug_var(l_log_head,l_progress,'l_distribution_ids_tbl', l_distribution_ids_tbl);
4080: PO_DEBUG.debug_var(l_log_head,l_progress,'l_project_ids_tbl', l_project_ids_tbl);
4081: PO_DEBUG.debug_var(l_log_head,l_progress,'l_task_ids_tbl', l_task_ids_tbl);
4082: PO_DEBUG.debug_var(l_log_head,l_progress,'l_dist_account_ids_tbl', l_dist_account_ids_tbl);
4083: PO_DEBUG.debug_stmt(l_log_head,l_progress,
4084: 'Before updating the invoice_adjustment_flag to R');
4085: END IF; /* IF g_debug_stmt */
4078: PO_DEBUG.debug_var(l_log_head,l_progress,'l_transaction_costs_tbl', l_transaction_costs_tbl);
4079: PO_DEBUG.debug_var(l_log_head,l_progress,'l_distribution_ids_tbl', l_distribution_ids_tbl);
4080: PO_DEBUG.debug_var(l_log_head,l_progress,'l_project_ids_tbl', l_project_ids_tbl);
4081: PO_DEBUG.debug_var(l_log_head,l_progress,'l_task_ids_tbl', l_task_ids_tbl);
4082: PO_DEBUG.debug_var(l_log_head,l_progress,'l_dist_account_ids_tbl', l_dist_account_ids_tbl);
4083: PO_DEBUG.debug_stmt(l_log_head,l_progress,
4084: 'Before updating the invoice_adjustment_flag to R');
4085: END IF; /* IF g_debug_stmt */
4086:
4079: PO_DEBUG.debug_var(l_log_head,l_progress,'l_distribution_ids_tbl', l_distribution_ids_tbl);
4080: PO_DEBUG.debug_var(l_log_head,l_progress,'l_project_ids_tbl', l_project_ids_tbl);
4081: PO_DEBUG.debug_var(l_log_head,l_progress,'l_task_ids_tbl', l_task_ids_tbl);
4082: PO_DEBUG.debug_var(l_log_head,l_progress,'l_dist_account_ids_tbl', l_dist_account_ids_tbl);
4083: PO_DEBUG.debug_stmt(l_log_head,l_progress,
4084: 'Before updating the invoice_adjustment_flag to R');
4085: END IF; /* IF g_debug_stmt */
4086:
4087: l_progress := '180';
4092: AND l_quantity_billeds_tbl(i) > 0;
4093:
4094: l_progress := '200';
4095: IF g_debug_stmt THEN
4096: PO_DEBUG.debug_stmt(l_log_head,l_progress,
4097: 'updated the invoice_adjustment_flag to R -- Rowcount: ' || SQL%ROWCOUNT);
4098: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Before Calling Inventory API');
4099: END IF; /* IF g_debug_stmt */
4100:
4094: l_progress := '200';
4095: IF g_debug_stmt THEN
4096: PO_DEBUG.debug_stmt(l_log_head,l_progress,
4097: 'updated the invoice_adjustment_flag to R -- Rowcount: ' || SQL%ROWCOUNT);
4098: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Before Calling Inventory API');
4099: END IF; /* IF g_debug_stmt */
4100:
4101: FOR i IN l_po_header_ids_tbl.FIRST..l_po_header_ids_tbl.LAST LOOP
4102:
4101: FOR i IN l_po_header_ids_tbl.FIRST..l_po_header_ids_tbl.LAST LOOP
4102:
4103: l_progress := '205';
4104: IF g_debug_stmt THEN
4105: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Prepare Record before Call Inventory API');
4106: END IF; /* IF g_debug_stmt */
4107:
4108: -- calculate Primary Quantity and UOM
4109: RCV_QUANTITIES_S.get_primary_qty_uom (
4115: x_primary_uom => l_primary_uom);
4116:
4117: l_progress := '210';
4118: IF g_debug_stmt THEN
4119: PO_DEBUG.debug_var(l_log_head,l_progress,'l_primary_quantity', l_primary_quantity);
4120: PO_DEBUG.debug_var(l_log_head,l_progress,'l_primary_uom', l_primary_uom);
4121: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Get UOM code');
4122: END IF; /* IF g_debug_stmt */
4123:
4116:
4117: l_progress := '210';
4118: IF g_debug_stmt THEN
4119: PO_DEBUG.debug_var(l_log_head,l_progress,'l_primary_quantity', l_primary_quantity);
4120: PO_DEBUG.debug_var(l_log_head,l_progress,'l_primary_uom', l_primary_uom);
4121: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Get UOM code');
4122: END IF; /* IF g_debug_stmt */
4123:
4124: BEGIN
4117: l_progress := '210';
4118: IF g_debug_stmt THEN
4119: PO_DEBUG.debug_var(l_log_head,l_progress,'l_primary_quantity', l_primary_quantity);
4120: PO_DEBUG.debug_var(l_log_head,l_progress,'l_primary_uom', l_primary_uom);
4121: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Get UOM code');
4122: END IF; /* IF g_debug_stmt */
4123:
4124: BEGIN
4125: -- INV expects the uom_code whereas PO stores unit_of_measure.
4133: END;
4134:
4135: l_progress := '220';
4136: IF g_debug_stmt THEN
4137: PO_DEBUG.debug_var(l_log_head,l_progress,'l_uom_code', l_uom_code);
4138: END IF; /* IF g_debug_stmt */
4139:
4140: l_mtl_trx_rec.organization_id := l_organization_ids_tbl(i);
4141: l_progress := '225';
4193: END LOOP;
4194:
4195: l_progress := '350';
4196: IF g_debug_stmt THEN
4197: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Prepare Record Done');
4198: END IF; /* IF g_debug_stmt */
4199:
4200: IF (l_mtl_index > 0) THEN
4201: l_progress := '360';
4199:
4200: IF (l_mtl_index > 0) THEN
4201: l_progress := '360';
4202: IF g_debug_stmt THEN
4203: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Call Inventory API');
4204: END IF; /* IF g_debug_stmt */
4205: PO_DEBUG.put_line('Call Inventory API');
4206:
4207: INV_LOGICAL_TRANSACTIONS_PUB.create_logical_transactions(
4201: l_progress := '360';
4202: IF g_debug_stmt THEN
4203: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Call Inventory API');
4204: END IF; /* IF g_debug_stmt */
4205: PO_DEBUG.put_line('Call Inventory API');
4206:
4207: INV_LOGICAL_TRANSACTIONS_PUB.create_logical_transactions(
4208: p_api_version_number => 1.0,
4209: p_init_msg_lst => FND_API.G_FALSE,
4218: x_msg_data => l_msg_data);
4219:
4220: l_progress := '370';
4221: IF g_debug_stmt THEN
4222: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status', l_return_status);
4223: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', x_msg_count);
4224: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', x_msg_data);
4225: END IF; /* IF g_debug_stmt */
4226:
4219:
4220: l_progress := '370';
4221: IF g_debug_stmt THEN
4222: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status', l_return_status);
4223: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', x_msg_count);
4224: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', x_msg_data);
4225: END IF; /* IF g_debug_stmt */
4226:
4227: PO_DEBUG.put_line('Return status : ' || l_return_status);
4220: l_progress := '370';
4221: IF g_debug_stmt THEN
4222: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status', l_return_status);
4223: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', x_msg_count);
4224: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', x_msg_data);
4225: END IF; /* IF g_debug_stmt */
4226:
4227: PO_DEBUG.put_line('Return status : ' || l_return_status);
4228: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
4223: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_count', x_msg_count);
4224: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', x_msg_data);
4225: END IF; /* IF g_debug_stmt */
4226:
4227: PO_DEBUG.put_line('Return status : ' || l_return_status);
4228: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
4229: PO_DEBUG.put_line('Message data : '|| l_msg_data);
4230:
4231: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) Then
4224: PO_DEBUG.debug_var(l_log_head,l_progress,'x_msg_data', x_msg_data);
4225: END IF; /* IF g_debug_stmt */
4226:
4227: PO_DEBUG.put_line('Return status : ' || l_return_status);
4228: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
4229: PO_DEBUG.put_line('Message data : '|| l_msg_data);
4230:
4231: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) Then
4232: IF (l_return_status = FND_API.G_RET_STS_ERROR) Then
4225: END IF; /* IF g_debug_stmt */
4226:
4227: PO_DEBUG.put_line('Return status : ' || l_return_status);
4228: PO_DEBUG.put_line('Message Count: ' || l_msg_count);
4229: PO_DEBUG.put_line('Message data : '|| l_msg_data);
4230:
4231: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) Then
4232: IF (l_return_status = FND_API.G_RET_STS_ERROR) Then
4233: RAISE FND_API.G_EXC_ERROR;
4239: END IF; /* IF (l_mtl_index > 0) */
4240:
4241: l_progress := '380';
4242: IF g_debug_stmt THEN
4243: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'After Call Inventory API');
4244: END IF; /* IF g_debug_stmt */
4245:
4246: END IF; /* IF l_po_header_ids_tbl.COUNT > 0 */
4247:
4246: END IF; /* IF l_po_header_ids_tbl.COUNT > 0 */
4247:
4248: l_progress := '390';
4249: IF g_debug_stmt THEN
4250: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Check EXIT condition');
4251: END IF; /* IF g_debug_stmt */
4252:
4253: IF (p_document_type = 'PO') THEN
4254: EXIT WHEN c_consigned_stdpo%NOTFOUND;
4257: END IF; /* IF (p_document_type = 'PO') */
4258:
4259: l_progress := '400';
4260: IF g_debug_stmt THEN
4261: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Clear PL/SQL tables');
4262: END IF; /* IF g_debug_stmt */
4263:
4264: l_po_header_ids_tbl.DELETE;
4265: l_po_release_ids_tbl.DELETE;
4287: END LOOP; /* c_consigned_stdpo / c_consigned_release */
4288:
4289: l_progress := '410';
4290: IF g_debug_stmt THEN
4291: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Close Cursor');
4292: END IF; /* IF g_debug_stmt */
4293:
4294: IF (p_document_type = 'PO') THEN
4295: CLOSE c_consigned_stdpo;
4300: END IF; /* IF (l_consigned_flag = 'N') */
4301:
4302: l_progress := '430';
4303: IF g_debug_stmt THEN
4304: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
4305: PO_DEBUG.debug_end(l_log_head);
4306: END IF;
4307:
4308: COMMIT; --
4301:
4302: l_progress := '430';
4303: IF g_debug_stmt THEN
4304: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
4305: PO_DEBUG.debug_end(l_log_head);
4306: END IF;
4307:
4308: COMMIT; --
4309:
4314: p_encoded => 'F');
4315: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4316:
4317: IF g_debug_unexp THEN
4318: PO_DEBUG.debug_exc(l_log_head,l_progress);
4319: END IF;
4320:
4321: IF (c_stdpo%ISOPEN) THEN
4322: CLOSE c_stdpo;
4336: p_encoded => 'F');
4337: x_return_status := FND_API.G_RET_STS_ERROR;
4338:
4339: IF g_debug_unexp THEN
4340: PO_DEBUG.debug_exc(l_log_head,l_progress);
4341: END IF;
4342:
4343: IF (c_stdpo%ISOPEN) THEN
4344: CLOSE c_stdpo;
4358: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name);
4359: END IF;
4360:
4361: IF g_debug_unexp THEN
4362: PO_DEBUG.debug_exc(l_log_head,l_progress);
4363: END IF;
4364:
4365: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
4366: p_encoded => 'F');