[Home] [Help]
335:
336:
337: BEGIN
338:
339: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath,
340: 'jai_rcv_excise_processing_pkg.update_RTV_Diff_value', 'START');
341:
342:
343: lv_statement_id := '1';
340: 'jai_rcv_excise_processing_pkg.update_RTV_Diff_value', 'START');
341:
342:
343: lv_statement_id := '1';
344: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath);
345:
346: fnd_file.put_line(FND_FILE.LOG, ' Inside Update RTV Diff value ->statement id '
347: || lv_statement_id);
348: fnd_file.put_line(FND_FILE.LOG, ' source register ' || p_source_reg);
353: ELSE
354: lv_transaction_type := pr_tax.transaction_type;
355: END IF;
356: lv_statement_id := '2';
357: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath);
358: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
359: jai_cmn_rg_pla_trxs_pkg.get_trxn_type_and_id(lv_transaction_type,
360: pr_base_trx.source_document_code,
361: ln_transaction_id);
359: jai_cmn_rg_pla_trxs_pkg.get_trxn_type_and_id(lv_transaction_type,
360: pr_base_trx.source_document_code,
361: ln_transaction_id);
362: lv_statement_id := '3';
363: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath);
364: FOR c_get_register_id IN
365: (SELECT register_id ,
366: cr_basic_ed,
367: cr_additional_ed,
380: AND transaction_source_num = ln_transaction_id
381: )
382: LOOP
383: lv_statement_id := '4';
384: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath);
385: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
386: ln_register_id := c_get_register_id.register_id;
387: ln_dr_basic := c_get_register_id.dr_basic_ed;
388: ln_dr_addl := c_get_register_id.dr_additional_ed;
403: ln_dr_other||'--'||ln_other_tax_debit);
404: END LOOP ;
405:
406: lv_statement_id := '5';
407: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath);
408: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
409:
410: lv_statement_id := '6';
411: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath);
407: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath);
408: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
409:
410: lv_statement_id := '6';
411: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath);
412: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
413:
414: lv_statement_id := '7';
415: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath);
411: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath);
412: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
413:
414: lv_statement_id := '7';
415: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath);
416: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
417: /* Set the value of credit and debit basic, additional and other */
418:
419: IF p_register_entry_type = CENVAT_DEBIT THEN
417: /* Set the value of credit and debit basic, additional and other */
418:
419: IF p_register_entry_type = CENVAT_DEBIT THEN
420: lv_statement_id := '8';
421: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath);
422: lv_upd_opening_bal_dr := ln_dr_basic + ln_dr_addl + ln_dr_other;
423: ln_dr_basic := ln_dr_basic+ pr_diff_tax.basic_excise;
424: ln_dr_addl := ln_dr_addl + pr_diff_tax.addl_excise + pr_diff_tax.cvd;
425: ln_dr_other := ln_dr_other + pr_diff_tax.other_excise;
463: P_PROCESS_STATUS => lv_process_status,
464: P_PROCESS_MESSAGE => lv_process_message
465: );
466: lv_statement_id := '9';
467: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath);
468: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
469: ln_closing_balance := ln_opening_balance + ln_tr_amount;
470: ln_opening_balance := ln_opening_balance - (nvl(lv_upd_opening_bal_cr,0) - nvl(lv_upd_opening_bal_dr,0));
471:
471:
472: fnd_file.put_line(FND_FILE.LOG, 'Opening balance to be updated ' || ln_opening_balance);
473:
474: lv_statement_id := '10';
475: p_codepath := jai_general_pkg.plot_codepath(10, p_codepath);
476: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
477:
478: /* Update PLA with the latest difference amount to the existing amount */
479: JAI_CMN_RG_PLA_TRXS_PKG.update_row(
490: P_OTHER_TAX_CREDIT => ln_other_tax_credit,
491: P_OTHER_TAX_DEBIT => ln_other_tax_debit
492: );
493: lv_statement_id := '11';
494: p_codepath := jai_general_pkg.plot_codepath(11, p_codepath);
495: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
496: /* Update the balances with the latest amount*/
497:
498: jai_cmn_rg_balances_pkg.update_row(
506: );
507: p_register_id := ln_register_id;
508: /* If source register is RG23 part II */
509: ELSE
510: lv_register_type := jai_general_pkg.get_rg_register_type(pr_tax.item_class);
511: IF pr_tax.transaction_type = 'CORRECT' THEN
512: lv_transaction_type := pr_tax.parent_transaction_type;
513: ELSE
514: lv_transaction_type := pr_tax.transaction_type;
513: ELSE
514: lv_transaction_type := pr_tax.transaction_type;
515: END IF;
516: lv_statement_id := '2';
517: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath);
518: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
519: jai_cmn_rg_23ac_ii_pkg.get_trxn_type_and_id(lv_transaction_type,
520: pr_base_trx.source_document_code,
521: ln_transaction_id);
519: jai_cmn_rg_23ac_ii_pkg.get_trxn_type_and_id(lv_transaction_type,
520: pr_base_trx.source_document_code,
521: ln_transaction_id);
522: lv_statement_id := '3';
523: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath);
524: FOR c_get_register_id IN
525: (SELECT register_id ,
526: cr_basic_ed,
527: cr_additional_ed,
562: ln_dr_other||'--'||ln_other_tax_debit);
563: END LOOP ;
564:
565: lv_statement_id := '5';
566: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath);
567: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
568:
569:
570: lv_statement_id := '6';
567: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
568:
569:
570: lv_statement_id := '6';
571: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath);
572: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
573: /* Set the value of credit and debit basic, additional and other */
574: IF p_register_entry_type = CENVAT_DEBIT THEN
575: lv_statement_id := '7';
585: nvl(pr_diff_tax.addl_excise,0)+ nvl(pr_diff_tax.cvd,0) +
586: nvl(pr_diff_tax.other_excise,0);
587: ELSE
588: lv_statement_id := '8';
589: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath);
590: lv_upd_opening_bal_cr := ln_cr_basic + ln_cr_addl + ln_cr_other;
591: ln_cr_basic := ln_cr_basic + pr_diff_tax.basic_excise;
592: ln_cr_addl := ln_cr_addl + pr_diff_tax.addl_excise + pr_diff_tax.cvd;
593: ln_cr_other := ln_cr_other + pr_diff_tax.other_excise;
604:
605: ln_tr_amount := nvl(ln_reg_cr,0) - nvl(ln_reg_dr,0);
606:
607: lv_statement_id := '9';
608: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath);
609: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
610:
611: /* Get the balance details */
612: jai_cmn_rg_balances_pkg.get_balance(
617: P_PROCESS_STATUS => lv_process_status,
618: P_PROCESS_MESSAGE => lv_process_message
619: );
620: lv_statement_id := '10';
621: p_codepath := jai_general_pkg.plot_codepath(10, p_codepath);
622: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
623: ln_closing_balance := ln_opening_balance + ln_tr_amount;
624: ln_opening_balance := ln_opening_balance - (nvl(lv_upd_opening_bal_cr,0) - nvl(lv_upd_opening_bal_dr,0));
625: fnd_file.put_line(FND_FILE.LOG, 'Opening balance to be updated ' || ln_opening_balance);
624: ln_opening_balance := ln_opening_balance - (nvl(lv_upd_opening_bal_cr,0) - nvl(lv_upd_opening_bal_dr,0));
625: fnd_file.put_line(FND_FILE.LOG, 'Opening balance to be updated ' || ln_opening_balance);
626:
627: lv_statement_id := '11';
628: p_codepath := jai_general_pkg.plot_codepath(11, p_codepath);
629: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
630:
631: /* Update RG 23 Part II with the latest difference amount to the existing amount */
632: jai_cmn_rg_23ac_ii_pkg.update_row(
646: p_process_status => lv_process_status,
647: p_process_message => lv_process_message
648: );
649: lv_statement_id := '12';
650: p_codepath := jai_general_pkg.plot_codepath(12, p_codepath);
651: fnd_file.put_line(FND_FILE.LOG, ' Value of statement id ' || lv_statement_id);
652: /* Update the balances with the latest amount*/
653:
654: jai_cmn_rg_balances_pkg.update_row(
689: AND source_register_id = p_register_id
690: AND tax_type = jai_constants.tax_type_exc_edu_cess;
691: END IF; /* Excise cess*/
692:
693: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath);
694:
695: IF pr_diff_tax.cvd_edu_cess <> 0 THEN
696: IF p_register_entry_type = CENVAT_DEBIT THEN
697: ln_other_tax_debit := pr_diff_tax.cvd_edu_cess;
777: lv_process_status := 'E';
778: lv_process_message := 'EXC_PRC_PKG.update_RTV_Diff_value'||SQLERRM
779: ||', StmtId->'||lv_statement_id;
780: FND_FILE.put_line( FND_FILE.log, 'Error in '||lv_process_message);
781: p_codepath := jai_general_pkg.plot_codepath(999, p_codepath, null, 'END');
782: END update_RTV_Diff_value;
783:
784: -- End for bug 5365346
785:
802: ||', Add CVD -> '|| pr_tax.addl_CVD
803: -- Date 30/10/2006 Bug 5228046 added by sacsethi
804: );
805:
806: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg_pkg.do_cenvat_rounding', 'START');
807:
808: ln_total_cenvat := pr_tax.basic_excise +
809: pr_tax.addl_excise +
810: pr_tax.other_excise +
816: ln_rounded_amt := ln_total_cenvat - ln_total_cenvat_rounded;
817:
818: IF ln_rounded_amt <> 0 THEN
819:
820: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath);
821:
822: IF pr_tax.cvd <> 0 THEN
823: pr_tax.cvd := pr_tax.cvd - ln_rounded_amt;
824: ELSIF pr_tax.other_excise <> 0 THEN
842: );
843:
844: END IF;
845:
846: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath, null, 'END');
847: EXCEPTION
848: WHEN OTHERS THEN
849: pr_tax := null;
850: FND_MESSAGE.SET_NAME ('JA','JAI_EXCEPTION_OCCURED');
1111: -- FND_FILE.put_line(FND_FILE.log,'*** Start jai_rcv_excise_processing_pkg.process_transaction');
1112: end if;
1113:
1114: lv_statement_id := '0';
1115: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.process_trx', 'START'); /* 1 */
1116: FND_FILE.put_line( FND_FILE.log, '***** Start of jai_rcv_excise_processing_pkg.process_transaction. Time:'||to_char(SYSDATE, 'dd/mm/yyyy hh24:mi:ss') );
1117:
1118: lv_statement_id := '1';
1119: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
1115: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.process_trx', 'START'); /* 1 */
1116: FND_FILE.put_line( FND_FILE.log, '***** Start of jai_rcv_excise_processing_pkg.process_transaction. Time:'||to_char(SYSDATE, 'dd/mm/yyyy hh24:mi:ss') );
1117:
1118: lv_statement_id := '1';
1119: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
1120: OPEN c_trx(p_transaction_id);
1121: FETCH c_trx INTO r_trx;
1122: CLOSE c_trx;
1123:
1131: lv_transaction_type := r_trx.transaction_type;
1132: END IF;
1133:
1134: lv_statement_id := '2';
1135: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
1136:
1137: validate_transaction(
1138: p_transaction_id => p_transaction_id,
1139: p_validation_type => 'COMMON',
1154: lv_tax_breakup_type := 'MODVAT';
1155: END IF;
1156:
1157: lv_statement_id := '4';
1158: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
1159:
1160: -- ln_curr_conv_rate := r_trx.currency_conversion_rate;
1161: get_tax_amount_breakup(
1162: p_shipment_line_id => r_trx.shipment_line_id,
1197:
1198: -- Following is to calculate Tax Breakup Amount As Per Apportion Factor. This is calculated based on
1199: -- Transaction UOMs, Quantities of Parent RECEIVE and present trxn an
1200: lv_statement_id := '4a';
1201: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
1202:
1203: -- These variable are used for 2nd 50% Claim of RECEIVE Transaction of CGIN Items
1204:
1205: r_half_tax := get_apportioned_tax(r_tax, 0.5,null);/*uncommented by vkaranam and passed null to the p_claim_type parameter for bug 4704957*/
1228: OPEN c_orgn_info(r_trx.organization_id, r_trx.location_id);
1229: FETCH c_orgn_info INTO r_orgn_info;
1230: CLOSE c_orgn_info;
1231:
1232: lv_register_type := jai_general_pkg.get_rg_register_type( p_item_class => r_trx.item_class);
1233:
1234: lv_statement_id := '5';
1235: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
1236:
1231:
1232: lv_register_type := jai_general_pkg.get_rg_register_type( p_item_class => r_trx.item_class);
1233:
1234: lv_statement_id := '5';
1235: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
1236:
1237: /* Vijay Shankar for Bug#4346453. RCV DFF Elim. Enh.
1238: -- Excise Invoce Generation for Return to Vendor Transactions
1239: IF lv_transaction_type = 'RETURN TO VENDOR' THEN
1254: FND_FILE.put_line(FND_FILE.log, 'After ExciseInv Gen. ExInvNo:'||nvl(lv_excise_invoice_no, 'NULL') );
1255: end if;
1256:
1257: lv_statement_id := '6';
1258: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath);
1259: IF lv_excise_invoice_no IS NOT NULL THEN
1260: INSERT INTO JAI_RCV_RTV_DTLS(
1261: transaction_id, parent_transaction_id, shipment_line_id,
1262: excise_invoice_no, excise_invoice_date, rg_register_part_i,
1267: SYSDATE, FND_GLOBAL.user_id, SYSDATE, FND_GLOBAL.user_id, FND_GLOBAL.login_id
1268: );
1269:
1270: lv_statement_id := '7';
1271: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath);
1272: jai_rcv_transactions_pkg.update_excise_invoice_no(
1273: p_transaction_id => p_transaction_id,
1274: p_excise_invoice_no => lv_excise_invoice_no,
1275: p_excise_invoice_date => ld_excise_invoice_date
1315: -- and cenvat entries happen for DELIVER and RTR (code=2)cases only if subinventory is nonbonded
1316: -- 1. RECEIVE and RTV. We dont check for Subinventory for these transaction types
1317: -- 2. DELIVER and RTR. These were supported only if subinventory is non bonded or expense or non asset case
1318: lv_statement_id := '8';
1319: p_codepath := jai_general_pkg.plot_codepath(10, p_codepath); /* 10 */
1320: IF lv_transaction_type IN ('RECEIVE', 'RETURN TO RECEIVING', 'DELIVER', 'RETURN TO VENDOR') THEN
1321:
1322: IF r_trx.organization_type = jai_rcv_trx_processing_pkg.MFG_ORGN THEN
1323:
1321:
1322: IF r_trx.organization_type = jai_rcv_trx_processing_pkg.MFG_ORGN THEN
1323:
1324: lv_statement_id := '9';
1325: p_codepath := jai_general_pkg.plot_codepath(11, p_codepath); /* 11 */
1326:
1327: IF (r_base_trx.source_document_code = jai_rcv_trx_processing_pkg.source_rma -- 'India RMA Receipt'
1328: AND r_trx.item_class IN ('FGIN', 'FGEX', 'CCIN', 'CCEX'))
1329: /*Added by nprashar for bug 6710747 The following condition is added to support register update for Inter Org Transfer*/
1368:
1369: ELSIF r_trx.item_class IN ('RMIN', 'RMEX', 'CCIN', 'CCEX', 'CGIN', 'CGEX') THEN
1370:
1371: lv_statement_id := '10';
1372: p_codepath := jai_general_pkg.plot_codepath(12, p_codepath); /* 12 */
1373:
1374: -- RG23 Part I Entry is already made during first Claim, in case of CGIN Items
1375: -- So no need of another entry during Second 50% Claim of CENVAT
1376: IF nvl(lv_cgin_code, 'XXX') <> 'REGULAR-HALF' THEN
1440:
1441: FND_FILE.put_line(FND_FILE.log, '<< Start 2nd 50% Claim of RECEIVE during RTV');
1442:
1443: lv_statement_id := '11';
1444: p_codepath := jai_general_pkg.plot_codepath(13, p_codepath);
1445: ln_receive_trx_id := r_trx.tax_transaction_id;
1446:
1447: -- Pass an RG23 PartII Entry against Parent RECEIVE line to the tune of 50% of RTV Quantity
1448: rg23_part_ii_entry(
1488:
1489: END IF;
1490:
1491: lv_statement_id := '11a';
1492: p_codepath := jai_general_pkg.plot_codepath(14, p_codepath);
1493: -- Pass accounting for the remaining 50% Claim against Parent RECEIVE line to the tune of RTV Quantity.
1494: -- Full amount is passed here but half amount will be passed in accounting_entries procedure
1495: accounting_entries(
1496: p_transaction_id => r_trx.transaction_id,
1521: -- End PARENT Half Claim entry for RTV
1522: /*vkaranam for bug #4704957,end*/
1523:
1524: lv_statement_id := '11b';
1525: p_codepath := jai_general_pkg.plot_codepath(15, p_codepath); /* 15 */
1526: -- lv_cgin_code will have a value only in case of CGIN items wherein 1st 50% claim is 'REGULAR-FULL + REVERSAL-HALF'
1527: -- and 2nd 50% claim is done by 'REGULAR-HALF'
1528: IF lv_cgin_code IN ( 'REGULAR-FULL + REVERSAL-HALF', 'REGULAR-HALF') THEN
1529: ln_amount_factor := 0.5;
1537: -- following if condition modified by Vijay Shankar for RECEIPTS DEPLUG
1538: -- IF lv_transaction_type = 'RETURN TO VENDOR' AND r_orgn_info.pref_pla = 1 THEN
1539: IF lv_transaction_type = 'RETURN TO VENDOR' THEN
1540:
1541: p_codepath := jai_general_pkg.plot_codepath(16, p_codepath); /* 16 */
1542:
1543: derive_duty_registers(
1544: p_organization_id => r_trx.organization_id,
1545: p_location_id => r_trx.location_id,
1565: OR lv_cenvat_register_type IN (jai_constants.register_type_a, jai_constants.register_type_c)
1566: THEN
1567:
1568: lv_statement_id := '13';
1569: p_codepath := jai_general_pkg.plot_codepath(17, p_codepath);
1570:
1571: IF lv_transaction_type = 'RECEIVE' AND lv_cgin_code IS NOT NULL THEN
1572: -- 1st Claim
1573: IF nvl(p_cenvat_claimed_ptg, 0) = 0 THEN
1607:
1608: ELSIF lv_cenvat_register_type = jai_constants.register_type_pla THEN
1609:
1610: lv_statement_id := '13.2';
1611: p_codepath := jai_general_pkg.plot_codepath(17.1, p_codepath);
1612: pla_entry(
1613: p_transaction_id => p_transaction_id,
1614: pr_tax => get_apportioned_tax(r_tax,
1615: ln_amount_factor,
1631: END IF;
1632:
1633: ELSE
1634: lv_statement_id := '13.3';
1635: p_codepath := jai_general_pkg.plot_codepath(17.2, p_codepath);
1636: --p_process_status := 'E';
1637: lv_message := 'Duty Register cannot be derived';
1638: GOTO finish;
1639: END IF;
1641: /* END - DUTY REGISTER HITTING LOGIC */
1642:
1643: /* START - ACCOUNTING LOGIC */
1644: lv_statement_id := '13a';
1645: p_codepath := jai_general_pkg.plot_codepath(18, p_codepath); /* 18 */
1646:
1647: fnd_file.put_line(FND_FILE.LOG, '
1648:
1649: accounting_entries(
1672: -- IF r_trx.item_class IN ('FGIN', 'FGEX') THEN
1673: -- right now i am assuming that we need not pass any accouting entries. however we need to pass rg23d entry
1674:
1675: lv_statement_id := '15';
1676: p_codepath := jai_general_pkg.plot_codepath(20, p_codepath); /* 20 */
1677: rg23_d_entry(
1678: p_transaction_id => p_transaction_id,
1679: pr_tax => r_tax,
1680: p_register_entry_type => lv_register_entry_type,
1693: GOTO finish;
1694: END IF;
1695:
1696: lv_statement_id := '16';
1697: p_codepath := jai_general_pkg.plot_codepath(21, p_codepath); /* 21 */
1698: -- there is no part II entry for TRADING transactions
1699: IF lv_transaction_type IN ('RECEIVE', 'RETURN TO VENDOR') AND r_trx.excise_in_trading = 'Y' THEN
1700:
1701: lb_process_iso := jai_rcv_trx_processing_pkg.process_iso_transaction(
1713: AND r_base_trx.source_document_code <> jai_rcv_trx_processing_pkg.source_rma /*srjayara for bug#5155138 - change done for base bug 5110511 + DFF Elimination*/
1714:
1715: THEN
1716:
1717: p_codepath := jai_general_pkg.plot_codepath(21.2, p_codepath);
1718: accounting_entries(
1719: p_transaction_id => r_trx.transaction_id,
1720: pr_tax => r_tax,
1721: p_cgin_code => NULL, -- lv_cgin_code can be null as this is trading organization
1734:
1735: END IF;
1736:
1737: ELSE
1738: p_codepath := jai_general_pkg.plot_codepath(21.5, p_codepath);
1739: lv_message := 'Organization Type Not supported';
1740: GOTO finish;
1741: END IF;
1742:
1745: END IF;
1746:
1747: ELSE
1748: lv_statement_id := '18';
1749: p_codepath := jai_general_pkg.plot_codepath(22, p_codepath); /* 22 */
1750: lv_message := 'Transaction Type Not supported';
1751: GOTO finish;
1752: END IF;
1753:
1751: GOTO finish;
1752: END IF;
1753:
1754: lv_statement_id := '19';
1755: p_codepath := jai_general_pkg.plot_codepath(23, p_codepath); /* 23 */
1756: -- Updation of RG Part1 Registers with Payment Register, Register_Id_Part_II, ChargeAccountId
1757: update_registers(
1758: p_quantity_register_id => ln_part_i_register_id,
1759: p_quantity_register => lv_part_i_register,
1767: );
1768:
1769: IF lv_transaction_type = 'RETURN TO VENDOR' AND ln_part_i_register_id IS NOT NULL THEN
1770: lv_statement_id := '20';
1771: p_codepath := jai_general_pkg.plot_codepath(24, p_codepath); /* 24 */
1772: UPDATE JAI_RCV_RTV_DTLS
1773: SET rg_register_part_i = ln_part_i_register_id
1774: WHERE transaction_id = p_transaction_id;
1775: END IF;
1812: p_process_status := 'Y';
1813:
1814: <
1815: IF lv_message IS NOT NULL THEN
1816: p_codepath := jai_general_pkg.plot_codepath(25, p_codepath); /* 25 */
1817:
1818: FND_FILE.put_line(FND_FILE.log, 'CENVAT_RG_PKG.process_trxn:'||lv_message||', StatementId:'||lv_statement_id);
1819: p_process_status := 'E';
1820: p_process_message := 'CENVAT_RG_PKG.process_trxn:'||lv_message||', StatementId:'||lv_statement_id;
1819: p_process_status := 'E';
1820: p_process_message := 'CENVAT_RG_PKG.process_trxn:'||lv_message||', StatementId:'||lv_statement_id;
1821: END IF;
1822:
1823: p_codepath := jai_general_pkg.plot_codepath(26, p_codepath, null, 'END'); /* 26 */
1824: FND_FILE.put_line( FND_FILE.log, '----- END, jai_rcv_excise_processing_pkg.process_transaction. Time:'||to_char(SYSDATE, 'dd/mm/yyyy hh24:mi:ss') );
1825:
1826: EXCEPTION
1827: WHEN OTHERS THEN
1827: WHEN OTHERS THEN
1828: p_process_status := 'E';
1829: p_process_message := 'CENVAT_RG_PKG.process_transaction->'||SQLERRM||', StmtId->'||lv_statement_id;
1830: FND_FILE.put_line( FND_FILE.log, 'Error in '||p_process_message);
1831: p_codepath := jai_general_pkg.plot_codepath(999, p_codepath, null, 'END');
1832:
1833: END process_transaction;
1834:
1835: -- this procedure to be called only for RMA case of FGIN, FGEX, CCIN, CCEX
1885: );
1886: end if;
1887:
1888: lv_statement_id := '1';
1889: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.rg_i_entry', 'START'); /* 1 */
1890:
1891: OPEN c_trx(p_transaction_id);
1892: FETCH c_trx INTO r_trx;
1893: CLOSE c_trx;
1892: FETCH c_trx INTO r_trx;
1893: CLOSE c_trx;
1894:
1895: lv_statement_id := '2';
1896: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
1897: OPEN c_base_trx(p_transaction_id);
1898: FETCH c_base_trx INTO r_base_trx;
1899: CLOSE c_base_trx;
1900:
1902: ln_customer_site_id := r_base_trx.customer_site_id;
1903:
1904: IF r_base_trx.source_document_code = 'REQ' THEN
1905: lv_statement_id := '4';
1906: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
1907: OPEN c_source_orgn_loc( r_base_trx.shipment_header_id, r_base_trx.requisition_line_id);
1908: FETCH c_source_orgn_loc INTO ln_vendor_id, ln_vendor_site_id;
1909: CLOSE c_source_orgn_loc;
1910:
1912: ln_vendor_site_id := -ln_vendor_site_id;
1913:
1914: ELSE
1915: lv_statement_id := '5';
1916: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
1917:
1918: get_changed_vendor_dtls(
1919: p_receive_trx_id => r_trx.tax_transaction_id,
1920: p_shipment_line_id => r_trx.shipment_line_id,
1943: END IF;
1944: END IF;
1945:
1946: lv_statement_id := '61';
1947: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
1948: jai_general_pkg.get_range_division(
1949: p_vendor_id => ln_vendor_id,
1950: p_vendor_site_id => ln_vendor_site_id,
1951: p_range_no => lv_range,
1944: END IF;
1945:
1946: lv_statement_id := '61';
1947: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
1948: jai_general_pkg.get_range_division(
1949: p_vendor_id => ln_vendor_id,
1950: p_vendor_site_id => ln_vendor_site_id,
1951: p_range_no => lv_range,
1952: p_division_no => lv_division
1955: lv_excise_invoice_no := r_trx.excise_invoice_no;
1956: ld_excise_invoice_date := r_trx.excise_invoice_date;
1957:
1958: lv_statement_id := '7';
1959: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
1960: -- Vijay Shankar for Bug#4346453. RCV DFF Elim. Enh. IF r_base_trx.attr_cat = 'India RMA Receipt' THEN
1961: IF r_base_trx.source_document_code = jai_rcv_trx_processing_pkg.source_rma then -- 'India RMA Receipt' THEN
1962: lv_transaction_type := 'CR';
1963: ELSE
1968: ln_entry_type := -1;
1969: END IF;
1970:
1971: lv_statement_id := '8';
1972: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
1973: ln_quantity := r_trx.quantity * ln_entry_type;
1974: ln_basic_ed := pr_tax.basic_excise * ln_entry_type;
1975: ln_additional_ed := (pr_tax.addl_excise + pr_tax.cvd) * ln_entry_type;
1976: ln_other_ed := pr_tax.other_excise * ln_entry_type;
1983: FND_FILE.put_line(FND_FILE.log,'Before call to RG1. ExDutyAmt:'||ln_excise_duty_amount);
1984: end if;
1985:
1986: lv_statement_id := '9';
1987: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8 */
1988: jai_cmn_rg_i_trxs_pkg.create_rg1_entry(
1989: p_register_id => p_register_id,
1990: p_register_id_part_ii => null,
1991: p_fin_year => jai_general_pkg.get_fin_year(p_organization_id => r_trx.organization_id),
1987: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8 */
1988: jai_cmn_rg_i_trxs_pkg.create_rg1_entry(
1989: p_register_id => p_register_id,
1990: p_register_id_part_ii => null,
1991: p_fin_year => jai_general_pkg.get_fin_year(p_organization_id => r_trx.organization_id),
1992: p_slno => lv_slno,
1993: p_transaction_id => null,
1994: p_organization_id => r_trx.organization_id,
1995: p_location_id => r_trx.location_id,
2041:
2042: /*bgowrava for forward porting Bug#5756676..end*/
2043:
2044:
2045: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath, null, 'END'); /* 9 */
2046:
2047: EXCEPTION
2048: WHEN OTHERS THEN
2049: p_process_status := 'E';
2048: WHEN OTHERS THEN
2049: p_process_status := 'E';
2050: p_process_message := 'CENVAT_RG_PKG.rg_i_entry->'||SQLERRM||', StmtId->'||lv_statement_id;
2051: FND_FILE.put_line( FND_FILE.log, 'Error in '||p_process_message);
2052: p_codepath := jai_general_pkg.plot_codepath(999, p_codepath, null, 'END');
2053:
2054: END rg_i_entry;
2055:
2056: PROCEDURE rg23_part_i_entry(
2102: );
2103: end if;
2104:
2105: lv_statement_id := '1';
2106: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.23_part_i', 'START'); /* 1 */
2107: OPEN c_trx(p_transaction_id);
2108: FETCH c_trx INTO r_trx;
2109: CLOSE c_trx;
2110:
2108: FETCH c_trx INTO r_trx;
2109: CLOSE c_trx;
2110:
2111: lv_statement_id := '2';
2112: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
2113:
2114: OPEN c_base_trx(p_transaction_id);
2115: FETCH c_base_trx INTO r_base_trx;
2116: CLOSE c_base_trx;
2118: ln_customer_id := r_base_trx.customer_id;
2119: ln_customer_site_id := r_base_trx.customer_site_id;
2120:
2121: lv_statement_id := '3';
2122: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
2123: IF r_base_trx.po_header_id IS NOT NULL THEN
2124: OPEN c_po_header(r_base_trx.po_header_id);
2125: FETCH c_po_header INTO r_po_header;
2126: CLOSE c_po_header;
2127: END IF;
2128:
2129: IF r_base_trx.source_document_code = 'REQ' THEN
2130: lv_statement_id := '4';
2131: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
2132: OPEN c_source_orgn_loc( r_base_trx.shipment_header_id, r_base_trx.requisition_line_id);
2133: FETCH c_source_orgn_loc INTO ln_vendor_id, ln_vendor_site_id;
2134: CLOSE c_source_orgn_loc;
2135:
2137: ln_vendor_site_id := -ln_vendor_site_id;
2138:
2139: ELSE
2140: lv_statement_id := '5';
2141: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
2142:
2143: -- Vijay Shankar for Bug#3940588
2144: get_changed_vendor_dtls(
2145: p_receive_trx_id => r_trx.tax_transaction_id,
2182: lv_excise_invoice_no := r_trx.excise_invoice_no;
2183: ld_excise_invoice_date := r_trx.excise_invoice_date;
2184:
2185: lv_statement_id := '6';
2186: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
2187: ln_quantity := r_trx.quantity * ln_entry_type;
2188: ln_basic_ed := pr_tax.basic_excise * ln_entry_type;
2189: ln_additional_ed := (pr_tax.addl_excise + pr_tax.cvd) * ln_entry_type;
2190: ln_additional_cvd := pr_tax.addl_cvd * ln_entry_type; -- Date 06/04/2007 by sacsethi for bug 6109941
2194: FND_FILE.put_line(FND_FILE.log,'Before call to jai_cmn_rg_23ac_i_trxs_pkg.insert_row');
2195: end if;
2196:
2197: lv_statement_id := '7';
2198: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
2199: jai_cmn_rg_23ac_i_trxs_pkg.insert_row(
2200: p_register_id => p_register_id,
2201: p_inventory_item_id => r_trx.inventory_item_id,
2202: p_organization_id => r_trx.organization_id,
2222: p_excise_invoice_date => ld_excise_invoice_date,
2223: p_oth_receipt_quantity => NULL,
2224: p_oth_receipt_id => NULL,
2225: p_oth_receipt_date => NULL,
2226: p_register_type => jai_general_pkg.get_rg_register_type(p_item_class => r_trx.item_class),
2227: p_identification_no => NULL,
2228: p_identification_mark => NULL,
2229: p_brand_name => NULL,
2230: p_date_of_verification => NULL,
2260: FND_FILE.put_line(FND_FILE.log, 'Updating quantity register flag to Y');
2261:
2262: /*bgowrava for forward porting Bug#5756676..end*/
2263:
2264: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath, null, 'END'); /* 8 */
2265:
2266: EXCEPTION
2267: WHEN OTHERS THEN
2268: p_process_status := 'E';
2267: WHEN OTHERS THEN
2268: p_process_status := 'E';
2269: p_process_message := 'CENVAT_RG_PKG.rg23_part_i_entry->'||SQLERRM||', StmtId->'||lv_statement_id;
2270: FND_FILE.put_line( FND_FILE.log, 'Error in '||p_process_message);
2271: p_codepath := jai_general_pkg.plot_codepath(999, p_codepath, null, 'END');
2272:
2273: END rg23_part_i_entry;
2274:
2275: PROCEDURE rg23_d_entry(
2353: );
2354: end if;
2355:
2356: lv_statement_id := '1';
2357: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.23_d', 'START'); /* 1 */
2358: OPEN c_trx(p_transaction_id);
2359: FETCH c_trx INTO r_trx;
2360: CLOSE c_trx;
2361:
2359: FETCH c_trx INTO r_trx;
2360: CLOSE c_trx;
2361:
2362: lv_statement_id := '2';
2363: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
2364: OPEN c_base_trx(p_transaction_id);
2365: FETCH c_base_trx INTO r_base_trx;
2366: CLOSE c_base_trx;
2367:
2369: ln_customer_site_id := r_base_trx.customer_site_id;
2370:
2371: IF r_base_trx.source_document_code = 'REQ' THEN
2372: lv_statement_id := '3';
2373: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
2374: OPEN c_source_orgn_loc( r_base_trx.shipment_header_id, r_base_trx.requisition_line_id);
2375: FETCH c_source_orgn_loc INTO ln_vendor_id, ln_vendor_site_id;
2376: CLOSE c_source_orgn_loc;
2377:
2393: END IF;
2394:
2395: IF r_base_trx.source_document_code = 'RMA' THEN
2396: lv_statement_id := '4';
2397: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
2398: OPEN c_rma_tax_rate(r_base_trx.oe_order_line_id);
2399: FETCH c_rma_tax_rate INTO ln_excise_duty_rate;
2400: CLOSE c_rma_tax_rate;
2401:
2413: END IF;
2414:
2415: ELSE
2416: lv_statement_id := '4.1';
2417: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
2418: OPEN c_tax_rate(r_trx.shipment_line_id);
2419: FETCH c_tax_rate INTO ln_excise_duty_rate;
2420: CLOSE c_tax_rate;
2421: END IF;
2420: CLOSE c_tax_rate;
2421: END IF;
2422:
2423: lv_statement_id := '5';
2424: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
2425: lv_transaction_uom_code := r_trx.uom_code;
2426:
2427: IF p_register_entry_type = CENVAT_DEBIT THEN
2428: ln_entry_type := -1;
2459: FND_FILE.put_line(FND_FILE.log,'Calling jai_cmn_rg_23d_trxs_pkg.insert_row');
2460: end if;
2461:
2462: lv_statement_id := '6';
2463: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
2464: jai_cmn_rg_23d_trxs_pkg.insert_row(
2465: p_register_id => p_register_id,
2466: p_organization_id => r_trx.organization_id,
2467: p_location_id => r_trx.location_id,
2479: p_register_code => NULL,
2480: p_released_date => NULL,
2481: p_comm_invoice_no => lv_excise_invoice_no,
2482: p_comm_invoice_date => ld_excise_invoice_date,
2483: p_receipt_boe_num => jai_general_pkg.get_matched_boe_no(p_transaction_id),
2484: p_oth_receipt_id => NULL,
2485: p_oth_receipt_date => NULL,
2486: p_oth_receipt_quantity => NULL,
2487: p_remarks => 'Live-Trx/PrntTrx:'||r_trx.transaction_id||'/'||r_trx.parent_transaction_id,
2525: p_process_status => p_process_status,
2526: p_process_message => p_process_message
2527: );
2528:
2529: p_codepath := jai_general_pkg.plot_codepath(7.1, p_codepath);
2530: lv_statement_id := '6.1';
2531: -- Vijay Shankar for Bug#3940588 EDUCATION CESS
2532: IF pr_tax.excise_edu_cess <> 0 THEN
2533: IF p_register_entry_type = CENVAT_DEBIT THEN
2546: );
2547: END IF;
2548:
2549: lv_statement_id := '6.2';
2550: p_codepath := jai_general_pkg.plot_codepath(7.2, p_codepath);
2551:
2552: IF pr_tax.cvd_edu_cess <> 0 THEN
2553: IF p_register_entry_type = CENVAT_DEBIT THEN
2554: ln_other_tax_debit := pr_tax.cvd_edu_cess;
2567: END IF;
2568: /*added the following by vkaranam for budget 07 impact - bug#5989740*/
2569: --start
2570: lv_statement_id := '6.3';
2571: p_codepath := jai_general_pkg.plot_codepath(7.3, p_codepath);
2572:
2573: IF pr_tax.sh_exc_edu_cess <> 0 THEN
2574: IF p_register_entry_type = CENVAT_DEBIT THEN
2575: ln_other_tax_debit := pr_tax.sh_exc_edu_cess;
2588: );
2589: END IF;
2590:
2591: lv_statement_id := '6.4';
2592: p_codepath := jai_general_pkg.plot_codepath(7.4, p_codepath);
2593:
2594: IF pr_tax.sh_cvd_edu_cess <> 0 THEN
2595: IF p_register_entry_type = CENVAT_DEBIT THEN
2596: ln_other_tax_debit := pr_tax.sh_cvd_edu_cess;
2610: --end bug#5989740
2611:
2612:
2613: lv_statement_id := '6.5';
2614: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8 */
2615:
2616: -- following code to update parent RG23D entry with transaction qty
2617: IF lv_transaction_type = 'RETURN TO VENDOR' OR ln_quantity_received < 0 THEN
2618: FND_FILE.put_line(FND_FILE.log, 'To Update Qty_To_Adjust field of RG23D Table' );
2617: IF lv_transaction_type = 'RETURN TO VENDOR' OR ln_quantity_received < 0 THEN
2618: FND_FILE.put_line(FND_FILE.log, 'To Update Qty_To_Adjust field of RG23D Table' );
2619:
2620: lv_statement_id := '7';
2621: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath); /* 9 */
2622: ln_quantity_received := nvl(r_base_trx.primary_quantity, r_base_trx.quantity);
2623:
2624: -- this is to reduce main RG23D entry of RECEIVE transaction incase of -ve RECEIVE Correction
2625: IF lv_transaction_type = 'RECEIVE' THEN
2632: p_required_trx_type => 'RECEIVE'
2633: );
2634:
2635: lv_statement_id := '8';
2636: p_codepath := jai_general_pkg.plot_codepath(10, p_codepath); /* 10 */
2637: OPEN c_parent_register_id(ln_ancestor_trxn_id, 18);
2638: FETCH c_parent_register_id INTO ln_ancestor_reg_id;
2639: CLOSE c_parent_register_id;
2640:
2642: FND_FILE.put_line(FND_FILE.log,'Calling jai_cmn_rg_23d_trxs_pkg.update_qty_to_adjust');
2643: end if;
2644:
2645: lv_statement_id := '9';
2646: p_codepath := jai_general_pkg.plot_codepath(11, p_codepath); /* 11 */
2647: jai_cmn_rg_23d_trxs_pkg.update_qty_to_adjust(
2648: p_register_id => ln_ancestor_reg_id,
2649: p_quantity => ln_quantity_received ,
2650: p_simulate_flag => p_simulate_flag,
2653: );
2654:
2655: END IF;
2656:
2657: p_codepath := jai_general_pkg.plot_codepath(12, p_codepath, null, 'END'); /* 12 */
2658:
2659: EXCEPTION
2660: WHEN OTHERS THEN
2661: p_process_status := 'E';
2660: WHEN OTHERS THEN
2661: p_process_status := 'E';
2662: p_process_message := 'CENVAT_RG_PKG.rg23_d_entry->'||SQLERRM||', StmtId->'||lv_statement_id;
2663: FND_FILE.put_line( FND_FILE.log, 'Error in '||p_process_message);
2664: p_codepath := jai_general_pkg.plot_codepath(999, p_codepath, null, 'END');
2665:
2666: END rg23_d_entry;
2667:
2668: PROCEDURE rg23_part_ii_entry(
2721: );
2722: end if;
2723:
2724: lv_statement_id := '1';
2725: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.23_part_ii', 'START'); /* 1 */
2726: OPEN c_trx(p_transaction_id);
2727: FETCH c_trx INTO r_trx;
2728: CLOSE c_trx;
2729:
2727: FETCH c_trx INTO r_trx;
2728: CLOSE c_trx;
2729:
2730: lv_statement_id := '2';
2731: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
2732: OPEN c_base_trx(p_transaction_id);
2733: FETCH c_base_trx INTO r_base_trx;
2734: CLOSE c_base_trx;
2735:
2737: ln_customer_site_id := r_base_trx.customer_site_id;
2738:
2739: IF r_base_trx.source_document_code = 'REQ' THEN
2740: lv_statement_id := '3';
2741: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
2742: OPEN c_source_orgn_loc( r_base_trx.shipment_header_id, r_base_trx.requisition_line_id);
2743: FETCH c_source_orgn_loc INTO ln_vendor_id, ln_vendor_site_id;
2744: CLOSE c_source_orgn_loc;
2745:
2794: ld_excise_invoice_date := r_trx.excise_invoice_date;
2795: END IF;
2796:
2797: lv_statement_id := '4';
2798: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
2799: IF p_register_entry_type = CENVAT_DEBIT THEN
2800: ln_dr_basic := pr_tax.basic_excise;
2801: ln_dr_addl := pr_tax.addl_excise + pr_tax.cvd;
2802: ln_dr_other := pr_tax.other_excise;
2813: if lb_rg_debug then
2814: FND_FILE.put_line(FND_FILE.log,'Calling jai_cmn_rg_23ac_ii_pkg.insert_row');
2815: end if;
2816:
2817: lv_register_type := jai_general_pkg.get_rg_register_type(r_trx.item_class);
2818: if lv_register_type = jai_constants.register_type_a then
2819: lv_source_register := jai_constants.reg_rg23a_2;
2820: else
2821: lv_source_register := jai_constants.reg_rg23c_2;
2821: lv_source_register := jai_constants.reg_rg23c_2;
2822: end if;
2823:
2824: lv_statement_id := '5';
2825: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
2826: jai_cmn_rg_23ac_ii_pkg.insert_row(
2827: p_register_id => p_register_id,
2828: p_inventory_item_id => r_trx.inventory_item_id,
2829: p_organization_id => r_trx.organization_id,
2860: p_process_status => p_process_status,
2861: p_process_message => p_process_message
2862: );
2863:
2864: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath);
2865:
2866: -- Vijay Shankar for Bug#3940588 EDUCATION CESS
2867: IF pr_tax.excise_edu_cess <> 0 THEN
2868: IF p_register_entry_type = CENVAT_DEBIT THEN
2880: p_process_message => p_process_message
2881: );
2882: END IF;
2883:
2884: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath);
2885:
2886: IF pr_tax.cvd_edu_cess <> 0 THEN
2887: IF p_register_entry_type = CENVAT_DEBIT THEN
2888: ln_other_tax_debit := pr_tax.cvd_edu_cess;
2918: p_process_message => p_process_message
2919: );
2920: END IF;
2921:
2922: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath);
2923:
2924: IF pr_tax.sh_cvd_edu_cess <> 0 THEN
2925: IF p_register_entry_type = CENVAT_DEBIT THEN
2926: ln_other_tax_debit := pr_tax.sh_cvd_edu_cess;
2939: END IF;
2940:
2941: -- END,Bgowrava for Bug#6071509
2942:
2943: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath, null, 'END');
2944:
2945: EXCEPTION
2946: WHEN OTHERS THEN
2947: p_process_status := 'E';
2946: WHEN OTHERS THEN
2947: p_process_status := 'E';
2948: p_process_message := 'CENVAT_RG_PKG.rg23_part_ii_entry->'||SQLERRM||', StmtId->'||lv_statement_id;
2949: FND_FILE.put_line( FND_FILE.log, 'Error in '||p_process_message);
2950: p_codepath := jai_general_pkg.plot_codepath(999, p_codepath, null, 'END');
2951:
2952: END rg23_part_ii_entry;
2953:
2954: PROCEDURE pla_entry(
2999: FND_FILE.put_line(FND_FILE.log,'^ PLA_Entry');
3000: end if;
3001:
3002: lv_statement_id := '1';
3003: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.pla', 'START'); /* 1 */
3004: OPEN c_trx(p_transaction_id);
3005: FETCH c_trx INTO r_trx;
3006: CLOSE c_trx;
3007:
3005: FETCH c_trx INTO r_trx;
3006: CLOSE c_trx;
3007:
3008: lv_statement_id := '2';
3009: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
3010: OPEN c_base_trx(p_transaction_id);
3011: FETCH c_base_trx INTO r_base_trx;
3012: CLOSE c_base_trx;
3013:
3012: CLOSE c_base_trx;
3013:
3014: IF r_base_trx.source_document_code = 'REQ' THEN
3015: lv_statement_id := '3';
3016: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
3017:
3018: OPEN c_source_orgn_loc( r_base_trx.shipment_header_id, r_base_trx.requisition_line_id);
3019: FETCH c_source_orgn_loc INTO ln_vendor_id, ln_vendor_site_id;
3020: CLOSE c_source_orgn_loc;
3046: lv_excise_invoice_no := r_trx.excise_invoice_no;
3047: ld_excise_invoice_date := r_trx.excise_invoice_date;
3048:
3049: lv_statement_id := '4';
3050: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
3051: IF p_register_entry_type = CENVAT_DEBIT THEN
3052: ln_dr_basic := pr_tax.basic_excise;
3053: ln_dr_addl := pr_tax.addl_excise + pr_tax.cvd;
3054: ln_dr_other := pr_tax.other_excise;
3064: FND_FILE.put_line(FND_FILE.log,'Calling jai_cmn_rg_pla_trxs_pkg.insert_row');
3065: end if;
3066:
3067: lv_statement_id := '5';
3068: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
3069: jai_cmn_rg_pla_trxs_pkg.insert_row(
3070: p_register_id => p_register_id,
3071: p_tr6_challan_no => NULL,
3072: p_tr6_challan_date => NULL,
3101: p_process_status => p_process_status,
3102: p_process_message => p_process_message
3103: );
3104:
3105: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath);
3106:
3107: -- Vijay Shankar for Bug#3940588 EDUCATION CESS
3108: IF pr_tax.excise_edu_cess <> 0 THEN
3109: IF p_register_entry_type = CENVAT_DEBIT THEN
3121: p_process_message => p_process_message
3122: );
3123: END IF;
3124:
3125: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath);
3126:
3127: IF pr_tax.cvd_edu_cess <> 0 THEN
3128: IF p_register_entry_type = CENVAT_DEBIT THEN
3129: ln_other_tax_debit := pr_tax.cvd_edu_cess;
3142: END IF;
3143:
3144: /*added the following by vkaranam for budget 07 impact - bug#5989740*/
3145: --start
3146: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath);
3147: IF pr_tax.sh_exc_edu_cess <> 0 THEN
3148: IF p_register_entry_type = CENVAT_DEBIT THEN
3149: ln_other_tax_debit := nvl(pr_tax.sh_exc_edu_cess,0);
3150: ELSE
3161: p_process_message => p_process_message
3162: );
3163: END IF;
3164:
3165: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath);
3166:
3167: IF pr_tax.sh_cvd_edu_cess <> 0 THEN
3168: IF p_register_entry_type = CENVAT_DEBIT THEN
3169: ln_other_tax_debit := nvl(pr_tax.sh_cvd_edu_cess,0);
3183: --end #5989740
3184:
3185:
3186:
3187: p_codepath := jai_general_pkg.plot_codepath(10, p_codepath, NULL, 'END'); /* 6 */
3188:
3189: EXCEPTION
3190: WHEN OTHERS THEN
3191: p_process_status := 'E';
3190: WHEN OTHERS THEN
3191: p_process_status := 'E';
3192: p_process_message := 'CENVAT_RG_PKG.pla_entry->'||SQLERRM||', StmtId->'||lv_statement_id;
3193: FND_FILE.put_line( FND_FILE.log, 'Error in '||p_process_message);
3194: p_codepath := jai_general_pkg.plot_codepath(999, p_codepath, null, 'END');
3195:
3196: END pla_entry;
3197:
3198: /*~~~~~~~~~~~~~~~~~~~ ACCOUNTING_ENTRIES Main Procedure for Accounting ~~~~~~~~~~~~~~~~~~~~~*/
3290:
3291: fnd_file.put_line(FND_FILE.LOG, '
3293: lv_statement_id := '1';
3294: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.accounting', 'START'); /* 1 */
3295: OPEN c_trx(p_transaction_id);
3296: FETCH c_trx INTO r_trx;
3297: CLOSE c_trx;
3298:
3296: FETCH c_trx INTO r_trx;
3297: CLOSE c_trx;
3298:
3299: lv_statement_id := '2';
3300: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
3301:
3302: fnd_file.put_line(FND_FILE.LOG, '
3304: lv_reference10 := 'India Local Cenvat Entries for Receipt:' || r_trx.receipt_num ||'. Transaction Type '||r_trx.transaction_type;
3306: lv_reference10 := lv_reference10 || ' of '||r_trx.parent_transaction_type;
3307: end if;
3308:
3309: lv_statement_id := '3';
3310: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
3311: IF( NVL(r_trx.cenvat_claimed_ptg, 0) = 100 AND pv_retro_reference IS NULL ) THEN--Added by eric on Jan 18,2008 for retro
3312: p_process_status := 'E';
3313: p_process_message := 'Cenvat was fully claimed already. No more claims can happen';
3314: GOTO end_of_accounting;
3320: FETCH c_base_trx INTO r_base_trx;
3321: CLOSE c_base_trx;
3322:
3323: lv_statement_id := '4';
3324: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
3325:
3326: fnd_file.put_line(FND_FILE.LOG, '
3328: IF r_trx.transaction_type = 'CORRECT' THEN
3330: ELSE
3331: lv_transaction_type := r_trx.transaction_type;
3332: END IF;
3333:
3334: lv_register_type := jai_general_pkg.get_rg_register_type(r_trx.item_class);
3335:
3336: -- following cenvat_claimed_ptg corresponds to RECEIVE i.e parent of any other type of transaction
3337: -- ln_cenvat_claimed_ptg := get_receive_claimed_ptg(p_transaction_id, r_trx.shipment_line_id);
3338:
3336: -- following cenvat_claimed_ptg corresponds to RECEIVE i.e parent of any other type of transaction
3337: -- ln_cenvat_claimed_ptg := get_receive_claimed_ptg(p_transaction_id, r_trx.shipment_line_id);
3338:
3339: lv_statement_id := '5';
3340: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
3341: OPEN c_orgn_info(r_trx.organization_id, r_trx.location_id);
3342: FETCH c_orgn_info INTO r_orgn_info;
3343: CLOSE c_orgn_info;
3344:
3351:
3352: fnd_file.put_line(FND_FILE.LOG, '
3354: lv_statement_id := '5a';
3355: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
3356: IF r_trx.organization_type = 'M' THEN
3357: lv_statement_id := '6';
3358: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
3359: lv_accnt_nature := 'CENVAT';
3354: lv_statement_id := '5a';
3355: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
3356: IF r_trx.organization_type = 'M' THEN
3357: lv_statement_id := '6';
3358: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
3359: lv_accnt_nature := 'CENVAT';
3360: -- Vijay Shankar for Bug#4346453. RCV DFF Elim. Enh. IF r_base_trx.attr_cat = 'India RMA Receipt' THEN
3361: IF r_base_trx.source_document_code = jai_rcv_trx_processing_pkg.source_rma then
3362: ln_receiving_accnt_id := r_orgn_info.excise_rcvble_account; /* In front end this is shown as excise Paid Payable Accnt */
3421: --added by vkaranam for budget 07 impact - bug#5989740
3422: ln_sh_total_exc_edu_cess_amt := nvl(pr_tax.sh_exc_edu_cess,0) + nvl(pr_tax.sh_cvd_edu_cess,0);
3423:
3424: lv_statement_id := '7';
3425: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8 */
3426: -- IF ln_cenvat_accnt_id IS NULL THEN
3427: IF ln_total_excise_amt <> 0 THEN
3428: IF ln_cenvat_accnt_id IS NULL THEN
3429: IF r_trx.organization_type = 'T' THEN
3514:
3515: fnd_file.put_line(FND_FILE.LOG, '
3517: lv_statement_id := '8';
3518: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath); /* 9 */
3519: IF lv_message IS NOT NULL THEN
3520: p_process_status := 'E';
3521: p_process_message := lv_message;
3522: RETURN;
3538: NULL;
3539: END IF;
3540:
3541: lv_statement_id := '9';
3542: p_codepath := jai_general_pkg.plot_codepath(10, p_codepath); /* 10 */
3543: IF p_cenvat_accounting_type = CENVAT_DEBIT THEN
3544: ln_debit := ln_total_excise_amt;
3545: ln_balancing_credit := ln_total_excise_amt;
3546: ln_credit := NULL;
3670:
3671: fnd_file.put_line(FND_FILE.LOG, '
3673: lv_statement_id := '10';
3674: p_codepath := jai_general_pkg.plot_codepath(11, p_codepath); /* 11 */
3675: IF p_cgin_code IS NULL OR (lv_register_type = 'C' AND p_cgin_code like 'REGULAR-FULL%') THEN
3676:
3677: if lb_rg_debug then
3678: FND_FILE.put_line(FND_FILE.log,'11_1 jai_rcv_accounting_pkg.process_transaction.'
3679: ||' Debit:'||ln_debit||', Credit:'||ln_credit||', CenvatAccntId:'||ln_cenvat_accnt_id);
3680: end if;
3681:
3682: lv_statement_id := '10a';
3683: p_codepath := jai_general_pkg.plot_codepath(12, p_codepath); /* 12 */
3684: -- Actual Entry-1: Cenvat Accounting ( This Includes Edu Cess also if different account is not specified for cess)
3685: -- bug 5581319. Added by Lakshmi Gopalsami
3686: IF NVL(ln_debit,0) <> 0 OR NVL(ln_credit,0) <> 0 THEN
3687: fnd_file.put_line(FND_FILE.LOG, '
3723: ||' Dr:'||ln_edu_cess_debit||', Cr:'||ln_edu_cess_credit||', EduCessAccnt:'||ln_cenvat_accnt_id);
3724: end if;
3725: fnd_file.put_line(FND_FILE.LOG, '
3727: p_codepath := jai_general_pkg.plot_codepath(12, p_codepath); /* 12 */
3728: -- Actual Entry-2: Cenvat Cess Accounting
3729: jai_rcv_accounting_pkg.process_transaction(
3730: P_TRANSACTION_ID => p_transaction_id,
3731: P_ACCT_TYPE => lv_accnt_type,
3764: ||' SH_Dr:'||ln_sh_edu_cess_debit||', SH_Cr:'||ln_sh_edu_cess_credit||', SH_EduCessAccnt:'||ln_sh_exc_edu_cess_accnt);
3765: end if;
3766:
3767: lv_statement_id := '10b';
3768: p_codepath := jai_general_pkg.plot_codepath(13, p_codepath); /* 13 */
3769: -- Actual Entry-2: Cenvat Cess Accounting
3770: jai_rcv_accounting_pkg.process_transaction(
3771: P_TRANSACTION_ID => p_transaction_id,
3772: P_ACCT_TYPE => lv_accnt_type,
3804: ||' Debit:'||ln_balancing_debit||', Credit:'||ln_balancing_credit||', RecvngAccntId:'||ln_receiving_accnt_id);
3805: end if;
3806:
3807: lv_statement_id := '10b';
3808: p_codepath := jai_general_pkg.plot_codepath(13, p_codepath); /* 13 */
3809: -- Balancing Entry: Receiving Accounting
3810: -- bug 5581319. Added by Lakshmi Gopalsami
3811: IF NVL(ln_balancing_debit,0) <> 0 OR NVL(ln_balancing_credit,0) <> 0 THEN
3812: fnd_file.put_line(FND_FILE.LOG, '
3850: AND nvl(ln_edu_cess_balancing_debit, ln_edu_cess_balancing_credit) <> 0
3851: THEN
3852:
3853: lv_statement_id := '10b';
3854: p_codepath := jai_general_pkg.plot_codepath(13.1, p_codepath);
3855: -- Balancing Entry: Receiving Accounting
3856: fnd_file.put_line(FND_FILE.LOG, '
3858: P_TRANSACTION_ID => p_transaction_id,
3896: AND nvl(ln_sh_edu_cess_balancin_debit, ln_sh_edu_cess_balancin_credit) <> 0
3897: THEN
3898:
3899: lv_statement_id := '10d';
3900: p_codepath := jai_general_pkg.plot_codepath(15.1, p_codepath);
3901: -- Balancing Entry: Receiving Accounting
3902: jai_rcv_accounting_pkg.process_transaction(
3903: P_TRANSACTION_ID => p_transaction_id,
3904: P_ACCT_TYPE => lv_accnt_type,
3942:
3943: IF nvl(p_cgin_code,'AA') IN ('REGULAR-HALF', 'REGULAR-FULL + REVERSAL-HALF') THEN
3944: fnd_file.put_line(FND_FILE.LOG, '
3946: p_codepath := jai_general_pkg.plot_codepath(15, p_codepath); /* 15 */
3947:
3948: -- this can happen only for RECEIVE type of transaction and that too for 2nd 50% Claim
3949: IF p_cgin_code = 'REGULAR-HALF' THEN
3950: lv_accnt_nature := 'CENVAT-REG-50%';
4135: GOTO end_of_accounting;
4136: END IF;
4137:
4138: lv_statement_id := '13';
4139: p_codepath := jai_general_pkg.plot_codepath(16, p_codepath); /* 16 */
4140: if lb_rg_debug then
4141: FND_FILE.put_line(FND_FILE.log,'21 jai_rcv_accounting_pkg.process_transaction'
4142: ||' Debit:'||ln_debit||', Credit:'||ln_credit||', CenvatAccntId:'||ln_cenvat_accnt_id);
4143: end if;
4142: ||' Debit:'||ln_debit||', Credit:'||ln_credit||', CenvatAccntId:'||ln_cenvat_accnt_id);
4143: end if;
4144:
4145: lv_statement_id := '13a';
4146: p_codepath := jai_general_pkg.plot_codepath(17, p_codepath); /* 17 */
4147: -- SecondSet First Entry_1: Cenvat Accounting
4148: -- bug 5581319. Added by Lakshmi Gopalsami
4149: IF NVL(ln_balancing_debit,0) <> 0 OR NVL(ln_balancing_credit,0) <> 0 THEN
4150:
4188: ||' Dr:'||ln_edu_cess_debit||', Cr:'||ln_edu_cess_credit||', Cess Accnt:'||ln_exc_edu_cess_accnt);
4189: end if;
4190: -- SecondSet First Entry_2: Education Cess Accounting
4191: lv_statement_id := '13z';
4192: p_codepath := jai_general_pkg.plot_codepath(17, p_codepath); /* 17 */
4193: -- SecondSet First Entry: cenvat Accounting
4194: fnd_file.put_line(FND_FILE.LOG, '
4196: P_TRANSACTION_ID => p_transaction_id,
4231: ||' Dr:'||ln_sh_edu_cess_debit||', Cr:'||ln_sh_edu_cess_credit||', SH Cess Accnt:'||ln_sh_exc_edu_cess_accnt);
4232: end if;
4233: -- SecondSet First Entry_2: SH Education Cess Accounting
4234: lv_statement_id := '13x';
4235: p_codepath := jai_general_pkg.plot_codepath(20, p_codepath);
4236: -- SecondSet First Entry: cenvat Accounting
4237: jai_rcv_accounting_pkg.process_transaction(
4238: P_TRANSACTION_ID => p_transaction_id,
4239: P_ACCT_TYPE => lv_accnt_type,
4273: ||' Debit:'||ln_balancing_debit||', Credit:'||ln_balancing_credit||', CenRcvbleAccntId:'||ln_cenvat_rcvble_accnt_id);
4274: end if;
4275:
4276: lv_statement_id := '13b';
4277: p_codepath := jai_general_pkg.plot_codepath(18, p_codepath); /* 18 */
4278: -- SecondSet Balancing Entry: Cenvat Receivable Accounting
4279: -- bug 5581319. Added by Lakshmi Gopalsami
4280: IF NVL(ln_balancing_debit,0) <> 0 OR NVL(ln_balancing_credit,0) <> 0 THEN
4281:
4319: ||' Dr:'||ln_bal_edu_cess_debit||', Cr:'||ln_bal_edu_cess_credit||', CessRcvbleAccnt:'||ln_cenvat_rcvble_accnt_id);
4320: end if;
4321:
4322: lv_statement_id := '13b';
4323: p_codepath := jai_general_pkg.plot_codepath(18, p_codepath); /* 18 */
4324: -- SecondSet Balancing Entry: Cenvat Receivable Accounting
4325: fnd_file.put_line(FND_FILE.LOG, '
4327: P_TRANSACTION_ID => p_transaction_id,
4363: ||' Dr:'||ln_sh_bal_edu_cess_debit||', Cr:'||ln_sh_bal_edu_cess_credit||', SH CessRcvbleAccnt:'||ln_cenvat_rcvble_accnt_id);
4364: end if;
4365:
4366: lv_statement_id := '13d';
4367: p_codepath := jai_general_pkg.plot_codepath(20, p_codepath); /* 18 */
4368: -- SecondSet Balancing Entry: Cenvat Receivable Accounting
4369: jai_rcv_accounting_pkg.process_transaction(
4370: P_TRANSACTION_ID => p_transaction_id,
4371: P_ACCT_TYPE => lv_accnt_type,
4405: <
4406: NULL;
4407:
4408: fnd_file.put_line(FND_FILE.LOG, '
4410: fnd_file.put_line(FND_FILE.LOG, '
4412: WHEN OTHERS THEN
4413: p_process_status := 'E';
4413: p_process_status := 'E';
4414: fnd_file.put_line(FND_FILE.LOG, '
4416: FND_FILE.put_line( FND_FILE.log, 'Error in '||p_process_message);
4417: p_codepath := jai_general_pkg.plot_codepath(999, p_codepath, null, 'END');
4418:
4419: END accounting_entries;
4420:
4421:
4434: lv_statement_id VARCHAR2(5);
4435: BEGIN
4436:
4437: lv_statement_id := '1';
4438: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.update_reg' , 'START'); /* 1 */
4439: if lb_rg_debug then
4440: /*dbms_output.put_line('^ Upd_Regs. Payid:'||p_payment_register_id
4441: ||', PayReg:'||p_payment_register
4442: ||', Qtyid:'||p_quantity_register_id
4450: end if;
4451:
4452: IF p_quantity_register IN ('RG23A', 'RG23C') THEN
4453: lv_statement_id := '2';
4454: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
4455: jai_cmn_rg_23ac_i_trxs_pkg.update_payment_details(
4456: p_register_id => p_quantity_register_id,
4457: p_register_id_part_ii => p_payment_register_id,
4458: p_charge_account_id => p_charge_account_id
4459: );
4460:
4461: ELSIF p_quantity_register = 'RG23D' THEN
4462: lv_statement_id := '3';
4463: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
4464: jai_cmn_rg_23d_trxs_pkg.update_payment_details(
4465: p_register_id => p_quantity_register_id,
4466: p_charge_account_id => p_charge_account_id
4467: );
4467: );
4468:
4469: ELSIF p_quantity_register = 'RG1' THEN
4470: lv_statement_id := '4';
4471: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
4472: UPDATE JAI_CMN_RG_I_TRXS
4473: SET
4474: register_id_part_ii = p_payment_register_id,
4475: charge_account_id = p_charge_account_id,
4481: END IF;
4482:
4483: IF p_payment_register IN ('RG23A', 'RG23C') THEN
4484: lv_statement_id := '5';
4485: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
4486: jai_cmn_rg_23ac_ii_pkg.update_payment_details(
4487: p_register_id => p_payment_register_id,
4488: p_register_id_part_i => p_quantity_register_id,
4489: p_charge_account_id => p_charge_account_id
4490: );
4491:
4492: ELSIF p_payment_register = 'PLA' THEN
4493: lv_statement_id := '6';
4494: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
4495: jai_cmn_rg_pla_trxs_pkg.update_payment_details(
4496: p_register_id => p_payment_register_id,
4497: p_charge_account_id => p_charge_account_id
4498: );
4497: p_charge_account_id => p_charge_account_id
4498: );
4499:
4500: ELSE
4501: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
4502: FND_FILE.put_line( FND_FILE.log, 'JA_IN_RECEIPT_MODVAT_RG_PKG.update_registers: No Payment Register Updated');
4503: END IF;
4504:
4505: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath, NULL, 'END'); /* 8 */
4501: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
4502: FND_FILE.put_line( FND_FILE.log, 'JA_IN_RECEIPT_MODVAT_RG_PKG.update_registers: No Payment Register Updated');
4503: END IF;
4504:
4505: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath, NULL, 'END'); /* 8 */
4506:
4507: EXCEPTION
4508: WHEN OTHERS THEN
4509: p_process_status := 'E';
4508: WHEN OTHERS THEN
4509: p_process_status := 'E';
4510: p_process_message := 'CENVAT_RG_PKG.update_registers->'||SQLERRM||', StmtId->'||lv_statement_id;
4511: FND_FILE.put_line( FND_FILE.log, 'Error in '||p_process_message);
4512: p_codepath := jai_general_pkg.plot_codepath(999, p_codepath, null, 'END');
4513:
4514: END update_registers;
4515:
4516: -- If this function returns a message, then it means there is some problem and processing should be stopped
4544: FND_FILE.put_line(FND_FILE.log,'^ Validate');
4545: end if;
4546:
4547: lv_statement_id := '1';
4548: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.validate', 'START'); /* 1 */
4549: OPEN c_trx(p_transaction_id);
4550: FETCH c_trx INTO r_trx;
4551: CLOSE c_trx;
4552:
4550: FETCH c_trx INTO r_trx;
4551: CLOSE c_trx;
4552:
4553: lv_statement_id := '2';
4554: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
4555: OPEN c_base_trx(p_transaction_id);
4556: FETCH c_base_trx INTO r_base_trx;
4557: CLOSE c_base_trx;
4558:
4568:
4569: IF p_validation_type = 'COMMON' THEN
4570:
4571: lv_statement_id := '5';
4572: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
4573: --upper added by narao.
4574: -- Vijay Shankar for Bug#4346453. RCV DFF Elim. Enh. IF r_base_trx.attr_cat = 'India RMA Receipt' AND upper(r_base_trx.rma_type) NOT IN ('PRODUCTION INPUT', 'GOODS RETURN') THEN
4575: /*
4576: ||Start of bug 5378630
4600: END IF;
4601:
4602: IF lv_transaction_type = 'RECEIVE' THEN
4603: lv_statement_id := '6';
4604: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
4605: IF r_trx.organization_type = 'M' THEN
4606: IF r_trx.item_cenvatable <> 'Y' THEN
4607: lv_validation_message := 'Item is not a Cenvatable one';
4608: END IF;
4621:
4622: ELSIF lv_transaction_type IN ('DELIVER', 'RETURN TO RECEIVING') THEN
4623:
4624: lv_statement_id := '7';
4625: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
4626: IF r_trx.organization_type = 'T' THEN
4627: lv_validation_message := 'No Cenvat/RG Entries are passed for '||lv_transaction_type;
4628: GOTO end_of_validation;
4629: END IF;
4628: GOTO end_of_validation;
4629: END IF;
4630:
4631: lv_statement_id := '7.1';
4632: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
4633: lv_include_cenvat_in_cost := jai_rcv_deliver_rtr_pkg.include_cenvat_in_costing(
4634: p_transaction_id => p_transaction_id,
4635: p_process_message => p_process_message,
4636: p_process_status => p_process_status,
4649:
4650: ELSIF lv_transaction_type = 'RETURN TO VENDOR' THEN
4651:
4652: lv_statement_id := '8';
4653: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
4654: IF r_trx.organization_type = 'T' THEN
4655: IF r_trx.item_trading_flag <> 'Y' THEN
4656: lv_validation_message := 'Item is not a Tradable one';
4657: --ELSIF r_trx.excise_in_trading <> 'Y' THEN
4675:
4676: <
4677:
4678: lv_statement_id := '9';
4679: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8 */
4680: IF lv_validation_message IS NOT NULL THEN
4681: p_process_status := 'X';
4682: p_process_message := lv_validation_message;
4683: END IF;
4681: p_process_status := 'X';
4682: p_process_message := lv_validation_message;
4683: END IF;
4684:
4685: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath, NULL, 'END'); /* 9 */
4686:
4687: EXCEPTION
4688: WHEN OTHERS THEN
4689: p_process_status := 'E';
4688: WHEN OTHERS THEN
4689: p_process_status := 'E';
4690: p_process_message := 'CENVAT_RG_PKG.validate_transaction->'||SQLERRM||', StmtId->'||lv_statement_id;
4691: FND_FILE.put_line( FND_FILE.log, 'Error in '||p_process_message);
4692: p_codepath := jai_general_pkg.plot_codepath(999, p_codepath, null, 'END');
4693:
4694: END validate_transaction;
4695:
4696: -- This procedure assumes that this is called only at the time of RTV
4718: FND_FILE.put_line(FND_FILE.log,'^ Gen_Exc_inv');
4719: end if;
4720:
4721: lv_statement_id := '1';
4722: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.generate_exc_inv', 'START'); /* 1 */
4723: OPEN c_trx(p_transaction_id);
4724: FETCH c_trx INTO r_trx;
4725: CLOSE c_trx;
4726:
4725: CLOSE c_trx;
4726:
4727: IF r_trx.transaction_type = 'CORRECT' THEN
4728: lv_statement_id := '2';
4729: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
4730:
4731: OPEN c_rtv_excise_inv_no(r_trx.parent_transaction_id);
4732: FETCH c_rtv_excise_inv_no INTO p_excise_invoice_no, p_excise_invoice_date;
4733: CLOSE c_rtv_excise_inv_no;
4732: FETCH c_rtv_excise_inv_no INTO p_excise_invoice_no, p_excise_invoice_date;
4733: CLOSE c_rtv_excise_inv_no;
4734: ELSE
4735: lv_statement_id := '3';
4736: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
4737: jai_cmn_setup_pkg.generate_excise_invoice_no(
4738: p_organization_id => p_organization_id,
4739: p_location_id => p_location_id,
4740: p_called_from => 'P', -- Required for excise generation during RTV
4738: p_organization_id => p_organization_id,
4739: p_location_id => p_location_id,
4740: p_called_from => 'P', -- Required for excise generation during RTV
4741: p_order_invoice_type_id => NULL,
4742: p_fin_year => jai_general_pkg.get_fin_year(p_organization_id),
4743: p_excise_inv_no => p_excise_invoice_no,
4744: p_errbuf => p_errbuf
4745: );
4746:
4748: p_excise_invoice_date := trunc(SYSDATE);
4749: END IF;
4750: END IF;
4751:
4752: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath, NULL, 'END'); /* 4 */
4753:
4754: EXCEPTION
4755: WHEN OTHERS THEN
4756: p_errbuf := 'CENVAT_RG_PKG.generate_excise_invoice->'||SQLERRM||', StmtId->'||lv_statement_id;
4754: EXCEPTION
4755: WHEN OTHERS THEN
4756: p_errbuf := 'CENVAT_RG_PKG.generate_excise_invoice->'||SQLERRM||', StmtId->'||lv_statement_id;
4757: FND_FILE.put_line( FND_FILE.log, 'Error in '||p_errbuf);
4758: p_codepath := jai_general_pkg.plot_codepath(999, p_errbuf, null, 'END');
4759: RAISE;
4760:
4761: END generate_excise_invoice;
4762:
4786: --ln_ancestor_receive_trxn_id :=
4787: -- jai_rcv_trx_processing_pkg.get_ancestor_id(p_transaction_id, p_shipment_line_id, 'RECEIVE');
4788:
4789: -- commented as pert of review and modified p_shipment_line_id -> p_transaction_id
4790: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.get_receive_claimed_ptg', 'START'); /* 1 */
4791: OPEN c_cenvat_claimed_ptg(p_shipment_line_id);
4792: FETCH c_cenvat_claimed_ptg INTO ln_cenvat_claimed_ptg;
4793: CLOSE c_cenvat_claimed_ptg;
4794:
4791: OPEN c_cenvat_claimed_ptg(p_shipment_line_id);
4792: FETCH c_cenvat_claimed_ptg INTO ln_cenvat_claimed_ptg;
4793: CLOSE c_cenvat_claimed_ptg;
4794:
4795: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath, NULL, 'END'); /* 2 */
4796:
4797: RETURN ln_cenvat_claimed_ptg;
4798: EXCEPTION
4799: WHEN OTHERS THEN
4824: If p_breakup_type is RG23D, then total tax amount should be added to excise amount instead of taking
4825: mod_cr_percentage into consideration
4826: */
4827:
4828: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.tax_breakup','START'); /* 1 */
4829: if lb_rg_debug then
4830: FND_FILE.put_line(FND_FILE.log,'^ tax_breakup');
4831: end if;
4832:
4845: WHERE rtl.shipment_line_id = p_shipment_line_id
4846: AND jtc.tax_id = rtl.tax_id)
4847: LOOP
4848:
4849: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
4850:
4851:
4852: IF tax_rec.currency <> jai_rcv_trx_processing_pkg.gv_func_curr THEN
4853: ln_curr_conv := NVL(p_curr_conv_rate, 1);
4855: ln_curr_conv := 1;
4856: END IF;
4857:
4858: IF p_breakup_type = 'RG23D' THEN -- trading case
4859: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
4860: IF upper(tax_rec.tax_type) = 'EXCISE' THEN
4861: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
4862: pr_tax.basic_excise := pr_tax.basic_excise + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4863:
4857:
4858: IF p_breakup_type = 'RG23D' THEN -- trading case
4859: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
4860: IF upper(tax_rec.tax_type) = 'EXCISE' THEN
4861: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
4862: pr_tax.basic_excise := pr_tax.basic_excise + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4863:
4864: ELSIF upper(tax_rec.tax_type) = 'ADDL. EXCISE' THEN
4865: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
4861: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
4862: pr_tax.basic_excise := pr_tax.basic_excise + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4863:
4864: ELSIF upper(tax_rec.tax_type) = 'ADDL. EXCISE' THEN
4865: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
4866: pr_tax.addl_excise := pr_tax.addl_excise + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4867:
4868: ELSIF upper(tax_rec.tax_type) = 'OTHER EXCISE' THEN
4869: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
4865: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
4866: pr_tax.addl_excise := pr_tax.addl_excise + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4867:
4868: ELSIF upper(tax_rec.tax_type) = 'OTHER EXCISE' THEN
4869: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
4870: pr_tax.other_excise := pr_tax.other_excise + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4871:
4872: ELSIF tax_rec.tax_type = 'CVD' THEN
4873: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
4869: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
4870: pr_tax.other_excise := pr_tax.other_excise + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4871:
4872: ELSIF tax_rec.tax_type = 'CVD' THEN
4873: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
4874: pr_tax.cvd := pr_tax.cvd + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4875:
4876: -- Start, Vijay Shankar for Bug#3940588
4877: ELSIF tax_rec.tax_type = jai_constants.tax_type_exc_edu_cess THEN
4890:
4891: --end bug #5989740*/
4892:
4893: ELSIF tax_rec.tax_type = jai_constants.tax_type_add_cvd THEN
4894: p_codepath := jai_general_pkg.plot_codepath(7.1, p_codepath); /* 7.1 */
4895: pr_tax.addl_cvd := pr_tax.addl_cvd + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4896: ELSE
4897: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8 */
4898: pr_tax.non_cenvat := pr_tax.non_cenvat + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4893: ELSIF tax_rec.tax_type = jai_constants.tax_type_add_cvd THEN
4894: p_codepath := jai_general_pkg.plot_codepath(7.1, p_codepath); /* 7.1 */
4895: pr_tax.addl_cvd := pr_tax.addl_cvd + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4896: ELSE
4897: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8 */
4898: pr_tax.non_cenvat := pr_tax.non_cenvat + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4899: END IF;
4900:
4901: ELSE -- manufacturing case
4898: pr_tax.non_cenvat := pr_tax.non_cenvat + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4899: END IF;
4900:
4901: ELSE -- manufacturing case
4902: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath); /* 9 */
4903:
4904: IF tax_rec.modvat_flag = 'Y' AND
4905: upper(tax_rec.tax_type) IN ('EXCISE', 'ADDL. EXCISE',
4906: 'OTHER EXCISE', 'CVD',
4913: jai_constants.tax_type_sh_cvd_edu_cess,
4914: jai_constants.tax_type_sh_exc_edu_cess)
4915: THEN
4916:
4917: p_codepath := jai_general_pkg.plot_codepath(10, p_codepath); /* 10 */
4918: IF upper(tax_rec.tax_type) = 'EXCISE' THEN
4919: p_codepath := jai_general_pkg.plot_codepath(11, p_codepath); /* 11 */
4920: pr_tax.basic_excise := pr_tax.basic_excise
4921: + round(tax_rec.tax_amount * (tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4915: THEN
4916:
4917: p_codepath := jai_general_pkg.plot_codepath(10, p_codepath); /* 10 */
4918: IF upper(tax_rec.tax_type) = 'EXCISE' THEN
4919: p_codepath := jai_general_pkg.plot_codepath(11, p_codepath); /* 11 */
4920: pr_tax.basic_excise := pr_tax.basic_excise
4921: + round(tax_rec.tax_amount * (tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4922: pr_tax.non_cenvat := pr_tax.non_cenvat
4923: + round(tax_rec.tax_amount * (1 - tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4922: pr_tax.non_cenvat := pr_tax.non_cenvat
4923: + round(tax_rec.tax_amount * (1 - tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4924:
4925: ELSIF upper(tax_rec.tax_type) = 'ADDL. EXCISE' THEN
4926: p_codepath := jai_general_pkg.plot_codepath(12, p_codepath); /* 12 */
4927: pr_tax.addl_excise := pr_tax.addl_excise
4928: + round(tax_rec.tax_amount * (tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4929: pr_tax.non_cenvat := pr_tax.non_cenvat
4930: + round(tax_rec.tax_amount * (1 - tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4929: pr_tax.non_cenvat := pr_tax.non_cenvat
4930: + round(tax_rec.tax_amount * (1 - tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4931:
4932: ELSIF upper(tax_rec.tax_type) = 'OTHER EXCISE' THEN
4933: p_codepath := jai_general_pkg.plot_codepath(13, p_codepath); /* 13 */
4934: pr_tax.other_excise := pr_tax.other_excise
4935: + round(tax_rec.tax_amount * (tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4936: pr_tax.non_cenvat := pr_tax.non_cenvat
4937: + round(tax_rec.tax_amount * (1 - tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4936: pr_tax.non_cenvat := pr_tax.non_cenvat
4937: + round(tax_rec.tax_amount * (1 - tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4938:
4939: ELSIF tax_rec.tax_type IN ('CVD') THEN
4940: p_codepath := jai_general_pkg.plot_codepath(14, p_codepath); /* 14 */
4941: pr_tax.cvd := pr_tax.cvd
4942: + round(tax_rec.tax_amount * (tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4943: pr_tax.non_cenvat := pr_tax.non_cenvat
4944: + round(tax_rec.tax_amount * (1 - tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4944: + round(tax_rec.tax_amount * (1 - tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4945: -- Date 04/06/2007 by sacsethi for bug 6109941
4946: -- Code review from bug 5228046
4947: ELSIF tax_rec.tax_type IN ( jai_constants.tax_type_add_cvd) THEN
4948: p_codepath := jai_general_pkg.plot_codepath(14, p_codepath); /* 14 */
4949: pr_tax.addl_cvd := pr_tax.addl_cvd
4950: + round(tax_rec.tax_amount * (tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4951: pr_tax.non_cenvat := pr_tax.non_cenvat
4952: + round(tax_rec.tax_amount * (1 - tax_rec.mod_cr_percentage/100) * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4981: --end ,for bug #5989740
4982:
4983:
4984: ELSE
4985: p_codepath := jai_general_pkg.plot_codepath(15, p_codepath); /* 15 */
4986: ln_mod_problem_amt := ln_mod_problem_amt
4987: + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4988: END IF;
4989:
4987: + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4988: END IF;
4989:
4990: ELSIF tax_rec.modvat_flag = 'N' and tax_rec.tax_type NOT IN ('TDS', 'Modvat Recovery') THEN
4991: p_codepath := jai_general_pkg.plot_codepath(16, p_codepath); /* 16 */
4992: pr_tax.non_cenvat := pr_tax.non_cenvat
4993: + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4994:
4995: ELSE
4992: pr_tax.non_cenvat := pr_tax.non_cenvat
4993: + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4994:
4995: ELSE
4996: p_codepath := jai_general_pkg.plot_codepath(17, p_codepath); /* 17 */
4997: ln_nonmod_problem_amt := ln_nonmod_problem_amt
4998: + round(tax_rec.tax_amount * ln_curr_conv * ln_apportion_factor, tax_rec.rnd);
4999: END IF;
5000:
5010: FND_FILE.put_line(FND_FILE.log, '$tax_breakup. Basic:'||pr_tax.basic_excise||', Addl:'||pr_tax.addl_excise
5011: ||', Other:'||pr_tax.other_excise||', cvd:'||pr_tax.cvd||', Addl. CVD:'|| pr_tax.addl_cvd||', exc_ces:'||pr_tax.excise_edu_cess||', cvd_ces:'||pr_tax.cvd_edu_cess );
5012: end if;
5013:
5014: p_codepath := jai_general_pkg.plot_codepath(18, p_codepath, NULL, 'END'); /* 18 */
5015:
5016: EXCEPTION
5017: WHEN OTHERS THEN
5018: pr_tax := null;
5078: lv_object_name varchar2(200) := 'jai_rcv_excise_processing_pkg.dervice_cgin_scenario';
5079:
5080: BEGIN
5081:
5082: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'cenvat_rg.cgin_scenario' , 'START'); /* 1 */
5083: if lb_rg_debug then
5084: -- dbms_output.put_line('^ Drv_CGIN_Scnrio');
5085: FND_FILE.put_line(FND_FILE.log,'^ Drv_CGIN_Scnrio');
5086: end if;
5128: 3) 'REGULAR-FULL'
5129: 4) 'REGULAR-FULL + PARENT-REGULAR-HALF'
5130: */
5131:
5132: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /* 2 */
5133: OPEN c_trx(p_transaction_id);
5134: FETCH c_trx INTO r_trx;
5135: CLOSE c_trx;
5136:
5134: FETCH c_trx INTO r_trx;
5135: CLOSE c_trx;
5136:
5137: IF r_trx.cenvat_claimed_ptg = 100 THEN
5138: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath); /* 3 */
5139: lv_message := 'Transaction is already full claimed';
5140: GOTO end_of_call;
5141: END IF;
5142:
5140: GOTO end_of_call;
5141: END IF;
5142:
5143: ln_receive_claimed_ptg := get_receive_claimed_ptg(p_transaction_id, r_trx.shipment_line_id, p_codepath);
5144: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
5145:
5146: IF r_trx.transaction_type = 'CORRECT' THEN
5147: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
5148: lv_transaction_type := r_trx.parent_transaction_type;
5143: ln_receive_claimed_ptg := get_receive_claimed_ptg(p_transaction_id, r_trx.shipment_line_id, p_codepath);
5144: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath); /* 4 */
5145:
5146: IF r_trx.transaction_type = 'CORRECT' THEN
5147: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
5148: lv_transaction_type := r_trx.parent_transaction_type;
5149: ELSE
5150: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
5151: lv_transaction_type := r_trx.transaction_type;
5146: IF r_trx.transaction_type = 'CORRECT' THEN
5147: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
5148: lv_transaction_type := r_trx.parent_transaction_type;
5149: ELSE
5150: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
5151: lv_transaction_type := r_trx.transaction_type;
5152: END IF;
5153:
5154: --following if block only for RECEIVE transactions
5151: lv_transaction_type := r_trx.transaction_type;
5152: END IF;
5153:
5154: --following if block only for RECEIVE transactions
5155: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
5156: IF r_trx.transaction_type = 'RECEIVE' THEN --, 'DELIVER', 'RETURN TO RECEIVING') THEN
5157: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8 */
5158:
5159: IF r_trx.cenvat_claimed_ptg = 0 THEN
5153:
5154: --following if block only for RECEIVE transactions
5155: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7 */
5156: IF r_trx.transaction_type = 'RECEIVE' THEN --, 'DELIVER', 'RETURN TO RECEIVING') THEN
5157: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8 */
5158:
5159: IF r_trx.cenvat_claimed_ptg = 0 THEN
5160: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath); /* 9 */
5161: p_cgin_code := 'REGULAR-FULL + REVERSAL-HALF';
5156: IF r_trx.transaction_type = 'RECEIVE' THEN --, 'DELIVER', 'RETURN TO RECEIVING') THEN
5157: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8 */
5158:
5159: IF r_trx.cenvat_claimed_ptg = 0 THEN
5160: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath); /* 9 */
5161: p_cgin_code := 'REGULAR-FULL + REVERSAL-HALF';
5162:
5163: -- RECEIVE is 50% claimed case
5164: ELSIF r_trx.cenvat_claimed_ptg < 100 THEN
5161: p_cgin_code := 'REGULAR-FULL + REVERSAL-HALF';
5162:
5163: -- RECEIVE is 50% claimed case
5164: ELSIF r_trx.cenvat_claimed_ptg < 100 THEN
5165: p_codepath := jai_general_pkg.plot_codepath(10, p_codepath); /* 10 */
5166: p_cgin_code := 'REGULAR-HALF';
5167:
5168: -- RECEIVE is 100% claimed case
5169: ELSIF r_trx.cenvat_claimed_ptg = 100 THEN
5166: p_cgin_code := 'REGULAR-HALF';
5167:
5168: -- RECEIVE is 100% claimed case
5169: ELSIF r_trx.cenvat_claimed_ptg = 100 THEN
5170: p_codepath := jai_general_pkg.plot_codepath(11, p_codepath); /* 11 */
5171: lv_message := 'Transaction is Fully Claimed';
5172: GOTO end_of_call;
5173: END IF;
5174:
5173: END IF;
5174:
5175: -- this elsif for DELIVER, RETURN TO RECEIVING, CORRECT of RECEIVE, DELIVER and RETURN TO RECEIVING
5176: ELSIF lv_transaction_type IN ('RECEIVE', 'DELIVER', 'RETURN TO RECEIVING') THEN
5177: p_codepath := jai_general_pkg.plot_codepath(12, p_codepath); /* 12 */
5178:
5179: IF ln_receive_claimed_ptg = 0 THEN
5180:
5181: p_codepath := jai_general_pkg.plot_codepath(13, p_codepath); /* 13 */
5177: p_codepath := jai_general_pkg.plot_codepath(12, p_codepath); /* 12 */
5178:
5179: IF ln_receive_claimed_ptg = 0 THEN
5180:
5181: p_codepath := jai_general_pkg.plot_codepath(13, p_codepath); /* 13 */
5182: lv_message := 'Parent Receive Transaction is not Claimed';
5183: GOTO end_of_call;
5184:
5185: -- RECEIVE is 50% claimed case
5184:
5185: -- RECEIVE is 50% claimed case
5186: ELSIF ln_receive_claimed_ptg < 100 THEN
5187:
5188: p_codepath := jai_general_pkg.plot_codepath(14, p_codepath); /* 14 */
5189: IF r_trx.cenvat_claimed_ptg = 0 THEN
5190: p_codepath := jai_general_pkg.plot_codepath(15, p_codepath); /* 15 */
5191: p_cgin_code := 'REGULAR-FULL + REVERSAL-HALF';
5192: ELSIF r_trx.cenvat_claimed_ptg = 50 THEN
5186: ELSIF ln_receive_claimed_ptg < 100 THEN
5187:
5188: p_codepath := jai_general_pkg.plot_codepath(14, p_codepath); /* 14 */
5189: IF r_trx.cenvat_claimed_ptg = 0 THEN
5190: p_codepath := jai_general_pkg.plot_codepath(15, p_codepath); /* 15 */
5191: p_cgin_code := 'REGULAR-FULL + REVERSAL-HALF';
5192: ELSIF r_trx.cenvat_claimed_ptg = 50 THEN
5193: p_codepath := jai_general_pkg.plot_codepath(16, p_codepath); /* 16 */
5194: lv_message := 'Second Claim did not happen for Parent transaction';
5189: IF r_trx.cenvat_claimed_ptg = 0 THEN
5190: p_codepath := jai_general_pkg.plot_codepath(15, p_codepath); /* 15 */
5191: p_cgin_code := 'REGULAR-FULL + REVERSAL-HALF';
5192: ELSIF r_trx.cenvat_claimed_ptg = 50 THEN
5193: p_codepath := jai_general_pkg.plot_codepath(16, p_codepath); /* 16 */
5194: lv_message := 'Second Claim did not happen for Parent transaction';
5195: GOTO end_of_call;
5196: END IF;
5197:
5196: END IF;
5197:
5198: -- RECEIVE is 100% claimed case
5199: ELSIF ln_receive_claimed_ptg = 100 THEN
5200: p_codepath := jai_general_pkg.plot_codepath(17, p_codepath); /* 17 */
5201: IF r_trx.cenvat_claimed_ptg = 0 THEN
5202: p_codepath := jai_general_pkg.plot_codepath(18, p_codepath); /* 18 */
5203: p_cgin_code := 'REGULAR-FULL';
5204: ELSIF r_trx.cenvat_claimed_ptg < 100 THEN
5198: -- RECEIVE is 100% claimed case
5199: ELSIF ln_receive_claimed_ptg = 100 THEN
5200: p_codepath := jai_general_pkg.plot_codepath(17, p_codepath); /* 17 */
5201: IF r_trx.cenvat_claimed_ptg = 0 THEN
5202: p_codepath := jai_general_pkg.plot_codepath(18, p_codepath); /* 18 */
5203: p_cgin_code := 'REGULAR-FULL';
5204: ELSIF r_trx.cenvat_claimed_ptg < 100 THEN
5205: p_codepath := jai_general_pkg.plot_codepath(19, p_codepath); /* 19 */
5206: p_cgin_code := 'REGULAR-HALF';
5201: IF r_trx.cenvat_claimed_ptg = 0 THEN
5202: p_codepath := jai_general_pkg.plot_codepath(18, p_codepath); /* 18 */
5203: p_cgin_code := 'REGULAR-FULL';
5204: ELSIF r_trx.cenvat_claimed_ptg < 100 THEN
5205: p_codepath := jai_general_pkg.plot_codepath(19, p_codepath); /* 19 */
5206: p_cgin_code := 'REGULAR-HALF';
5207: END IF;
5208: END IF;
5209:
5208: END IF;
5209:
5210: ELSIF lv_transaction_type = 'RETURN TO VENDOR' THEN
5211:
5212: p_codepath := jai_general_pkg.plot_codepath(20, p_codepath); /* 20 */
5213: -- Need to implement this. Very Complicated One
5214: IF ln_receive_claimed_ptg = 0 THEN
5215: p_codepath := jai_general_pkg.plot_codepath(21, p_codepath); /* 21 */
5216: lv_message := 'Parent Receive Transaction is not Claimed';
5211:
5212: p_codepath := jai_general_pkg.plot_codepath(20, p_codepath); /* 20 */
5213: -- Need to implement this. Very Complicated One
5214: IF ln_receive_claimed_ptg = 0 THEN
5215: p_codepath := jai_general_pkg.plot_codepath(21, p_codepath); /* 21 */
5216: lv_message := 'Parent Receive Transaction is not Claimed';
5217: GOTO end_of_call;
5218:
5219: -- RECEIVE is 50% claimed case
5217: GOTO end_of_call;
5218:
5219: -- RECEIVE is 50% claimed case
5220: ELSIF ln_receive_claimed_ptg < 100 THEN
5221: p_codepath := jai_general_pkg.plot_codepath(22, p_codepath); /* 22 */
5222: -- following modified by Vijay Shankar for Bug#3940588
5223: p_cgin_code := 'REGULAR-FULL + PARENT-REGULAR-HALF';/*uncommented by vkaranam fro bug #4704957*/
5224: --p_cgin_code := 'REGULAR-FULL + REVERSAL-HALF';/*commented by vkaranam fro bug #4704957*/
5225:
5224: --p_cgin_code := 'REGULAR-FULL + REVERSAL-HALF';/*commented by vkaranam fro bug #4704957*/
5225:
5226: -- RECEIVE is 100% claimed case
5227: ELSIF ln_receive_claimed_ptg = 100 THEN
5228: p_codepath := jai_general_pkg.plot_codepath(23, p_codepath); /* 23 */
5229: p_cgin_code := 'REGULAR-FULL';
5230:
5231: END IF;
5232: p_codepath := jai_general_pkg.plot_codepath(24, p_codepath); /* 24 */
5228: p_codepath := jai_general_pkg.plot_codepath(23, p_codepath); /* 23 */
5229: p_cgin_code := 'REGULAR-FULL';
5230:
5231: END IF;
5232: p_codepath := jai_general_pkg.plot_codepath(24, p_codepath); /* 24 */
5233:
5234: END IF;
5235:
5236: <
5233:
5234: END IF;
5235:
5236: <
5237: p_codepath := jai_general_pkg.plot_codepath(25, p_codepath); /* 25 */
5238:
5239: IF lv_message IS NOT NULL THEN
5240: p_process_status := 'E';
5241: p_process_message := lv_message;
5240: p_process_status := 'E';
5241: p_process_message := lv_message;
5242: RETURN;
5243: END IF;
5244: p_codepath := jai_general_pkg.plot_codepath(26, p_codepath, NULL, 'END'); /* 26 */
5245: EXCEPTION
5246: WHEN OTHERS THEN
5247: p_cgin_code := null;
5248: FND_MESSAGE.SET_NAME ('JA','JAI_EXCEPTION_OCCURED');
5287:
5288: BEGIN
5289:
5290: FND_FILE.put_line( fnd_file.log, '^derive_duty_registers');
5291: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'CENVAT_RG_PKG.DRV_DUTY_REG' , 'START');
5292:
5293: OPEN c_orgn_info(p_organization_id, p_location_id);
5294: FETCH c_orgn_info INTO r_orgn_info;
5295: CLOSE c_orgn_info;
5298: lv_pref1_register := jai_constants.register_type_pla;
5299: lv_cess_pref1_register := jai_constants.reg_pla;
5300:
5301: IF p_item_class IN ('CGIN','CGEX') THEN
5302: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath);
5303: lv_pref2_register := jai_constants.register_type_c;
5304: lv_cess_pref2_register := jai_constants.reg_rg23c;
5305: ELSE
5306: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath);
5302: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath);
5303: lv_pref2_register := jai_constants.register_type_c;
5304: lv_cess_pref2_register := jai_constants.reg_rg23c;
5305: ELSE
5306: p_codepath := jai_general_pkg.plot_codepath(3, p_codepath);
5307: lv_pref2_register := jai_constants.register_type_a;
5308: lv_cess_pref2_register := jai_constants.reg_rg23a;
5309: END IF;
5310:
5310:
5311: ELSE -- IF r_orgn_info.pref_rg23a = 1 THEN
5312:
5313: IF p_item_class IN ('CGIN','CGEX') THEN
5314: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath);
5315: lv_pref1_register := jai_constants.register_type_c;
5316: lv_cess_pref1_register := jai_constants.reg_rg23c;
5317: ELSE
5318: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath);
5314: p_codepath := jai_general_pkg.plot_codepath(4, p_codepath);
5315: lv_pref1_register := jai_constants.register_type_c;
5316: lv_cess_pref1_register := jai_constants.reg_rg23c;
5317: ELSE
5318: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath);
5319: lv_pref1_register := jai_constants.register_type_a;
5320: lv_cess_pref1_register := jai_constants.reg_rg23a;
5321: END IF;
5322:
5338:
5339: IF lv_pref1_register = jai_constants.register_type_pla
5340: AND r_orgn_info.allow_negative_pla = jai_constants.yes
5341: THEN
5342: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath);
5343: p_cenvat_register_type := jai_constants.register_type_pla;
5344: GOTO end_of_procedure;
5345: END IF;
5346:
5344: GOTO end_of_procedure;
5345: END IF;
5346:
5347: /* BALANCES CHECKING */
5348: p_codepath := jai_general_pkg.plot_codepath(7, p_codepath);
5349: check_cenvat_balances(
5350: p_organization_id => p_organization_id,
5351: p_location_id => p_location_id,
5352: p_transaction_amount => pr_tax.basic_excise +
5359: p_process_message => lv_process_message
5360: );
5361:
5362: IF lv_process_flag = jai_constants.unexpected_error THEN
5363: p_codepath := jai_general_pkg.plot_codepath(8, p_codepath);
5364: p_process_flag := 'E';
5365: p_process_message := lv_process_message;
5366: GOTO end_of_procedure;
5367:
5365: p_process_message := lv_process_message;
5366: GOTO end_of_procedure;
5367:
5368: ELSIF lv_process_flag = jai_constants.expected_error THEN
5369: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath);
5370:
5371: ELSIF lv_process_flag = jai_constants.successful THEN
5372:
5373: p_codepath := jai_general_pkg.plot_codepath(11, p_codepath);
5369: p_codepath := jai_general_pkg.plot_codepath(9, p_codepath);
5370:
5371: ELSIF lv_process_flag = jai_constants.successful THEN
5372:
5373: p_codepath := jai_general_pkg.plot_codepath(11, p_codepath);
5374: IF pr_tax.excise_edu_cess + pr_tax.cvd_edu_cess <> 0 THEN /* This if condition and its else added by ssumaith - bug# 4187859*/
5375: jai_cmn_rg_others_pkg.check_balances(
5376: p_organization_id => p_organization_id ,
5377: p_location_id => p_location_id,
5381: p_process_message => lv_process_message
5382: );
5383:
5384: IF lv_process_flag = jai_constants.unexpected_error THEN
5385: p_codepath := jai_general_pkg.plot_codepath(12, p_codepath);
5386: p_process_flag := 'E';
5387: p_process_message := lv_process_message;
5388: GOTO end_of_procedure;
5389:
5387: p_process_message := lv_process_message;
5388: GOTO end_of_procedure;
5389:
5390: ELSIF lv_process_flag = jai_constants.expected_error THEN
5391: p_codepath := jai_general_pkg.plot_codepath(13, p_codepath);
5392: ELSIF lv_process_flag = jai_constants.successful THEN
5393: p_codepath := jai_general_pkg.plot_codepath(14, p_codepath);
5394: p_cenvat_register_type := lv_pref1_register;
5395: GOTO end_of_procedure;
5389:
5390: ELSIF lv_process_flag = jai_constants.expected_error THEN
5391: p_codepath := jai_general_pkg.plot_codepath(13, p_codepath);
5392: ELSIF lv_process_flag = jai_constants.successful THEN
5393: p_codepath := jai_general_pkg.plot_codepath(14, p_codepath);
5394: p_cenvat_register_type := lv_pref1_register;
5395: GOTO end_of_procedure;
5396: END IF;
5397: /*added the following by vkaranam for budget 07 impact - bug#5989740*/
5407: p_process_message => lv_process_message
5408: );
5409:
5410: IF lv_process_flag = jai_constants.unexpected_error THEN
5411: p_codepath := jai_general_pkg.plot_codepath(14.1, p_codepath);
5412: p_process_flag := 'E';
5413: p_process_message := lv_process_message;
5414: GOTO end_of_procedure;
5415:
5413: p_process_message := lv_process_message;
5414: GOTO end_of_procedure;
5415:
5416: ELSIF lv_process_flag = jai_constants.expected_error THEN
5417: p_codepath := jai_general_pkg.plot_codepath(14.2, p_codepath);
5418: ELSIF lv_process_flag = jai_constants.successful THEN
5419: p_codepath := jai_general_pkg.plot_codepath(14.3, p_codepath);
5420: p_cenvat_register_type := lv_pref1_register;
5421: GOTO end_of_procedure;
5415:
5416: ELSIF lv_process_flag = jai_constants.expected_error THEN
5417: p_codepath := jai_general_pkg.plot_codepath(14.2, p_codepath);
5418: ELSIF lv_process_flag = jai_constants.successful THEN
5419: p_codepath := jai_general_pkg.plot_codepath(14.3, p_codepath);
5420: p_cenvat_register_type := lv_pref1_register;
5421: GOTO end_of_procedure;
5422: END IF;
5423: --end bug #5989740
5431:
5432: IF lv_pref2_register = jai_constants.register_type_pla
5433: AND r_orgn_info.allow_negative_pla = jai_constants.yes
5434: THEN
5435: p_codepath := jai_general_pkg.plot_codepath(15, p_codepath);
5436: p_cenvat_register_type := lv_pref2_register;
5437: GOTO end_of_procedure;
5438: END IF;
5439:
5436: p_cenvat_register_type := lv_pref2_register;
5437: GOTO end_of_procedure;
5438: END IF;
5439:
5440: p_codepath := jai_general_pkg.plot_codepath(16, p_codepath);
5441: check_cenvat_balances(
5442: p_organization_id => p_organization_id,
5443: p_location_id => p_location_id,
5444: p_transaction_amount => pr_tax.basic_excise +
5451: p_process_message => lv_process_message
5452: );
5453:
5454: IF lv_process_flag = jai_constants.unexpected_error THEN
5455: p_codepath := jai_general_pkg.plot_codepath(17, p_codepath);
5456: p_process_flag := 'E';
5457: p_process_message := lv_process_message;
5458: GOTO end_of_procedure;
5459:
5457: p_process_message := lv_process_message;
5458: GOTO end_of_procedure;
5459:
5460: ELSIF lv_process_flag = jai_constants.expected_error THEN
5461: p_codepath := jai_general_pkg.plot_codepath(18, p_codepath);
5462: p_process_flag := 'E';
5463: p_process_message := 'Sufficient Balances are not available in both '||lv_pref1_register||' and '||lv_pref2_register||' registers';
5464: GOTO end_of_procedure;
5465:
5464: GOTO end_of_procedure;
5465:
5466: ELSIF lv_process_flag = jai_constants.successful THEN
5467:
5468: p_codepath := jai_general_pkg.plot_codepath(19, p_codepath);
5469:
5470: IF pr_tax.excise_edu_cess + pr_tax.cvd_edu_cess <> 0 THEN /* This if condition and its else added by ssumaith - bug# 4187859*/
5471: jai_cmn_rg_others_pkg.check_balances(
5472: p_organization_id => p_organization_id ,
5476: p_process_flag => lv_process_flag,
5477: p_process_message => lv_process_message
5478: );
5479: IF lv_process_flag = jai_constants.unexpected_error THEN
5480: p_codepath := jai_general_pkg.plot_codepath(20, p_codepath);
5481: p_process_flag := 'E';
5482: p_process_message := lv_process_message;
5483: GOTO end_of_procedure;
5484:
5482: p_process_message := lv_process_message;
5483: GOTO end_of_procedure;
5484:
5485: ELSIF lv_process_flag = jai_constants.expected_error THEN
5486: p_codepath := jai_general_pkg.plot_codepath(21, p_codepath);
5487: p_process_flag := 'E';
5488: p_process_message := 'Sufficient Balances are not available in both '||lv_pref1_register||' and '||lv_pref2_register||' registers';
5489: GOTO end_of_procedure;
5490:
5488: p_process_message := 'Sufficient Balances are not available in both '||lv_pref1_register||' and '||lv_pref2_register||' registers';
5489: GOTO end_of_procedure;
5490:
5491: ELSIF lv_process_flag = jai_constants.successful THEN
5492: p_codepath := jai_general_pkg.plot_codepath(22, p_codepath);
5493: p_cenvat_register_type := lv_pref2_register;
5494: GOTO end_of_procedure;
5495: END IF;
5496: /*added the following by vkaranam for budget 07 impact - bug#5989740*/
5506: p_process_message => lv_process_message
5507: );
5508:
5509: IF lv_process_flag = jai_constants.unexpected_error THEN
5510: p_codepath := jai_general_pkg.plot_codepath(22.1, p_codepath);
5511: p_process_flag := 'E';
5512: p_process_message := lv_process_message;
5513: GOTO end_of_procedure;
5514:
5512: p_process_message := lv_process_message;
5513: GOTO end_of_procedure;
5514:
5515: ELSIF lv_process_flag = jai_constants.expected_error THEN
5516: p_codepath := jai_general_pkg.plot_codepath(22.2, p_codepath);
5517: p_process_flag := 'E';
5518: p_process_message := 'Sufficient Balances are not available in both '||lv_pref1_register||' and '||lv_pref2_register||' registers';
5519: GOTO end_of_procedure;
5520:
5518: p_process_message := 'Sufficient Balances are not available in both '||lv_pref1_register||' and '||lv_pref2_register||' registers';
5519: GOTO end_of_procedure;
5520:
5521: ELSIF lv_process_flag = jai_constants.successful THEN
5522: p_codepath := jai_general_pkg.plot_codepath(22.3, p_codepath);
5523: p_cenvat_register_type := lv_pref2_register;
5524: GOTO end_of_procedure;
5525: END IF;
5526:
5535: END IF;
5536:
5537: <
5538:
5539: p_codepath := jai_general_pkg.plot_codepath(25, p_codepath, 'CENVAT_RG_PKG.DRV_DUTY_REG' , 'END');
5540: FND_FILE.put_line( fnd_file.log, '$derive_duty_registers. Register Type:'||p_cenvat_register_type);
5541: -- dbms_output.put_line( '$derive_duty_registers. Register Type:'||p_cenvat_register_type);
5542:
5543: EXCEPTION
5543: EXCEPTION
5544: WHEN OTHERS THEN
5545: p_process_flag := 'E';
5546: p_process_message := 'DERIVE_DUTY_REGISTERS: Error:'||SQLERRM;
5547: p_codepath := jai_general_pkg.plot_codepath(-999, p_codepath, 'CENVAT_RG_PKG.DRV_DUTY_REG' , 'END');
5548:
5549: END derive_duty_registers;
5550:
5551: PROCEDURE check_cenvat_balances(
5680: r_base_trx c_base_trx%ROWTYPE;
5681: begin
5682:
5683: lv_statement_id := '1';
5684: pv_codepath := jai_general_pkg.plot_codepath(1, pv_codepath, 'jai_rcv_excise_processing_pkg.rtv_processing_for_ssi', 'START');
5685: lv_simulate_flag := jai_constants.no;
5686: lv_register_entry_type := jai_rcv_excise_processing_pkg.cenvat_debit;
5687:
5688: open c_trx(pn_transaction_id);
5711: end if;
5712:
5713: if r_diff_tax.excise_edu_cess <> 0 and ln_excise_cess_accnt_id is null then
5714: lv_statement_id := '2.1';
5715: pv_codepath := jai_general_pkg.plot_codepath(2.1, pv_codepath);
5716: pv_process_status := 'E';
5717: pv_process_message := 'Excise Education cess account is not defined in the tax. (TaxId:'||ln_excise_cess_tax_id||')';
5718: GOTO end_of_procedure;
5719: end if;
5730: end if;
5731:
5732: if r_diff_tax.sh_exc_edu_cess <> 0 and ln_excise_sh_cess_accnt_id is null then
5733: lv_statement_id := '2.1';
5734: pv_codepath := jai_general_pkg.plot_codepath(2.1, pv_codepath);
5735: pv_process_status := 'E';
5736: pv_process_message := 'Excise SH Education cess account is not defined in the tax. (TaxId:'||ln_excise_sh_cess_tax_id||')';
5737: GOTO end_of_procedure;
5738: end if;
5758:
5759: if lv_cenvat_register_type IN (jai_constants.register_type_a, jai_constants.register_type_c) then
5760:
5761: lv_statement_id := '5';
5762: pv_codepath := jai_general_pkg.plot_codepath(17, pv_codepath);
5763:
5764: lv_reference_num := 'CENVAT-SSI';
5765: /*
5766: jai_rcv_excise_processing_pkg.rg23_part_ii_entry(
5800: lv_reference_name := 'JAI_CMN_RG_23AC_II_TRXS';
5801: ln_reference_id := ln_part_ii_register_id;
5802: elsif lv_cenvat_register_type = jai_constants.register_type_pla THEN
5803: lv_statement_id := '7';
5804: pv_codepath := jai_general_pkg.plot_codepath(17.1, pv_codepath);
5805: /* Bug 5365346. Added by Lakshmi Gopalsami
5806: Commented the call to pla entry and added
5807: jai_rcv_excise_processing_pkg.pla_entry(
5808: p_transaction_id => r_trx.transaction_id,
5839: lv_reference_name := 'JAI_CMN_RG_PLA_TRXS';
5840: ln_reference_id := ln_part_ii_register_id;
5841: else
5842: lv_statement_id := '9';
5843: pv_codepath := jai_general_pkg.plot_codepath(17.2, pv_codepath);
5844: pv_process_status := 'E';
5845: pv_process_message := 'Duty Register cannot be derived';
5846: GOTO end_of_procedure;
5847: end if;
6175:
6176: lv_statement_id := '29';
6177: pv_process_status := jai_constants.yes;
6178: <
6179: pv_codepath := jai_general_pkg.plot_codepath(75, pv_codepath, 'jai_rcv_excise_processing_pkg.rtv_processing_for_ssi', 'END');
6180:
6181: exception
6182: when others then
6183: pv_process_status := 'E';
6182: when others then
6183: pv_process_status := 'E';
6184: pv_process_message := 'Unexpected error in jai_rcv_excise_processing_pkg.rtv_processing_for_ssi(StmtId:'
6185: ||lv_statement_id||'). ErrMsg:'||SQLERRM;
6186: pv_codepath := jai_general_pkg.plot_codepath(999, pv_codepath, 'jai_rcv_excise_processing_pkg.rtv_processing_for_ssi', 'END');
6187:
6188: end rtv_processing_for_ssi;
6189:
6190: END jai_rcv_excise_processing_pkg;