DBA Data[Home] [Help]

APPS.JAI_CMN_RGM_PROCESSING_PKG dependencies on JAI_GENERAL_PKG

Line 1139: lv_codepath := jai_general_pkg.plot_codepath(1,lv_codepath, 'PROCESS_PAYMENT', 'START');

1135:
1136:
1137: BEGIN
1138: g_debug := 'Y';
1139: lv_codepath := jai_general_pkg.plot_codepath(1,lv_codepath, 'PROCESS_PAYMENT', 'START');
1140:
1141: -- added for bug#7191302 by Xiao, begin
1142: open c_total_inv_amount(p_invoice_id);
1143: fetch c_total_inv_amount into lv_total_inv_amount;

Line 1159: lv_codepath := jai_general_pkg.plot_codepath(2, lv_codepath);

1155: FETCH c_invoice_distribution INTO r_dist;
1156: CLOSE c_invoice_distribution;
1157:
1158: r_dist.invoice_amount:=lv_total_inv_amount; -- added for bug#7191302 by Xiao
1159: lv_codepath := jai_general_pkg.plot_codepath(2, lv_codepath);
1160:
1161: -- Following condition is true only if Invoice Distribution Accounting did not happen
1162: IF r_dist.posted_flag IS NULL OR r_dist.posted_flag <> 'Y' THEN
1163: lv_codepath := jai_general_pkg.plot_codepath(3, lv_codepath);

Line 1163: lv_codepath := jai_general_pkg.plot_codepath(3, lv_codepath);

1159: lv_codepath := jai_general_pkg.plot_codepath(2, lv_codepath);
1160:
1161: -- Following condition is true only if Invoice Distribution Accounting did not happen
1162: IF r_dist.posted_flag IS NULL OR r_dist.posted_flag <> 'Y' THEN
1163: lv_codepath := jai_general_pkg.plot_codepath(3, lv_codepath);
1164: IF g_debug='Y' THEN
1165: fnd_file.put_line(fnd_file.log,'AccntChkFail. InvId,LineNum,DisNum:'||r_dist.invoice_id||','
1166: ||r_dist.invoice_line_number||','||r_dist.distribution_line_number);
1167: END IF;

Line 1181: lv_codepath := jai_general_pkg.plot_codepath(4, lv_codepath);

1177: CLOSE c_reference;
1178:
1179: -- If the following if condition is satisfied, then it means there is no REFERENCE entry and thus no RECEOVERY should happen
1180: IF r_ref.reference_id IS NULL THEN
1181: lv_codepath := jai_general_pkg.plot_codepath(4, lv_codepath);
1182: RETURN;
1183: -- if the following is satisfied then it means this is a reversal of a parent line which is processed and hence should return back
1184: ELSIF r_ref.reversal_flag = 'Y' THEN
1185: lv_codepath := jai_general_pkg.plot_codepath(5, lv_codepath);

Line 1185: lv_codepath := jai_general_pkg.plot_codepath(5, lv_codepath);

1181: lv_codepath := jai_general_pkg.plot_codepath(4, lv_codepath);
1182: RETURN;
1183: -- if the following is satisfied then it means this is a reversal of a parent line which is processed and hence should return back
1184: ELSIF r_ref.reversal_flag = 'Y' THEN
1185: lv_codepath := jai_general_pkg.plot_codepath(5, lv_codepath);
1186: p_process_flag := jai_constants.already_processed;
1187: RETURN;
1188: END IF;
1189:

Line 1198: lv_codepath := jai_general_pkg.plot_codepath(6, lv_codepath);

1194: CLOSE c_rgm_repository_id;
1195:
1196: -- if the following is satisfied, then it means the payment against the invoice is already processed
1197: IF ln_rgm_reposotory_id IS NOT NULL THEN
1198: lv_codepath := jai_general_pkg.plot_codepath(6, lv_codepath);
1199: p_process_flag := jai_constants.already_processed;
1200: RETURN;
1201: END IF;
1202:

Line 1203: lv_codepath := jai_general_pkg.plot_codepath(7, lv_codepath);

1199: p_process_flag := jai_constants.already_processed;
1200: RETURN;
1201: END IF;
1202:
1203: lv_codepath := jai_general_pkg.plot_codepath(7, lv_codepath);
1204: -- following will be true only in case Accounting Check for Invoice distribution is not done in calling procedure
1205: IF r_dist.invoice_distribution_id IS NULL THEN
1206: OPEN c_invoice_distribution(p_inv_dist_id);
1207: FETCH c_invoice_distribution INTO r_dist;

Line 1213: lv_codepath := jai_general_pkg.plot_codepath(8, lv_codepath);

1209: END IF;
1210:
1211: IF p_payment_table_name = jai_constants.ap_payments THEN
1212:
1213: lv_codepath := jai_general_pkg.plot_codepath(8, lv_codepath);
1214: OPEN c_invoice_payment(p_payment_document_id);
1215: FETCH c_invoice_payment INTO r_payment;
1216: CLOSE c_invoice_payment;
1217:

Line 1219: lv_codepath := jai_general_pkg.plot_codepath(9, lv_codepath);

1215: FETCH c_invoice_payment INTO r_payment;
1216: CLOSE c_invoice_payment;
1217:
1218: IF r_payment.future_pay_due_date IS NOT NULL AND r_payment.future_pay_due_date > trunc(sysdate) THEN
1219: lv_codepath := jai_general_pkg.plot_codepath(9, lv_codepath);
1220: p_process_flag := 'FP';
1221: p_process_message := 'Future payment which is not yet matured';
1222: RETURN;
1223: END IF;

Line 1233: lv_codepath := jai_general_pkg.plot_codepath(10, lv_codepath);

1229:
1230: -- To Derive Src Trx Type and Transaction Date for Normal Payment
1231: IF r_payment.amount > 0 THEN
1232: IF r_payment.future_pay_due_date IS NOT NULL THEN
1233: lv_codepath := jai_general_pkg.plot_codepath(10, lv_codepath);
1234: lv_src_trx_type := jai_constants.future_payment;
1235: ld_transaction_date := r_payment.future_pay_due_date;
1236: ELSE
1237: lv_codepath := jai_general_pkg.plot_codepath(11, lv_codepath);

Line 1237: lv_codepath := jai_general_pkg.plot_codepath(11, lv_codepath);

1233: lv_codepath := jai_general_pkg.plot_codepath(10, lv_codepath);
1234: lv_src_trx_type := jai_constants.future_payment;
1235: ld_transaction_date := r_payment.future_pay_due_date;
1236: ELSE
1237: lv_codepath := jai_general_pkg.plot_codepath(11, lv_codepath);
1238: lv_src_trx_type := jai_constants.payment;
1239: ld_transaction_date := r_payment.check_date;
1240: END IF;
1241:

Line 1245: lv_codepath := jai_general_pkg.plot_codepath(12, lv_codepath);

1241:
1242: -- Void Case
1243: ELSE
1244: IF r_payment.void_date IS NOT NULL THEN
1245: lv_codepath := jai_general_pkg.plot_codepath(12, lv_codepath);
1246: lv_src_trx_type := jai_constants.payment_voided;
1247: ld_transaction_date := r_payment.void_date;
1248: ELSE
1249: lv_codepath := jai_general_pkg.plot_codepath(13, lv_codepath);

Line 1249: lv_codepath := jai_general_pkg.plot_codepath(13, lv_codepath);

1245: lv_codepath := jai_general_pkg.plot_codepath(12, lv_codepath);
1246: lv_src_trx_type := jai_constants.payment_voided;
1247: ld_transaction_date := r_payment.void_date;
1248: ELSE
1249: lv_codepath := jai_general_pkg.plot_codepath(13, lv_codepath);
1250: lv_src_trx_type := jai_constants.payment_reversal;
1251: ld_transaction_date := r_payment.check_date;
1252: END IF;
1253: END IF;

Line 1257: lv_codepath := jai_general_pkg.plot_codepath(14, lv_codepath);

1253: END IF;
1254:
1255: ELSIF p_payment_table_name = jai_constants.ap_prepayments THEN
1256:
1257: lv_codepath := jai_general_pkg.plot_codepath(14, lv_codepath);
1258: OPEN c_invoice_distribution(p_payment_document_id);
1259: FETCH c_invoice_distribution INTO r_prepayment;
1260: CLOSE c_invoice_distribution;
1261:

Line 1270: lv_codepath := jai_general_pkg.plot_codepath(15, lv_codepath);

1266: ld_transaction_date := trunc(r_prepayment.creation_date);
1267:
1268: -- if the following condition is satisfied, then it means a prepayment unapplication onto invoice
1269: IF r_prepayment.parent_reversal_id IS NOT NULL THEN
1270: lv_codepath := jai_general_pkg.plot_codepath(15, lv_codepath);
1271: lv_src_trx_type := jai_constants.prepay_unapplication;
1272: ELSE
1273: lv_codepath := jai_general_pkg.plot_codepath(16, lv_codepath);
1274: lv_src_trx_type := jai_constants.prepay_application;

