50: PROCEDURE reapply_credit_memo(
51: p_customer_trx_id IN NUMBER,
52: p_cash_receipt_id IN NUMBER,
53: p_amount_applied IN NUMBER,
54: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
55: x_return_status OUT NOCOPY VARCHAR2,
56: x_msg_count OUT NOCOPY NUMBER,
57: x_msg_data OUT NOCOPY VARCHAR2)
58: IS
86:
87: -- Standard Start of API savepoint
88: SAVEPOINT reapply_credit_memo_pvt;
89: -- Initialize message list if p_init_msg_list is set to TRUE.
90: IF FND_API.to_Boolean( p_init_msg_list )
91: THEN
92: FND_MSG_PUB.initialize;
93: END IF;
94: -- Initialize API return status to success
91: THEN
92: FND_MSG_PUB.initialize;
93: END IF;
94: -- Initialize API return status to success
95: x_return_status := FND_API.G_RET_STS_SUCCESS;
96:
97: /* initialize global variables */
98: arp_global.init_global;
99: arp_standard.init_standard;
170: | 4) Raise error if validation errors found |
171: +---------------------------------------------------------------------*/
172: IF (l_error_count > 0)
173: THEN
174: RAISE FND_API.G_EXC_ERROR;
175: END IF;
176:
177: /*---------------------------------------------------------------------+
178: | 5) Call the entity handler to unapply |
206: THEN
207: ROLLBACK TO reapply_credit_memo_pvt;
208:
209: -- Display_Parameters;
210: x_return_status := FND_API.G_RET_STS_ERROR ;
211: FND_MESSAGE.SET_NAME ('AR','GENERIC_MESSAGE');
212: FND_MESSAGE.SET_TOKEN('GENERIC_TEXT','ARP_DEDUCTION_COVER2.reapply_credit_memo : '||SQLERRM);
213: FND_MSG_PUB.Add;
214:
211: FND_MESSAGE.SET_NAME ('AR','GENERIC_MESSAGE');
212: FND_MESSAGE.SET_TOKEN('GENERIC_TEXT','ARP_DEDUCTION_COVER2.reapply_credit_memo : '||SQLERRM);
213: FND_MSG_PUB.Add;
214:
215: FND_MSG_PUB.Count_And_Get( p_encoded => FND_API.G_FALSE,
216: p_count => x_msg_count,
217: p_data => x_msg_data
218: );
219: RETURN;
266: l_global_attribute_rec.global_attribute20 := l_ra_rec.global_attribute20;
267:
268: ar_receipt_api_pub.apply (
269: p_api_version => 1.0,
270: p_init_msg_list => FND_API.G_FALSE,
271: x_return_status => l_return_status,
272: x_msg_count => l_msg_count,
273: x_msg_data => l_msg_data,
274: p_cash_receipt_id => p_cash_receipt_id,
283: p_global_attribute_rec => l_global_attribute_rec,
284: p_comments => l_ra_rec.comments);
285: IF l_return_status = 'E'
286: THEN
287: RAISE FND_API.G_EXC_ERROR;
288: ELSIF l_return_status = 'U'
289: THEN
290: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
291: END IF;
286: THEN
287: RAISE FND_API.G_EXC_ERROR;
288: ELSIF l_return_status = 'U'
289: THEN
290: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
291: END IF;
292:
293: IF PG_DEBUG in ('Y', 'C') THEN
294: arp_standard.debug('ARP_DEDUCTION_COVER2.reapply_credit_memo()-');
294: arp_standard.debug('ARP_DEDUCTION_COVER2.reapply_credit_memo()-');
295: END IF;
296:
297: EXCEPTION
298: WHEN FND_API.G_EXC_ERROR THEN
299: ROLLBACK TO reapply_credit_memo_pvt;
300: x_return_status := FND_API.G_RET_STS_ERROR ;
301: FND_MSG_PUB.Count_And_Get
302: (p_encoded => FND_API.G_FALSE,
296:
297: EXCEPTION
298: WHEN FND_API.G_EXC_ERROR THEN
299: ROLLBACK TO reapply_credit_memo_pvt;
300: x_return_status := FND_API.G_RET_STS_ERROR ;
301: FND_MSG_PUB.Count_And_Get
302: (p_encoded => FND_API.G_FALSE,
303: p_count => x_msg_count,
304: p_data => x_msg_data);
298: WHEN FND_API.G_EXC_ERROR THEN
299: ROLLBACK TO reapply_credit_memo_pvt;
300: x_return_status := FND_API.G_RET_STS_ERROR ;
301: FND_MSG_PUB.Count_And_Get
302: (p_encoded => FND_API.G_FALSE,
303: p_count => x_msg_count,
304: p_data => x_msg_data);
305: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
306: IF PG_DEBUG in ('Y', 'C') THEN
301: FND_MSG_PUB.Count_And_Get
302: (p_encoded => FND_API.G_FALSE,
303: p_count => x_msg_count,
304: p_data => x_msg_data);
305: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
306: IF PG_DEBUG in ('Y', 'C') THEN
307: arp_standard.debug('reapply_credit_memo: ' || 'Unexpected error '||sqlerrm||
308: ' at arp_deduction_cover2.reapply_credit_memo()+');
309: END IF;
307: arp_standard.debug('reapply_credit_memo: ' || 'Unexpected error '||sqlerrm||
308: ' at arp_deduction_cover2.reapply_credit_memo()+');
309: END IF;
310: ROLLBACK TO reapply_credit_memo_pvt;
311: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
312: FND_MSG_PUB.Count_And_Get
313: (p_encoded => FND_API.G_FALSE,
314: p_count => x_msg_count,
315: p_data => x_msg_data);
309: END IF;
310: ROLLBACK TO reapply_credit_memo_pvt;
311: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
312: FND_MSG_PUB.Count_And_Get
313: (p_encoded => FND_API.G_FALSE,
314: p_count => x_msg_count,
315: p_data => x_msg_data);
316: WHEN OTHERS THEN
317: IF (SQLCODE = -20001)
319: IF PG_DEBUG in ('Y', 'C') THEN
320: arp_util.debug('reapply_credit_memo: ' || '20001 error '||
321: ' at arp_deduction_cover2.reapply_credit_memo()+');
322: END IF;
323: x_return_status := FND_API.G_RET_STS_ERROR ;
324: ELSE
325: IF PG_DEBUG in ('Y', 'C') THEN
326: arp_util.debug('reapply_credit_memo: ' || 'Unexpected error '||sqlerrm||
327: ' at arp_deduction_cover2.reapply_credit_memo()+');
325: IF PG_DEBUG in ('Y', 'C') THEN
326: arp_util.debug('reapply_credit_memo: ' || 'Unexpected error '||sqlerrm||
327: ' at arp_deduction_cover2.reapply_credit_memo()+');
328: END IF;
329: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
330: IF FND_MSG_PUB.Check_Msg_Level
331: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
332: THEN
333: FND_MSG_PUB.Add_Exc_Msg
337: END IF;
338: END IF;
339: ROLLBACK TO reapply_credit_memo_pvt;
340: FND_MSG_PUB.Count_And_Get
341: (p_encoded => FND_API.G_FALSE,
342: p_count => x_msg_count,
343: p_data => x_msg_data);
344: END reapply_credit_memo;
345: