231: arp_app_pkg.lock_p( p_ra_id );
232: EXCEPTION
233: WHEN OTHERS
234: THEN
235: FND_MESSAGE.SET_NAME( 'FND', 'FND_LOCK_RECORD_ERROR');
236: FND_MSG_PUB.Add;
237: APP_EXCEPTION.raise_exception;
238: END;
239:
281: p_reversal_gl_date, p_reversal_date,
282: TRUE, NULL, NULL );
283:
284: ELSE
285: fnd_message.set_name( 'AR', 'AR_CBK_FAIL');
286: APP_EXCEPTION.raise_exception;
287: END IF;
288:
289: --snambiar for receipt chargeback,we need to reverse the chargeback also
297: p_reversal_date,
298: NULL,
299: NULL );
300: ELSE
301: fnd_message.set_name( 'AR', 'AR_CBK_FAIL');
302: APP_EXCEPTION.raise_exception;
303: END IF;
304:
305: ELSIF (l_ra_rec.applied_payment_schedule_id in (-6 , -9 )) THEN --Bug 5532825 Added -9 for CCCB
314: p_reversal_date=>p_reversal_gl_date,
315: p_reversal_comments=>l_ra_rec.comments,
316: p_called_from=>p_called_from);
317: ELSE
318: fnd_message.set_name( 'AR', 'AR_RW_CCR_REMITTED');
319: APP_EXCEPTION.raise_exception;
320: END IF;
321: END IF;
322:
610: arp_app_pkg.lock_p( pn_ra_id );
611: EXCEPTION
612: WHEN OTHERS
613: THEN
614: FND_MESSAGE.SET_NAME( 'FND', 'FND_LOCK_RECORD_ERROR');
615: FND_MSG_PUB.Add;
616: APP_EXCEPTION.raise_exception;
617: END;
618:
939: arp_app_pkg.lock_p( pn_ra_id );
940: EXCEPTION
941: WHEN OTHERS
942: THEN
943: FND_MESSAGE.SET_NAME( 'FND', 'FND_LOCK_RECORD_ERROR');
944: FND_MSG_PUB.Add;
945: APP_EXCEPTION.raise_exception;
946: END;
947: arp_app_pkg.fetch_p( pn_ra_id, lr_ra_rec );
1043: arp_app_pkg.lock_p( ln_unapp_ra_id );
1044: EXCEPTION
1045: WHEN OTHERS
1046: THEN
1047: FND_MESSAGE.SET_NAME( 'FND', 'FND_LOCK_RECORD_ERROR');
1048: FND_MSG_PUB.Add;
1049: APP_EXCEPTION.raise_exception;
1050: END;
1051:
2634: arp_standard.debug( 'arp_process_application.validate_args_appdel()+' );
2635: END IF;
2636: --
2637: IF ( p_ra_id is NULL ) THEN
2638: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
2639: APP_EXCEPTION.raise_exception;
2640: END IF;
2641: --
2642: IF PG_DEBUG in ('Y', 'C') THEN
3004: END IF;
3005: --
3006: IF ( p_ra_id IS NULL OR p_reversal_gl_date IS NULL OR
3007: p_select_flag IS NULL ) THEN
3008: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
3009: APP_EXCEPTION.raise_exception;
3010: END IF;
3011: --
3012: IF ( p_select_flag <> TRUE ) THEN
3010: END IF;
3011: --
3012: IF ( p_select_flag <> TRUE ) THEN
3013: IF ( p_cr_id IS NULL OR p_ps_id IS NULL ) THEN
3014: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
3015: APP_EXCEPTION.raise_exception;
3016: END IF;
3017: END IF;
3018: --
3392: EXCEPTION
3393: when no_data_found then
3394: null;
3395: when too_many_rows then
3396: FND_MESSAGE.set_name ('AR', 'AR_RW_PAID_INVOICE_TWICE' );
3397: APP_EXCEPTION.raise_exception;
3398: END;
3399:
3400: /* Bug fix 1659928
3413: IF l_allow_over_application ='N'
3414: AND arp_deduction.overapplication_indicator(l_inv_orig_amount,
3415: l_inv_bal_amount,
3416: l_effective_amount_applied) ='Y' THEN
3417: FND_MESSAGE.set_name ('AR', 'AR_CKAP_OVERAPP' );
3418: APP_EXCEPTION.raise_exception;
3419: END IF;
3420:
3421: /* End bug fix 1659928 */
3522: EXCEPTION
3523: when no_data_found then
3524: null;
3525: when claim_multi_assign then
3526: FND_MESSAGE.set_name ('AR', 'AR_RW_APP_CLAIM_MULTI_ASSIGN' );
3527: APP_EXCEPTION.raise_exception;
3528: END;
3529:
3530: END IF;
4240: IF ( p_receipt_ps_id IS NULL OR
4241: p_invoice_ps_id IS NULL OR
4242: p_apply_date IS NULL OR
4243: p_gl_date IS NULL ) THEN
4244: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
4245: APP_EXCEPTION.raise_exception;
4246: END IF;
4247: --
4248: IF ( p_amount_applied IS NULL AND
4247: --
4248: IF ( p_amount_applied IS NULL AND
4249: p_earned_discount_taken IS NULL AND
4250: p_unearned_discount_taken IS NULL ) THEN
4251: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
4252: APP_EXCEPTION.raise_exception;
4253: END IF;
4254:
4255: ------------------------------------------------------------------
4261: IF ( p_receipt_currency_code <> p_invoice_currency_code
4262: AND (SIGN(p_invoice_ps_id) <> -1) AND
4263: ( p_amount_applied_from is NULL OR
4264: p_trans_to_receipt_rate is NULL ) ) THEN
4265: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
4266: APP_EXCEPTION.raise_exception;
4267: END IF;
4268:
4269:
4467: EXCEPTION
4468: when no_data_found then
4469: null;
4470: when too_many_rows then
4471: FND_MESSAGE.set_name ('AR', 'AR_RW_PAID_INVOICE_TWICE' );
4472: APP_EXCEPTION.raise_exception;
4473: END;
4474:
4475: /* Bug fix 1659928
4487: IF l_allow_over_application ='N'
4488: AND arp_deduction.overapplication_indicator(l_inv_orig_amount,
4489: l_inv_bal_amount,
4490: l_effective_amount_applied) ='Y' THEN
4491: FND_MESSAGE.set_name ('AR', 'AR_CKAP_OVERAPP' );
4492: APP_EXCEPTION.raise_exception;
4493: END IF;
4494:
4495: /* End bug fix 1659928 */
4759: --
4760: IF ( p_cm_ps_id IS NULL OR p_invoice_ps_id IS NULL OR
4761: p_apply_date IS NULL OR p_gl_date IS NULL OR
4762: p_amount_applied IS NULL ) THEN
4763: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
4764: APP_EXCEPTION.raise_exception;
4765: END IF;
4766: --
4767: IF PG_DEBUG in ('Y', 'C') THEN
5257: END IF;
5258: --
5259: IF ( p_ps_id IS NULL OR p_apply_date IS NULL OR
5260: p_gl_date IS NULL OR p_amount_applied IS NULL ) THEN
5261: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
5262: APP_EXCEPTION.raise_exception;
5263: END IF;
5264: --
5265: IF PG_DEBUG in ('Y', 'C') THEN
5749: ||SQLERRM);
5750: END IF;
5751: FND_MSG_PUB.Get (FND_MSG_PUB.G_FIRST, FND_API.G_TRUE,
5752: l_msg_data, l_msg_index);
5753: FND_MESSAGE.Set_Encoded (l_msg_data);
5754: app_exception.raise_exception;
5755:
5756: WHEN OTHERS THEN
5757: IF PG_DEBUG in ('Y', 'C') THEN
6242:
6243: IF ( p_ps_id IS NULL OR p_apply_date IS NULL OR p_gl_date IS NULL OR p_amount_applied IS NULL
6244: OR p_receivables_trx_id IS NULL OR p_application_ps_id IS NULL
6245: OR (p_receivables_trx_id <> -16 AND p_application_ps_id > -1) ) THEN
6246: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
6247: APP_EXCEPTION.raise_exception;
6248: END IF;
6249: IF p_application_ps_id IN (-2) AND p_link_to_customer_trx_id IS NULL THEN
6250: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
6246: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
6247: APP_EXCEPTION.raise_exception;
6248: END IF;
6249: IF p_application_ps_id IN (-2) AND p_link_to_customer_trx_id IS NULL THEN
6250: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
6251: APP_EXCEPTION.raise_exception;
6252: END IF;
6253:
6254: IF PG_DEBUG in ('Y', 'C') THEN
6484: OR (p_application_ps_id = (-6) and p_activity_type <> 'CCREFUND' )
6485: OR (p_application_ps_id = (-5) and p_activity_type <> 'ADJUST' )
6486: OR (p_application_ps_id = (-8) and p_activity_type <> 'CM_REFUND' )
6487: THEN
6488: FND_MESSAGE.set_name ('AR', 'AR_ARGUEMENTS_FAIL' );
6489: APP_EXCEPTION.raise_exception;
6490:
6491: END IF;
6492:
6853: WHEN no_data_found THEN
6854: null;
6855: WHEN too_many_rows THEN
6856: x_return_status := FND_API.G_RET_STS_ERROR;
6857: FND_MESSAGE.set_name ('AR', 'AR_RW_APP_CLAIM_MULTI_ASSIGN' );
6858: APP_EXCEPTION.raise_exception;
6859: END;
6860: END IF;
6861:
7656: END IF;
7657: --Bug 1812334 : ar_notes entry needs to be created also when the claim is cancelled.
7658:
7659: IF p_flag = 'CREATE' THEN
7660: fnd_message.set_name('AR', 'AR_RW_APP_TRX_CLAIM_NOTE');
7661: fnd_message.set_token('RECEIPT_NUM',p_receipt_number);
7662: fnd_message.set_token('CLAIM_NUM',p_claim_number);
7663: ELSIF p_flag = 'CANCEL' THEN
7664: fnd_message.set_name('AR', 'AR_RW_APP_TRX_CLAIM_CANCL_NOTE');
7657: --Bug 1812334 : ar_notes entry needs to be created also when the claim is cancelled.
7658:
7659: IF p_flag = 'CREATE' THEN
7660: fnd_message.set_name('AR', 'AR_RW_APP_TRX_CLAIM_NOTE');
7661: fnd_message.set_token('RECEIPT_NUM',p_receipt_number);
7662: fnd_message.set_token('CLAIM_NUM',p_claim_number);
7663: ELSIF p_flag = 'CANCEL' THEN
7664: fnd_message.set_name('AR', 'AR_RW_APP_TRX_CLAIM_CANCL_NOTE');
7665: fnd_message.set_token('CLAIM_NUM',p_claim_number);
7658:
7659: IF p_flag = 'CREATE' THEN
7660: fnd_message.set_name('AR', 'AR_RW_APP_TRX_CLAIM_NOTE');
7661: fnd_message.set_token('RECEIPT_NUM',p_receipt_number);
7662: fnd_message.set_token('CLAIM_NUM',p_claim_number);
7663: ELSIF p_flag = 'CANCEL' THEN
7664: fnd_message.set_name('AR', 'AR_RW_APP_TRX_CLAIM_CANCL_NOTE');
7665: fnd_message.set_token('CLAIM_NUM',p_claim_number);
7666: END IF;
7660: fnd_message.set_name('AR', 'AR_RW_APP_TRX_CLAIM_NOTE');
7661: fnd_message.set_token('RECEIPT_NUM',p_receipt_number);
7662: fnd_message.set_token('CLAIM_NUM',p_claim_number);
7663: ELSIF p_flag = 'CANCEL' THEN
7664: fnd_message.set_name('AR', 'AR_RW_APP_TRX_CLAIM_CANCL_NOTE');
7665: fnd_message.set_token('CLAIM_NUM',p_claim_number);
7666: END IF;
7667:
7668: /* bug 3161148, need to pass only 240 characters as that is the
7661: fnd_message.set_token('RECEIPT_NUM',p_receipt_number);
7662: fnd_message.set_token('CLAIM_NUM',p_claim_number);
7663: ELSIF p_flag = 'CANCEL' THEN
7664: fnd_message.set_name('AR', 'AR_RW_APP_TRX_CLAIM_CANCL_NOTE');
7665: fnd_message.set_token('CLAIM_NUM',p_claim_number);
7666: END IF;
7667:
7668: /* bug 3161148, need to pass only 240 characters as that is the
7669: limit on the column in the table. */
7666: END IF;
7667:
7668: /* bug 3161148, need to pass only 240 characters as that is the
7669: limit on the column in the table. */
7670: l_text := substrb(fnd_message.get,1,240);
7671:
7672: l_user_id := arp_standard.profile.user_id;
7673: l_last_update_login := arp_standard.profile.last_update_login;
7674: l_sysdate := SYSDATE;
8086: ||SQLERRM);
8087: END IF;
8088: FND_MSG_PUB.Get (FND_MSG_PUB.G_FIRST, FND_API.G_TRUE,
8089: l_msg_data, l_msg_index);
8090: FND_MESSAGE.Set_Encoded (l_msg_data);
8091: app_exception.raise_exception;
8092:
8093: WHEN OTHERS THEN
8094: IF PG_DEBUG in ('Y', 'C') THEN
8138: INTO x_claim_status
8139: USING p_claim_id;
8140: EXCEPTION
8141: WHEN OTHERS THEN
8142: FND_MESSAGE.set_name('AR','AR_RW_INVALID_CLAIM_ID');
8143: FND_MESSAGE.set_token('CLAIM_ID',p_claim_id);
8144: APP_EXCEPTION.raise_exception;
8145: END;
8146: IF PG_DEBUG in ('Y', 'C') THEN
8139: USING p_claim_id;
8140: EXCEPTION
8141: WHEN OTHERS THEN
8142: FND_MESSAGE.set_name('AR','AR_RW_INVALID_CLAIM_ID');
8143: FND_MESSAGE.set_token('CLAIM_ID',p_claim_id);
8144: APP_EXCEPTION.raise_exception;
8145: END;
8146: IF PG_DEBUG in ('Y', 'C') THEN
8147: arp_standard.debug( 'arp_process_application.get_claim_status()-' );
8541: INTO l_trx_number
8542: FROM ra_customer_trx
8543: WHERE customer_Trx_id = p_app_cust_Trx_id;
8544:
8545: FND_MESSAGE.SET_NAME('AR', 'AR_REG_CM_UNAPP_COMMENTS');
8546: FND_MESSAGE.SET_TOKEN('INVOICE_NUMBER', l_trx_number);
8547: l_message_text := fnd_message.get;
8548:
8549: UPDATE ra_cust_trx_line_gl_dist
8542: FROM ra_customer_trx
8543: WHERE customer_Trx_id = p_app_cust_Trx_id;
8544:
8545: FND_MESSAGE.SET_NAME('AR', 'AR_REG_CM_UNAPP_COMMENTS');
8546: FND_MESSAGE.SET_TOKEN('INVOICE_NUMBER', l_trx_number);
8547: l_message_text := fnd_message.get;
8548:
8549: UPDATE ra_cust_trx_line_gl_dist
8550: SET comments = comments || l_message_text
8543: WHERE customer_Trx_id = p_app_cust_Trx_id;
8544:
8545: FND_MESSAGE.SET_NAME('AR', 'AR_REG_CM_UNAPP_COMMENTS');
8546: FND_MESSAGE.SET_TOKEN('INVOICE_NUMBER', l_trx_number);
8547: l_message_text := fnd_message.get;
8548:
8549: UPDATE ra_cust_trx_line_gl_dist
8550: SET comments = comments || l_message_text
8551: WHERE customer_trx_id = p_cust_trx_id