Line 1273: lv_codepath := jai_general_pkg.plot_codepath(16, lv_codepath);

1269: IF r_prepayment.parent_reversal_id IS NOT NULL THEN
1270: lv_codepath := jai_general_pkg.plot_codepath(15, lv_codepath);
1271: lv_src_trx_type := jai_constants.prepay_unapplication;
1272: ELSE
1273: lv_codepath := jai_general_pkg.plot_codepath(16, lv_codepath);
1274: lv_src_trx_type := jai_constants.prepay_application;
1275: END IF;
1276:
1277: END IF;

Line 1285: lv_codepath := jai_general_pkg.plot_codepath(17, lv_codepath);

1281:
1282: -- Following condition is satisfied if the distribution tax line is reversal of a parent distribution tax line
1283: IF r_dist.reversal_flag = 'Y' AND r_dist.parent_reversal_id IS NOT NULL THEN
1284:
1285: lv_codepath := jai_general_pkg.plot_codepath(17, lv_codepath);
1286: OPEN c_reference(p_source, p_invoice_id, r_dist.parent_reversal_id);
1287: FETCH c_reference INTO r_parent_ref;
1288: CLOSE c_reference;
1289:

Line 1303: lv_codepath := jai_general_pkg.plot_codepath(18, lv_codepath);

1299:
1300: -- following elsif is added to take care of void scenarios, where in the recovered amt againt the main payment is reversed
1301: ELSIF lv_src_trx_type = jai_constants.payment_voided THEN
1302:
1303: lv_codepath := jai_general_pkg.plot_codepath(18, lv_codepath);
1304: OPEN c_repo_recovered_amt(p_source, p_payment_table_name, r_payment.reversal_inv_pmt_id, r_ref.reference_id);
1305: FETCH c_repo_recovered_amt INTO ln_parent_recovered_amt;
1306: CLOSE c_repo_recovered_amt;
1307:

Line 1318: lv_codepath := jai_general_pkg.plot_codepath(20, lv_codepath);

1314: ln_discounted_amount := -ln_parent_recovered_amt * ( nvl(r_payment.discount_taken,0)/nvl(r_payment.amount,1) );
1315:
1316: -- following elsif is added to take care of Prepay Unapply scenarios, where in the recovered amt againt the main payment is reversed
1317: ELSIF lv_src_trx_type = jai_constants.prepay_unapplication THEN
1318: lv_codepath := jai_general_pkg.plot_codepath(20, lv_codepath);
1319: OPEN c_repo_recovered_amt(p_source, p_payment_table_name, r_prepayment.parent_reversal_id, r_ref.reference_id);
1320: FETCH c_repo_recovered_amt INTO ln_parent_recovered_amt;
1321: CLOSE c_repo_recovered_amt;
1322:

Line 1329: lv_codepath := jai_general_pkg.plot_codepath(22, lv_codepath);

1325: ELSE
1326: IF r_dist.invoice_amount = 0 THEN
1327: r_dist.invoice_amount := 1;
1328: end if;
1329: lv_codepath := jai_general_pkg.plot_codepath(22, lv_codepath);
1330: ln_recovered_amount := (r_ref.recoverable_amount * ln_payment_amount) / r_dist.invoice_amount; -- CHK
1331:
1332: /* Discount is considered only for payments and not for prepayments */
1333: if r_payment.amount = 0 THEN

Line 1346: lv_codepath := jai_general_pkg.plot_codepath(23, lv_codepath);

1342: ||', PaymtAmt:'||ln_payment_amount||', InvAmt:'||r_dist.invoice_amount||', DiscTaken:'||r_payment.discount_taken
1343: ||', rPayAmt:'||r_payment.amount||', DiscRecoAmt:'||ln_discounted_amount);
1344: END IF;
1345:
1346: lv_codepath := jai_general_pkg.plot_codepath(23, lv_codepath);
1347: ln_recovered_amount := nvl(ln_recovered_amount, 0);
1348: ln_discounted_amount := nvl(ln_discounted_amount, 0);
1349:
1350: ln_validate_amount := r_ref.recovered_amount + r_ref.discounted_amount + ln_recovered_amount + ln_discounted_amount;

