147: -- Only status = 0 are success cases whose settlement is completed in Payments.
148: -- This is an error staus, so error has to be raised.
149: IF p_module_name = 'AR_AUTOMATIC_CLEARING' THEN
150: -- If call is from AR conc request, put messages in fnd log file
151: FND_MESSAGE.SET_NAME('AR','AR_IBY_SETTLEMENT_PENDING_CLR');
152: FND_MESSAGE.SET_TOKEN('RECEIPT_NUMBER',l_receipt_number);
153: l_settle_error_message := FND_MESSAGE.GET;
154: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
155:
148: -- This is an error staus, so error has to be raised.
149: IF p_module_name = 'AR_AUTOMATIC_CLEARING' THEN
150: -- If call is from AR conc request, put messages in fnd log file
151: FND_MESSAGE.SET_NAME('AR','AR_IBY_SETTLEMENT_PENDING_CLR');
152: FND_MESSAGE.SET_TOKEN('RECEIPT_NUMBER',l_receipt_number);
153: l_settle_error_message := FND_MESSAGE.GET;
154: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
155:
156: l_settle_error_message := 'Extension ID queried is: ' || l_payment_trxn_extn_id;
149: IF p_module_name = 'AR_AUTOMATIC_CLEARING' THEN
150: -- If call is from AR conc request, put messages in fnd log file
151: FND_MESSAGE.SET_NAME('AR','AR_IBY_SETTLEMENT_PENDING_CLR');
152: FND_MESSAGE.SET_TOKEN('RECEIPT_NUMBER',l_receipt_number);
153: l_settle_error_message := FND_MESSAGE.GET;
154: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
155:
156: l_settle_error_message := 'Extension ID queried is: ' || l_payment_trxn_extn_id;
157: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
156: l_settle_error_message := 'Extension ID queried is: ' || l_payment_trxn_extn_id;
157: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
158: ELSE
159: -- If call is not from AR conc request, raise FND exception raise.
160: FND_MESSAGE.SET_NAME('AR','AR_IBY_SETTLEMENT_PENDING_CLR');
161: FND_MESSAGE.SET_TOKEN('RECEIPT_NUMBER',l_receipt_number);
162: RAISE settlement_pending_raise;
163: END IF;
164:
157: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
158: ELSE
159: -- If call is not from AR conc request, raise FND exception raise.
160: FND_MESSAGE.SET_NAME('AR','AR_IBY_SETTLEMENT_PENDING_CLR');
161: FND_MESSAGE.SET_TOKEN('RECEIPT_NUMBER',l_receipt_number);
162: RAISE settlement_pending_raise;
163: END IF;
164:
165: RETURN ;
170: raise;
171: WHEN OTHERS THEN
172: -- Still raise the error, As the receipt is remitted but no record in IBY table.
173: IF p_module_name = 'AR_AUTOMATIC_CLEARING' THEN
174: FND_MESSAGE.SET_NAME('AR','AR_IBY_SETTLEMENT_PENDING_CLR');
175: FND_MESSAGE.SET_TOKEN('RECEIPT_NUMBER',l_receipt_number);
176: l_settle_error_message := FND_MESSAGE.GET;
177: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
178:
171: WHEN OTHERS THEN
172: -- Still raise the error, As the receipt is remitted but no record in IBY table.
173: IF p_module_name = 'AR_AUTOMATIC_CLEARING' THEN
174: FND_MESSAGE.SET_NAME('AR','AR_IBY_SETTLEMENT_PENDING_CLR');
175: FND_MESSAGE.SET_TOKEN('RECEIPT_NUMBER',l_receipt_number);
176: l_settle_error_message := FND_MESSAGE.GET;
177: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
178:
179: l_settle_error_message := 'Extension ID queried is: ' || l_payment_trxn_extn_id;
172: -- Still raise the error, As the receipt is remitted but no record in IBY table.
173: IF p_module_name = 'AR_AUTOMATIC_CLEARING' THEN
174: FND_MESSAGE.SET_NAME('AR','AR_IBY_SETTLEMENT_PENDING_CLR');
175: FND_MESSAGE.SET_TOKEN('RECEIPT_NUMBER',l_receipt_number);
176: l_settle_error_message := FND_MESSAGE.GET;
177: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
178:
179: l_settle_error_message := 'Extension ID queried is: ' || l_payment_trxn_extn_id;
180: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
178:
179: l_settle_error_message := 'Extension ID queried is: ' || l_payment_trxn_extn_id;
180: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
181: ELSE
182: FND_MESSAGE.SET_NAME('AR','AR_IBY_SETTLEMENT_PENDING_CLR');
183: FND_MESSAGE.SET_TOKEN('RECEIPT_NUMBER',l_receipt_number);
184: RAISE settlement_pending_raise;
185: END IF;
186:
179: l_settle_error_message := 'Extension ID queried is: ' || l_payment_trxn_extn_id;
180: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
181: ELSE
182: FND_MESSAGE.SET_NAME('AR','AR_IBY_SETTLEMENT_PENDING_CLR');
183: FND_MESSAGE.SET_TOKEN('RECEIPT_NUMBER',l_receipt_number);
184: RAISE settlement_pending_raise;
185: END IF;
186:
187: RETURN ;
196: IF p_module_name = 'AR_AUTOMATIC_CLEARING' THEN
197: l_settle_error_message := 'Exception while quering cash receipt ID: '|| p_cr_id ;
198: fnd_file.put_line(FND_FILE.LOG,l_settle_error_message);
199: ELSE
200: FND_MESSAGE.SET_NAME('AR','GENERIC_MESSAGE');
201: APP_EXCEPTION.RAISE_EXCEPTION;
202: END IF;
203: RETURN ;
204: END;
223: -- check if receipt is reversed. If yes, raise exception.
224: -- (bug 376817)
225:
226: IF ( l_crh_rec_old.status = 'REVERSED' ) THEN
227: fnd_message.set_name('AR', 'AR_CANNOT_CLEAR_REV_RECEIPT' );
228: app_exception.raise_exception;
229: END IF;
230:
231: -- Fetch the cash receipt record
1101: -- Check if this receipt has already been reversed or unclear, then
1102: -- fail and give an error message
1103: IF ( l_crh_rec_old.status = 'REVERSED')
1104: THEN
1105: fnd_message.set_name('AR', 'AR_CANNOT_UNCLEAR_REV_RECEIPT' );
1106: app_exception.raise_exception;
1107: ELSE
1108: IF ( l_crh_rec_old.status <> 'CLEARED' )
1109: THEN
1106: app_exception.raise_exception;
1107: ELSE
1108: IF ( l_crh_rec_old.status <> 'CLEARED' )
1109: THEN
1110: fnd_message.set_name('AR', 'AR_RECEIPT_CANNOT_UNCLEAR' );
1111: app_exception.raise_exception;
1112: END IF;
1113: END IF;
1114: -- make sure the receipt was not created as CLEARED
1561: -- then fail and give an error message.
1562: IF ( l_crh_rec_old.status = 'RISK_ELIMINATED' ) OR
1563: ( l_crh_rec_old.factor_flag <> 'Y' )
1564: THEN
1565: fnd_message.set_name('AR', 'AR_CANNOT_ELIMINATE_RISK' );
1566: app_exception.raise_exception;
1567: END IF;
1568:
1569: -- Insert a new history record
1831: -- then fail and give an error message.
1832: IF ( l_crh_rec_old.status <> 'RISK_ELIMINATED' ) OR
1833: ( l_crh_rec_old.factor_flag <> 'Y' )
1834: THEN
1835: fnd_message.set_name('AR', 'AR_CANNOT_UNDO_RISK_ELIMINATE' );
1836: app_exception.raise_exception;
1837: END IF;
1838:
1839: -- Insert a new history record
2374: IF PG_DEBUG in ('Y', 'C') THEN
2375: arp_util.debug('API Exception: arp_cashbook.reverse '||SQLERRM);
2376: END IF;
2377: FND_MSG_PUB.Get (FND_MSG_PUB.G_FIRST, FND_API.G_TRUE, l_msg_data, l_msg_index);
2378: FND_MESSAGE.Set_Encoded (l_msg_data);
2379: app_exception.raise_exception;
2380:
2381: WHEN OTHERS THEN
2382: IF PG_DEBUG in ('Y', 'C') THEN
2381: WHEN OTHERS THEN
2382: IF PG_DEBUG in ('Y', 'C') THEN
2383: arp_util.debug('Exception: arp_cashbook.reverse '||SQLERRM);
2384: END IF;
2385: fnd_message.set_name('AR', 'AR_BR_CANNOT_REVERSE_REC');
2386: app_exception.raise_exception;
2387:
2388: END;
2389:
2463: OPEN applied_to_std_cur;
2464: FETCH applied_to_std_cur INTO applied_to_std_rec;
2465:
2466: IF applied_to_std_cur%FOUND THEN
2467: fnd_message.set_name('AR', 'AR_RW_CANNOT_REVERSE_BR_STD');
2468: app_exception.raise_exception;
2469: END IF;
2470:
2471: CLOSE applied_to_std_cur;
2473: OPEN applied_to_reserved_br_cur;
2474: FETCH applied_to_reserved_br_cur INTO applied_to_reserved_br_rec;
2475:
2476: IF applied_to_reserved_br_cur%FOUND THEN
2477: fnd_message.set_name('AR', 'AR_RW_CANNOT_REVERSE_BR_STD');
2478: app_exception.raise_exception;
2479: END IF;
2480:
2481: CLOSE applied_to_reserved_br_cur;
2603: OPEN BATCH;
2604: FETCH BATCH INTO Batchinfo;
2605: if (BATCH%NOTFOUND) then
2606: CLOSE BATCH;
2607: FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
2608: APP_EXCEPTION.Raise_Exception;
2609: end if;
2610: CLOSE BATCH;
2611:
2723: )
2724: then
2725: return;
2726: else
2727: FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
2728: APP_EXCEPTION.Raise_Exception;
2729: end if;
2730: END Lock_Row;
2731: