120: -- Standard Start of API savepoint
121: SAVEPOINT Get_DefaultPriceList;
122:
123: -- Standard call to check for call compatibility.
124: IF NOT FND_API.Compatible_API_Call (l_api_version,
125: p_api_version,
126: l_api_name,
127: G_PKG_NAME)
128: THEN
125: p_api_version,
126: l_api_name,
127: G_PKG_NAME)
128: THEN
129: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
130: END IF;
131:
132: -- Initialize message list if p_init_msg_list is set to TRUE.
133: IF FND_API.to_Boolean(p_init_msg_list) THEN
129: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
130: END IF;
131:
132: -- Initialize message list if p_init_msg_list is set to TRUE.
133: IF FND_API.to_Boolean(p_init_msg_list) THEN
134: FND_MSG_PUB.initialize;
135: END IF;
136:
137: -- Initialize API return status to success
134: FND_MSG_PUB.initialize;
135: END IF;
136:
137: -- Initialize API return status to success
138: x_return_status := FND_API.G_RET_STS_SUCCESS;
139:
140: --
141: -- Begin API Body
142: --
168: p_api_name => l_api_name);
169:
170: -- Validate the repair type ID
171: IF NOT( CSD_PROCESS_UTIL.Validate_repair_type_id ( p_repair_type_id => p_repair_type_id )) THEN
172: RAISE FND_API.G_EXC_ERROR;
173: END IF;
174:
175: -- Validate the repair line ID
176: IF NOT( CSD_PROCESS_UTIL.Validate_rep_line_id ( p_repair_line_id => p_repair_line_id )) THEN
173: END IF;
174:
175: -- Validate the repair line ID
176: IF NOT( CSD_PROCESS_UTIL.Validate_rep_line_id ( p_repair_line_id => p_repair_line_id )) THEN
177: RAISE FND_API.G_EXC_ERROR;
178: END IF;
179:
180:
181: --debug msg
202:
203: l_contract_line_id := Get_DefaultContract(p_repair_line_id);
204: IF (l_contract_line_id = -1) THEN
205: -- gilam: bug 3542319 - remove raising the exception and set flag to false
206: --RAISE FND_API.G_EXC_ERROR;
207: l_use_contract_pl := FALSE;
208: --
209: END IF;
210:
242: -- gilam: bug 3542319 - changed logic for contract price list
243: -- set it to false first, then change it to yes if contract price list is used
244: l_use_contract_pl := FALSE;
245:
246: IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
247: x_contract_validated := l_contract_validated;
248:
249: IF (l_contract_validated) THEN
250: IF (l_contract_pl_id IS NOT NULL) THEN
312: p_data => x_msg_data );
313:
314: EXCEPTION
315:
316: WHEN FND_API.G_EXC_ERROR THEN
317: ROLLBACK TO Get_DefaultPriceList;
318: x_return_status := FND_API.G_RET_STS_ERROR ;
319: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
320: p_data => x_msg_data);
314: EXCEPTION
315:
316: WHEN FND_API.G_EXC_ERROR THEN
317: ROLLBACK TO Get_DefaultPriceList;
318: x_return_status := FND_API.G_RET_STS_ERROR ;
319: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
320: p_data => x_msg_data);
321:
322: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
318: x_return_status := FND_API.G_RET_STS_ERROR ;
319: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
320: p_data => x_msg_data);
321:
322: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
323: ROLLBACK TO Get_DefaultPriceList;
324: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
325: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
326: p_data => x_msg_data );
320: p_data => x_msg_data);
321:
322: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
323: ROLLBACK TO Get_DefaultPriceList;
324: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
325: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
326: p_data => x_msg_data );
327:
328: WHEN OTHERS THEN
326: p_data => x_msg_data );
327:
328: WHEN OTHERS THEN
329: ROLLBACK TO Get_DefaultPriceList;
330: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
331: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
332: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME ,
333: l_api_name );
334: END IF;
503: -- Standard Start of API savepoint
504: SAVEPOINT Get_ContractPriceList;
505:
506: -- Standard call to check for call compatibility.
507: IF NOT FND_API.Compatible_API_Call (l_api_version,
508: p_api_version,
509: l_api_name,
510: G_PKG_NAME)
511: THEN
508: p_api_version,
509: l_api_name,
510: G_PKG_NAME)
511: THEN
512: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
513: END IF;
514:
515: -- Initialize message list if p_init_msg_list is set to TRUE.
516: IF FND_API.to_Boolean(p_init_msg_list) THEN
512: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
513: END IF;
514:
515: -- Initialize message list if p_init_msg_list is set to TRUE.
516: IF FND_API.to_Boolean(p_init_msg_list) THEN
517: FND_MSG_PUB.initialize;
518: END IF;
519:
520: -- Initialize API return status to success
517: FND_MSG_PUB.initialize;
518: END IF;
519:
520: -- Initialize API return status to success
521: x_return_status := FND_API.G_RET_STS_SUCCESS;
522:
523: --
524: -- Begin API Body
525: --
548:
549:
550: -- Validate the repair line ID
551: IF NOT( CSD_PROCESS_UTIL.Validate_repair_type_id ( p_repair_type_id => p_repair_type_id )) THEN
552: RAISE FND_API.G_EXC_ERROR;
553: END IF;
554:
555: BEGIN
556:
564: WHEN others THEN
565: FND_MESSAGE.SET_NAME('CSD','CSD_API_CONTRACT_PL');
566: FND_MESSAGE.SET_TOKEN('REPAIR_TYPE_ID', p_repair_type_id);
567: FND_MSG_PUB.Add;
568: RAISE FND_API.G_EXC_ERROR;
569:
570: END;
571:
572: --debug msg
607: l_use_contract_bp_pl := FALSE;
608:
609: END;
610:
611: IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
612:
613: -- only 1 row should be returned
614: IF (l_pl_out_tbl.COUNT = 1) THEN
615:
637: l_use_contract_bp_pl := FALSE;
638:
639: END IF;
640:
641: ELSIF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
642:
643: -- contract has errors, set flag to false
644: l_use_contract_bp_pl := FALSE;
645:
700: p_data => x_msg_data );
701:
702: EXCEPTION
703:
704: WHEN FND_API.G_EXC_ERROR THEN
705: ROLLBACK TO Get_ContractPriceList;
706: x_return_status := FND_API.G_RET_STS_ERROR ;
707: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
708: p_data => x_msg_data);
702: EXCEPTION
703:
704: WHEN FND_API.G_EXC_ERROR THEN
705: ROLLBACK TO Get_ContractPriceList;
706: x_return_status := FND_API.G_RET_STS_ERROR ;
707: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
708: p_data => x_msg_data);
709:
710: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
706: x_return_status := FND_API.G_RET_STS_ERROR ;
707: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
708: p_data => x_msg_data);
709:
710: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
711: ROLLBACK TO Get_ContractPriceList;
712: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
713: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
714: p_data => x_msg_data );
708: p_data => x_msg_data);
709:
710: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
711: ROLLBACK TO Get_ContractPriceList;
712: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
713: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
714: p_data => x_msg_data );
715:
716: WHEN OTHERS THEN
714: p_data => x_msg_data );
715:
716: WHEN OTHERS THEN
717: ROLLBACK TO Get_ContractPriceList;
718: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
719: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
720: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME ,
721: l_api_name );
722: END IF;
775: -- Standard Start of API savepoint
776: SAVEPOINT Validate_Contract;
777:
778: -- Standard call to check for call compatibility.
779: IF NOT FND_API.Compatible_API_Call (l_api_version,
780: p_api_version,
781: l_api_name,
782: G_PKG_NAME)
783: THEN
780: p_api_version,
781: l_api_name,
782: G_PKG_NAME)
783: THEN
784: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
785: END IF;
786:
787: -- Initialize message list if p_init_msg_list is set to TRUE.
788: IF FND_API.to_Boolean(p_init_msg_list) THEN
784: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
785: END IF;
786:
787: -- Initialize message list if p_init_msg_list is set to TRUE.
788: IF FND_API.to_Boolean(p_init_msg_list) THEN
789: FND_MSG_PUB.initialize;
790: END IF;
791:
792: -- Initialize API return status to success
789: FND_MSG_PUB.initialize;
790: END IF;
791:
792: -- Initialize API return status to success
793: x_return_status := FND_API.G_RET_STS_SUCCESS;
794:
795: --
796: -- Begin API Body
797: --
817: p_api_name => l_api_name);
818:
819: -- Validate the repair type ID
820: IF NOT( CSD_PROCESS_UTIL.Validate_repair_type_id ( p_repair_type_id => p_repair_type_id )) THEN
821: RAISE FND_API.G_EXC_ERROR;
822: END IF;
823:
824:
825: --debug msg
849: IF (g_debug > 0 ) THEN
850: csd_gen_utility_pvt.ADD ('p_contract_line_id is null');
851: END IF;
852:
853: RAISE FND_API.G_EXC_ERROR;
854:
855: END IF;
856:
857: --debug msg
858: IF (g_debug > 0 ) THEN
859: csd_gen_utility_pvt.ADD ('Call Get_ContractPriceList procedure: return status ='|| x_return_status);
860: END IF;
861:
862: IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
863:
864: x_contract_validated := l_contract_validated;
865:
866: IF (l_contract_pl_id IS NOT NULL) THEN
868: ELSE
869: x_contract_currency_code := Get_PLCurrCode (l_billing_pl_id);
870: END IF;
871:
872: ELSIF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
873:
874: --debug msg
875: IF (g_debug > 0 ) THEN
876: csd_gen_utility_pvt.ADD ('Get_ContractPL procedure failed');
875: IF (g_debug > 0 ) THEN
876: csd_gen_utility_pvt.ADD ('Get_ContractPL procedure failed');
877: END IF;
878:
879: RAISE FND_API.G_EXC_ERROR;
880:
881: END IF;
882:
883: EXCEPTION
881: END IF;
882:
883: EXCEPTION
884:
885: WHEN FND_API.G_EXC_ERROR THEN
886: ROLLBACK TO Validate_Contract;
887: x_return_status := FND_API.G_RET_STS_ERROR ;
888: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
889: p_data => x_msg_data);
883: EXCEPTION
884:
885: WHEN FND_API.G_EXC_ERROR THEN
886: ROLLBACK TO Validate_Contract;
887: x_return_status := FND_API.G_RET_STS_ERROR ;
888: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
889: p_data => x_msg_data);
890:
891: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
887: x_return_status := FND_API.G_RET_STS_ERROR ;
888: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
889: p_data => x_msg_data);
890:
891: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
892: ROLLBACK TO Validate_Contract;
893: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
894: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
895: p_data => x_msg_data );
889: p_data => x_msg_data);
890:
891: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
892: ROLLBACK TO Validate_Contract;
893: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
894: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
895: p_data => x_msg_data );
896:
897: WHEN OTHERS THEN
895: p_data => x_msg_data );
896:
897: WHEN OTHERS THEN
898: ROLLBACK TO Validate_Contract;
899: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
900: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
901: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME ,
902: l_api_name );
903: END IF;
1014: -- Standard Start of API savepoint
1015: SAVEPOINT Get_DiscountedPrice;
1016:
1017: -- Standard call to check for call compatibility.
1018: IF NOT FND_API.Compatible_API_Call (l_api_version,
1019: p_api_version,
1020: l_api_name,
1021: G_PKG_NAME)
1022: THEN
1019: p_api_version,
1020: l_api_name,
1021: G_PKG_NAME)
1022: THEN
1023: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1024: END IF;
1025:
1026: -- Initialize message list if p_init_msg_list is set to TRUE.
1027: IF FND_API.to_Boolean(p_init_msg_list) THEN
1023: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1024: END IF;
1025:
1026: -- Initialize message list if p_init_msg_list is set to TRUE.
1027: IF FND_API.to_Boolean(p_init_msg_list) THEN
1028: FND_MSG_PUB.initialize;
1029: END IF;
1030:
1031: -- Initialize API return status to success
1028: FND_MSG_PUB.initialize;
1029: END IF;
1030:
1031: -- Initialize API return status to success
1032: x_return_status := FND_API.G_RET_STS_SUCCESS;
1033:
1034: --
1035: -- Begin API Body
1036: --
1068:
1069:
1070: -- Validate the repair type ID
1071: IF NOT( CSD_PROCESS_UTIL.Validate_repair_type_id ( p_repair_type_id => p_repair_type_id )) THEN
1072: RAISE FND_API.G_EXC_ERROR;
1073: END IF;
1074:
1075: BEGIN
1076:
1085: WHEN others THEN
1086: FND_MESSAGE.SET_NAME('CSD','CSD_API_DISCOUNTED_PRICE');
1087: FND_MESSAGE.SET_TOKEN('REPAIR_TYPE_ID', p_repair_type_id);
1088: FND_MSG_PUB.Add;
1089: RAISE FND_API.G_EXC_ERROR;
1090:
1091: END;
1092:
1093: -- Set l_contract_in_tbl attributes
1125: x_est_discounted_amt_tbl => l_contract_out_tbl
1126: );
1127:
1128:
1129: IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
1130:
1131: -- only 1 row should be returned
1132: IF (l_contract_out_tbl.COUNT > 1) THEN
1133: RAISE FND_API.G_EXC_ERROR;
1129: IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
1130:
1131: -- only 1 row should be returned
1132: IF (l_contract_out_tbl.COUNT > 1) THEN
1133: RAISE FND_API.G_EXC_ERROR;
1134: ELSE
1135:
1136: IF (l_contract_out_tbl(i).discounted_amount IS NULL) THEN
1137: x_discounted_price := l_contract_in_tbl(i).charge_amount;
1139: x_discounted_price := l_contract_out_tbl(i).discounted_amount;
1140: END IF;
1141: END IF;
1142:
1143: ELSIF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1144: RAISE FND_API.G_EXC_ERROR;
1145: END IF;
1146:
1147: -- API body ends here
1140: END IF;
1141: END IF;
1142:
1143: ELSIF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1144: RAISE FND_API.G_EXC_ERROR;
1145: END IF;
1146:
1147: -- API body ends here
1148:
1151: p_data => x_msg_data );
1152:
1153: EXCEPTION
1154:
1155: WHEN FND_API.G_EXC_ERROR THEN
1156: ROLLBACK TO Get_DiscountedPrice;
1157: x_return_status := FND_API.G_RET_STS_ERROR ;
1158: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
1159: p_data => x_msg_data);
1153: EXCEPTION
1154:
1155: WHEN FND_API.G_EXC_ERROR THEN
1156: ROLLBACK TO Get_DiscountedPrice;
1157: x_return_status := FND_API.G_RET_STS_ERROR ;
1158: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
1159: p_data => x_msg_data);
1160:
1161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1157: x_return_status := FND_API.G_RET_STS_ERROR ;
1158: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
1159: p_data => x_msg_data);
1160:
1161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1162: ROLLBACK TO Get_DiscountedPrice;
1163: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1164: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
1165: p_data => x_msg_data );
1159: p_data => x_msg_data);
1160:
1161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1162: ROLLBACK TO Get_DiscountedPrice;
1163: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1164: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
1165: p_data => x_msg_data );
1166:
1167: WHEN OTHERS THEN
1165: p_data => x_msg_data );
1166:
1167: WHEN OTHERS THEN
1168: ROLLBACK TO Get_DiscountedPrice;
1169: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1170: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1171: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME ,
1172: l_api_name );
1173: END IF;
1237: csd_gen_utility_pvt.ADD ('Get_CoverageInfo procedure: p_business_process_id='|| p_business_process_id);
1238: END IF;
1239:
1240: -- Initialize API return status to success
1241: x_return_status := FND_API.G_RET_STS_SUCCESS;
1242:
1243: IF (g_debug > 0 ) THEN
1244: csd_gen_utility_pvt.dump_api_info ( p_pkg_name => G_PKG_NAME,
1245: p_api_name => l_api_name );
1293: -- Log an error message.
1294: FND_MESSAGE.SET_NAME('CSD', 'CSD_CHRG_UTIL_NO_COVG');
1295: -- No coverage information found for contract and business process.
1296: FND_MSG_PUB.ADD;
1297: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1298: END IF;
1299: ******/
1300: x_coverage_txn_group_id := null;
1301:
1299: ******/
1300: x_coverage_txn_group_id := null;
1301:
1302: EXCEPTION
1303: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1304: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1305: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
1306: p_data => x_msg_data );
1307: WHEN OTHERS THEN
1300: x_coverage_txn_group_id := null;
1301:
1302: EXCEPTION
1303: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1304: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1305: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
1306: p_data => x_msg_data );
1307: WHEN OTHERS THEN
1308: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1304: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1305: FND_MSG_PUB.Count_And_Get (p_count => x_msg_count,
1306: p_data => x_msg_data );
1307: WHEN OTHERS THEN
1308: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1309: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1310: THEN
1311: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME ,
1312: l_api_name );
1442: -- Standard Start of API savepoint
1443: SAVEPOINT Convert_To_Actual_Lines;
1444:
1445: -- Standard call to check for call compatibility.
1446: IF NOT FND_API.Compatible_API_Call( lc_api_version,
1447: p_api_version,
1448: lc_api_name,
1449: G_PKG_NAME ) THEN
1450: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1446: IF NOT FND_API.Compatible_API_Call( lc_api_version,
1447: p_api_version,
1448: lc_api_name,
1449: G_PKG_NAME ) THEN
1450: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1451: END IF;
1452:
1453: -- Initialize message list if p_init_msg_list is set to TRUE.
1454: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1450: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1451: END IF;
1452:
1453: -- Initialize message list if p_init_msg_list is set to TRUE.
1454: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1455: FND_MSG_PUB.initialize;
1456: END IF;
1457:
1458: -- logging
1497: 'p_contract_line_id: ' || p_contract_line_id);
1498: end if;
1499:
1500: -- Initialize API return status to success
1501: x_return_status := FND_API.G_RET_STS_SUCCESS;
1502:
1503: --
1504: -- Begin API Body
1505: --
1535: end if;
1536: FND_MESSAGE.SET_NAME( 'CSD', 'CSD_CHRG_NO_OPER_UNIT');
1537: -- Could not determine the operating unit. Operating unit is required to derive line types.
1538: FND_MSG_PUB.add_detail( p_message_type => FND_MSG_PUB.G_ERROR_MSG );
1539: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1540: END IF;
1541:
1542: -- Get the coverage details for the business process and
1543: -- Contract line id.
1571: -- swai: bug fix 4770958 (FP of 4499468)
1572: -- due to rearch of contracts for r12,
1573: -- no need to check for null coverage txn group anymore
1574: -- IF ( l_coverage_txn_group_id IS NULL
1575: -- OR x_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1576: IF ( x_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1577: if (lc_proc_level >= lc_debug_level) then
1578: FND_LOG.STRING(lc_proc_level, lc_mod_name,
1579: 'Coverage information could not be determined for the contract and business process.');
1572: -- due to rearch of contracts for r12,
1573: -- no need to check for null coverage txn group anymore
1574: -- IF ( l_coverage_txn_group_id IS NULL
1575: -- OR x_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1576: IF ( x_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1577: if (lc_proc_level >= lc_debug_level) then
1578: FND_LOG.STRING(lc_proc_level, lc_mod_name,
1579: 'Coverage information could not be determined for the contract and business process.');
1580: end if;
1580: end if;
1581: FND_MESSAGE.SET_NAME( 'CSD', 'CSD_CHRG_UTIL_NO_COVG');
1582: -- Coverage information could not be determined for the contract and business process.
1583: FND_MSG_PUB.add_detail( p_message_type => FND_MSG_PUB.G_ERROR_MSG );
1584: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1585: END IF;
1586: END IF;
1587:
1588: l_numRows := p_MLE_lines_tbl.COUNT;
1684:
1685: -- If API returned NULL value for the selling price
1686: -- we consider it's an error.
1687: IF l_unit_selling_price IS NULL THEN
1688: RAISE FND_API.G_eXC_ERROR;
1689: END IF;
1690:
1691: EXCEPTION
1692: -- The reason we only handle 'FND_API.G_EXC_ERROR' exception
1688: RAISE FND_API.G_eXC_ERROR;
1689: END IF;
1690:
1691: EXCEPTION
1692: -- The reason we only handle 'FND_API.G_EXC_ERROR' exception
1693: -- is because the above API throws only one type of exception.
1694: -- If there is any other exception then it should be caught
1695: -- outside the loop in the main EXCEPTION block of the procedure.
1696: WHEN FND_API.G_EXC_ERROR THEN
1692: -- The reason we only handle 'FND_API.G_EXC_ERROR' exception
1693: -- is because the above API throws only one type of exception.
1694: -- If there is any other exception then it should be caught
1695: -- outside the loop in the main EXCEPTION block of the procedure.
1696: WHEN FND_API.G_EXC_ERROR THEN
1697: --DBMS_OUTPUT.put_line( 'NEW: The unit price is '
1698: -- || l_unit_selling_price );
1699: --DBMS_OUTPUT.put_line( 'NEW: The status is '
1700: -- || l_return_status );
1821:
1822: -- Line type id is a required field. If the value is NULL then
1823: -- the current record is ineligible for further processing.
1824: IF ( l_line_type_id IS NULL
1825: OR l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
1826: --DBMS_OUTPUT.put_line( 'NEW: inside the line_typeId NULL check.' );
1827: l_skip_curr_rec := TRUE;
1828: FND_MESSAGE.SET_NAME( 'CSD', 'CSD_CHRG_LINE_TYPE_MISS');
1829: -- Line type, for the current organization, has not been set for the item $ITEM. Check the service activity billing types set up.
1952: || 'x_discounted_price = ' || l_discounted_price
1953: || ', x_return_status = ' || l_return_status);
1954: end if;
1955:
1956: IF (( l_return_status <> FND_API.G_RET_STS_SUCCESS )
1957: OR ( l_discounted_price IS NULL )) THEN
1958: l_skip_curr_rec := TRUE;
1959: FND_MESSAGE.SET_NAME( 'CSD', 'CSD_CHRG_DISCOUNT_PRICE');
1960: -- There was an error while trying to get discount price for the item $ITEM using the contract $CONTRACT_NUMBER.
1967: -- We do not do Actuals costing.
1968: /*
1969: CSD_COST_ANALYSIS_PVT.Get_InvItemCost(
1970: p_api_version => 1.0,
1971: p_commit => fnd_api.g_false,
1972: p_init_msg_list => fnd_api.g_false,
1973: p_validation_level => fnd_api.g_valid_level_full,
1974: x_return_status => x_return_status,
1975: x_msg_count => x_msg_count,
1968: /*
1969: CSD_COST_ANALYSIS_PVT.Get_InvItemCost(
1970: p_api_version => 1.0,
1971: p_commit => fnd_api.g_false,
1972: p_init_msg_list => fnd_api.g_false,
1973: p_validation_level => fnd_api.g_valid_level_full,
1974: x_return_status => x_return_status,
1975: x_msg_count => x_msg_count,
1976: x_msg_data => x_msg_data,
1969: CSD_COST_ANALYSIS_PVT.Get_InvItemCost(
1970: p_api_version => 1.0,
1971: p_commit => fnd_api.g_false,
1972: p_init_msg_list => fnd_api.g_false,
1973: p_validation_level => fnd_api.g_valid_level_full,
1974: x_return_status => x_return_status,
1975: x_msg_count => x_msg_count,
1976: x_msg_data => x_msg_data,
1977: p_inventory_item_id => p_MLE_lines_tbl(i).inventory_item_id,
1980: p_charge_date => sysdate,
1981: p_currency_code => p_currency_code,
1982: x_item_cost => px_charge_lines_tbl(l_curRow).item_cost
1983: );
1984: if(l_return_status <> FND_API.G_RET_STS_SUCCESS) then
1985: px_charge_lines_tbl(l_curRow).item_cost := null;
1986: --
1987: -- give warning message that cost could not be determined?
1988: -- x_warning_flag := FND_API.G_TRUE;
1984: if(l_return_status <> FND_API.G_RET_STS_SUCCESS) then
1985: px_charge_lines_tbl(l_curRow).item_cost := null;
1986: --
1987: -- give warning message that cost could not be determined?
1988: -- x_warning_flag := FND_API.G_TRUE;
1989: -- x_return_status := FND_API.G_RET_STS_ERROR;
1990: --FND_MESSAGE.SET_NAME('CSD','CSD_EST_ESTIMATED_CHARGE_ERR');
1991: --FND_MESSAGE.SET_TOKEN('CONTRACT_NUMBER',px_charge_lines_tbl(l_curRow).contract_number);
1992: --FND_MSG_PUB.add_detail( p_message_type => FND_MSG_PUB.G_WARNING_MSG );
1985: px_charge_lines_tbl(l_curRow).item_cost := null;
1986: --
1987: -- give warning message that cost could not be determined?
1988: -- x_warning_flag := FND_API.G_TRUE;
1989: -- x_return_status := FND_API.G_RET_STS_ERROR;
1990: --FND_MESSAGE.SET_NAME('CSD','CSD_EST_ESTIMATED_CHARGE_ERR');
1991: --FND_MESSAGE.SET_TOKEN('CONTRACT_NUMBER',px_charge_lines_tbl(l_curRow).contract_number);
1992: --FND_MSG_PUB.add_detail( p_message_type => FND_MSG_PUB.G_WARNING_MSG );
1993: -- l_skip_curr_rec := TRUE;
2089: /* END IF;*/
2090:
2091: ELSE
2092: -- If the current row is not valid then set the OUT flag.
2093: x_warning_flag := FND_API.G_TRUE;
2094: --DBMS_OUTPUT.put_line( 'NEW: Inside the warnings ..'
2095: -- || x_warning_flag );
2096:
2097: END IF;
2106: --
2107: -- End API Body
2108: --
2109:
2110: --IF ( x_warning_flag = FND_API.G_TRUE ) THEN
2111: --DBMS_OUTPUT.put_line( 'NEW: TRUE WARNING' );
2112: --END IF;
2113:
2114: -- Standard check of p_commit.
2112: --END IF;
2113:
2114: -- Standard check of p_commit.
2115:
2116: IF FND_API.To_Boolean( p_commit ) THEN
2117: COMMIT WORK;
2118: END IF;-- Standard call to get message count and IF count is get message info.
2119:
2120: -- logging
2128: p_data => x_msg_data );
2129: */
2130:
2131: EXCEPTION
2132: WHEN FND_API.G_EXC_ERROR THEN
2133: ROLLBACK TO Convert_To_Actual_Lines;
2134: --DBMS_OUTPUT.put_line( 'NEW: Inside EXC ERROR' );
2135: x_return_status := FND_API.G_RET_STS_ERROR;
2136: FND_MSG_PUB.Count_And_Get( p_count => x_msg_count,
2131: EXCEPTION
2132: WHEN FND_API.G_EXC_ERROR THEN
2133: ROLLBACK TO Convert_To_Actual_Lines;
2134: --DBMS_OUTPUT.put_line( 'NEW: Inside EXC ERROR' );
2135: x_return_status := FND_API.G_RET_STS_ERROR;
2136: FND_MSG_PUB.Count_And_Get( p_count => x_msg_count,
2137: p_data => x_msg_data );
2138:
2139: -- save message in debug log
2141: FND_LOG.STRING(lc_excep_level, lc_mod_name,
2142: 'EXC_ERROR['||x_msg_data||']');
2143: END IF;
2144:
2145: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2146: ROLLBACK TO Convert_To_Actual_Lines;
2147: --DBMS_OUTPUT.put_line( 'NEW: Inside UNEXP ERROR' );
2148: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2149: FND_MSG_PUB.Count_And_Get( p_count => x_msg_count,
2144:
2145: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2146: ROLLBACK TO Convert_To_Actual_Lines;
2147: --DBMS_OUTPUT.put_line( 'NEW: Inside UNEXP ERROR' );
2148: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2149: FND_MSG_PUB.Count_And_Get( p_count => x_msg_count,
2150: p_data => x_msg_data );
2151:
2152: -- save message in debug log
2156: END IF;
2157:
2158: WHEN OTHERS THEN
2159: ROLLBACK TO Convert_To_Actual_Lines;
2160: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2161: --DBMS_OUTPUT.put_line( 'SQLCODE= '
2162: -- || SQLCODE );
2163: --DBMS_OUTPUT.put_line( 'SQLERRM= '
2164: -- || SQLERRM );