Line 1358: lv_codepath := jai_general_pkg.plot_codepath(24, lv_codepath);

1354: end if;
1355:
1356:
1357: IF r_ref.recoverable_amount > 0 AND ln_validate_amount > r_ref.recoverable_amount THEN
1358: lv_codepath := jai_general_pkg.plot_codepath(24, lv_codepath);
1359:
1360: ln_diff_amount := ln_validate_amount - r_ref.recoverable_amount;
1361: ln_discounted_amount := ln_discounted_amount - (ln_discounted_amount * ln_diff_amount / ln_validate_amount);
1362: ln_recovered_amount := ln_recovered_amount - (ln_recovered_amount * ln_diff_amount / ln_validate_amount);

Line 1366: lv_codepath := jai_general_pkg.plot_codepath(25, lv_codepath);

1362: ln_recovered_amount := ln_recovered_amount - (ln_recovered_amount * ln_diff_amount / ln_validate_amount);
1363: --ln_recovered_amount := r_ref.recoverable_amount - r_ref.recovered_amount;
1364:
1365: ELSIF r_ref.recoverable_amount < 0 AND ln_validate_amount < r_ref.recoverable_amount THEN
1366: lv_codepath := jai_general_pkg.plot_codepath(25, lv_codepath);
1367:
1368: ln_diff_amount := ln_validate_amount - r_ref.recoverable_amount;
1369: ln_discounted_amount := ln_discounted_amount - (ln_discounted_amount * ln_diff_amount / ln_validate_amount);
1370: ln_recovered_amount := ln_recovered_amount - (ln_recovered_amount * ln_diff_amount / ln_validate_amount);

Line 1381: lv_codepath := jai_general_pkg.plot_codepath(26, lv_codepath);

1377: ||', RecoAmt:'||ln_recovered_amount||', DiscRecoAmt:'||ln_discounted_amount);
1378: END IF;
1379:
1380: IF ln_recovered_amount = 0 THEN
1381: lv_codepath := jai_general_pkg.plot_codepath(26, lv_codepath);
1382: IF g_debug='Y' THEN
1383: fnd_file.put_line(fnd_file.log,'Allready amount is recovered');
1384: END IF;
1385: RETURN;

Line 1399: lv_codepath := jai_general_pkg.plot_codepath(27.1, lv_codepath);

1395: p_process_flag => lv_process_flag,
1396: p_process_message => lv_process_message
1397: );
1398: IF lv_process_flag <> jai_constants.successful THEN
1399: lv_codepath := jai_general_pkg.plot_codepath(27.1, lv_codepath);
1400: FND_FILE.put_line(fnd_file.log, 'Error Flag:'||lv_process_flag||' Error Message:'||lv_process_message);
1401: return;
1402: END IF;
1403: /*Bug 5879769 bduvarag End*/

Line 1418: lv_codepath := jai_general_pkg.plot_codepath(27, lv_codepath);

1414: ln_exc_gain_loss_amt := 0;
1415: END IF;
1416: /*Bug 8294236 - End*/
1417:
1418: lv_codepath := jai_general_pkg.plot_codepath(27, lv_codepath);
1419: lv_called_from := 'AP_PROCESSING';--rchandan for bug#4428980
1420: jai_cmn_rgm_recording_pkg.insert_repository_entry(
1421: p_repository_id => ln_rgm_reposotory_id,
1422: p_regime_id => p_regime_id,

Line 1462: lv_codepath := jai_general_pkg.plot_codepath(28, lv_codepath);

1458: p_curr_conv_rate => nvl(r_payment.exchange_rate,rec_get_curr_dtls.exchange_rate) -- Added for Bug 7522584
1459: );
1460:
1461: IF p_process_flag <> jai_constants.successful THEN
1462: lv_codepath := jai_general_pkg.plot_codepath(28, lv_codepath);
1463: RETURN;
1464: END IF;
1465:
1466: /*Bug 8294236 - Start*/

Line 1514: lv_codepath := jai_general_pkg.plot_codepath(49, lv_codepath, 'PROCESS_PAYMENT', 'END');

1510: p_process_message => p_process_message
1511: );
1512:
1513: <>
1514: lv_codepath := jai_general_pkg.plot_codepath(49, lv_codepath, 'PROCESS_PAYMENT', 'END');
1515:
1516: IF g_debug = 'Y' THEN
1517: FND_FILE.put_line( fnd_file.log, 'Codepath:'||lv_codepath);
1518: END IF;