99: --salogan::Added Cursor to fetch conc request details CP ER 9299910::01-JUN-2009::END
100:
101: -- Begin Procedure code
102: BEGIN
103: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
104: fnd_log.string
105: (
106: fnd_log.level_procedure,
107: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details.begin',
100:
101: -- Begin Procedure code
102: BEGIN
103: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
104: fnd_log.string
105: (
106: fnd_log.level_procedure,
107: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details.begin',
108: 'At the start of PLSQL procedure'
102: BEGIN
103: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
104: fnd_log.string
105: (
106: fnd_log.level_procedure,
107: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details.begin',
108: 'At the start of PLSQL procedure'
109: );
110: END IF;
129: END IF;
130:
131: l_cost_price_rec:= p_x_cost_price_rec;
132:
133: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
134: fnd_log.string
135: (
136: fnd_log.level_statement,
137: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
130:
131: l_cost_price_rec:= p_x_cost_price_rec;
132:
133: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
134: fnd_log.string
135: (
136: fnd_log.level_statement,
137: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
138: 'Got request for cost record of Visit ID : ' || p_x_cost_price_rec.visit_id
132:
133: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
134: fnd_log.string
135: (
136: fnd_log.level_statement,
137: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
138: 'Got request for cost record of Visit ID : ' || p_x_cost_price_rec.visit_id
139: );
140: fnd_log.string
136: fnd_log.level_statement,
137: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
138: 'Got request for cost record of Visit ID : ' || p_x_cost_price_rec.visit_id
139: );
140: fnd_log.string
141: (
142: fnd_log.level_statement,
143: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
144: 'Got request for update visit cost details of mr session ID : ' || p_x_cost_price_rec.mr_session_id
138: 'Got request for cost record of Visit ID : ' || p_x_cost_price_rec.visit_id
139: );
140: fnd_log.string
141: (
142: fnd_log.level_statement,
143: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
144: 'Got request for update visit cost details of mr session ID : ' || p_x_cost_price_rec.mr_session_id
145: );
146: fnd_log.string
142: fnd_log.level_statement,
143: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
144: 'Got request for update visit cost details of mr session ID : ' || p_x_cost_price_rec.mr_session_id
145: );
146: fnd_log.string
147: (
148: fnd_log.level_statement,
149: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
150: 'Got request for update visit cost details of cost session ID : ' || p_x_cost_price_rec.cost_session_id
144: 'Got request for update visit cost details of mr session ID : ' || p_x_cost_price_rec.mr_session_id
145: );
146: fnd_log.string
147: (
148: fnd_log.level_statement,
149: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
150: 'Got request for update visit cost details of cost session ID : ' || p_x_cost_price_rec.cost_session_id
151: );
152: END IF;
154: -- make sure that visit id is present in the input
155: IF(p_x_cost_price_rec.visit_id IS NULL OR p_x_cost_price_rec.visit_id = FND_API.G_MISS_NUM) THEN
156: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
157: FND_MSG_PUB.ADD;
158: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
159: fnd_log.string
160: (
161: fnd_log.level_exception,
162: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
155: IF(p_x_cost_price_rec.visit_id IS NULL OR p_x_cost_price_rec.visit_id = FND_API.G_MISS_NUM) THEN
156: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
157: FND_MSG_PUB.ADD;
158: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
159: fnd_log.string
160: (
161: fnd_log.level_exception,
162: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
163: 'Visit id is mandatory but found null in input '
157: FND_MSG_PUB.ADD;
158: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
159: fnd_log.string
160: (
161: fnd_log.level_exception,
162: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
163: 'Visit id is mandatory but found null in input '
164: );
165: END IF;
177:
178: IF (visit_info_csr%NOTFOUND)THEN
179: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_VISIT');
180: FND_MSG_PUB.ADD;
181: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
182: fnd_log.string
183: (
184: fnd_log.level_exception,
185: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
178: IF (visit_info_csr%NOTFOUND)THEN
179: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_VISIT');
180: FND_MSG_PUB.ADD;
181: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
182: fnd_log.string
183: (
184: fnd_log.level_exception,
185: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
186: 'Visit id not found in ahl_visits_b table'
180: FND_MSG_PUB.ADD;
181: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
182: fnd_log.string
183: (
184: fnd_log.level_exception,
185: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
186: 'Visit id not found in ahl_visits_b table'
187: );
188: END IF;
200: FETCH customer_id_csr INTO l_cost_price_rec.customer_id;
201: IF(customer_id_csr%NOTFOUND)THEN
202: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_SR_ID');
203: FND_MSG_PUB.ADD;
204: IF(fnd_log.level_unexpected >= fnd_log.g_current_runtime_level)THEN
205: fnd_log.string
206: (
207: fnd_log.level_unexpected,
208: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
201: IF(customer_id_csr%NOTFOUND)THEN
202: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_SR_ID');
203: FND_MSG_PUB.ADD;
204: IF(fnd_log.level_unexpected >= fnd_log.g_current_runtime_level)THEN
205: fnd_log.string
206: (
207: fnd_log.level_unexpected,
208: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
209: 'Service request associated is invalid as record not found : l_cost_price_rec.service_request_id : '||l_cost_price_rec.service_request_id
203: FND_MSG_PUB.ADD;
204: IF(fnd_log.level_unexpected >= fnd_log.g_current_runtime_level)THEN
205: fnd_log.string
206: (
207: fnd_log.level_unexpected,
208: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
209: 'Service request associated is invalid as record not found : l_cost_price_rec.service_request_id : '||l_cost_price_rec.service_request_id
210: );
211: END IF;
235:
236: IF(price_list_name_csr%NOTFOUND)THEN
237: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_VISIT');
238: FND_MSG_PUB.ADD;
239: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
240: fnd_log.string
241: (
242: fnd_log.level_error,
243: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
236: IF(price_list_name_csr%NOTFOUND)THEN
237: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_VISIT');
238: FND_MSG_PUB.ADD;
239: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
240: fnd_log.string
241: (
242: fnd_log.level_error,
243: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
244: 'List name not found for stored list id'
238: FND_MSG_PUB.ADD;
239: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
240: fnd_log.string
241: (
242: fnd_log.level_error,
243: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
244: 'List name not found for stored list id'
245: );
246: END IF;
251: CLOSE price_list_name_csr;
252: END IF;
253:
254: --salogan::Fetching conc request details CP ER 9299910::01-JUN-2009::Begin
255: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
256: fnd_log.string
257: (
258: fnd_log.level_statement,
259: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
252: END IF;
253:
254: --salogan::Fetching conc request details CP ER 9299910::01-JUN-2009::Begin
255: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
256: fnd_log.string
257: (
258: fnd_log.level_statement,
259: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
260: 'Concurrent program request id . ' || l_cost_price_rec.Cp_Request_Id
254: --salogan::Fetching conc request details CP ER 9299910::01-JUN-2009::Begin
255: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
256: fnd_log.string
257: (
258: fnd_log.level_statement,
259: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
260: 'Concurrent program request id . ' || l_cost_price_rec.Cp_Request_Id
261: );
262: END IF;
290: x_return_status => x_return_status
291: );
292:
293: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
294: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
295: fnd_log.string
296: (
297: fnd_log.level_exception,
298: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
291: );
292:
293: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
294: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
295: fnd_log.string
296: (
297: fnd_log.level_exception,
298: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
299: 'AHL_VWP_COST_PVT.Calculate_WO_Cost API threw error : x_return_status : ' || x_return_status
293: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
294: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
295: fnd_log.string
296: (
297: fnd_log.level_exception,
298: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
299: 'AHL_VWP_COST_PVT.Calculate_WO_Cost API threw error : x_return_status : ' || x_return_status
300: );
301: END IF;
314: x_return_status => x_return_status
315: );
316:
317: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
318: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
319: fnd_log.string
320: (
321: fnd_log.level_exception,
322: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
315: );
316:
317: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
318: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
319: fnd_log.string
320: (
321: fnd_log.level_exception,
322: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
323: 'AHL_VWP_COST_PVT.Calculate_Visit_Cost API threw error : x_return_status : ' || x_return_status
317: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
318: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
319: fnd_log.string
320: (
321: fnd_log.level_exception,
322: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
323: 'AHL_VWP_COST_PVT.Calculate_Visit_Cost API threw error : x_return_status : ' || x_return_status
324: );
325: END IF;
339: );
340: END IF;
341:
342: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
343: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
344: fnd_log.string
345: (
346: fnd_log.level_exception,
347: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
340: END IF;
341:
342: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
343: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
344: fnd_log.string
345: (
346: fnd_log.level_exception,
347: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
348: 'AHL_VWP_COST_PVT.Get_Profit_or_Loss API threw error : x_return_status : ' || x_return_status
342: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
343: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
344: fnd_log.string
345: (
346: fnd_log.level_exception,
347: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details',
348: 'AHL_VWP_COST_PVT.Get_Profit_or_Loss API threw error : x_return_status : ' || x_return_status
349: );
350: END IF;
399: p_x_cost_price_rec.cp_request_date := conc_req_rec.cp_request_date;
400: END IF;
401: --salogan::stored conc request params in cost record OUT param CP ER 9299910::01-JUN-2009::END
402:
403: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
404: fnd_log.string
405: (
406: fnd_log.level_procedure,
407: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details.end',
400: END IF;
401: --salogan::stored conc request params in cost record OUT param CP ER 9299910::01-JUN-2009::END
402:
403: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
404: fnd_log.string
405: (
406: fnd_log.level_procedure,
407: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details.end',
408: 'At the end of PLSQL procedure'
402:
403: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
404: fnd_log.string
405: (
406: fnd_log.level_procedure,
407: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.get_visit_cost_details.end',
408: 'At the end of PLSQL procedure'
409: );
410: END IF;
496: FOR UPDATE OF object_version_number;
497: visit_rec update_visit_csr%ROWTYPE;
498:
499: BEGIN
500: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
501: fnd_log.string
502: (
503: fnd_log.level_procedure,
504: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details.begin',
497: visit_rec update_visit_csr%ROWTYPE;
498:
499: BEGIN
500: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
501: fnd_log.string
502: (
503: fnd_log.level_procedure,
504: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details.begin',
505: 'At the start of PLSQL procedure'
499: BEGIN
500: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
501: fnd_log.string
502: (
503: fnd_log.level_procedure,
504: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details.begin',
505: 'At the start of PLSQL procedure'
506: );
507: END IF;
517: -- Initialize API return status to success
518: x_return_status := FND_API.G_RET_STS_SUCCESS;
519: l_cost_price_rec := p_x_cost_price_rec;
520:
521: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
522: fnd_log.string
523: (
524: fnd_log.level_statement,
525: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
518: x_return_status := FND_API.G_RET_STS_SUCCESS;
519: l_cost_price_rec := p_x_cost_price_rec;
520:
521: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
522: fnd_log.string
523: (
524: fnd_log.level_statement,
525: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
526: 'Got request for update visit cost details of Visit ID : ' || p_x_cost_price_rec.visit_id
520:
521: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
522: fnd_log.string
523: (
524: fnd_log.level_statement,
525: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
526: 'Got request for update visit cost details of Visit ID : ' || p_x_cost_price_rec.visit_id
527: );
528: fnd_log.string
524: fnd_log.level_statement,
525: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
526: 'Got request for update visit cost details of Visit ID : ' || p_x_cost_price_rec.visit_id
527: );
528: fnd_log.string
529: (
530: fnd_log.level_statement,
531: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
532: 'outside party flag : ' || p_x_cost_price_rec.outside_party_flag
526: 'Got request for update visit cost details of Visit ID : ' || p_x_cost_price_rec.visit_id
527: );
528: fnd_log.string
529: (
530: fnd_log.level_statement,
531: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
532: 'outside party flag : ' || p_x_cost_price_rec.outside_party_flag
533: );
534: fnd_log.string
530: fnd_log.level_statement,
531: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
532: 'outside party flag : ' || p_x_cost_price_rec.outside_party_flag
533: );
534: fnd_log.string
535: (
536: fnd_log.level_statement,
537: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
538: 'Price List Name : ' || p_x_cost_price_rec.price_list_name
532: 'outside party flag : ' || p_x_cost_price_rec.outside_party_flag
533: );
534: fnd_log.string
535: (
536: fnd_log.level_statement,
537: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
538: 'Price List Name : ' || p_x_cost_price_rec.price_list_name
539: );
540: END IF;
542: -- Make sure that visit id is present in the input
543: IF(p_x_cost_price_rec.visit_id IS NULL OR p_x_cost_price_rec.visit_id = FND_API.G_MISS_NUM) THEN
544: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
545: FND_MSG_PUB.ADD;
546: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
547: fnd_log.string
548: (
549: fnd_log.level_exception,
550: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
543: IF(p_x_cost_price_rec.visit_id IS NULL OR p_x_cost_price_rec.visit_id = FND_API.G_MISS_NUM) THEN
544: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
545: FND_MSG_PUB.ADD;
546: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
547: fnd_log.string
548: (
549: fnd_log.level_exception,
550: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
551: 'Visit id is mandatory but found null in input '
545: FND_MSG_PUB.ADD;
546: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
547: fnd_log.string
548: (
549: fnd_log.level_exception,
550: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
551: 'Visit id is mandatory but found null in input '
552: );
553: END IF;
557: --make sure outside party flag is valid
558: IF (NVL(p_x_cost_price_rec.outside_party_flag,'N') NOT IN ('Y','N'))THEN
559: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_OSP_INV');
560: FND_MSG_PUB.ADD;
561: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
562: fnd_log.string
563: (
564: fnd_log.level_exception,
565: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
558: IF (NVL(p_x_cost_price_rec.outside_party_flag,'N') NOT IN ('Y','N'))THEN
559: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_OSP_INV');
560: FND_MSG_PUB.ADD;
561: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
562: fnd_log.string
563: (
564: fnd_log.level_exception,
565: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
566: 'Input OSP Flag is invalid : ' || p_x_cost_price_rec.outside_party_flag
560: FND_MSG_PUB.ADD;
561: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
562: fnd_log.string
563: (
564: fnd_log.level_exception,
565: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
566: 'Input OSP Flag is invalid : ' || p_x_cost_price_rec.outside_party_flag
567: );
568: END IF;
581: FND_MSG_PUB.ADD;
582: CLOSE visit_info_csr;
583: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
584:
585: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
586: fnd_log.string
587: (
588: fnd_log.level_exception,
589: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
582: CLOSE visit_info_csr;
583: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
584:
585: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
586: fnd_log.string
587: (
588: fnd_log.level_exception,
589: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
590: 'Visit id not found in ahl_visits_b table'
584:
585: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
586: fnd_log.string
587: (
588: fnd_log.level_exception,
589: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
590: 'Visit id not found in ahl_visits_b table'
591: );
592: END IF;
596: FND_MSG_PUB.ADD;
597: CLOSE visit_info_csr;
598: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
599:
600: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
601: fnd_log.string
602: (
603: fnd_log.level_error,
604: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
597: CLOSE visit_info_csr;
598: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
599:
600: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
601: fnd_log.string
602: (
603: fnd_log.level_error,
604: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
605: 'Visit is closed so can not update outside party flag or price list'
599:
600: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
601: fnd_log.string
602: (
603: fnd_log.level_error,
604: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
605: 'Visit is closed so can not update outside party flag or price list'
606: );
607: END IF;
611: FND_MSG_PUB.ADD;
612: CLOSE visit_info_csr;
613: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
614:
615: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
616: fnd_log.string
617: (
618: fnd_log.level_error,
619: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
612: CLOSE visit_info_csr;
613: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
614:
615: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
616: fnd_log.string
617: (
618: fnd_log.level_error,
619: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
620: 'No service request is attached to visit so can not update outside party flag or price list'
614:
615: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
616: fnd_log.string
617: (
618: fnd_log.level_error,
619: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
620: 'No service request is attached to visit so can not update outside party flag or price list'
621: );
622: END IF;
631: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_OSP_FLAG_MOD');
632: FND_MSG_PUB.ADD;
633: RAISE FND_API.G_EXC_ERROR;
634:
635: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
636: fnd_log.string
637: (
638: fnd_log.level_error,
639: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
632: FND_MSG_PUB.ADD;
633: RAISE FND_API.G_EXC_ERROR;
634:
635: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
636: fnd_log.string
637: (
638: fnd_log.level_error,
639: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
640: 'Can not modify outside party flag because tasks has already been created'
634:
635: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
636: fnd_log.string
637: (
638: fnd_log.level_error,
639: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
640: 'Can not modify outside party flag because tasks has already been created'
641: );
642: END IF;
654: THEN
655:
656: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_PRICE_LIST_MAND');
657: FND_MSG_PUB.ADD;
658: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
659: fnd_log.string
660: (
661: fnd_log.level_error,
662: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
655:
656: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_PRICE_LIST_MAND');
657: FND_MSG_PUB.ADD;
658: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
659: fnd_log.string
660: (
661: fnd_log.level_error,
662: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
663: 'Price List is mandatory'
657: FND_MSG_PUB.ADD;
658: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
659: fnd_log.string
660: (
661: fnd_log.level_error,
662: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
663: 'Price List is mandatory'
664: );
665: END IF;
673: x_price_list_id => l_cost_price_rec.price_list_id,
674: x_return_status => x_return_status
675: );
676: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
677: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
678: fnd_log.string
679: (
680: fnd_log.level_error,
681: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
674: x_return_status => x_return_status
675: );
676: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
677: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
678: fnd_log.string
679: (
680: fnd_log.level_error,
681: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
682: 'AHL_VWP_RULES_PVT.Check_Price_List_Name_Or_Id API Threw error'
676: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
677: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
678: fnd_log.string
679: (
680: fnd_log.level_error,
681: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
682: 'AHL_VWP_RULES_PVT.Check_Price_List_Name_Or_Id API Threw error'
683: );
684: END IF;
687: ELSIF(l_cost_price_rec.outside_party_flag = 'N' AND l_cost_price_rec.price_list_name IS NOT NULL)THEN
688: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_OSP_VISIT_PR_LIST');
689: -- Please select check box 'Visit for outside party' or remove price list from LOV.
690: FND_MSG_PUB.ADD;
691: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
692: fnd_log.string
693: (
694: fnd_log.level_error,
695: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
688: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_OSP_VISIT_PR_LIST');
689: -- Please select check box 'Visit for outside party' or remove price list from LOV.
690: FND_MSG_PUB.ADD;
691: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
692: fnd_log.string
693: (
694: fnd_log.level_error,
695: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
696: 'Price List is mandatory'
690: FND_MSG_PUB.ADD;
691: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
692: fnd_log.string
693: (
694: fnd_log.level_error,
695: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
696: 'Price List is mandatory'
697: );
698: END IF;
722: (TRUNC(l_price_list_active_end_date) < TRUNC(l_start_date_time)) THEN
723:
724: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_PRICE_LIST_INV_STR');
725: FND_MSG_PUB.ADD;
726: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
727: fnd_log.string
728: (
729: fnd_log.level_error,
730: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
723:
724: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_PRICE_LIST_INV_STR');
725: FND_MSG_PUB.ADD;
726: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
727: fnd_log.string
728: (
729: fnd_log.level_error,
730: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
731: 'Price List is not active on visit start date'
725: FND_MSG_PUB.ADD;
726: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
727: fnd_log.string
728: (
729: fnd_log.level_error,
730: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
731: 'Price List is not active on visit start date'
732: );
733: END IF;
743: (TRUNC(l_price_list_active_end_date) < TRUNC(l_close_date_time)) THEN
744:
745: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_PRICE_LIST_INV_END');
746: FND_MSG_PUB.ADD;
747: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
748: fnd_log.string
749: (
750: fnd_log.level_error,
751: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
744:
745: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_PRICE_LIST_INV_END');
746: FND_MSG_PUB.ADD;
747: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
748: fnd_log.string
749: (
750: fnd_log.level_error,
751: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
752: 'Price List is not active on visit end date'
746: FND_MSG_PUB.ADD;
747: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
748: fnd_log.string
749: (
750: fnd_log.level_error,
751: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
752: 'Price List is not active on visit end date'
753: );
754: END IF;
765:
766: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_PRICE_LIST_INV_SYS');
767: -- CHANGE THIS MESSAGE TEST AND NAME TOO -- IMPORTANT
768: FND_MSG_PUB.ADD;
769: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
770: fnd_log.string
771: (
772: fnd_log.level_error,
773: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
766: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_PRICE_LIST_INV_SYS');
767: -- CHANGE THIS MESSAGE TEST AND NAME TOO -- IMPORTANT
768: FND_MSG_PUB.ADD;
769: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
770: fnd_log.string
771: (
772: fnd_log.level_error,
773: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
774: 'Price List is not active on current todays date'
768: FND_MSG_PUB.ADD;
769: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
770: fnd_log.string
771: (
772: fnd_log.level_error,
773: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details',
774: 'Price List is not active on current todays date'
775: );
776: END IF;
873: IF FND_API.TO_BOOLEAN(p_commit) THEN
874: COMMIT WORK;
875: END IF;
876:
877: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
878: fnd_log.string
879: (
880: fnd_log.level_procedure,
881: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details.end',
874: COMMIT WORK;
875: END IF;
876:
877: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
878: fnd_log.string
879: (
880: fnd_log.level_procedure,
881: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details.end',
882: 'At the end of PLSQL procedure'
876:
877: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
878: fnd_log.string
879: (
880: fnd_log.level_procedure,
881: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.update_visit_cost_details.end',
882: 'At the end of PLSQL procedure'
883: );
884: END IF;
946: l_cost_price_rec AHL_VWP_VISIT_CST_PR_PVT.cost_price_rec_type;
947:
948: BEGIN
949:
950: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
951: fnd_log.string
952: (
953: fnd_log.level_procedure,
954: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost.begin',
947:
948: BEGIN
949:
950: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
951: fnd_log.string
952: (
953: fnd_log.level_procedure,
954: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost.begin',
955: 'At the start of PLSQL procedure'
949:
950: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
951: fnd_log.string
952: (
953: fnd_log.level_procedure,
954: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost.begin',
955: 'At the start of PLSQL procedure'
956: );
957: END IF;
977: END IF;
978:
979: l_cost_price_rec:= p_x_cost_price_rec;
980:
981: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
982: fnd_log.string
983: (
984: fnd_log.level_statement,
985: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
978:
979: l_cost_price_rec:= p_x_cost_price_rec;
980:
981: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
982: fnd_log.string
983: (
984: fnd_log.level_statement,
985: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
986: 'Got request for estimating cost of Visit ID : ' || p_x_cost_price_rec.visit_id
980:
981: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
982: fnd_log.string
983: (
984: fnd_log.level_statement,
985: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
986: 'Got request for estimating cost of Visit ID : ' || p_x_cost_price_rec.visit_id
987: );
988:
985: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
986: 'Got request for estimating cost of Visit ID : ' || p_x_cost_price_rec.visit_id
987: );
988:
989: fnd_log.string
990: (
991: fnd_log.level_statement,
992: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
993: 'input mr session id : ' || p_x_cost_price_rec.mr_session_id
987: );
988:
989: fnd_log.string
990: (
991: fnd_log.level_statement,
992: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
993: 'input mr session id : ' || p_x_cost_price_rec.mr_session_id
994: );
995:
992: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
993: 'input mr session id : ' || p_x_cost_price_rec.mr_session_id
994: );
995:
996: fnd_log.string
997: (
998: fnd_log.level_statement,
999: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
1000: 'input cost session id : ' || p_x_cost_price_rec.cost_session_id
994: );
995:
996: fnd_log.string
997: (
998: fnd_log.level_statement,
999: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
1000: 'input cost session id : ' || p_x_cost_price_rec.cost_session_id
1001: );
1002: END IF;
1006: IF(p_x_cost_price_rec.visit_id IS NULL OR p_x_cost_price_rec.visit_id = FND_API.G_MISS_NUM) THEN
1007: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
1008: FND_MSG_PUB.ADD;
1009:
1010: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1011: fnd_log.string
1012: (
1013: fnd_log.level_exception,
1014: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
1007: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
1008: FND_MSG_PUB.ADD;
1009:
1010: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1011: fnd_log.string
1012: (
1013: fnd_log.level_exception,
1014: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
1015: 'Visit id is mandatory but found null in input '
1009:
1010: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1011: fnd_log.string
1012: (
1013: fnd_log.level_exception,
1014: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
1015: 'Visit id is mandatory but found null in input '
1016: );
1017: END IF;
1026:
1027: -- Release visit if required
1028: IF l_release_visit_required ='Y' THEN
1029:
1030: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1031: fnd_log.string
1032: (
1033: fnd_log.level_procedure,
1034: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1027: -- Release visit if required
1028: IF l_release_visit_required ='Y' THEN
1029:
1030: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1031: fnd_log.string
1032: (
1033: fnd_log.level_procedure,
1034: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1035: 'Before calling ahl vwp proj prod pvt.release visit'
1029:
1030: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1031: fnd_log.string
1032: (
1033: fnd_log.level_procedure,
1034: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1035: 'Before calling ahl vwp proj prod pvt.release visit'
1036: );
1037: END IF;
1054: x_msg_data => l_msg_data);
1055:
1056: --salogan::Added release flag parameter based on the module type BG/Standard CP ER 9299910::01-JUN-2009::END
1057:
1058: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1059: fnd_log.string
1060: (
1061: fnd_log.level_procedure,
1062: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||': End API',
1055:
1056: --salogan::Added release flag parameter based on the module type BG/Standard CP ER 9299910::01-JUN-2009::END
1057:
1058: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1059: fnd_log.string
1060: (
1061: fnd_log.level_procedure,
1062: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||': End API',
1063: 'After calling ahl vwp proj prod pvt.Release Visit task wo Return Status : '|| l_return_status
1057:
1058: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1059: fnd_log.string
1060: (
1061: fnd_log.level_procedure,
1062: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||': End API',
1063: 'After calling ahl vwp proj prod pvt.Release Visit task wo Return Status : '|| l_return_status
1064: );
1065: END IF;
1086: x_return_status => x_return_status
1087: );
1088:
1089: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1090: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1091: fnd_log.string
1092: (
1093: fnd_log.level_exception,
1094: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
1087: );
1088:
1089: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1090: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1091: fnd_log.string
1092: (
1093: fnd_log.level_exception,
1094: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
1095: 'AHL_VWP_COST_PVT.Estimate_WO_Cost API threw error : x_return_status : ' || x_return_status
1089: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1090: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1091: fnd_log.string
1092: (
1093: fnd_log.level_exception,
1094: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost',
1095: 'AHL_VWP_COST_PVT.Estimate_WO_Cost API threw error : x_return_status : ' || x_return_status
1096: );
1097: END IF;
1113: p_x_cost_price_rec.Is_Cst_Struc_updated := l_cost_price_rec.Is_Cst_Struc_updated;
1114: p_x_cost_price_rec.cost_session_id := l_cost_price_rec.cost_session_id;
1115: p_x_cost_price_rec.mr_session_id := l_cost_price_rec.mr_session_id;
1116:
1117: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1118: fnd_log.string
1119: (
1120: fnd_log.level_procedure,
1121: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost.end',
1114: p_x_cost_price_rec.cost_session_id := l_cost_price_rec.cost_session_id;
1115: p_x_cost_price_rec.mr_session_id := l_cost_price_rec.mr_session_id;
1116:
1117: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1118: fnd_log.string
1119: (
1120: fnd_log.level_procedure,
1121: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost.end',
1122: 'At the end of PLSQL procedure'
1116:
1117: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1118: fnd_log.string
1119: (
1120: fnd_log.level_procedure,
1121: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_cost.end',
1122: 'At the end of PLSQL procedure'
1123: );
1124: END IF;
1199: l_msg_data VARCHAR2(2000);
1200: l_msg_count NUMBER;
1201:
1202: BEGIN
1203: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1204: fnd_log.string
1205: (
1206: fnd_log.level_procedure,
1207: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.Estimate_SR_Price.begin',
1200: l_msg_count NUMBER;
1201:
1202: BEGIN
1203: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1204: fnd_log.string
1205: (
1206: fnd_log.level_procedure,
1207: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.Estimate_SR_Price.begin',
1208: 'At the start of PLSQL procedure'
1202: BEGIN
1203: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1204: fnd_log.string
1205: (
1206: fnd_log.level_procedure,
1207: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.Estimate_SR_Price.begin',
1208: 'At the start of PLSQL procedure'
1209: );
1210: END IF;
1264: );
1265:
1266: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1267:
1268: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1269: fnd_log.string
1270: (
1271: fnd_log.level_error,
1272: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.Estimate_SR_Price',
1265:
1266: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1267:
1268: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1269: fnd_log.string
1270: (
1271: fnd_log.level_error,
1272: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.Estimate_SR_Price',
1273: 'AHL_VWP_MR_CST_PR_PVT.Estimate_MR_Price API Threw error'
1267:
1268: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1269: fnd_log.string
1270: (
1271: fnd_log.level_error,
1272: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.Estimate_SR_Price',
1273: 'AHL_VWP_MR_CST_PR_PVT.Estimate_MR_Price API Threw error'
1274: );
1275: END IF;
1335: );
1336:
1337: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1338:
1339: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1340: fnd_log.string
1341: (
1342: fnd_log.level_error,
1343: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_SR_price',
1336:
1337: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1338:
1339: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1340: fnd_log.string
1341: (
1342: fnd_log.level_error,
1343: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_SR_price',
1344: 'AHL_VWP_TASK_CST_PR_PVT.Estimate_Task_Price API Threw error'
1338:
1339: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1340: fnd_log.string
1341: (
1342: fnd_log.level_error,
1343: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_SR_price',
1344: 'AHL_VWP_TASK_CST_PR_PVT.Estimate_Task_Price API Threw error'
1345: );
1346: END IF;
1373:
1374: p_x_cost_price_rec.estimated_price:=l_estimated_price;
1375: p_x_cost_price_rec.actual_price:=l_actual_price;
1376:
1377: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1378: fnd_log.string
1379: (
1380: fnd_log.level_procedure,
1381: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.Estimate_SR_Price.end',
1374: p_x_cost_price_rec.estimated_price:=l_estimated_price;
1375: p_x_cost_price_rec.actual_price:=l_actual_price;
1376:
1377: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1378: fnd_log.string
1379: (
1380: fnd_log.level_procedure,
1381: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.Estimate_SR_Price.end',
1382: 'At the end of PLSQL procedure'
1376:
1377: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1378: fnd_log.string
1379: (
1380: fnd_log.level_procedure,
1381: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.Estimate_SR_Price.end',
1382: 'At the end of PLSQL procedure'
1383: );
1384: END IF;
1489: l_error_msg_code VARCHAR2(240);
1490: l_valid_flag VARCHAR2(1);
1491:
1492: BEGIN
1493: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1494: fnd_log.string
1495: (
1496: fnd_log.level_procedure,
1497: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price.begin',
1490: l_valid_flag VARCHAR2(1);
1491:
1492: BEGIN
1493: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1494: fnd_log.string
1495: (
1496: fnd_log.level_procedure,
1497: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price.begin',
1498: 'At the start of PLSQL procedure'
1492: BEGIN
1493: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
1494: fnd_log.string
1495: (
1496: fnd_log.level_procedure,
1497: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price.begin',
1498: 'At the start of PLSQL procedure'
1499: );
1500: END IF;
1519: END IF;
1520:
1521: l_cost_price_rec:= p_x_cost_price_rec;
1522:
1523: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
1524: fnd_log.string
1525: (
1526: fnd_log.level_statement,
1527: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1520:
1521: l_cost_price_rec:= p_x_cost_price_rec;
1522:
1523: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
1524: fnd_log.string
1525: (
1526: fnd_log.level_statement,
1527: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1528: 'Got request for estimating of Visit ID : ' || p_x_cost_price_rec.visit_id
1522:
1523: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
1524: fnd_log.string
1525: (
1526: fnd_log.level_statement,
1527: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1528: 'Got request for estimating of Visit ID : ' || p_x_cost_price_rec.visit_id
1529: );
1530: END IF;
1533:
1534: IF(p_x_cost_price_rec.visit_id IS NULL OR p_x_cost_price_rec.visit_id = FND_API.G_MISS_NUM) THEN
1535: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
1536: FND_MSG_PUB.ADD;
1537: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1538: fnd_log.string
1539: (
1540: fnd_log.level_exception,
1541: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1534: IF(p_x_cost_price_rec.visit_id IS NULL OR p_x_cost_price_rec.visit_id = FND_API.G_MISS_NUM) THEN
1535: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
1536: FND_MSG_PUB.ADD;
1537: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1538: fnd_log.string
1539: (
1540: fnd_log.level_exception,
1541: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1542: 'Visit id is mandatory but found null in input '
1536: FND_MSG_PUB.ADD;
1537: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1538: fnd_log.string
1539: (
1540: fnd_log.level_exception,
1541: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1542: 'Visit id is mandatory but found null in input '
1543: );
1544: END IF;
1553:
1554: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_VISIT');
1555: FND_MSG_PUB.ADD;
1556:
1557: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1558: fnd_log.string
1559: (
1560: fnd_log.level_exception,
1561: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1554: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_VISIT');
1555: FND_MSG_PUB.ADD;
1556:
1557: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1558: fnd_log.string
1559: (
1560: fnd_log.level_exception,
1561: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1562: 'visit info not found for input visit id'
1556:
1557: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
1558: fnd_log.string
1559: (
1560: fnd_log.level_exception,
1561: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1562: 'visit info not found for input visit id'
1563: );
1564: END IF;
1573: IF(l_cost_price_rec.outside_party_flag <> 'Y')THEN
1574: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_PR_EST');
1575: FND_MSG_PUB.ADD;
1576:
1577: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1578: fnd_log.string
1579: (
1580: fnd_log.level_error,
1581: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1574: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_PR_EST');
1575: FND_MSG_PUB.ADD;
1576:
1577: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1578: fnd_log.string
1579: (
1580: fnd_log.level_error,
1581: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1582: 'Price estimation is restricted to outside party visit only '
1576:
1577: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1578: fnd_log.string
1579: (
1580: fnd_log.level_error,
1581: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1582: 'Price estimation is restricted to outside party visit only '
1583: );
1584: END IF;
1584: END IF;
1585: RAISE FND_API.G_EXC_ERROR;
1586: END IF;
1587:
1588: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1589: fnd_log.string
1590: (
1591: fnd_log.level_error,
1592: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1585: RAISE FND_API.G_EXC_ERROR;
1586: END IF;
1587:
1588: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1589: fnd_log.string
1590: (
1591: fnd_log.level_error,
1592: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1593: 'Before release_visit cursor'
1587:
1588: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1589: fnd_log.string
1590: (
1591: fnd_log.level_error,
1592: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1593: 'Before release_visit cursor'
1594: );
1595: END IF;
1608: x_msg_count => l_msg_count,
1609: x_msg_data => l_msg_data);
1610:
1611:
1612: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1613: fnd_log.string
1614: (
1615: fnd_log.level_procedure,
1616: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||': End API',
1609: x_msg_data => l_msg_data);
1610:
1611:
1612: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1613: fnd_log.string
1614: (
1615: fnd_log.level_procedure,
1616: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||': End API',
1617: 'After calling ahl vwp task cost pvt.Estimate Task cost Return Status : '|| l_return_status
1611:
1612: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1613: fnd_log.string
1614: (
1615: fnd_log.level_procedure,
1616: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||': End API',
1617: 'After calling ahl vwp task cost pvt.Estimate Task cost Return Status : '|| l_return_status
1618: );
1619: END IF;
1634:
1635: --- Populate pricing attributes
1636:
1637: -- find out customer id
1638: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1639: fnd_log.string
1640: (
1641: fnd_log.level_error,
1642: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1635: --- Populate pricing attributes
1636:
1637: -- find out customer id
1638: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1639: fnd_log.string
1640: (
1641: fnd_log.level_error,
1642: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1643: 'Before customer cursor'
1637: -- find out customer id
1638: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1639: fnd_log.string
1640: (
1641: fnd_log.level_error,
1642: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1643: 'Before customer cursor'
1644: );
1645: END IF;
1650: IF(customer_id_csr%NOTFOUND)THEN
1651: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_SRVREQ_NOCUST');
1652: FND_MSG_PUB.ADD;
1653:
1654: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1655: fnd_log.string
1656: (
1657: fnd_log.level_error,
1658: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1651: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INV_SRVREQ_NOCUST');
1652: FND_MSG_PUB.ADD;
1653:
1654: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1655: fnd_log.string
1656: (
1657: fnd_log.level_error,
1658: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1659: 'Customer id not found for service request'
1653:
1654: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1655: fnd_log.string
1656: (
1657: fnd_log.level_error,
1658: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1659: 'Customer id not found for service request'
1660: );
1661: END IF;
1675: IF l_cost_price_rec.currency IS NULL THEN
1676: FND_MESSAGE.Set_Name(G_PKG_NAME,'AHL_VWP_CST_NO_CURRENCY');
1677: FND_MSG_PUB.ADD;
1678:
1679: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1680: fnd_log.string
1681: (
1682: fnd_log.level_error,
1683: 'ahl.plsql.'||G_PKG_NAME||'.'||L_API_NAME,
1676: FND_MESSAGE.Set_Name(G_PKG_NAME,'AHL_VWP_CST_NO_CURRENCY');
1677: FND_MSG_PUB.ADD;
1678:
1679: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1680: fnd_log.string
1681: (
1682: fnd_log.level_error,
1683: 'ahl.plsql.'||G_PKG_NAME||'.'||L_API_NAME,
1684: 'No curency is defined for the organization of the visit'
1678:
1679: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1680: fnd_log.string
1681: (
1682: fnd_log.level_error,
1683: 'ahl.plsql.'||G_PKG_NAME||'.'||L_API_NAME,
1684: 'No curency is defined for the organization of the visit'
1685: );
1686: END IF;
1694:
1695: FND_MESSAGE.set_name( 'AHL','AHL_VWP_PRICE_LIST_INVALID' );
1696: FND_MSG_PUB.add;
1697:
1698: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1699: fnd_log.string
1700: (
1701: fnd_log.level_error,
1702: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1695: FND_MESSAGE.set_name( 'AHL','AHL_VWP_PRICE_LIST_INVALID' );
1696: FND_MSG_PUB.add;
1697:
1698: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1699: fnd_log.string
1700: (
1701: fnd_log.level_error,
1702: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1703: 'Price list not found for Visit'
1697:
1698: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1699: fnd_log.string
1700: (
1701: fnd_log.level_error,
1702: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1703: 'Price list not found for Visit'
1704: );
1705: END IF;
1709: l_cost_price_rec.PRICE_LIST_ID:=l_visit_rec.price_list_id;
1710: l_cost_price_rec.Organization_Id:=l_visit_rec.organization_id;
1711:
1712:
1713: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
1714:
1715: fnd_log.string
1716: (
1717: fnd_log.level_statement,
1711:
1712:
1713: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
1714:
1715: fnd_log.string
1716: (
1717: fnd_log.level_statement,
1718: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1719: 'Customer Id : ' || l_cost_price_rec.customer_id
1713: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
1714:
1715: fnd_log.string
1716: (
1717: fnd_log.level_statement,
1718: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1719: 'Customer Id : ' || l_cost_price_rec.customer_id
1720: );
1721:
1718: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1719: 'Customer Id : ' || l_cost_price_rec.customer_id
1720: );
1721:
1722: fnd_log.string
1723: (
1724: fnd_log.level_statement,
1725: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1726: 'Visit Id : ' || l_cost_price_rec.visit_id
1720: );
1721:
1722: fnd_log.string
1723: (
1724: fnd_log.level_statement,
1725: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1726: 'Visit Id : ' || l_cost_price_rec.visit_id
1727: );
1728:
1725: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1726: 'Visit Id : ' || l_cost_price_rec.visit_id
1727: );
1728:
1729: fnd_log.string
1730: (
1731: fnd_log.level_statement,
1732: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1733: 'Currency : ' || l_cost_price_rec.currency
1727: );
1728:
1729: fnd_log.string
1730: (
1731: fnd_log.level_statement,
1732: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1733: 'Currency : ' || l_cost_price_rec.currency
1734: );
1735:
1732: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1733: 'Currency : ' || l_cost_price_rec.currency
1734: );
1735:
1736: fnd_log.string
1737: (
1738: fnd_log.level_statement,
1739: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1740: 'Price List Id : ' || l_cost_price_rec.PRICE_LIST_ID
1734: );
1735:
1736: fnd_log.string
1737: (
1738: fnd_log.level_statement,
1739: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1740: 'Price List Id : ' || l_cost_price_rec.PRICE_LIST_ID
1741: );
1742:
1739: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1740: 'Price List Id : ' || l_cost_price_rec.PRICE_LIST_ID
1741: );
1742:
1743: fnd_log.string
1744: (
1745: fnd_log.level_statement,
1746: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1747: 'Organization ID : ' || l_cost_price_rec.Organization_Id
1741: );
1742:
1743: fnd_log.string
1744: (
1745: fnd_log.level_statement,
1746: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
1747: 'Organization ID : ' || l_cost_price_rec.Organization_Id
1748: );
1749:
1759:
1760:
1761: --- Check job status
1762:
1763: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
1764: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
1765: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': ',
1766: 'before check job status');
1767: END IF;
1760:
1761: --- Check job status
1762:
1763: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
1764: FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,
1765: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': ',
1766: 'before check job status');
1767: END IF;
1768:
1781: END IF;
1782: END IF;
1783:
1784:
1785: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1786: fnd_log.string
1787: (
1788: fnd_log.level_error,
1789: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1782: END IF;
1783:
1784:
1785: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1786: fnd_log.string
1787: (
1788: fnd_log.level_error,
1789: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1790: 'Before Summary TAsk cursor '
1784:
1785: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1786: fnd_log.string
1787: (
1788: fnd_log.level_error,
1789: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1790: 'Before Summary TAsk cursor '
1791: );
1792: END IF;
1836: );
1837:
1838: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1839:
1840: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1841: fnd_log.string
1842: (
1843: fnd_log.level_error,
1844: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1837:
1838: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1839:
1840: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1841: fnd_log.string
1842: (
1843: fnd_log.level_error,
1844: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1845: 'AHL_VWP_MR_CST_PR_PVT.Estimate_MR_Price API Threw error'
1839:
1840: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1841: fnd_log.string
1842: (
1843: fnd_log.level_error,
1844: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1845: 'AHL_VWP_MR_CST_PR_PVT.Estimate_MR_Price API Threw error'
1846: );
1847: END IF;
1893: );
1894:
1895: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1896:
1897: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1898: fnd_log.string
1899: (
1900: fnd_log.level_error,
1901: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1894:
1895: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1896:
1897: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1898: fnd_log.string
1899: (
1900: fnd_log.level_error,
1901: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1902: 'Estimate_SR_Price API Threw error'
1896:
1897: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1898: fnd_log.string
1899: (
1900: fnd_log.level_error,
1901: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1902: 'Estimate_SR_Price API Threw error'
1903: );
1904: END IF;
1964: );
1965:
1966: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1967:
1968: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1969: fnd_log.string
1970: (
1971: fnd_log.level_error,
1972: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1965:
1966: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
1967:
1968: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1969: fnd_log.string
1970: (
1971: fnd_log.level_error,
1972: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1973: 'AHL_VWP_TASK_CST_PR_PVT.Estimate_Task_Price API Threw error'
1967:
1968: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
1969: fnd_log.string
1970: (
1971: fnd_log.level_error,
1972: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price',
1973: 'AHL_VWP_TASK_CST_PR_PVT.Estimate_Task_Price API Threw error'
1974: );
1975: END IF;
2139: IF FND_API.TO_BOOLEAN(p_commit) THEN
2140: COMMIT WORK;
2141: END IF;
2142:
2143: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2144: fnd_log.string
2145: (
2146: fnd_log.level_procedure,
2147: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price.end',
2140: COMMIT WORK;
2141: END IF;
2142:
2143: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2144: fnd_log.string
2145: (
2146: fnd_log.level_procedure,
2147: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price.end',
2148: 'At the end of PLSQL procedure'
2142:
2143: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2144: fnd_log.string
2145: (
2146: fnd_log.level_procedure,
2147: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.estimate_visit_price.end',
2148: 'At the end of PLSQL procedure'
2149: );
2150: END IF;
2240: L_FULL_NAME CONSTANT VARCHAR2(60) := G_PKG_NAME || '.' || L_API_NAME;
2241:
2242: BEGIN
2243:
2244: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2245: fnd_log.string
2246: (
2247: fnd_log.level_procedure,
2248: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot.begin',
2241:
2242: BEGIN
2243:
2244: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2245: fnd_log.string
2246: (
2247: fnd_log.level_procedure,
2248: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot.begin',
2249: 'At the start of PLSQL procedure'
2243:
2244: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2245: fnd_log.string
2246: (
2247: fnd_log.level_procedure,
2248: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot.begin',
2249: 'At the start of PLSQL procedure'
2250: );
2251: END IF;
2271: THEN
2272: RAISE Fnd_Api.G_EXC_UNEXPECTED_ERROR;
2273: END IF;
2274:
2275: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2276: fnd_log.string
2277: (
2278: fnd_log.level_statement,
2279: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot',
2272: RAISE Fnd_Api.G_EXC_UNEXPECTED_ERROR;
2273: END IF;
2274:
2275: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2276: fnd_log.string
2277: (
2278: fnd_log.level_statement,
2279: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot',
2280: 'Got request for tasking a price snapshot of Visit ID : ' || p_visit_id
2274:
2275: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2276: fnd_log.string
2277: (
2278: fnd_log.level_statement,
2279: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot',
2280: 'Got request for tasking a price snapshot of Visit ID : ' || p_visit_id
2281: );
2282: END IF;
2287:
2288: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
2289: FND_MSG_PUB.ADD;
2290:
2291: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
2292: fnd_log.string
2293: (
2294: fnd_log.level_exception,
2295: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot',
2288: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
2289: FND_MSG_PUB.ADD;
2290:
2291: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
2292: fnd_log.string
2293: (
2294: fnd_log.level_exception,
2295: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot',
2296: 'Visit id is mandatory but found null in input '
2290:
2291: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
2292: fnd_log.string
2293: (
2294: fnd_log.level_exception,
2295: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot',
2296: 'Visit id is mandatory but found null in input '
2297: );
2298: END IF;
2311: FND_MESSAGE.Set_Token('VISIT_TASK_NUMBER',other_tasks_rec.visit_task_number);
2312: FND_MESSAGE.Set_Token('VISIT_NUMBER',other_tasks_rec.visit_number);
2313: FND_MSG_PUB.ADD;
2314:
2315: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2316: fnd_log.string
2317: (
2318: fnd_log.level_error,
2319: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot',
2312: FND_MESSAGE.Set_Token('VISIT_NUMBER',other_tasks_rec.visit_number);
2313: FND_MSG_PUB.ADD;
2314:
2315: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2316: fnd_log.string
2317: (
2318: fnd_log.level_error,
2319: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot',
2320: 'Price not found for task id : ' || other_tasks_rec.visit_task_id
2314:
2315: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2316: fnd_log.string
2317: (
2318: fnd_log.level_error,
2319: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot',
2320: 'Price not found for task id : ' || other_tasks_rec.visit_task_id
2321: );
2322: END IF;
2410: IF FND_API.TO_BOOLEAN(p_commit) THEN
2411: COMMIT WORK;
2412: END IF;
2413:
2414: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2415: fnd_log.string
2416: (
2417: fnd_log.level_procedure,
2418: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot.end',
2411: COMMIT WORK;
2412: END IF;
2413:
2414: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2415: fnd_log.string
2416: (
2417: fnd_log.level_procedure,
2418: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot.end',
2419: 'At the end of PLSQL procedure'
2413:
2414: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2415: fnd_log.string
2416: (
2417: fnd_log.level_procedure,
2418: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_price_snapshot.end',
2419: 'At the end of PLSQL procedure'
2420: );
2421: END IF;
2521: L_API_NAME CONSTANT VARCHAR2(30) := 'create_cost_snapshot';
2522: L_FULL_NAME CONSTANT VARCHAR2(60) := G_PKG_NAME || '.' || L_API_NAME;
2523:
2524: BEGIN
2525: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2526: fnd_log.string
2527: (
2528: fnd_log.level_procedure,
2529: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot.begin',
2522: L_FULL_NAME CONSTANT VARCHAR2(60) := G_PKG_NAME || '.' || L_API_NAME;
2523:
2524: BEGIN
2525: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2526: fnd_log.string
2527: (
2528: fnd_log.level_procedure,
2529: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot.begin',
2530: 'At the start of PLSQL procedure'
2524: BEGIN
2525: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2526: fnd_log.string
2527: (
2528: fnd_log.level_procedure,
2529: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot.begin',
2530: 'At the start of PLSQL procedure'
2531: );
2532: END IF;
2551: END IF;
2552:
2553: l_cost_price_rec := p_x_cost_price_rec;
2554:
2555: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2556: fnd_log.string
2557: (
2558: fnd_log.level_statement,
2559: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2552:
2553: l_cost_price_rec := p_x_cost_price_rec;
2554:
2555: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2556: fnd_log.string
2557: (
2558: fnd_log.level_statement,
2559: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2560: 'Got request for tasking a cost snapshot of Visit ID : ' || p_x_cost_price_rec.visit_id
2554:
2555: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2556: fnd_log.string
2557: (
2558: fnd_log.level_statement,
2559: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2560: 'Got request for tasking a cost snapshot of Visit ID : ' || p_x_cost_price_rec.visit_id
2561: );
2562: END IF;
2564: -- make sure that visit id is present in the input
2565: IF(p_x_cost_price_rec.visit_id IS NULL OR p_x_cost_price_rec.visit_id = FND_API.G_MISS_NUM) THEN
2566: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
2567: FND_MSG_PUB.ADD;
2568: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
2569: fnd_log.string
2570: (
2571: fnd_log.level_exception,
2572: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2565: IF(p_x_cost_price_rec.visit_id IS NULL OR p_x_cost_price_rec.visit_id = FND_API.G_MISS_NUM) THEN
2566: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
2567: FND_MSG_PUB.ADD;
2568: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
2569: fnd_log.string
2570: (
2571: fnd_log.level_exception,
2572: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2573: 'Visit id is mandatory but found null in input '
2567: FND_MSG_PUB.ADD;
2568: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
2569: fnd_log.string
2570: (
2571: fnd_log.level_exception,
2572: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2573: 'Visit id is mandatory but found null in input '
2574: );
2575: END IF;
2590: x_return_status => x_return_status
2591: );
2592:
2593: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
2594: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
2595: fnd_log.string
2596: (
2597: fnd_log.level_exception,
2598: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2591: );
2592:
2593: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
2594: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
2595: fnd_log.string
2596: (
2597: fnd_log.level_exception,
2598: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2599: 'AHL_VWP_COST_PVT.Estimate_WO_Cost API threw error : x_return_status : ' || x_return_status
2593: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
2594: IF (fnd_log.level_exception >= fnd_log.g_current_runtime_level)THEN
2595: fnd_log.string
2596: (
2597: fnd_log.level_exception,
2598: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2599: 'AHL_VWP_COST_PVT.Estimate_WO_Cost API threw error : x_return_status : ' || x_return_status
2600: );
2601: END IF;
2619:
2620: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
2621: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_CALC_TCOST_ERR');
2622: FND_MSG_PUB.ADD;
2623: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2624: fnd_log.string
2625: (
2626: fnd_log.level_error,
2627: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2620: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
2621: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_CALC_TCOST_ERR');
2622: FND_MSG_PUB.ADD;
2623: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2624: fnd_log.string
2625: (
2626: fnd_log.level_error,
2627: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2628: 'AHL_VWP_COST_PVT.Calculate_Task_Cost API threw error :summary: x_return_status : ' || x_return_status
2622: FND_MSG_PUB.ADD;
2623: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2624: fnd_log.string
2625: (
2626: fnd_log.level_error,
2627: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2628: 'AHL_VWP_COST_PVT.Calculate_Task_Cost API threw error :summary: x_return_status : ' || x_return_status
2629: );
2630: END IF;
2687:
2688: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
2689: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_CALC_TCOST_ERR');
2690: FND_MSG_PUB.ADD;
2691: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2692: fnd_log.string
2693: (
2694: fnd_log.level_error,
2695: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2688: IF(x_return_status <> FND_API.G_RET_STS_SUCCESS)THEN
2689: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_CALC_TCOST_ERR');
2690: FND_MSG_PUB.ADD;
2691: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2692: fnd_log.string
2693: (
2694: fnd_log.level_error,
2695: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2696: 'AHL_VWP_COST_PVT.Calculate_Task_Cost API threw error :other: x_return_status : ' || x_return_status
2690: FND_MSG_PUB.ADD;
2691: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2692: fnd_log.string
2693: (
2694: fnd_log.level_error,
2695: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot',
2696: 'AHL_VWP_COST_PVT.Calculate_Task_Cost API threw error :other: x_return_status : ' || x_return_status
2697: );
2698: END IF;
2749: IF FND_API.TO_BOOLEAN(p_commit) THEN
2750: COMMIT WORK;
2751: END IF;
2752:
2753: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2754: fnd_log.string
2755: (
2756: fnd_log.level_procedure,
2757: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot.end',
2750: COMMIT WORK;
2751: END IF;
2752:
2753: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2754: fnd_log.string
2755: (
2756: fnd_log.level_procedure,
2757: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot.end',
2758: 'At the end of PLSQL procedure'
2752:
2753: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2754: fnd_log.string
2755: (
2756: fnd_log.level_procedure,
2757: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.create_cost_snapshot.end',
2758: 'At the end of PLSQL procedure'
2759: );
2760: END IF;
2880: CONNECT BY originating_task_id = PRIOR visit_task_id;
2881: --
2882: BEGIN
2883:
2884: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2885: fnd_log.string
2886: (
2887: fnd_log.level_procedure,
2888: l_module_name,
2881: --
2882: BEGIN
2883:
2884: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2885: fnd_log.string
2886: (
2887: fnd_log.level_procedure,
2888: l_module_name,
2889: 'Start of '||l_api_name
2883:
2884: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
2885: fnd_log.string
2886: (
2887: fnd_log.level_procedure,
2888: l_module_name,
2889: 'Start of '||l_api_name
2890: );
2891: END IF;
2905: END IF;
2906:
2907: x_return_status:=FND_API.G_RET_STS_SUCCESS;
2908:
2909: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2910: fnd_log.string
2911: (
2912: fnd_log.level_statement,
2913: l_module_name,
2906:
2907: x_return_status:=FND_API.G_RET_STS_SUCCESS;
2908:
2909: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2910: fnd_log.string
2911: (
2912: fnd_log.level_statement,
2913: l_module_name,
2914: 'Request to get items without price for Visit ID : ' || l_cost_price_rec.visit_id
2908:
2909: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2910: fnd_log.string
2911: (
2912: fnd_log.level_statement,
2913: l_module_name,
2914: 'Request to get items without price for Visit ID : ' || l_cost_price_rec.visit_id
2915: );
2916: END IF;
2921: l_cost_price_rec.visit_id = FND_API.G_MISS_NUM) THEN
2922: FND_MESSAGE.Set_Name('AHL','AHL_VWP_CST_INPUT_MISS');
2923: FND_MSG_PUB.ADD;
2924:
2925: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2926: fnd_log.string
2927: (
2928: fnd_log.level_error,
2929: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
2922: FND_MESSAGE.Set_Name('AHL','AHL_VWP_CST_INPUT_MISS');
2923: FND_MSG_PUB.ADD;
2924:
2925: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2926: fnd_log.string
2927: (
2928: fnd_log.level_error,
2929: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
2930: 'Visit id is mandatory but found null in input '
2924:
2925: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
2926: fnd_log.string
2927: (
2928: fnd_log.level_error,
2929: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
2930: 'Visit id is mandatory but found null in input '
2931: );
2932: END IF;
2956:
2957:
2958: IF l_release_visit_required ='Y' THEN
2959:
2960: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2961: fnd_log.string
2962: (
2963: fnd_log.level_statement,
2964: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
2957:
2958: IF l_release_visit_required ='Y' THEN
2959:
2960: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2961: fnd_log.string
2962: (
2963: fnd_log.level_statement,
2964: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
2965: 'Before calling ahl vwp proj prod pvt.release visit'
2959:
2960: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2961: fnd_log.string
2962: (
2963: fnd_log.level_statement,
2964: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
2965: 'Before calling ahl vwp proj prod pvt.release visit'
2966: );
2967: END IF;
2978: x_msg_data =>x_msg_data,
2979: p_visit_id =>l_visit_rec.visit_id
2980: );
2981:
2982: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2983: fnd_log.string
2984: (
2985: fnd_log.level_statement,
2986: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
2979: p_visit_id =>l_visit_rec.visit_id
2980: );
2981:
2982: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2983: fnd_log.string
2984: (
2985: fnd_log.level_statement,
2986: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
2987: 'After calling ahl vwp proj prod pvt.Release Visit task wo Return Status : '|| l_return_status
2981:
2982: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2983: fnd_log.string
2984: (
2985: fnd_log.level_statement,
2986: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
2987: 'After calling ahl vwp proj prod pvt.Release Visit task wo Return Status : '|| l_return_status
2988: );
2989: END IF;
3022:
3023: END IF;
3024:
3025:
3026: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3027: fnd_log.string
3028: (
3029: fnd_log.level_statement,
3030: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3023: END IF;
3024:
3025:
3026: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3027: fnd_log.string
3028: (
3029: fnd_log.level_statement,
3030: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3031: 'Price List ID :' ||l_cost_price_rec.price_list_id
3025:
3026: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3027: fnd_log.string
3028: (
3029: fnd_log.level_statement,
3030: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3031: 'Price List ID :' ||l_cost_price_rec.price_list_id
3032: );
3033: END IF;
3033: END IF;
3034:
3035: l_cost_price_rec.organization_id:=l_visit_rec.organization_id;
3036:
3037: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3038: fnd_log.string
3039: (
3040: fnd_log.level_statement,
3041: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3034:
3035: l_cost_price_rec.organization_id:=l_visit_rec.organization_id;
3036:
3037: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3038: fnd_log.string
3039: (
3040: fnd_log.level_statement,
3041: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3042: 'Organization ID :' ||l_cost_price_rec.organization_id
3036:
3037: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3038: fnd_log.string
3039: (
3040: fnd_log.level_statement,
3041: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3042: 'Organization ID :' ||l_cost_price_rec.organization_id
3043: );
3044: END IF;
3049: Open c_customer_csr(l_visit_rec.service_request_id);
3050: fetch c_customer_csr into l_cost_price_rec.customer_id;
3051: close c_customer_csr;
3052:
3053: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3054: fnd_log.string
3055: (
3056: fnd_log.level_statement,
3057: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3050: fetch c_customer_csr into l_cost_price_rec.customer_id;
3051: close c_customer_csr;
3052:
3053: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3054: fnd_log.string
3055: (
3056: fnd_log.level_statement,
3057: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3058: 'Customer ID :' ||l_cost_price_rec.customer_id
3052:
3053: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3054: fnd_log.string
3055: (
3056: fnd_log.level_statement,
3057: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3058: 'Customer ID :' ||l_cost_price_rec.customer_id
3059: );
3060: END IF;
3070: -- Error handling
3071: IF l_cost_price_rec.currency IS NULL THEN
3072: FND_MESSAGE.Set_Name(G_PKG_NAME,'AHL_VWP_CST_NO_CURRENCY');
3073: FND_MSG_PUB.ADD;
3074: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
3075: fnd_log.string
3076: (
3077: fnd_log.level_error,
3078: 'ahl.plsql.'||G_PKG_NAME||'.'||L_API_NAME,
3071: IF l_cost_price_rec.currency IS NULL THEN
3072: FND_MESSAGE.Set_Name(G_PKG_NAME,'AHL_VWP_CST_NO_CURRENCY');
3073: FND_MSG_PUB.ADD;
3074: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
3075: fnd_log.string
3076: (
3077: fnd_log.level_error,
3078: 'ahl.plsql.'||G_PKG_NAME||'.'||L_API_NAME,
3079: 'No curency is defined for the organization of the visit'
3073: FND_MSG_PUB.ADD;
3074: IF (fnd_log.level_error >= fnd_log.g_current_runtime_level)THEN
3075: fnd_log.string
3076: (
3077: fnd_log.level_error,
3078: 'ahl.plsql.'||G_PKG_NAME||'.'||L_API_NAME,
3079: 'No curency is defined for the organization of the visit'
3080: );
3081: END IF;
3081: END IF;
3082: RAISE FND_API.G_EXC_ERROR;
3083: END IF;
3084:
3085: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3086: fnd_log.string
3087: (
3088: fnd_log.level_statement,
3089: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3082: RAISE FND_API.G_EXC_ERROR;
3083: END IF;
3084:
3085: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3086: fnd_log.string
3087: (
3088: fnd_log.level_statement,
3089: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3090: 'Currency Code :' ||l_cost_price_rec.currency
3084:
3085: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3086: fnd_log.string
3087: (
3088: fnd_log.level_statement,
3089: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3090: 'Currency Code :' ||l_cost_price_rec.currency
3091: );
3092: END IF;
3091: );
3092: END IF;
3093:
3094:
3095: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3096: fnd_log.string
3097: (
3098: fnd_log.level_statement,
3099: l_module_name,
3092: END IF;
3093:
3094:
3095: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3096: fnd_log.string
3097: (
3098: fnd_log.level_statement,
3099: l_module_name,
3100: 'Before Call to AHL_VWP_RULES_PVT.Check_Job_Status'
3094:
3095: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3096: fnd_log.string
3097: (
3098: fnd_log.level_statement,
3099: l_module_name,
3100: 'Before Call to AHL_VWP_RULES_PVT.Check_Job_Status'
3101: );
3102: END IF;
3116: RAISE FND_API.G_EXC_ERROR;
3117: END IF;
3118: END IF;
3119:
3120: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3121: fnd_log.string
3122: (
3123: fnd_log.level_statement,
3124: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3117: END IF;
3118: END IF;
3119:
3120: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3121: fnd_log.string
3122: (
3123: fnd_log.level_statement,
3124: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3125: 'Job Status :' ||l_job_status_code
3119:
3120: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3121: fnd_log.string
3122: (
3123: fnd_log.level_statement,
3124: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3125: 'Job Status :' ||l_job_status_code
3126: );
3127: END IF;
3132: LOOP
3133: FETCH c_summary_tasks_csr into l_summary_recs;
3134: EXIT WHEN c_summary_tasks_csr%notfound;
3135:
3136: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3137: fnd_log.string(
3138: fnd_log.level_statement,
3139: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3140: 'Current Task ID: ' || l_summary_recs.visit_task_id
3133: FETCH c_summary_tasks_csr into l_summary_recs;
3134: EXIT WHEN c_summary_tasks_csr%notfound;
3135:
3136: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3137: fnd_log.string(
3138: fnd_log.level_statement,
3139: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3140: 'Current Task ID: ' || l_summary_recs.visit_task_id
3141: );
3134: EXIT WHEN c_summary_tasks_csr%notfound;
3135:
3136: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3137: fnd_log.string(
3138: fnd_log.level_statement,
3139: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3140: 'Current Task ID: ' || l_summary_recs.visit_task_id
3141: );
3142: END IF;
3146: FETCH get_summary_task_times_csr INTO l_cost_price_rec.Task_Start_Date,
3147: l_cost_price_rec.Task_END_Date;
3148: CLOSE get_summary_task_times_csr;
3149:
3150: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3151: fnd_log.string
3152: (
3153: fnd_log.level_statement,
3154: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3147: l_cost_price_rec.Task_END_Date;
3148: CLOSE get_summary_task_times_csr;
3149:
3150: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3151: fnd_log.string
3152: (
3153: fnd_log.level_statement,
3154: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3155: 'task_start_date : ' ||l_cost_price_rec.task_start_date
3149:
3150: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3151: fnd_log.string
3152: (
3153: fnd_log.level_statement,
3154: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3155: 'task_start_date : ' ||l_cost_price_rec.task_start_date
3156: );
3157: END IF;
3155: 'task_start_date : ' ||l_cost_price_rec.task_start_date
3156: );
3157: END IF;
3158:
3159: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3160: fnd_log.string
3161: (
3162: fnd_log.level_statement,
3163: l_module_name,
3156: );
3157: END IF;
3158:
3159: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3160: fnd_log.string
3161: (
3162: fnd_log.level_statement,
3163: l_module_name,
3164: 'Before Call to AHL_VWP_MR_CST_PR_PVT.get_mr_items_no_price'
3158:
3159: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3160: fnd_log.string
3161: (
3162: fnd_log.level_statement,
3163: l_module_name,
3164: 'Before Call to AHL_VWP_MR_CST_PR_PVT.get_mr_items_no_price'
3165: );
3166: END IF;
3180: x_cost_price_tbl =>l_cost_price_tbl1
3181: );
3182:
3183:
3184: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3185: fnd_log.string
3186: (
3187: fnd_log.level_statement,
3188: l_module_name,
3181: );
3182:
3183:
3184: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3185: fnd_log.string
3186: (
3187: fnd_log.level_statement,
3188: l_module_name,
3189: 'After Call to AHL_VWP_MR_CST_PR_PVT.get_mr_items_no_price'
3183:
3184: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3185: fnd_log.string
3186: (
3187: fnd_log.level_statement,
3188: l_module_name,
3189: 'After Call to AHL_VWP_MR_CST_PR_PVT.get_mr_items_no_price'
3190: );
3191: END IF;
3215: LOOP
3216: FETCH c_task_csr into l_task_csr_rec;
3217: EXIT WHEN c_task_csr%NOTFOUND;
3218:
3219: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3220: fnd_log.string(
3221: fnd_log.level_statement,
3222: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3223: 'Current Task ID: ' || l_task_csr_rec.visit_task_id
3216: FETCH c_task_csr into l_task_csr_rec;
3217: EXIT WHEN c_task_csr%NOTFOUND;
3218:
3219: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3220: fnd_log.string(
3221: fnd_log.level_statement,
3222: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3223: 'Current Task ID: ' || l_task_csr_rec.visit_task_id
3224: );
3217: EXIT WHEN c_task_csr%NOTFOUND;
3218:
3219: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3220: fnd_log.string(
3221: fnd_log.level_statement,
3222: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3223: 'Current Task ID: ' || l_task_csr_rec.visit_task_id
3224: );
3225: END IF;
3230: FETCH get_summary_task_times_csr INTO l_cost_price_rec.Task_Start_Date,
3231: l_cost_price_rec.Task_END_Date;
3232: CLOSE get_summary_task_times_csr;
3233:
3234: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3235: fnd_log.string
3236: (
3237: fnd_log.level_statement,
3238: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3231: l_cost_price_rec.Task_END_Date;
3232: CLOSE get_summary_task_times_csr;
3233:
3234: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3235: fnd_log.string
3236: (
3237: fnd_log.level_statement,
3238: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3239: 'task_start_date : ' ||l_cost_price_rec.task_start_date
3233:
3234: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3235: fnd_log.string
3236: (
3237: fnd_log.level_statement,
3238: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3239: 'task_start_date : ' ||l_cost_price_rec.task_start_date
3240: );
3241: END IF;
3239: 'task_start_date : ' ||l_cost_price_rec.task_start_date
3240: );
3241: END IF;
3242:
3243: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3244: fnd_log.string
3245: (
3246: fnd_log.level_statement,
3247: l_module_name,
3240: );
3241: END IF;
3242:
3243: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3244: fnd_log.string
3245: (
3246: fnd_log.level_statement,
3247: l_module_name,
3248: 'Before Call to AHL_VWP_TASK_CST_PR_PVt.get_task_items_no_price'
3242:
3243: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3244: fnd_log.string
3245: (
3246: fnd_log.level_statement,
3247: l_module_name,
3248: 'Before Call to AHL_VWP_TASK_CST_PR_PVt.get_task_items_no_price'
3249: );
3250: END IF;
3262: p_cost_price_rec =>l_cost_price_rec,
3263: x_cost_price_tbl =>l_cost_price_tbl1
3264: );
3265:
3266: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3267: fnd_log.string
3268: (
3269: fnd_log.level_statement,
3270: l_module_name,
3263: x_cost_price_tbl =>l_cost_price_tbl1
3264: );
3265:
3266: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3267: fnd_log.string
3268: (
3269: fnd_log.level_statement,
3270: l_module_name,
3271: 'After Call to AHL_VWP_TASK_CST_PR_PVt.get_task_items_no_price'
3265:
3266: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3267: fnd_log.string
3268: (
3269: fnd_log.level_statement,
3270: l_module_name,
3271: 'After Call to AHL_VWP_TASK_CST_PR_PVt.get_task_items_no_price'
3272: );
3273: END IF;
3301: END IF;
3302:
3303: x_cost_price_tbl:=l_cost_price_tbl;
3304:
3305: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3306: fnd_log.string
3307: (
3308: fnd_log.level_statement,
3309: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3302:
3303: x_cost_price_tbl:=l_cost_price_tbl;
3304:
3305: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3306: fnd_log.string
3307: (
3308: fnd_log.level_statement,
3309: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3310: 'Total number of items w/o price for the MR: ' || x_cost_price_tbl.count
3304:
3305: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3306: fnd_log.string
3307: (
3308: fnd_log.level_statement,
3309: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3310: 'Total number of items w/o price for the MR: ' || x_cost_price_tbl.count
3311: );
3312: END IF;
3314: IF FND_API.TO_BOOLEAN(p_commit) THEN
3315: COMMIT;
3316: END IF;
3317:
3318: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3319: fnd_log.string
3320: (
3321: fnd_log.level_procedure,
3322: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3315: COMMIT;
3316: END IF;
3317:
3318: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3319: fnd_log.string
3320: (
3321: fnd_log.level_procedure,
3322: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3323: 'At the end of the procedure');
3317:
3318: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3319: fnd_log.string
3320: (
3321: fnd_log.level_procedure,
3322: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3323: 'At the end of the procedure');
3324: END IF;
3325:
3418: l_dummy NUMBER;
3419:
3420: BEGIN
3421:
3422: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
3423: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
3424: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': Begin API',
3425: 'At the start of the procedure');
3426: END IF;
3419:
3420: BEGIN
3421:
3422: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level)THEN
3423: FND_LOG.STRING(FND_LOG.LEVEL_PROCEDURE,
3424: 'ahl.plsql.'||G_PKG_NAME||'.'||l_api_name||': Begin API',
3425: 'At the start of the procedure');
3426: END IF;
3427:
3430: OPEN c_visit_csr(p_visit_id);
3431: FETCH c_visit_csr into l_any_task_chg_flag, l_visit_status_code;
3432: CLOSE c_visit_csr;
3433:
3434: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3435: fnd_log.string
3436: (
3437: fnd_log.level_statement,
3438: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3431: FETCH c_visit_csr into l_any_task_chg_flag, l_visit_status_code;
3432: CLOSE c_visit_csr;
3433:
3434: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3435: fnd_log.string
3436: (
3437: fnd_log.level_statement,
3438: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3439: '.any_task_chg_flag : ' || l_any_task_chg_flag
3433:
3434: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3435: fnd_log.string
3436: (
3437: fnd_log.level_statement,
3438: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3439: '.any_task_chg_flag : ' || l_any_task_chg_flag
3440: );
3441:
3440: );
3441:
3442: END IF;
3443:
3444: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3445: fnd_log.string
3446: (
3447: fnd_log.level_statement,
3448: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3441:
3442: END IF;
3443:
3444: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3445: fnd_log.string
3446: (
3447: fnd_log.level_statement,
3448: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3449: '.visit status code : ' || l_visit_status_code
3443:
3444: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3445: fnd_log.string
3446: (
3447: fnd_log.level_statement,
3448: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3449: '.visit status code : ' || l_visit_status_code
3450: );
3451:
3470: OPEN c_get_master_wo_cur(p_visit_id);
3471: FETCH c_get_master_wo_cur INTO l_master_wo_rec;
3472: CLOSE c_get_master_wo_cur;
3473:
3474: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3475: fnd_log.string
3476: (
3477: fnd_log.level_statement,
3478: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3471: FETCH c_get_master_wo_cur INTO l_master_wo_rec;
3472: CLOSE c_get_master_wo_cur;
3473:
3474: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3475: fnd_log.string
3476: (
3477: fnd_log.level_statement,
3478: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3479: 'Visit Master Workorder Id : ' || l_master_wo_rec.workorder_id
3473:
3474: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3475: fnd_log.string
3476: (
3477: fnd_log.level_statement,
3478: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3479: 'Visit Master Workorder Id : ' || l_master_wo_rec.workorder_id
3480: );
3481: END IF;
3501: OPEN c_check_wo_exists_cur(l_visit_tasks_rec.visit_task_id);
3502: FETCH c_check_wo_exists_cur INTO l_dummy;
3503:
3504: IF c_check_wo_exists_cur%NOTFOUND THEN
3505: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3506: fnd_log.string
3507: (
3508: fnd_log.level_statement,
3509: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3502: FETCH c_check_wo_exists_cur INTO l_dummy;
3503:
3504: IF c_check_wo_exists_cur%NOTFOUND THEN
3505: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3506: fnd_log.string
3507: (
3508: fnd_log.level_statement,
3509: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3510: 'workorder not exist for visit task '||l_visit_tasks_rec.visit_task_id
3504: IF c_check_wo_exists_cur%NOTFOUND THEN
3505: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3506: fnd_log.string
3507: (
3508: fnd_log.level_statement,
3509: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3510: 'workorder not exist for visit task '||l_visit_tasks_rec.visit_task_id
3511: );
3512: END IF;
3524: CLOSE c_get_visit_tasks_cur;
3525: END IF; -- released visit flag
3526:
3527: x_release_visit_required := l_release_visit_required;
3528: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3529: fnd_log.string
3530: (
3531: fnd_log.level_statement,
3532: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3525: END IF; -- released visit flag
3526:
3527: x_release_visit_required := l_release_visit_required;
3528: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3529: fnd_log.string
3530: (
3531: fnd_log.level_statement,
3532: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3533: 'x_release_visit_required: '||x_release_visit_required
3527: x_release_visit_required := l_release_visit_required;
3528: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
3529: fnd_log.string
3530: (
3531: fnd_log.level_statement,
3532: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3533: 'x_release_visit_required: '||x_release_visit_required
3534: );
3535: END IF;
3533: 'x_release_visit_required: '||x_release_visit_required
3534: );
3535: END IF;
3536:
3537: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3538: fnd_log.string
3539: (
3540: fnd_log.level_statement,
3541: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3534: );
3535: END IF;
3536:
3537: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3538: fnd_log.string
3539: (
3540: fnd_log.level_statement,
3541: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3542: 'At the end of the procedure'
3536:
3537: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3538: fnd_log.string
3539: (
3540: fnd_log.level_statement,
3541: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
3542: 'At the end of the procedure'
3543: );
3544: END IF;
3601: l_visit_status VARCHAR2(20);
3602: ------------------------------------
3603: -- Common constants and variables --
3604: ------------------------------------
3605: l_log_current_level NUMBER := fnd_log.g_current_runtime_level;
3606: l_log_statement NUMBER := fnd_log.level_statement;
3607: l_log_procedure NUMBER := fnd_log.level_procedure;
3608: l_log_error NUMBER := fnd_log.level_error;
3609: l_log_unexpected NUMBER := fnd_log.level_unexpected;
3602: ------------------------------------
3603: -- Common constants and variables --
3604: ------------------------------------
3605: l_log_current_level NUMBER := fnd_log.g_current_runtime_level;
3606: l_log_statement NUMBER := fnd_log.level_statement;
3607: l_log_procedure NUMBER := fnd_log.level_procedure;
3608: l_log_error NUMBER := fnd_log.level_error;
3609: l_log_unexpected NUMBER := fnd_log.level_unexpected;
3610: -----------------------------------------------------------------
3603: -- Common constants and variables --
3604: ------------------------------------
3605: l_log_current_level NUMBER := fnd_log.g_current_runtime_level;
3606: l_log_statement NUMBER := fnd_log.level_statement;
3607: l_log_procedure NUMBER := fnd_log.level_procedure;
3608: l_log_error NUMBER := fnd_log.level_error;
3609: l_log_unexpected NUMBER := fnd_log.level_unexpected;
3610: -----------------------------------------------------------------
3611: -- To find visit related information
3604: ------------------------------------
3605: l_log_current_level NUMBER := fnd_log.g_current_runtime_level;
3606: l_log_statement NUMBER := fnd_log.level_statement;
3607: l_log_procedure NUMBER := fnd_log.level_procedure;
3608: l_log_error NUMBER := fnd_log.level_error;
3609: l_log_unexpected NUMBER := fnd_log.level_unexpected;
3610: -----------------------------------------------------------------
3611: -- To find visit related information
3612: CURSOR c_visit (c_id IN NUMBER) IS
3605: l_log_current_level NUMBER := fnd_log.g_current_runtime_level;
3606: l_log_statement NUMBER := fnd_log.level_statement;
3607: l_log_procedure NUMBER := fnd_log.level_procedure;
3608: l_log_error NUMBER := fnd_log.level_error;
3609: l_log_unexpected NUMBER := fnd_log.level_unexpected;
3610: -----------------------------------------------------------------
3611: -- To find visit related information
3612: CURSOR c_visit (c_id IN NUMBER) IS
3613: SELECT * FROM AHL_VISITS_B
3625: l_dummy c_conc_req_phase%ROWTYPE;
3626:
3627: BEGIN
3628: IF (l_log_procedure >= l_log_current_level) THEN
3629: fnd_log.string(l_log_procedure,L_DEBUG_KEY||'.begin','At the start of the PLSQL procedure. Visit id = ' || p_x_cost_price_rec.Visit_id);
3630: END IF;
3631: -- Standard start of API savepoint
3632: SAVEPOINT bg_estimate_visit_cost_pvt;
3633:
3647:
3648: SELECT visit_number, status_code INTO l_visit_num, l_visit_status FROM AHL_VISITS_B WHERE visit_id = p_x_cost_price_rec.Visit_id;
3649:
3650: IF (l_log_procedure >= l_log_current_level) THEN
3651: fnd_log.string(l_log_procedure,L_DEBUG_KEY||'.begin','After fetching the visit number, status from visit id. Visit Number = ' || l_visit_num|| 'Visit Status Code = '||l_visit_status);
3652: END IF;
3653:
3654: -- Check for Required Parameters
3655: IF(p_x_cost_price_rec.Visit_id IS NULL OR p_x_cost_price_rec.Visit_id = FND_API.G_MISS_NUM) THEN
3655: IF(p_x_cost_price_rec.Visit_id IS NULL OR p_x_cost_price_rec.Visit_id = FND_API.G_MISS_NUM) THEN
3656: FND_MESSAGE.Set_Name(G_APP_NAME,'AHL_VWP_CST_INPUT_MISS');
3657: FND_MSG_PUB.ADD;
3658: IF (l_log_unexpected >= l_log_current_level)THEN
3659: fnd_log.string
3660: (
3661: l_log_unexpected,
3662: 'ahl.plsql.AHL_VWP_VISIT_CST_PR_PVT.bg_estimate_visit_cost',
3663: 'Visit id is mandatory but found null in input '
3678: -- Validate visit if required
3679: IF l_visit_status IS NOT NULL AND l_visit_status <> 'RELEASED' THEN
3680:
3681: IF (l_log_statement >= l_log_current_level)THEN
3682: fnd_log.string (l_log_statement,L_DEBUG_KEY, 'Before Calling AHL_VWP_PROJ_PROD_PVT.Validate_Before_Production');
3683: END IF;
3684:
3685: --Valdate before Cost Estimation happens
3686: AHL_VWP_PROJ_PROD_PVT.Validate_Before_Production
3699: -- Check Error Message stack.
3700: x_msg_count := FND_MSG_PUB.count_msg;
3701:
3702: IF (l_log_statement >= l_log_current_level)THEN
3703: fnd_log.string ( l_log_statement, L_DEBUG_KEY,'Errors from AHL_VWP_PROJ_PROD_PVT.Validate_Before_Production - '||x_msg_count);
3704: END IF;
3705: RAISE Fnd_Api.g_exc_error;
3706: END IF;
3707: END IF;
3706: END IF;
3707: END IF;
3708:
3709: IF (l_log_statement >= l_log_current_level) THEN
3710: FND_LOG.STRING(l_log_statement,L_DEBUG_KEY,
3711: ' Before calling concurrent program to estimate visit cost ');
3712: END IF;
3713:
3714: OPEN c_visit(p_x_cost_price_rec.Visit_id);
3714: OPEN c_visit(p_x_cost_price_rec.Visit_id);
3715: FETCH c_visit INTO c_visit_rec;
3716:
3717: IF (l_log_statement >= l_log_current_level) THEN
3718: fnd_log.string(l_log_statement,L_DEBUG_KEY, 'concurrent parameter values p_api_version -> '||p_api_version||' , visit_number -> '||l_visit_num);--||' , p_release_flag -> '||p_release_flag
3719: END IF;
3720:
3721: l_curr_org_id := MO_GLOBAL.get_current_org_id();
3722: FND_REQUEST.SET_ORG_ID(l_curr_org_id);
3727: argument2 => l_visit_num,
3728: argument3 => 'CST_EXEC');
3729:
3730: IF (l_log_statement >= l_log_current_level) THEN
3731: fnd_log.string(l_log_statement,L_DEBUG_KEY,'l_req_id = '|| l_req_id);
3732: END IF;
3733:
3734: IF (l_req_id = 0) THEN
3735: IF (l_log_statement >= l_log_current_level) THEN
3732: END IF;
3733:
3734: IF (l_req_id = 0) THEN
3735: IF (l_log_statement >= l_log_current_level) THEN
3736: fnd_log.string(l_log_statement,L_DEBUG_KEY, ' Concurrent program request failed.');
3737: END IF;
3738: ELSE
3739: IF (l_log_statement >= l_log_current_level) THEN
3740: fnd_log.string(l_log_statement,L_DEBUG_KEY, ' Concurrent program request successful.');
3736: fnd_log.string(l_log_statement,L_DEBUG_KEY, ' Concurrent program request failed.');
3737: END IF;
3738: ELSE
3739: IF (l_log_statement >= l_log_current_level) THEN
3740: fnd_log.string(l_log_statement,L_DEBUG_KEY, ' Concurrent program request successful.');
3741: END IF;
3742:
3743: x_request_id := l_req_id;
3744: --Update the table with l_req_id
3753: COMMIT WORK;
3754: END IF;
3755:
3756: IF (l_log_procedure >= l_log_current_level)THEN
3757: fnd_log.string ( l_log_procedure,L_DEBUG_KEY ||'.end','At the end of PLSQL procedure, x_return_status=' || x_return_status);
3758: END IF;
3759: EXCEPTION
3760: WHEN FND_API.G_EXC_ERROR THEN
3761: x_return_status := FND_API.G_RET_STS_ERROR;