DBA Data[Home] [Help]

APPS.JAI_AR_TCS_REP_PKG dependencies on JAI_CONSTANTS

Line 170: AND jrttv.regime_code = jai_constants.tcs_regime;

166: AND jspl.delivery_id = p_delivery_id
167: AND jspl.delivery_detail_id = p_delivery_detail_id
168: AND jsptl.tax_id = jtc.tax_id
169: AND jtc.tax_type = jrttv.tax_type
170: AND jrttv.regime_code = jai_constants.tcs_regime;
171:
172: CURSOR cur_get_order_num( cp_hdr_id JAI_OM_WSH_LINES_ALL.ORDER_HEADER_ID%TYPE)
173: IS
174: SELECT

Line 203: -- lv_source_name := jai_constants.tcs_source ; -- modified by csahoo for bug#6155839

199: v_std_text := 'India Localization Entry for sales order #' ;
200: v_ref_23 := 'jai_ar_tcs_rep_pkg.wsh_interim_accounting';
201: v_ref_24 := 'wsh_new_deliveries';
202: v_ref_25 := 'delivery_id';
203: -- lv_source_name := jai_constants.tcs_source ; -- modified by csahoo for bug#6155839
204: -- lv_category_name := 'Receivables India' ; -- modified by csahoo for bug#6155839
205:
206: lv_source_name := 'Receivables India' ; --bug#9587338
207: lv_category_name :=jai_constants.tcs_source; --bug#9587338

Line 207: lv_category_name :=jai_constants.tcs_source; --bug#9587338

203: -- lv_source_name := jai_constants.tcs_source ; -- modified by csahoo for bug#6155839
204: -- lv_category_name := 'Receivables India' ; -- modified by csahoo for bug#6155839
205:
206: lv_source_name := 'Receivables India' ; --bug#9587338
207: lv_category_name :=jai_constants.tcs_source; --bug#9587338
208:
209: set_debug_context;
210:
211:

Line 216: p_process_flag := jai_constants.successful ;

212: /*commented by csahoo for bug# 6401388
213: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
214: pn_reg_id => ln_reg_id
215: );*/
216: p_process_flag := jai_constants.successful ;
217: p_process_message := null ;
218:
219: OPEN cur_get_order_num( cp_hdr_id => p_order_header_id );
220: FETCH cur_get_order_num INTO ln_order_number;

Line 247: p_organization_type => jai_constants.orgn_type_io ,

243: pv_log_msg => 'Before call to jai_cmn_rgm_recording_pkg.get_account for int liab'
244: );*/
245: v_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
246: p_regime_id => rec_cur_get_picking_taxes.regime_id ,
247: p_organization_type => jai_constants.orgn_type_io ,
248: p_organization_id => p_organization_id ,
249: p_location_id => p_location_id ,
250: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
251: p_account_name => jai_constants.liability

Line 251: p_account_name => jai_constants.liability

247: p_organization_type => jai_constants.orgn_type_io ,
248: p_organization_id => p_organization_id ,
249: p_location_id => p_location_id ,
250: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
251: p_account_name => jai_constants.liability
252: );
253:
254: /*commented by csahoo for bug# 6401388
255: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 260: p_organization_type => jai_constants.orgn_type_io ,

256: pv_log_msg => 'Before call to jai_cmn_rgm_recording_pkg.get_account for liab'
257: );*/
258: v_int_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
259: p_regime_id => rec_cur_get_picking_taxes.regime_id ,
260: p_organization_type => jai_constants.orgn_type_io ,
261: p_organization_id => p_organization_id ,
262: p_location_id => p_location_id ,
263: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
264: p_account_name => jai_constants.liability_interim

Line 264: p_account_name => jai_constants.liability_interim

260: p_organization_type => jai_constants.orgn_type_io ,
261: p_organization_id => p_organization_id ,
262: p_location_id => p_location_id ,
263: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
264: p_account_name => jai_constants.liability_interim
265: );
266:
267:
268:

Line 280: p_process_flag := jai_constants.expected_error;

276: /*commented by csahoo for bug# 6401388
277: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
278: pv_log_msg => 'Error in call to jai_cmn_rgm_recording_pkg.get_account'
279: );*/
280: p_process_flag := jai_constants.expected_error;
281: p_process_message := 'Invalid Code combination ,please check the TCS Tax - Tax Accounting Setup';
282: return;
283: END IF;
284:

Line 386: p_process_flag := jai_constants.unexpected_error;

382: jai_cmn_debug_contexts_pkg.deregister (pn_reg_id => ln_reg_id);*/
383:
384: EXCEPTION
385: WHEN OTHERS THEN
386: p_process_flag := jai_constants.unexpected_error;
387: p_process_message := 'Unexpected error in the jai_ar_tcs_rep_pkg.wsh_interim_accounting '||substr(sqlerrm,1,300);
388:
389: END wsh_interim_accounting;
390:

Line 426: AND jrttv.regime_code = jai_constants.tcs_regime;

422: WHERE
423: jrtl.shipment_line_id = p_shipment_line_id
424: AND jrtl.tax_id = jtc.tax_id
425: AND jtc.tax_type = jrttv.tax_type
426: AND jrttv.regime_code = jai_constants.tcs_regime;
427:
428: cursor c_fetch_org_information(cp_organization_id in number) is
429: select set_of_books_id, organization_code
430: from org_organization_definitions

Line 465: lv_category_name VARCHAR2(100) := jai_constants.tcs_source ;

461: v_ref_25 GL_INTERFACE.REFERENCE25%TYPE := 'transaction_id' ; -- holds the column name -- 'delivery_id'
462: v_ref_26 GL_INTERFACE.REFERENCE26%TYPE ; -- holds the column value -- eg -- 13645
463: ln_order_number OE_ORDER_HEADERS_ALL.ORDER_NUMBER%TYPE ;
464: lv_source_name VARCHAR2(100) := 'Receivables India' ;
465: lv_category_name VARCHAR2(100) := jai_constants.tcs_source ;
466: v_int_liab_acc_ccid NUMBER;
467: v_liab_acc_ccid NUMBER;
468: v_receipt_num NUMBER;
469: p_codepath VARCHAR2(2000);

Line 479: p_process_flag := jai_constants.successful ;

475: lv_member_name := 'RECEIPT_INTERIM_ACCOUNTING';
476: set_debug_context;
477:
478: set_debug_context;
479: p_process_flag := jai_constants.successful ;
480: p_process_message := null ;
481:
482: for receipt_rec IN (SELECT receipt_num
483: FROM rcv_shipment_headers

Line 518: p_organization_type => jai_constants.orgn_type_io ,

514: *********************************************************************************************************/
515:
516: v_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
517: p_regime_id => rec_cur_get_picking_taxes.regime_id ,
518: p_organization_type => jai_constants.orgn_type_io ,
519: p_organization_id => p_organization_id ,
520: p_location_id => p_line_location_id ,
521: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
522: p_account_name => jai_constants.liability

Line 522: p_account_name => jai_constants.liability

518: p_organization_type => jai_constants.orgn_type_io ,
519: p_organization_id => p_organization_id ,
520: p_location_id => p_line_location_id ,
521: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
522: p_account_name => jai_constants.liability
523: );
524:
525: v_int_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
526: p_regime_id => rec_cur_get_picking_taxes.regime_id ,

Line 527: p_organization_type => jai_constants.orgn_type_io ,

523: );
524:
525: v_int_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
526: p_regime_id => rec_cur_get_picking_taxes.regime_id ,
527: p_organization_type => jai_constants.orgn_type_io ,
528: p_organization_id => p_organization_id ,
529: p_location_id => p_line_location_id ,
530: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
531: p_account_name => jai_constants.liability_interim

Line 531: p_account_name => jai_constants.liability_interim

527: p_organization_type => jai_constants.orgn_type_io ,
528: p_organization_id => p_organization_id ,
529: p_location_id => p_line_location_id ,
530: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
531: p_account_name => jai_constants.liability_interim
532: );
533:
534: IF v_int_liab_acc_ccid IS NULL OR
535: v_liab_acc_ccid IS NULL

Line 541: p_process_flag := jai_constants.expected_error;

537: /**********************************************************************************************************
538: || Code Combination id has been returned as null from the function jai_rgm_trx_recording_pkg.get_account
539: || This is an error condition and the current processing has to be stopped
540: **********************************************************************************************************/
541: p_process_flag := jai_constants.expected_error;
542: p_process_message := 'Invalid Code combination ,please check the TCS Tax - Tax Accounting Setup';
543: return;
544: END IF;
545:

Line 737: p_process_flag := jai_constants.unexpected_error;

733: END LOOP;
734:
735: EXCEPTION
736: WHEN OTHERS THEN
737: p_process_flag := jai_constants.unexpected_error;
738: p_process_message := 'Unexpected error in the jai_ar_tcs_rep_pkg.receipt_interim_accounting '||substr(sqlerrm,1,300);
739:
740: END receipt_interim_accounting;
741:

Line 774: AND jrttv.regime_code = jai_constants.tcs_regime

770: jrct.customer_trx_id = jrctl.customer_trx_id
771: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
772: AND jrcttl.tax_id = jtc.tax_id
773: AND jtc.tax_type = jrttv.tax_type
774: AND jrttv.regime_code = jai_constants.tcs_regime
775: AND jrct.customer_trx_id = cp_customer_trx_id
776: AND jrctl.customer_trx_line_id = nvl( cp_customer_trx_line_id , jrctl.customer_trx_line_id );
777:
778: /* Added for Bug 6734317 - Start */

Line 826: -- lv_source_name := jai_constants.tcs_source ; -- modified by csahoo for bug#6155839 commented for bug#9587338

822: lv_member_name := 'AR_ACCOUNTING';
823: v_ref_23 := 'jai_ar_tcs_rep_pkg.ar_accounting';
824: v_ref_24 := 'ra_customer_trx_all' ;
825: v_ref_25 := 'customer_trx_id' ;
826: -- lv_source_name := jai_constants.tcs_source ; -- modified by csahoo for bug#6155839 commented for bug#9587338
827: -- lv_category_name := 'Receivables India' ; -- modified by csahoo for bug#6155839 commented for bug#9587338
828:
829: lv_source_name := 'Receivables India' ; --bug#9587338
830: lv_category_name :=jai_constants.tcs_source; --bug#9587338

Line 830: lv_category_name :=jai_constants.tcs_source; --bug#9587338

826: -- lv_source_name := jai_constants.tcs_source ; -- modified by csahoo for bug#6155839 commented for bug#9587338
827: -- lv_category_name := 'Receivables India' ; -- modified by csahoo for bug#6155839 commented for bug#9587338
828:
829: lv_source_name := 'Receivables India' ; --bug#9587338
830: lv_category_name :=jai_constants.tcs_source; --bug#9587338
831:
832: set_debug_context;
833:
834:

Line 838: p_process_flag := jai_constants.successful ;

834:
835: /* jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
836: pn_reg_id => ln_reg_id
837: ); --commmented by CSahoo, BUG#5631784*/
838: p_process_flag := jai_constants.successful ;
839: p_process_message := null ;
840:
841: v_ref_26 := nvl(p_ract.customer_trx_id,p_ractl.customer_trx_id) ;
842:

Line 870: p_organization_type => jai_constants.orgn_type_io ,

866: pv_log_msg => 'Before call to jai_cmn_rgm_recording_pkg.get_account for int liab'
867: );*/
868: v_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
869: p_regime_id => rec_cur_get_inv_det.regime_id ,
870: p_organization_type => jai_constants.orgn_type_io ,
871: p_organization_id => rec_cur_get_inv_det.organization_id ,
872: p_location_id => rec_cur_get_inv_det.location_id ,
873: p_tax_type => rec_cur_get_inv_det.tax_type ,
874: p_account_name => jai_constants.liability

Line 874: p_account_name => jai_constants.liability

870: p_organization_type => jai_constants.orgn_type_io ,
871: p_organization_id => rec_cur_get_inv_det.organization_id ,
872: p_location_id => rec_cur_get_inv_det.location_id ,
873: p_tax_type => rec_cur_get_inv_det.tax_type ,
874: p_account_name => jai_constants.liability
875: );
876:
877: /*commented by csahoo for bug# 6401388
878: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 883: p_organization_type => jai_constants.orgn_type_io ,

879: pv_log_msg => 'Before call to jai_cmn_rgm_recording_pkg.get_account for liab'
880: );*/
881: v_int_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
882: p_regime_id => rec_cur_get_inv_det.regime_id ,
883: p_organization_type => jai_constants.orgn_type_io ,
884: p_organization_id => rec_cur_get_inv_det.organization_id ,
885: p_location_id => rec_cur_get_inv_det.location_id ,
886: p_tax_type => rec_cur_get_inv_det.tax_type ,
887: p_account_name => jai_constants.liability_interim

Line 887: p_account_name => jai_constants.liability_interim

883: p_organization_type => jai_constants.orgn_type_io ,
884: p_organization_id => rec_cur_get_inv_det.organization_id ,
885: p_location_id => rec_cur_get_inv_det.location_id ,
886: p_tax_type => rec_cur_get_inv_det.tax_type ,
887: p_account_name => jai_constants.liability_interim
888: );
889:
890:
891:

Line 903: p_process_flag := jai_constants.expected_error;

899: /*commented by csahoo for bug# 6401388
900: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
901: pv_log_msg => 'Error in call to jai_cmn_rgm_recording_pkg.get_account'
902: );*/
903: p_process_flag := jai_constants.expected_error;
904: p_process_message := 'Invalid Code combination ,please check the TCS Tax - Tax Accounting Setup';
905: return;
906: END IF;
907:

Line 1034: p_process_flag := jai_constants.unexpected_error;

1030: jai_cmn_debug_contexts_pkg.deregister (pn_reg_id => ln_reg_id);*/
1031:
1032: EXCEPTION
1033: WHEN OTHERS THEN
1034: p_process_flag := jai_constants.unexpected_error;
1035: p_process_message := 'Unexpected error in the jai_ar_tcs_rep_pkg.man_ar_completion_accounting '||substr(sqlerrm,1,300);
1036:
1037: END ar_accounting;
1038:

Line 1064: AND jrttv.regime_code = jai_constants.tcs_regime; /* Applied to doc has got TCS type of tax*/

1060: jsl.header_id = cp_header_id
1061: AND jsl.line_id = jstl.line_id
1062: AND jtc.tax_id = jstl.tax_id
1063: AND jtc.tax_type = jrttv.tax_type
1064: AND jrttv.regime_code = jai_constants.tcs_regime; /* Applied to doc has got TCS type of tax*/
1065:
1066:
1067:
1068: /*

Line 1095: AND jrttv.regime_code = jai_constants.tcs_regime /* Applied to doc has got TCS type of tax*/

1091: WHERE
1092: jsl.line_id = jstl.line_id
1093: AND jtc.tax_id = jstl.tax_id
1094: AND jtc.tax_type = jrttv.tax_type
1095: AND jrttv.regime_code = jai_constants.tcs_regime /* Applied to doc has got TCS type of tax*/
1096: );
1097:
1098: /*******
1099: || Validate that the inventory_items for all lines of the sales order should have the same TCS item classification

Line 1134: lv_process_flag := jai_constants.successful ;

1130: /*commented by csahoo for bug# 6401388
1131: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
1132: pn_reg_id => ln_reg_id
1133: );*/
1134: lv_process_flag := jai_constants.successful ;
1135: lv_process_message := null ;
1136:
1137: p_process_flag := lv_process_flag ;
1138: p_process_message := lv_process_message ;

Line 1147: IF ln_event = jai_constants.order_booked AND

1143:
1144: /*
1145: ||Check that the order has a flow status code as booked else skip the transaction
1146: */
1147: IF ln_event = jai_constants.order_booked AND
1148: p_ooh.flow_status_code <> jai_constants.order_booked
1149: THEN
1150: /*commented by csahoo for bug# 6401388
1151: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 1148: p_ooh.flow_status_code <> jai_constants.order_booked

1144: /*
1145: ||Check that the order has a flow status code as booked else skip the transaction
1146: */
1147: IF ln_event = jai_constants.order_booked AND
1148: p_ooh.flow_status_code <> jai_constants.order_booked
1149: THEN
1150: /*commented by csahoo for bug# 6401388
1151: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1152: pv_log_msg => ' Skip the transaction as order has a flow status code as '|| p_ooh.flow_status_code ||' which is different from BOOKED '

Line 1154: p_process_flag := jai_constants.not_applicable ;

1150: /*commented by csahoo for bug# 6401388
1151: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1152: pv_log_msg => ' Skip the transaction as order has a flow status code as '|| p_ooh.flow_status_code ||' which is different from BOOKED '
1153: );*/
1154: p_process_flag := jai_constants.not_applicable ;
1155: return;
1156:
1157: END IF;
1158:

Line 1171: p_process_flag := jai_constants.not_applicable ;

1167: /*commented by csahoo for bug# 6401388
1168: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1169: pv_log_msg => ' Skip as order does not have TCS type of taxes '
1170: );*/
1171: p_process_flag := jai_constants.not_applicable ;
1172: return;
1173: END IF;
1174: CLOSE cur_chk_tcs_applicable;
1175:

Line 1181: IF ln_event IN ( jai_constants.order_booked ,

1177:
1178: /*########################################################################################################
1179: || VALIDATE THAT ALL LINES SHOULD HAVE TCS OR NIETHER SHOUD HAVE ANY - PART - 2
1180: ########################################################################################################*/
1181: IF ln_event IN ( jai_constants.order_booked ,
1182: jai_constants.wsh_ship_confirm
1183: )
1184: THEN
1185:

Line 1182: jai_constants.wsh_ship_confirm

1178: /*########################################################################################################
1179: || VALIDATE THAT ALL LINES SHOULD HAVE TCS OR NIETHER SHOUD HAVE ANY - PART - 2
1180: ########################################################################################################*/
1181: IF ln_event IN ( jai_constants.order_booked ,
1182: jai_constants.wsh_ship_confirm
1183: )
1184: THEN
1185:
1186: /****************

Line 1205: p_process_flag := jai_constants.expected_error;

1201: pv_log_msg => 'Error :- Cannot Book/ship the sales order if some lines have TCS type of tax and some dont '||fnd_global.local_chr(10)
1202: ||', lv_process_flag -> '|| lv_process_flag ||fnd_global.local_chr(10)
1203: ||', lv_process_message -> '||lv_process_message
1204: );*/
1205: p_process_flag := jai_constants.expected_error;
1206: p_process_message := 'Cannot Book/Ship the Sales Order as some lines do not have TCS type of taxes ';
1207: return;
1208: CLOSE cur_chk_tcs_for_all_lines ;
1209: END IF;

Line 1225: p_regime_code => jai_constants.tcs_regime ,

1221: /*
1222: ||Get the value for the item classification pertaining to the IO and inventory item combination
1223: */
1224: jai_inv_items_pkg.jai_get_attrib (
1225: p_regime_code => jai_constants.tcs_regime ,
1226: p_organization_id => p_ooh.ship_from_org_id , -- Organization id of the Selling organization (warehouse_id)
1227: p_inventory_item_id => rec_cur_validate_all_items.inventory_item_id ,
1228: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
1229: p_attribute_value => lv_item_classification ,

Line 1228: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,

1224: jai_inv_items_pkg.jai_get_attrib (
1225: p_regime_code => jai_constants.tcs_regime ,
1226: p_organization_id => p_ooh.ship_from_org_id , -- Organization id of the Selling organization (warehouse_id)
1227: p_inventory_item_id => rec_cur_validate_all_items.inventory_item_id ,
1228: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
1229: p_attribute_value => lv_item_classification ,
1230: p_process_flag => lv_process_flag ,
1231: p_process_msg => lv_process_message
1232: );

Line 1234: IF lv_process_flag = jai_constants.expected_error OR ---------A2

1230: p_process_flag => lv_process_flag ,
1231: p_process_msg => lv_process_message
1232: );
1233:
1234: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1235: lv_process_flag = jai_constants.unexpected_error
1236: THEN
1237: /*
1238: || As Returned status is an error/not applicable hence:-

Line 1235: lv_process_flag = jai_constants.unexpected_error

1231: p_process_msg => lv_process_message
1232: );
1233:
1234: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1235: lv_process_flag = jai_constants.unexpected_error
1236: THEN
1237: /*
1238: || As Returned status is an error/not applicable hence:-
1239: || Set out variables p_process_flag and p_process_message accordingly

Line 1273: p_process_flag := jai_constants.expected_error ;

1269: ||', lv_process_flag -> '|| lv_process_flag ||fnd_global.local_chr(10)
1270: ||', lv_process_message -> '||lv_process_message
1271: );*/
1272:
1273: p_process_flag := jai_constants.expected_error ;
1274: p_process_message := 'Cannot Book/Ship the sales order. All lines should either have the same TCS item classification or none of the line should have TCS type of taxes' ;
1275: return;
1276: END IF;
1277: END LOOP;

Line 1314: AND gl_dist.account_class = jai_constants.account_class_rec

1310: JAI_CMN_TAXES_ALL jtc ,
1311: jai_regime_tax_types_v jrttv
1312: WHERE
1313: gl_dist.customer_trx_id = jrct.customer_trx_id
1314: AND gl_dist.account_class = jai_constants.account_class_rec
1315: AND gl_dist.latest_rec_flag = jai_constants.yes
1316: AND jrct.customer_trx_id = cp_customer_trx_id
1317: AND jrct.customer_trx_id = jrctl.customer_trx_id
1318: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id

Line 1315: AND gl_dist.latest_rec_flag = jai_constants.yes

1311: jai_regime_tax_types_v jrttv
1312: WHERE
1313: gl_dist.customer_trx_id = jrct.customer_trx_id
1314: AND gl_dist.account_class = jai_constants.account_class_rec
1315: AND gl_dist.latest_rec_flag = jai_constants.yes
1316: AND jrct.customer_trx_id = cp_customer_trx_id
1317: AND jrct.customer_trx_id = jrctl.customer_trx_id
1318: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
1319: AND jtc.tax_id = jrcttl.tax_id

Line 1321: AND jrttv.regime_code = jai_constants.tcs_regime; /* Applied to doc has got TCS type of tax*/

1317: AND jrct.customer_trx_id = jrctl.customer_trx_id
1318: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
1319: AND jtc.tax_id = jrcttl.tax_id
1320: AND jtc.tax_type = jrttv.tax_type
1321: AND jrttv.regime_code = jai_constants.tcs_regime; /* Applied to doc has got TCS type of tax*/
1322:
1323:
1324: /*
1325: ||Get the trx type of the document

Line 1375: AND jrttv.regime_code = jai_constants.tcs_regime

1371: WHERE
1372: jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
1373: AND jtc.tax_id = jrcttl.tax_id
1374: AND jtc.tax_type = jrttv.tax_type
1375: AND jrttv.regime_code = jai_constants.tcs_regime
1376: );
1377:
1378:
1379: /*

Line 1396: AND jrttv.tax_type = jai_constants.tax_type_tcs_surcharge

1392: jrctl.customer_trx_id = cp_customer_trx_id
1393: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
1394: AND jrcttl.tax_id = jtc.tax_id
1395: AND jtc.tax_type = jrttv.tax_type
1396: AND jrttv.tax_type = jai_constants.tax_type_tcs_surcharge
1397: AND jrttv.regime_code = jai_constants.tcs_regime;
1398:
1399:
1400:

Line 1397: AND jrttv.regime_code = jai_constants.tcs_regime;

1393: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
1394: AND jrcttl.tax_id = jtc.tax_id
1395: AND jtc.tax_type = jrttv.tax_type
1396: AND jrttv.tax_type = jai_constants.tax_type_tcs_surcharge
1397: AND jrttv.regime_code = jai_constants.tcs_regime;
1398:
1399:
1400:
1401: /*******

Line 1445: lv_process_flag := jai_constants.successful ;

1441: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
1442: pn_reg_id => ln_reg_id
1443: );*/
1444:
1445: lv_process_flag := jai_constants.successful ;
1446: lv_process_message := null ;
1447:
1448: p_process_flag := lv_process_flag ;
1449: p_process_message := lv_process_message ;

Line 1534: p_process_flag := jai_constants.not_applicable;

1530: );*/
1531: /*Bug 10245810 - Repository to be updated during CM Completion also*/
1532: /*
1533: IF lv_trx_type = 'CM' THEN
1534: p_process_flag := jai_constants.not_applicable;
1535: return;
1536: END IF;
1537: */
1538:

Line 1543: IF ln_event = jai_constants.trx_event_completion THEN

1539: /*########################################################################################################
1540: || VALIDATIONS FOR INVOICE COMPLETION PART - 4
1541: ########################################################################################################*/
1542:
1543: IF ln_event = jai_constants.trx_event_completion THEN
1544:
1545: /*commented by csahoo for bug# 6401388
1546: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1547: pv_log_msg => ' Event is -> '||ln_event

Line 1555: IF p_ract.complete_flag = jai_constants.yes THEN

1551: || DERIVE DOCUMENT TYPE - PART - 4.1
1552: ########################################################################################################*/
1553:
1554:
1555: IF p_ract.complete_flag = jai_constants.yes THEN
1556:
1557: /*commented by csahoo for bug# 6401388
1558: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1559: pv_log_msg => ' Complete -> '||p_ract.complete_flag

Line 1562: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm,jai_constants.ar_invoice_type_cm) THEN

1558: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1559: pv_log_msg => ' Complete -> '||p_ract.complete_flag
1560: );*/
1561: /*Bug 10245810 - Added CM Type also. Repository to be updated during CM Completion also*/
1562: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm,jai_constants.ar_invoice_type_cm) THEN
1563: /*
1564: ||Invoice/DM completion
1565: */
1566: lv_doc_type := jai_constants.trx_type_inv_comp;

Line 1566: lv_doc_type := jai_constants.trx_type_inv_comp;

1562: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm,jai_constants.ar_invoice_type_cm) THEN
1563: /*
1564: ||Invoice/DM completion
1565: */
1566: lv_doc_type := jai_constants.trx_type_inv_comp;
1567: ELSE
1568: /*commented by csahoo for bug# 6401388
1569: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1570: pv_log_msg => ' Skip as type -> '||lv_trx_type ||' not applicable for TCS processing '

Line 1572: p_process_flag := jai_constants.not_applicable;

1568: /*commented by csahoo for bug# 6401388
1569: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1570: pv_log_msg => ' Skip as type -> '||lv_trx_type ||' not applicable for TCS processing '
1571: );*/
1572: p_process_flag := jai_constants.not_applicable;
1573: return;
1574: END IF;
1575:
1576: ELSIF p_ract.complete_flag = jai_constants.no THEN

Line 1576: ELSIF p_ract.complete_flag = jai_constants.no THEN

1572: p_process_flag := jai_constants.not_applicable;
1573: return;
1574: END IF;
1575:
1576: ELSIF p_ract.complete_flag = jai_constants.no THEN
1577: /*
1578: ||
1579: */
1580: /*Bug 10245810 - Added CM Type also. Repository to be updated during CM InCompletion also*/

Line 1581: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm,jai_constants.ar_invoice_type_cm) THEN

1577: /*
1578: ||
1579: */
1580: /*Bug 10245810 - Added CM Type also. Repository to be updated during CM InCompletion also*/
1581: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm,jai_constants.ar_invoice_type_cm) THEN
1582: /*
1583: ||Invoice/DM incompletion
1584: */
1585: lv_doc_type := jai_constants.trx_type_inv_incomp;

Line 1585: lv_doc_type := jai_constants.trx_type_inv_incomp;

1581: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm,jai_constants.ar_invoice_type_cm) THEN
1582: /*
1583: ||Invoice/DM incompletion
1584: */
1585: lv_doc_type := jai_constants.trx_type_inv_incomp;
1586: ELSE
1587: /*commented by csahoo for bug# 6401388
1588: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1589: pv_log_msg => ' Skip as type -> '||lv_trx_type ||' not applicable for TCS processing '

Line 1591: p_process_flag := jai_constants.not_applicable;

1587: /*commented by csahoo for bug# 6401388
1588: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1589: pv_log_msg => ' Skip as type -> '||lv_trx_type ||' not applicable for TCS processing '
1590: );*/
1591: p_process_flag := jai_constants.not_applicable;
1592: return;
1593: END IF;
1594: END IF;
1595:

Line 1607: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,

1603: || Validate that an invoice cannot be incompleted if the TCS
1604: || for the same has already been settled
1605: ********/
1606: /*Bug 10245810 - Added CM Type also*/
1607: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1608: jai_constants.ar_doc_type_dm,
1609: jai_constants.ar_invoice_type_cm
1610: ) AND
1611: lv_doc_type = jai_constants.trx_type_inv_incomp

Line 1608: jai_constants.ar_doc_type_dm,

1604: || for the same has already been settled
1605: ********/
1606: /*Bug 10245810 - Added CM Type also*/
1607: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1608: jai_constants.ar_doc_type_dm,
1609: jai_constants.ar_invoice_type_cm
1610: ) AND
1611: lv_doc_type = jai_constants.trx_type_inv_incomp
1612:

Line 1609: jai_constants.ar_invoice_type_cm

1605: ********/
1606: /*Bug 10245810 - Added CM Type also*/
1607: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1608: jai_constants.ar_doc_type_dm,
1609: jai_constants.ar_invoice_type_cm
1610: ) AND
1611: lv_doc_type = jai_constants.trx_type_inv_incomp
1612:
1613: THEN -----------------A1

Line 1611: lv_doc_type = jai_constants.trx_type_inv_incomp

1607: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1608: jai_constants.ar_doc_type_dm,
1609: jai_constants.ar_invoice_type_cm
1610: ) AND
1611: lv_doc_type = jai_constants.trx_type_inv_incomp
1612:
1613: THEN -----------------A1
1614: /*
1615: ||Trx type is invoice or Debit memo

Line 1626: p_process_flag := jai_constants.expected_error;

1622: pv_log_msg => 'Error :- Cannot Incomplete the invoice if it has already been settled '||fnd_global.local_chr(10)
1623: ||', lv_process_flag -> '|| lv_process_flag ||fnd_global.local_chr(10)
1624: ||', lv_process_message -> '||lv_process_message
1625: );*/
1626: p_process_flag := jai_constants.expected_error;
1627: /*Bug 10245810 - Modified process message*/
1628: p_process_message := 'Cannot incomplete the Invoice/Debit/Credit Memo as TCS taxes have already been settled';
1629: return;
1630: END IF;

Line 1640: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,

1636: /*########################################################################################################
1637: || INVOICE COMPLETION VALIDATIONS - PART - 4.2
1638: ########################################################################################################*/
1639: /*Bug 10245810 - Added CM Type also*/
1640: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1641: jai_constants.ar_doc_type_dm,
1642: jai_constants.ar_invoice_type_cm
1643: ) AND
1644: lv_doc_type = jai_constants.trx_type_inv_comp

Line 1641: jai_constants.ar_doc_type_dm,

1637: || INVOICE COMPLETION VALIDATIONS - PART - 4.2
1638: ########################################################################################################*/
1639: /*Bug 10245810 - Added CM Type also*/
1640: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1641: jai_constants.ar_doc_type_dm,
1642: jai_constants.ar_invoice_type_cm
1643: ) AND
1644: lv_doc_type = jai_constants.trx_type_inv_comp
1645: THEN -----------------A3

Line 1642: jai_constants.ar_invoice_type_cm

1638: ########################################################################################################*/
1639: /*Bug 10245810 - Added CM Type also*/
1640: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1641: jai_constants.ar_doc_type_dm,
1642: jai_constants.ar_invoice_type_cm
1643: ) AND
1644: lv_doc_type = jai_constants.trx_type_inv_comp
1645: THEN -----------------A3
1646: /****************

Line 1644: lv_doc_type = jai_constants.trx_type_inv_comp

1640: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1641: jai_constants.ar_doc_type_dm,
1642: jai_constants.ar_invoice_type_cm
1643: ) AND
1644: lv_doc_type = jai_constants.trx_type_inv_comp
1645: THEN -----------------A3
1646: /****************
1647: || Event is completion
1648: || Validate that all lines have TCS type of taxes

Line 1665: p_process_flag := jai_constants.expected_error;

1661: pv_log_msg => 'Error :- Cannot complete the invoice if some lines have TCS type of tax and some dont '||fnd_global.local_chr(10)
1662: ||', lv_process_flag -> '|| lv_process_flag ||fnd_global.local_chr(10)
1663: ||', lv_process_message -> '||lv_process_message
1664: );*/
1665: p_process_flag := jai_constants.expected_error;
1666: /*Bug 10245810 - Modified process message*/
1667: p_process_message := 'Cannot complete the Invoice/Debit/Credit Memo as some lines of the document do not have TCS type of taxes ';
1668: return;
1669: CLOSE cur_chk_tcs_for_all_lines ;

Line 1684: p_regime_code => jai_constants.tcs_regime ,

1680: /*
1681: ||Get the value for the item classification pertaining to the IO and inventory item combination
1682: */
1683: jai_inv_items_pkg.jai_get_attrib (
1684: p_regime_code => jai_constants.tcs_regime ,
1685: p_organization_id => rec_cur_validate_all_items.organization_id ,
1686: p_inventory_item_id => rec_cur_validate_all_items.inventory_item_id ,
1687: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
1688: p_attribute_value => lv_item_classification ,

Line 1687: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,

1683: jai_inv_items_pkg.jai_get_attrib (
1684: p_regime_code => jai_constants.tcs_regime ,
1685: p_organization_id => rec_cur_validate_all_items.organization_id ,
1686: p_inventory_item_id => rec_cur_validate_all_items.inventory_item_id ,
1687: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
1688: p_attribute_value => lv_item_classification ,
1689: p_process_flag => lv_process_flag ,
1690: p_process_msg => lv_process_message
1691: );

Line 1693: IF lv_process_flag = jai_constants.expected_error OR ---------A2

1689: p_process_flag => lv_process_flag ,
1690: p_process_msg => lv_process_message
1691: );
1692:
1693: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1694: lv_process_flag = jai_constants.unexpected_error
1695: THEN
1696: /*
1697: || As Returned status is an error/not applicable hence:-

Line 1694: lv_process_flag = jai_constants.unexpected_error

1690: p_process_msg => lv_process_message
1691: );
1692:
1693: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1694: lv_process_flag = jai_constants.unexpected_error
1695: THEN
1696: /*
1697: || As Returned status is an error/not applicable hence:-
1698: || Set out variables p_process_flag and p_process_message accordingly

Line 1732: p_process_flag := jai_constants.expected_error ;

1728: ||', lv_process_flag -> '|| lv_process_flag ||fnd_global.local_chr(10)
1729: ||', lv_process_message -> '||lv_process_message
1730: );*/
1731:
1732: p_process_flag := jai_constants.expected_error ;
1733: p_process_message := 'Cannot complete invoice. All lines should either have the same TCS item classification or none of the line should have TCS type of taxes' ;
1734: return;
1735: END IF;
1736:

Line 1747: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,

1743: OPEN cur_chk_tcs_sur_tax ( cp_customer_trx_id => p_ract.customer_trx_id );
1744: FETCH cur_chk_tcs_sur_tax INTO ln_surcharge_cnt;
1745: CLOSE cur_chk_tcs_sur_tax ;
1746:
1747: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
1748: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
1749: cp_organization_id => ln_organization_id
1750: ) ;
1751: FETCH c_get_rgm_attribute INTO ln_regime_id, lv_org_tan_no ;

Line 1748: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,

1744: FETCH cur_chk_tcs_sur_tax INTO ln_surcharge_cnt;
1745: CLOSE cur_chk_tcs_sur_tax ;
1746:
1747: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
1748: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
1749: cp_organization_id => ln_organization_id
1750: ) ;
1751: FETCH c_get_rgm_attribute INTO ln_regime_id, lv_org_tan_no ;
1752: CLOSE c_get_rgm_attribute;

Line 1757: p_party_type => jai_constants.party_type_customer ,

1753:
1754: jai_rgm_thhold_proc_pkg.get_threshold_slab_id (
1755: p_regime_id => ln_regime_id ,
1756: p_org_tan_no => lv_org_tan_no ,
1757: p_party_type => jai_constants.party_type_customer ,
1758: p_party_id => nvl(p_ract.ship_to_customer_id,p_ract.bill_to_customer_id) ,
1759: p_source_trx_date => ld_source_doc_date ,
1760: p_org_id => p_ract.org_id ,
1761: p_threshold_slab_id => ln_threshold_slab_id ,

Line 1762: p_called_from => jai_constants.tcs_event_surcharge , --Added by mmurtuza for bug#13025013

1758: p_party_id => nvl(p_ract.ship_to_customer_id,p_ract.bill_to_customer_id) ,
1759: p_source_trx_date => ld_source_doc_date ,
1760: p_org_id => p_ract.org_id ,
1761: p_threshold_slab_id => ln_threshold_slab_id ,
1762: p_called_from => jai_constants.tcs_event_surcharge , --Added by mmurtuza for bug#13025013
1763: p_process_flag => lv_process_flag ,
1764: p_process_message => lv_process_message
1765: );
1766:

Line 1767: IF lv_process_flag = jai_constants.expected_error OR ---------A2

1763: p_process_flag => lv_process_flag ,
1764: p_process_message => lv_process_message
1765: );
1766:
1767: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1768: lv_process_flag = jai_constants.unexpected_error OR
1769: lv_process_flag = jai_constants.not_applicable
1770: THEN
1771: /*

Line 1768: lv_process_flag = jai_constants.unexpected_error OR

1764: p_process_message => lv_process_message
1765: );
1766:
1767: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1768: lv_process_flag = jai_constants.unexpected_error OR
1769: lv_process_flag = jai_constants.not_applicable
1770: THEN
1771: /*
1772: || As Returned status is an error/not applicable hence:-

Line 1769: lv_process_flag = jai_constants.not_applicable

1765: );
1766:
1767: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1768: lv_process_flag = jai_constants.unexpected_error OR
1769: lv_process_flag = jai_constants.not_applicable
1770: THEN
1771: /*
1772: || As Returned status is an error/not applicable hence:-
1773: || Set out variables p_process_flag and p_process_message accordingly

Line 1803: p_process_flag := jai_constants.expected_error ;

1799: ||IF threshold level is up and surcharge type of taxes not present
1800: || on the invoice line then error
1801: */
1802: IF ln_surcharge_cnt = 0 THEN /* Surcharge does not exist */
1803: p_process_flag := jai_constants.expected_error ;
1804: p_process_message := 'Cannot complete invoice as surcharge is applicable however TCS Surcharge tax is not found on the document' ;
1805: return;
1806: END IF;
1807: ELSE

Line 1813: p_process_flag := jai_constants.expected_error ;

1809: ||IF threshold level is down and surcharge type of taxes are present
1810: || on the invoice line then error
1811: */
1812: IF ln_surcharge_cnt = 1 THEN /* Surcharge exist */
1813: p_process_flag := jai_constants.expected_error ;
1814: p_process_message := 'Cannot complete invoice as surcharge is not applicable however TCS Surcharge tax is found on the document' ;
1815: return;
1816: END IF;
1817: END IF;

Line 1859: rcta.complete_flag = jai_constants.yes

1855: JAI_AR_TRX_TAX_LINES jrcttl ,
1856: JAI_CMN_TAXES_ALL jtc ,
1857: jai_regime_tax_types_v jrttv
1858: WHERE
1859: rcta.complete_flag = jai_constants.yes
1860: AND rcta.customer_trx_id = cp_customer_trx_id
1861: AND gl_dist.customer_trx_id = rcta.customer_trx_id
1862: AND gl_dist.account_class = jai_constants.account_class_rec
1863: AND gl_dist.latest_rec_flag = jai_constants.yes

Line 1862: AND gl_dist.account_class = jai_constants.account_class_rec

1858: WHERE
1859: rcta.complete_flag = jai_constants.yes
1860: AND rcta.customer_trx_id = cp_customer_trx_id
1861: AND gl_dist.customer_trx_id = rcta.customer_trx_id
1862: AND gl_dist.account_class = jai_constants.account_class_rec
1863: AND gl_dist.latest_rec_flag = jai_constants.yes
1864: AND rcta.customer_trx_id = jrct.customer_trx_id
1865: AND jrct.customer_trx_id = jrctl.customer_trx_id
1866: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id

Line 1863: AND gl_dist.latest_rec_flag = jai_constants.yes

1859: rcta.complete_flag = jai_constants.yes
1860: AND rcta.customer_trx_id = cp_customer_trx_id
1861: AND gl_dist.customer_trx_id = rcta.customer_trx_id
1862: AND gl_dist.account_class = jai_constants.account_class_rec
1863: AND gl_dist.latest_rec_flag = jai_constants.yes
1864: AND rcta.customer_trx_id = jrct.customer_trx_id
1865: AND jrct.customer_trx_id = jrctl.customer_trx_id
1866: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
1867: AND jtc.tax_id = jrcttl.tax_id

Line 1869: AND jrttv.regime_code = jai_constants.tcs_regime;

1865: AND jrct.customer_trx_id = jrctl.customer_trx_id
1866: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
1867: AND jtc.tax_id = jrcttl.tax_id
1868: AND jrttv.tax_type = jtc.tax_type /* Applied to doc has got TCS type of tax*/
1869: AND jrttv.regime_code = jai_constants.tcs_regime;
1870:
1871: /*
1872: ||Get the sign of the Cash receipt document
1873: */

Line 1893: account_class = jai_constants.account_class_rec

1889: sign(nvl(amount,0)) app_fr_sign
1890: FROM
1891: ra_cust_trx_line_gl_dist_all
1892: WHERE
1893: account_class = jai_constants.account_class_rec
1894: AND latest_rec_flag = jai_constants.yes
1895: AND customer_trx_id = cp_cm_customer_trx_id;
1896:
1897: /*

Line 1894: AND latest_rec_flag = jai_constants.yes

1890: FROM
1891: ra_cust_trx_line_gl_dist_all
1892: WHERE
1893: account_class = jai_constants.account_class_rec
1894: AND latest_rec_flag = jai_constants.yes
1895: AND customer_trx_id = cp_cm_customer_trx_id;
1896:
1897: /*
1898: || Check that the Cash receipt has got TCS type of confirmed taxes

Line 1914: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */

1910: WHERE
1911: jcra.cash_receipt_id = acra.cash_receipt_id
1912: AND jcra.cash_receipt_id = cp_cash_receipt_id
1913: AND jcra.cash_receipt_id = jdt.source_doc_id
1914: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
1915: AND jcra.confirm_flag = jai_constants.yes
1916: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1917: AND jrttv.regime_code = jai_constants.tcs_regime
1918: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug

Line 1915: AND jcra.confirm_flag = jai_constants.yes

1911: jcra.cash_receipt_id = acra.cash_receipt_id
1912: AND jcra.cash_receipt_id = cp_cash_receipt_id
1913: AND jcra.cash_receipt_id = jdt.source_doc_id
1914: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
1915: AND jcra.confirm_flag = jai_constants.yes
1916: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1917: AND jrttv.regime_code = jai_constants.tcs_regime
1918: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
1919:

Line 1917: AND jrttv.regime_code = jai_constants.tcs_regime

1913: AND jcra.cash_receipt_id = jdt.source_doc_id
1914: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
1915: AND jcra.confirm_flag = jai_constants.yes
1916: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1917: AND jrttv.regime_code = jai_constants.tcs_regime
1918: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
1919:
1920:
1921: /*

Line 1918: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug

1914: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
1915: AND jcra.confirm_flag = jai_constants.yes
1916: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1917: AND jrttv.regime_code = jai_constants.tcs_regime
1918: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
1919:
1920:
1921: /*
1922: || Get the application details for the current unapplications from the repository

Line 1970: lv_process_flag := jai_constants.successful ;

1966: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
1967: pn_reg_id => ln_reg_id
1968: );*/
1969:
1970: lv_process_flag := jai_constants.successful ;
1971: lv_process_message := null ;
1972:
1973: p_process_flag := lv_process_flag ;
1974: p_process_message := lv_process_message ;

Line 1995: IF p_araa.application_type IN (jai_constants.ar_cash ,

1991: /*########################################################################################################
1992: || CHECK TCS APPLICABILITY ON APPLIED FROM DOCUMENTS AND DERIVE APPLICATION TYPE - PART -2
1993: ########################################################################################################*/
1994:
1995: IF p_araa.application_type IN (jai_constants.ar_cash ,
1996: jai_constants.ar_status_activity
1997: ) AND -------------A1
1998: p_araa.cash_receipt_id IS NOT NULL
1999: THEN

Line 1996: jai_constants.ar_status_activity

1992: || CHECK TCS APPLICABILITY ON APPLIED FROM DOCUMENTS AND DERIVE APPLICATION TYPE - PART -2
1993: ########################################################################################################*/
1994:
1995: IF p_araa.application_type IN (jai_constants.ar_cash ,
1996: jai_constants.ar_status_activity
1997: ) AND -------------A1
1998: p_araa.cash_receipt_id IS NOT NULL
1999: THEN
2000: /*

Line 2018: p_process_flag := jai_constants.not_applicable ;

2014: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2015: pv_log_msg => ' Skip As TCS not applicable ON Derived from documents '
2016: );*/
2017: CLOSE cur_chk_crtcs_applicable;
2018: p_process_flag := jai_constants.not_applicable ;
2019: return ;
2020: ELSE
2021: /*
2022: ||Check for ACTIVITY I.E receipt to receipt or receipt to credit memo any other type of application other than Receipt/CM to INV or DM

Line 2029: IF p_araa.status = jai_constants.ar_status_activity THEN

2025: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2026: pv_log_msg => 'TCS is applicable'
2027: );*/
2028:
2029: IF p_araa.status = jai_constants.ar_status_activity THEN
2030: /*
2031: || As current receivable application is an activity indicating a receipt to receipt getting applied to another receipt
2032: || or Credit Memo hence stop this processing as otherwise this would lead to down stream TCS data corruption.
2033: */

Line 2038: p_process_flag := jai_constants.expected_error;

2034: /*commented by csahoo for bug# 6401388
2035: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2036: pv_log_msg => 'Cannot apply a RECEIPT to any other document (any of them having TCS applicability) other than a Invoice or Debit Memo'
2037: );*/
2038: p_process_flag := jai_constants.expected_error;
2039: p_process_message := 'Cannot apply a RECEIPT to any other document (any of them having TCS applicability) other than a Invoice or Debit Memo';
2040: return;
2041:
2042: END IF;

Line 2059: lv_app_doc_type := jai_constants.trx_type_rct_app ; /* Event is 'RECEIPT_APPLICATION' */

2055: || IF sign of amount field of receivable application is the same as the sign of the cash receipt amount
2056: || then application is receipt application else it would be receipt un application
2057: */
2058: IF ln_sign_of_app = ln_sign_of_app_fr_doc THEN
2059: lv_app_doc_type := jai_constants.trx_type_rct_app ; /* Event is 'RECEIPT_APPLICATION' */
2060: ELSE
2061: lv_app_doc_type := jai_constants.trx_type_rct_unapp ;/* Event is 'RECEIPT_UNAPPLICATION' */
2062: END IF;
2063:

Line 2061: lv_app_doc_type := jai_constants.trx_type_rct_unapp ;/* Event is 'RECEIPT_UNAPPLICATION' */

2057: */
2058: IF ln_sign_of_app = ln_sign_of_app_fr_doc THEN
2059: lv_app_doc_type := jai_constants.trx_type_rct_app ; /* Event is 'RECEIPT_APPLICATION' */
2060: ELSE
2061: lv_app_doc_type := jai_constants.trx_type_rct_unapp ;/* Event is 'RECEIPT_UNAPPLICATION' */
2062: END IF;
2063:
2064:
2065: ELSIF p_araa.application_type = jai_constants.ar_invoice_type_cm AND -------------A1

Line 2065: ELSIF p_araa.application_type = jai_constants.ar_invoice_type_cm AND -------------A1

2061: lv_app_doc_type := jai_constants.trx_type_rct_unapp ;/* Event is 'RECEIPT_UNAPPLICATION' */
2062: END IF;
2063:
2064:
2065: ELSIF p_araa.application_type = jai_constants.ar_invoice_type_cm AND -------------A1
2066: p_araa.customer_trx_id IS NOT NULL
2067: THEN
2068: /*
2069: ||Application is Credit Memo

Line 2085: p_process_flag := jai_constants.not_applicable ;

2081: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2082: pv_log_msg => ' Skip As TCS not applicable ON Derived from documents '
2083: );*/
2084: CLOSE cur_chk_tcs_applicable;
2085: p_process_flag := jai_constants.not_applicable ;
2086: return;
2087: END IF;
2088: CLOSE cur_chk_tcs_applicable;
2089:

Line 2102: lv_app_doc_type := jai_constants.trx_type_cm_app ; /* Event is 'CREDIT_MEMO_APPLICATION' */

2098: || IF sign of amount field of receivable application is the same as the sign of the Credit Memo amount
2099: || then application is Credit Memo Application else it would be Credit Memo Unapplication
2100: */
2101: IF ln_sign_of_app = ln_sign_of_app_fr_doc THEN
2102: lv_app_doc_type := jai_constants.trx_type_cm_app ; /* Event is 'CREDIT_MEMO_APPLICATION' */
2103: ELSE
2104: lv_app_doc_type := jai_constants.trx_type_cm_unapp ;/* Event is 'CREDIT_MEMO_UNAPPLICATION' */
2105: END IF;
2106:

Line 2104: lv_app_doc_type := jai_constants.trx_type_cm_unapp ;/* Event is 'CREDIT_MEMO_UNAPPLICATION' */

2100: */
2101: IF ln_sign_of_app = ln_sign_of_app_fr_doc THEN
2102: lv_app_doc_type := jai_constants.trx_type_cm_app ; /* Event is 'CREDIT_MEMO_APPLICATION' */
2103: ELSE
2104: lv_app_doc_type := jai_constants.trx_type_cm_unapp ;/* Event is 'CREDIT_MEMO_UNAPPLICATION' */
2105: END IF;
2106:
2107: /*
2108: ||Get the value for the item classification pertaining to the IO and inventory item combination

Line 2111: p_regime_code => jai_constants.tcs_regime ,

2107: /*
2108: ||Get the value for the item classification pertaining to the IO and inventory item combination
2109: */
2110: jai_inv_items_pkg.jai_get_attrib (
2111: p_regime_code => jai_constants.tcs_regime ,
2112: p_organization_id => ln_app_fr_organization_id ,
2113: p_inventory_item_id => ln_app_fr_inventory_item_id ,
2114: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
2115: p_attribute_value => ln_app_fr_itm_class ,

Line 2114: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,

2110: jai_inv_items_pkg.jai_get_attrib (
2111: p_regime_code => jai_constants.tcs_regime ,
2112: p_organization_id => ln_app_fr_organization_id ,
2113: p_inventory_item_id => ln_app_fr_inventory_item_id ,
2114: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
2115: p_attribute_value => ln_app_fr_itm_class ,
2116: p_process_flag => lv_process_flag ,
2117: p_process_msg => lv_process_message
2118: );

Line 2120: IF lv_process_flag = jai_constants.expected_error OR ---------A2

2116: p_process_flag => lv_process_flag ,
2117: p_process_msg => lv_process_message
2118: );
2119:
2120: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2121: lv_process_flag = jai_constants.unexpected_error
2122: THEN
2123: /*
2124: || As Returned status is an error hence:-

Line 2121: lv_process_flag = jai_constants.unexpected_error

2117: p_process_msg => lv_process_message
2118: );
2119:
2120: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2121: lv_process_flag = jai_constants.unexpected_error
2122: THEN
2123: /*
2124: || As Returned status is an error hence:-
2125: || Set out variables p_process_flag and p_process_message accordingly

Line 2147: p_process_flag := jai_constants.not_applicable ;

2143: /*commented by csahoo for bug# 6401388
2144: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2145: pv_log_msg => ' Skip as scenario is niether CASH nor CM '
2146: );*/
2147: p_process_flag := jai_constants.not_applicable ;
2148: return;
2149: END IF; -------------A1
2150:
2151: /*commented by csahoo for bug# 6401388

Line 2170: p_process_flag := jai_constants.not_applicable ;

2166: FETCH cur_chk_tcs_applicable INTO ln_app_to_organization_id, ln_app_to_inventory_item_id, ln_app_to_amount ;
2167:
2168: IF CUR_CHK_TCS_APPLICABLE%NOTFOUND THEN
2169: CLOSE cur_chk_tcs_applicable;
2170: p_process_flag := jai_constants.not_applicable ;
2171: /*commented by csahoo for bug# 6401388
2172: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2173: pv_log_msg => ' Skip the processing as TCS is not applicable on the transaction'
2174: );*/

Line 2183: p_regime_code => jai_constants.tcs_regime ,

2179: /*
2180: ||Get the value for the item classification pertaining to the IO and inventory item combination
2181: */
2182: jai_inv_items_pkg.jai_get_attrib (
2183: p_regime_code => jai_constants.tcs_regime ,
2184: p_organization_id => ln_app_to_organization_id ,
2185: p_inventory_item_id => ln_app_to_inventory_item_id ,
2186: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
2187: p_attribute_value => ln_app_to_itm_class ,

Line 2186: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,

2182: jai_inv_items_pkg.jai_get_attrib (
2183: p_regime_code => jai_constants.tcs_regime ,
2184: p_organization_id => ln_app_to_organization_id ,
2185: p_inventory_item_id => ln_app_to_inventory_item_id ,
2186: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
2187: p_attribute_value => ln_app_to_itm_class ,
2188: p_process_flag => lv_process_flag ,
2189: p_process_msg => lv_process_message
2190: );

Line 2192: IF lv_process_flag = jai_constants.expected_error OR ---------A2

2188: p_process_flag => lv_process_flag ,
2189: p_process_msg => lv_process_message
2190: );
2191:
2192: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2193: lv_process_flag = jai_constants.unexpected_error
2194: THEN
2195: /*
2196: || As Returned status is an error hence:-

Line 2193: lv_process_flag = jai_constants.unexpected_error

2189: p_process_msg => lv_process_message
2190: );
2191:
2192: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2193: lv_process_flag = jai_constants.unexpected_error
2194: THEN
2195: /*
2196: || As Returned status is an error hence:-
2197: || Set out variables p_process_flag and p_process_message accordingly

Line 2221: IF lv_app_doc_type IN ( jai_constants.trx_type_rct_app ,

2217: || All lines of the applied from and to documents should belong to the same item classification.
2218: || Do not allow a transaction if this rule is not followed.
2219: */
2220:
2221: IF lv_app_doc_type IN ( jai_constants.trx_type_rct_app ,
2222: jai_constants.trx_type_cm_app
2223: )
2224: THEN
2225: IF ln_app_fr_itm_class <> ln_app_to_itm_class THEN

Line 2222: jai_constants.trx_type_cm_app

2218: || Do not allow a transaction if this rule is not followed.
2219: */
2220:
2221: IF lv_app_doc_type IN ( jai_constants.trx_type_rct_app ,
2222: jai_constants.trx_type_cm_app
2223: )
2224: THEN
2225: IF ln_app_fr_itm_class <> ln_app_to_itm_class THEN
2226:

Line 2233: p_process_flag := jai_constants.expected_error ;

2229: pv_log_msg => ' Item classification for the application from and to item class do not match hence error '||fnd_global.local_chr(10)
2230: ||', p_process_flag -> '|| p_process_flag
2231: ||', lv_process_message -> '|| lv_process_message
2232: );*/
2233: p_process_flag := jai_constants.expected_error ;
2234: p_process_message := 'Application is not allowed as the APPLIED FROM and TO DOCUMENTS have different item classifications.';
2235: return;
2236: END IF;
2237: END IF;

Line 2251: p_process_flag := jai_constants.expected_error ;

2247: ||', applied to amount -> '|| ln_app_to_amount ||fnd_global.local_chr(10)
2248: ||', p_process_flag -> '|| p_process_flag ||fnd_global.local_chr(10)
2249: ||', lv_process_message -> '|| lv_process_message
2250: );*/
2251: p_process_flag := jai_constants.expected_error ;
2252: p_process_message := 'Over Application of a document to other is not allowed if both the taxes have TCS type of taxes .';
2253: return;
2254: END IF;
2255:

Line 2265: IF lv_app_doc_type = jai_constants.trx_type_rct_unapp THEN

2261: /*########################################################################################################
2262: || RESTRICTIONS ON RECEIPT UNAPPLICATION
2263: ########################################################################################################*/
2264:
2265: IF lv_app_doc_type = jai_constants.trx_type_rct_unapp THEN
2266: /*
2267: ||Validate that the parent receipt application record is present in the repository.
2268: */
2269: OPEN cur_chk_parent_rec ( cp_applied_fr_doc_id => p_araa.cash_receipt_id ,

Line 2285: p_process_flag := jai_constants.not_applicable ;

2281: pv_log_msg => 'Skip,case For unapplication, Parent transaction record is not present in the repository'||fnd_global.local_chr(10)
2282: ||', p_process_flag -> '|| p_process_flag ||fnd_global.local_chr(10)
2283: );*/
2284:
2285: p_process_flag := jai_constants.not_applicable ;
2286: return;
2287: END IF;
2288:
2289: CLOSE cur_chk_parent_rec;

Line 2295: p_process_flag := jai_constants.expected_error ;

2291: IF rec_cur_chk_parent_rec.settlement_id is NOT NULL THEN
2292: /*
2293: || Original Application already settled hence
2294: */
2295: p_process_flag := jai_constants.expected_error ;
2296: p_process_message := 'Parent application has already been settled. hence cannot unapply';
2297: /*commented by csahoo for bug# 6401388
2298: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2299: pv_log_msg => ' Error :-Parent application has already been settled. hence cannot unapply'||fnd_global.local_chr(10)

Line 2314: IF lv_app_doc_type = jai_constants.trx_type_cm_unapp THEN

2310: /*########################################################################################################
2311: || RESTRICTIONS ON CREDIT MEMO UNAPPLICATION
2312: ########################################################################################################*/
2313:
2314: IF lv_app_doc_type = jai_constants.trx_type_cm_unapp THEN
2315: /*
2316: ||Validate that the parent credit memo application record is present in the repository.
2317: */
2318: OPEN cur_chk_parent_rec ( cp_applied_fr_doc_id => p_araa.customer_trx_id ,

Line 2332: p_process_flag := jai_constants.not_applicable ;

2328: pv_log_msg => ' Skip the processing as TCS is not applicable on the transaction'||fnd_global.local_chr(10)
2329: ||', p_process_flag -> '|| p_process_flag
2330: );*/
2331: CLOSE cur_chk_parent_rec;
2332: p_process_flag := jai_constants.not_applicable ;
2333: return;
2334: END IF;
2335:
2336: CLOSE cur_chk_parent_rec;

Line 2348: p_process_flag := jai_constants.expected_error ;

2344: pv_log_msg => ' Error :-Parent application has already been settled. hence cannot unapply'||fnd_global.local_chr(10)
2345: ||', p_process_flag -> '|| p_process_flag
2346: ||', lv_process_message -> '|| lv_process_message
2347: );*/
2348: p_process_flag := jai_constants.expected_error ;
2349: p_process_message := 'Parent application has already been settled. hence cannot unapply';
2350: return;
2351: END IF;
2352: END IF;

Line 2396: AND jrttv.regime_code = jai_constants.tcs_regime

2392: WHERE
2393: jcra.cash_receipt_id = cp_cash_receipt_id
2394: AND jcra.cash_receipt_id = jdt.source_doc_id
2395: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
2396: AND jrttv.regime_code = jai_constants.tcs_regime
2397: AND jcra.confirm_flag = jai_constants.yes
2398: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
2399:
2400: /*

Line 2397: AND jcra.confirm_flag = jai_constants.yes

2393: jcra.cash_receipt_id = cp_cash_receipt_id
2394: AND jcra.cash_receipt_id = jdt.source_doc_id
2395: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
2396: AND jrttv.regime_code = jai_constants.tcs_regime
2397: AND jcra.confirm_flag = jai_constants.yes
2398: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
2399:
2400: /*
2401: ||Get the last record pertaining to the cash receipt confirmation

Line 2398: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug

2394: AND jcra.cash_receipt_id = jdt.source_doc_id
2395: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
2396: AND jrttv.regime_code = jai_constants.tcs_regime
2397: AND jcra.confirm_flag = jai_constants.yes
2398: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
2399:
2400: /*
2401: ||Get the last record pertaining to the cash receipt confirmation
2402: */

Line 2448: lv_process_flag := jai_constants.successful ;

2444: ||', p_acra.amount -> '||p_acra.amount ||fnd_global.local_chr(10)
2445: ||', p_acra.type -> '||p_acra.type ||fnd_global.local_chr(10)
2446: );*/
2447:
2448: lv_process_flag := jai_constants.successful ;
2449: lv_process_message := null ;
2450:
2451: p_process_flag := lv_process_flag ;
2452: p_process_message := lv_process_message ;

Line 2470: p_process_flag := jai_constants.not_applicable;

2466: OPEN cur_chk_tcs_applicable ( cp_cash_receipt_id => p_acra.cash_receipt_id );
2467: FETCH cur_chk_tcs_applicable INTO ln_exists;
2468: IF cur_chk_tcs_applicable%NOTFOUND THEN
2469: CLOSE cur_chk_tcs_applicable ;
2470: p_process_flag := jai_constants.not_applicable;
2471: return;
2472: END IF;
2473: CLOSE cur_chk_tcs_applicable ;
2474:

Line 2479: IF p_document_type = jai_constants.trx_type_rct_rvs THEN /* 'RECEIPT_REVERSAL' */

2475: /*########################################################################################################
2476: || VALIDATIONS FOR RECEIPT REVERSAL
2477: ########################################################################################################*/
2478:
2479: IF p_document_type = jai_constants.trx_type_rct_rvs THEN /* 'RECEIPT_REVERSAL' */
2480: /*
2481: || Check that an original record with cash receipt confirmation exists in the repository.
2482: || In case it does not exist, then error out the record as it need not hit the repository
2483: || If it exists then check whether it has been settled . If yes then throw an error

Line 2490: cp_source_document_type => jai_constants.ar_cash_tax_confirmed

2486: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2487: pv_log_msg => 'Validate for Receipt Reversal '
2488: );*/
2489: OPEN cur_chk_tcs_settlement ( cp_source_document_id => p_acra.cash_receipt_id ,
2490: cp_source_document_type => jai_constants.ar_cash_tax_confirmed
2491: );
2492: FETCH cur_chk_tcs_settlement INTO rec_cur_chk_tcs_settlement;
2493: IF CUR_CHK_TCS_SETTLEMENT%NOTFOUND THEN
2494: /*

Line 2502: p_process_flag := jai_constants.expected_error;

2498: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2499: pv_log_msg => 'Original Receipt Confirmation records does not exists in the repository. Cannot reverse receipt'
2500: );*/
2501: CLOSE cur_chk_tcs_settlement;
2502: p_process_flag := jai_constants.expected_error;
2503: p_process_message := 'Cannot reverse the receipt as the receipt confirmation record does not exists in the repository ';
2504: return;
2505: ELSE
2506: /*

Line 2518: p_process_flag := jai_constants.expected_error;

2514: /*commented by csahoo for bug# 6401388
2515: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2516: pv_log_msg => ' TCS On the original confirmed receipt has been settled. CAnnot reverse the receipt'
2517: );*/
2518: p_process_flag := jai_constants.expected_error;
2519: p_process_message := 'Cannot reverse the receipt as the tcs taxes pertaining to the receipt have been confirmed ';
2520: return;
2521: END IF;
2522: END IF;

Line 2557: AND rct.account_class = jai_constants.account_class_rec

2553: ra_cust_trx_line_gl_dist_all rct
2554: , jai_ar_trx_lines jatl --added by eric for inclusive tax
2555: WHERE jatl.customer_trx_id = rct.customer_trx_id --added by eric for inclusive tax
2556: AND rct.customer_trx_id = p_ract.customer_trx_id
2557: AND rct.account_class = jai_constants.account_class_rec
2558: AND rct.latest_rec_flag = jai_constants.yes;
2559:
2560: -- Added by Jia Li for inclusive taxes on 2008-01-18
2561: ----------------------------------------------------------------

Line 2558: AND rct.latest_rec_flag = jai_constants.yes;

2554: , jai_ar_trx_lines jatl --added by eric for inclusive tax
2555: WHERE jatl.customer_trx_id = rct.customer_trx_id --added by eric for inclusive tax
2556: AND rct.customer_trx_id = p_ract.customer_trx_id
2557: AND rct.account_class = jai_constants.account_class_rec
2558: AND rct.latest_rec_flag = jai_constants.yes;
2559:
2560: -- Added by Jia Li for inclusive taxes on 2008-01-18
2561: ----------------------------------------------------------------
2562: CURSOR cur_get_inv_exclu_amt

Line 2619: AND jrttv.regime_code = jai_constants.tcs_regime;

2615: WHERE
2616: jrcttl.link_to_cust_trx_line_id = cp_customer_trx_line_id
2617: AND jrcttl.tax_id = jtc.tax_id
2618: AND jrttv.tax_type = jtc.tax_type
2619: AND jrttv.regime_code = jai_constants.tcs_regime;
2620:
2621: CURSOR cur_get_no_of_rows
2622: IS
2623: SELECT

Line 2632: ln_last_line_flag VARCHAR2(1) := jai_constants.no ;

2628: customer_trx_id = p_ract.customer_trx_id ;
2629:
2630: ln_row_count NUMBER(3) ;
2631: ln_line_counter NUMBER(3) := 0 ;
2632: ln_last_line_flag VARCHAR2(1) := jai_constants.no ;
2633: lv_process_flag VARCHAR2(2) ;
2634: lv_process_message VARCHAR2(2000) ;
2635: lv_document_type VARCHAR2(100) ;
2636: ln_trx_ref_id JAI_RGM_REFS_ALL.TRX_REF_ID%TYPE ;

Line 2653: lv_process_flag := jai_constants.successful ;

2649: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context
2650: , pn_reg_id => ln_reg_id
2651: );*/
2652:
2653: lv_process_flag := jai_constants.successful ;
2654: lv_process_message := null ;
2655:
2656: p_process_flag := lv_process_flag ;
2657: p_process_message := lv_process_message ;

Line 2665: IF p_document_type IN ( jai_constants.trx_type_inv_comp ,

2661: ||Check that the document is of type
2662: ||Confirmed cash receipt
2663: *******/
2664:
2665: IF p_document_type IN ( jai_constants.trx_type_inv_comp ,
2666: jai_constants.trx_type_inv_incomp
2667: )
2668: THEN ---------A1
2669: /*########################################################################################################

Line 2666: jai_constants.trx_type_inv_incomp

2662: ||Confirmed cash receipt
2663: *******/
2664:
2665: IF p_document_type IN ( jai_constants.trx_type_inv_comp ,
2666: jai_constants.trx_type_inv_incomp
2667: )
2668: THEN ---------A1
2669: /*########################################################################################################
2670: || DERIVE VALUES AND INSERT COMPLETED INVOICES INTO JAI_RGM_TRX_REFS_ALL TABLE ---- PART -1

Line 2689: IF p_document_type = jai_constants.trx_type_inv_incomp THEN

2685:
2686: ln_total_inv_amount := ln_total_inv_amount + ln_total_inv_exclu_amt;
2687: ----------------------------------------------------------------------
2688:
2689: IF p_document_type = jai_constants.trx_type_inv_incomp THEN
2690: /*
2691: ||Reverse the sign of the amount if the invoice is gettin incompleted.
2692: */
2693: ln_total_inv_amount := ln_total_inv_amount * (-1);

Line 2707: p_regime_code => jai_constants.tcs_regime ,

2703: /*
2704: ||Get the value for the item classification pertaining to the IO and inventory item combination
2705: */
2706: jai_inv_items_pkg.jai_get_attrib (
2707: p_regime_code => jai_constants.tcs_regime ,
2708: p_organization_id => rec_cur_get_inv_line_det.organization_id ,
2709: p_inventory_item_id => rec_cur_get_inv_line_det.inventory_item_id ,
2710: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
2711: p_attribute_value => lv_item_classification ,

Line 2710: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,

2706: jai_inv_items_pkg.jai_get_attrib (
2707: p_regime_code => jai_constants.tcs_regime ,
2708: p_organization_id => rec_cur_get_inv_line_det.organization_id ,
2709: p_inventory_item_id => rec_cur_get_inv_line_det.inventory_item_id ,
2710: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
2711: p_attribute_value => lv_item_classification ,
2712: p_process_flag => lv_process_flag ,
2713: p_process_msg => lv_process_message
2714: );

Line 2717: IF lv_process_flag = jai_constants.expected_error OR ---------A2

2713: p_process_msg => lv_process_message
2714: );
2715:
2716:
2717: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2718: lv_process_flag = jai_constants.unexpected_error
2719: THEN
2720: /*
2721: || As Returned status is an error/not applicable hence:-

Line 2718: lv_process_flag = jai_constants.unexpected_error

2714: );
2715:
2716:
2717: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2718: lv_process_flag = jai_constants.unexpected_error
2719: THEN
2720: /*
2721: || As Returned status is an error/not applicable hence:-
2722: || Set out variables p_process_flag and p_process_message accordingly

Line 2730: IF p_document_type = jai_constants.trx_type_inv_incomp THEN

2726: p_process_message := lv_process_message ;
2727: return;
2728: END IF; ---------A2
2729:
2730: IF p_document_type = jai_constants.trx_type_inv_incomp THEN
2731: /*
2732: ||Reverse the sign of the amount if the invoice is getting incompleted.
2733: */
2734: rec_cur_get_inv_line_det.line_amount := rec_cur_get_inv_line_det.line_amount * (-1);

Line 2762: p_table_name => jai_constants.ar_inv_lines_table ,

2758: p_document_id => p_ract.customer_trx_id ,
2759: p_document_type => p_document_type ,
2760: p_document_line_id => rec_cur_get_inv_line_det.customer_trx_line_id ,
2761: p_document_date => ld_document_date ,
2762: p_table_name => jai_constants.ar_inv_lines_table ,
2763: p_line_amount => rec_cur_get_inv_line_det.line_amount * nvl( p_ract.exchange_rate , 1 ) ,
2764: p_document_amount => ln_total_inv_amount ,
2765: p_org_id => p_ract.org_id ,
2766: p_organization_id => rec_cur_get_inv_line_det.organization_id ,

Line 2775: IF lv_process_flag = jai_constants.expected_error OR ---------A2

2771: p_process_flag => lv_process_flag ,
2772: p_process_message => lv_process_message
2773: );
2774:
2775: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2776: lv_process_flag = jai_constants.unexpected_error
2777: THEN
2778: /*
2779: || As Returned status is an error/not applicable hence:-

Line 2776: lv_process_flag = jai_constants.unexpected_error

2772: p_process_message => lv_process_message
2773: );
2774:
2775: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2776: lv_process_flag = jai_constants.unexpected_error
2777: THEN
2778: /*
2779: || As Returned status is an error/not applicable hence:-
2780: || Set out variables p_process_flag and p_process_message accordingly

Line 2792: IF p_document_type = jai_constants.trx_type_inv_incomp THEN

2788: /*########################################################################################################
2789: || INSERT INVOICE TAXES INTO JAI_RGM_TAXES TABLE ---- PART -2
2790: ########################################################################################################*/
2791:
2792: IF p_document_type = jai_constants.trx_type_inv_incomp THEN
2793: /*
2794: ||Reverse the sign of the amount if the invoice is getting incompleted.
2795: */
2796: ln_apportion_factor := -1;

Line 2810: IF lv_process_flag = jai_constants.expected_error OR ---------A2

2806: p_process_flag => lv_process_flag ,
2807: p_process_message => lv_process_message
2808: );
2809:
2810: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2811: lv_process_flag = jai_constants.unexpected_error OR
2812: lv_process_flag = jai_constants.not_applicable
2813: THEN
2814: /*

Line 2811: lv_process_flag = jai_constants.unexpected_error OR

2807: p_process_message => lv_process_message
2808: );
2809:
2810: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2811: lv_process_flag = jai_constants.unexpected_error OR
2812: lv_process_flag = jai_constants.not_applicable
2813: THEN
2814: /*
2815: || As Returned status is an error/not applicable hence:-

Line 2812: lv_process_flag = jai_constants.not_applicable

2808: );
2809:
2810: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2811: lv_process_flag = jai_constants.unexpected_error OR
2812: lv_process_flag = jai_constants.not_applicable
2813: THEN
2814: /*
2815: || As Returned status is an error/not applicable hence:-
2816: || Set out variables p_process_flag and p_process_message accordingly

Line 2877: AND jrttv.regime_code = jai_constants.tcs_regime

2873: WHERE
2874: jdt.tax_id = jtc.tax_id
2875: AND jtc.tax_type = jrttv.tax_type
2876: AND jdt.source_doc_id = p_acra.cash_receipt_id
2877: AND jrttv.regime_code = jai_constants.tcs_regime
2878: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
2879:
2880: /*****
2881: || Get all the applications for which Cash Receipt has got TCS type of taxes

Line 2878: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug

2874: jdt.tax_id = jtc.tax_id
2875: AND jtc.tax_type = jrttv.tax_type
2876: AND jdt.source_doc_id = p_acra.cash_receipt_id
2877: AND jrttv.regime_code = jai_constants.tcs_regime
2878: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
2879:
2880: /*****
2881: || Get all the applications for which Cash Receipt has got TCS type of taxes
2882: || and the corresponding invoice also have got TCS type of tax.

Line 2897: AND ra.display = jai_constants.yes

2893: ra.cash_receipt_id = jcra.cash_receipt_id
2894: AND ra.cash_receipt_id = cp_cash_receipt_id
2895: AND ra.status = 'APP'
2896: AND ra.application_type = 'CASH'
2897: AND ra.display = jai_constants.yes
2898: AND jcra.confirm_flag = jai_constants.yes
2899: AND exists ( SELECT /* TCS type of taxes exist for the receipt */
2900: 1
2901: FROM

Line 2898: AND jcra.confirm_flag = jai_constants.yes

2894: AND ra.cash_receipt_id = cp_cash_receipt_id
2895: AND ra.status = 'APP'
2896: AND ra.application_type = 'CASH'
2897: AND ra.display = jai_constants.yes
2898: AND jcra.confirm_flag = jai_constants.yes
2899: AND exists ( SELECT /* TCS type of taxes exist for the receipt */
2900: 1
2901: FROM
2902: jai_cmn_document_taxes jdt ,

Line 2906: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */

2902: jai_cmn_document_taxes jdt ,
2903: jai_regime_tax_types_v jrttv
2904: WHERE
2905: jdt.source_doc_id = jcra.cash_receipt_id
2906: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
2907: AND jdt.tax_type = jrttv.tax_type
2908: AND jrttv.regime_code = jai_constants.tcs_regime
2909: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash --added by eric for a bug
2910: )

Line 2908: AND jrttv.regime_code = jai_constants.tcs_regime

2904: WHERE
2905: jdt.source_doc_id = jcra.cash_receipt_id
2906: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
2907: AND jdt.tax_type = jrttv.tax_type
2908: AND jrttv.regime_code = jai_constants.tcs_regime
2909: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash --added by eric for a bug
2910: )
2911: AND exists ( SELECT /* TCS type of taxes exist for the corresponding Invoice */
2912: 1

Line 2909: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash --added by eric for a bug

2905: jdt.source_doc_id = jcra.cash_receipt_id
2906: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
2907: AND jdt.tax_type = jrttv.tax_type
2908: AND jrttv.regime_code = jai_constants.tcs_regime
2909: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash --added by eric for a bug
2910: )
2911: AND exists ( SELECT /* TCS type of taxes exist for the corresponding Invoice */
2912: 1
2913: FROM

Line 2923: AND jrttv.regime_code = jai_constants.tcs_regime

2919: jrctl.customer_trx_id = ra.applied_customer_trx_id
2920: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
2921: AND jrcttl.tax_id = jtc.tax_id
2922: AND jtc.tax_type = jrttv.tax_type
2923: AND jrttv.regime_code = jai_constants.tcs_regime
2924: );
2925:
2926: /********
2927: || Get the details of the source receipt

Line 2976: lv_process_flag := jai_constants.successful ;

2972: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context
2973: , pn_reg_id => ln_reg_id
2974: );*/
2975:
2976: lv_process_flag := jai_constants.successful ;
2977: lv_process_message := null ;
2978:
2979: p_process_flag := lv_process_flag ;
2980: p_process_message := lv_process_message ;

Line 2991: IF p_document_type = jai_constants.ar_cash_tax_confirmed THEN ---------C1

2987: ||Confirmed cash receipt
2988:
2989: *******/
2990:
2991: IF p_document_type = jai_constants.ar_cash_tax_confirmed THEN ---------C1
2992: /*commented by csahoo for bug# 6401388
2993: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2994: pv_log_msg => ' Confirmation processing for the receipts with the following details'||fnd_global.local_chr(10)
2995: ||', p_acra.receipt_number -> '||p_acra.receipt_number ||fnd_global.local_chr(10)

Line 3037: p_table_name => jai_constants.jai_cash_rcpts ,

3033: p_document_id => p_acra.cash_receipt_id ,
3034: p_document_type => p_document_type ,
3035: p_document_line_id => p_acra.cash_receipt_id ,
3036: p_document_date => rec_cur_get_cr_details.gl_date ,
3037: p_table_name => jai_constants.jai_cash_rcpts ,
3038: p_line_amount => ln_rcpt_amount ,
3039: p_document_amount => ln_rcpt_amount ,
3040: p_org_id => p_acra.org_id ,
3041: p_organization_id => rec_cur_get_cr_details.organization_id ,

Line 3055: IF lv_process_flag = jai_constants.expected_error OR ---------A2

3051: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3052: pv_log_msg => ' Return from insert_repository_references '
3053: );*/
3054:
3055: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3056: lv_process_flag = jai_constants.unexpected_error OR
3057: lv_process_flag = jai_constants.not_applicable
3058: THEN
3059: /*

Line 3056: lv_process_flag = jai_constants.unexpected_error OR

3052: pv_log_msg => ' Return from insert_repository_references '
3053: );*/
3054:
3055: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3056: lv_process_flag = jai_constants.unexpected_error OR
3057: lv_process_flag = jai_constants.not_applicable
3058: THEN
3059: /*
3060: || As Returned status is an error/not applicable hence:-

Line 3057: lv_process_flag = jai_constants.not_applicable

3053: );*/
3054:
3055: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3056: lv_process_flag = jai_constants.unexpected_error OR
3057: lv_process_flag = jai_constants.not_applicable
3058: THEN
3059: /*
3060: || As Returned status is an error/not applicable hence:-
3061: || Set out variables p_process_flag and p_process_message accordingly

Line 3098: IF lv_process_flag = jai_constants.expected_error OR ---------A2

3094: /*commented by csahoo for bug# 6401388
3095: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3096: pv_log_msg => ' Return from copy_taxes_from_source '
3097: );*/
3098: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3099: lv_process_flag = jai_constants.unexpected_error OR
3100: lv_process_flag = jai_constants.not_applicable
3101: THEN
3102: /*

Line 3099: lv_process_flag = jai_constants.unexpected_error OR

3095: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3096: pv_log_msg => ' Return from copy_taxes_from_source '
3097: );*/
3098: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3099: lv_process_flag = jai_constants.unexpected_error OR
3100: lv_process_flag = jai_constants.not_applicable
3101: THEN
3102: /*
3103: || As Returned status is an error/not applicable hence:-

Line 3100: lv_process_flag = jai_constants.not_applicable

3096: pv_log_msg => ' Return from copy_taxes_from_source '
3097: );*/
3098: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3099: lv_process_flag = jai_constants.unexpected_error OR
3100: lv_process_flag = jai_constants.not_applicable
3101: THEN
3102: /*
3103: || As Returned status is an error/not applicable hence:-
3104: || Set out variables p_process_flag and p_process_message accordingly

Line 3152: IF lv_process_flag = jai_constants.expected_error OR ---------A2

3148: /*commented by csahoo for bug# 6401388
3149: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3150: pv_log_msg => ' Return from jai_ar_tcs_rep_pkg.process_transactions '
3151: );*/
3152: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3153: lv_process_flag = jai_constants.unexpected_error OR
3154: lv_process_flag = jai_constants.not_applicable
3155: THEN
3156: /*

Line 3153: lv_process_flag = jai_constants.unexpected_error OR

3149: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3150: pv_log_msg => ' Return from jai_ar_tcs_rep_pkg.process_transactions '
3151: );*/
3152: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3153: lv_process_flag = jai_constants.unexpected_error OR
3154: lv_process_flag = jai_constants.not_applicable
3155: THEN
3156: /*
3157: || As Returned status is an error/not applicable hence:-

Line 3154: lv_process_flag = jai_constants.not_applicable

3150: pv_log_msg => ' Return from jai_ar_tcs_rep_pkg.process_transactions '
3151: );*/
3152: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3153: lv_process_flag = jai_constants.unexpected_error OR
3154: lv_process_flag = jai_constants.not_applicable
3155: THEN
3156: /*
3157: || As Returned status is an error/not applicable hence:-
3158: || Set out variables p_process_flag and p_process_message accordingly

Line 3183: ELSIF p_document_type = jai_constants.trx_type_rct_rvs THEN ---------C1

3179: /*########################################################################################################
3180: || PROCESS AR CASH RECEIPT REVERSALS ---- PART -4
3181: ########################################################################################################*/
3182:
3183: ELSIF p_document_type = jai_constants.trx_type_rct_rvs THEN ---------C1
3184: /*commented by csahoo for bug# 6401388
3185: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3186: pv_log_msg => ' Start of receipt reversal processing '
3187: );*/

Line 3189: cp_source_document_type => jai_constants.ar_cash_tax_confirmed

3185: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3186: pv_log_msg => ' Start of receipt reversal processing '
3187: );*/
3188: OPEN cur_get_parent_transaction ( cp_source_document_id => p_acra.cash_receipt_id ,
3189: cp_source_document_type => jai_constants.ar_cash_tax_confirmed
3190: ) ;
3191:
3192: FETCH cur_get_parent_transaction INTO ln_parent_transaction_id;
3193: /*

Line 3211: IF lv_process_flag = jai_constants.expected_error OR ---------A2

3207: p_apportion_factor => -1 ,/* As reversal cannot be partial */
3208: p_process_flag => lv_process_flag ,
3209: p_process_message => lv_process_message
3210: );
3211: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3212: lv_process_flag = jai_constants.unexpected_error OR
3213: lv_process_flag = jai_constants.not_applicable
3214: THEN
3215: /*

Line 3212: lv_process_flag = jai_constants.unexpected_error OR

3208: p_process_flag => lv_process_flag ,
3209: p_process_message => lv_process_message
3210: );
3211: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3212: lv_process_flag = jai_constants.unexpected_error OR
3213: lv_process_flag = jai_constants.not_applicable
3214: THEN
3215: /*
3216: || As Returned status is an error/not applicable hence:-

Line 3213: lv_process_flag = jai_constants.not_applicable

3209: p_process_message => lv_process_message
3210: );
3211: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3212: lv_process_flag = jai_constants.unexpected_error OR
3213: lv_process_flag = jai_constants.not_applicable
3214: THEN
3215: /*
3216: || As Returned status is an error/not applicable hence:-
3217: || Set out variables p_process_flag and p_process_message accordingly

Line 3280: AND rcta.complete_flag = jai_constants.yes

3276: JAI_CMN_TAXES_ALL jtc ,
3277: jai_regime_tax_types_v jrttv
3278: WHERE
3279: rcta.customer_trx_id = cp_applied_customer_trx_id
3280: AND rcta.complete_flag = jai_constants.yes
3281: AND rcta.customer_trx_id = gl_dist.customer_trx_id
3282: AND gl_dist.account_class = jai_constants.account_class_rec
3283: AND gl_dist.latest_rec_flag = jai_constants.yes
3284: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id

Line 3282: AND gl_dist.account_class = jai_constants.account_class_rec

3278: WHERE
3279: rcta.customer_trx_id = cp_applied_customer_trx_id
3280: AND rcta.complete_flag = jai_constants.yes
3281: AND rcta.customer_trx_id = gl_dist.customer_trx_id
3282: AND gl_dist.account_class = jai_constants.account_class_rec
3283: AND gl_dist.latest_rec_flag = jai_constants.yes
3284: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
3285: AND rcta.customer_trx_id = jrct.customer_trx_id
3286: AND jrct.customer_trx_id = jrctl.customer_trx_id

Line 3283: AND gl_dist.latest_rec_flag = jai_constants.yes

3279: rcta.customer_trx_id = cp_applied_customer_trx_id
3280: AND rcta.complete_flag = jai_constants.yes
3281: AND rcta.customer_trx_id = gl_dist.customer_trx_id
3282: AND gl_dist.account_class = jai_constants.account_class_rec
3283: AND gl_dist.latest_rec_flag = jai_constants.yes
3284: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
3285: AND rcta.customer_trx_id = jrct.customer_trx_id
3286: AND jrct.customer_trx_id = jrctl.customer_trx_id
3287: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id

Line 3290: AND jrttv.regime_code = jai_constants.tcs_regime

3286: AND jrct.customer_trx_id = jrctl.customer_trx_id
3287: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
3288: AND jrcttl.tax_id = jtc.tax_id
3289: AND jtc.tax_type = jrttv.tax_type
3290: AND jrttv.regime_code = jai_constants.tcs_regime
3291: AND trx_types.type IN ( jai_constants.ar_invoice_type_inv , /* Applied to doc has to be either a invoice or DM or CM */
3292: jai_constants.ar_invoice_type_cm ,
3293: jai_constants.ar_doc_type_dm
3294: );

Line 3291: AND trx_types.type IN ( jai_constants.ar_invoice_type_inv , /* Applied to doc has to be either a invoice or DM or CM */

3287: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
3288: AND jrcttl.tax_id = jtc.tax_id
3289: AND jtc.tax_type = jrttv.tax_type
3290: AND jrttv.regime_code = jai_constants.tcs_regime
3291: AND trx_types.type IN ( jai_constants.ar_invoice_type_inv , /* Applied to doc has to be either a invoice or DM or CM */
3292: jai_constants.ar_invoice_type_cm ,
3293: jai_constants.ar_doc_type_dm
3294: );
3295:

Line 3292: jai_constants.ar_invoice_type_cm ,

3288: AND jrcttl.tax_id = jtc.tax_id
3289: AND jtc.tax_type = jrttv.tax_type
3290: AND jrttv.regime_code = jai_constants.tcs_regime
3291: AND trx_types.type IN ( jai_constants.ar_invoice_type_inv , /* Applied to doc has to be either a invoice or DM or CM */
3292: jai_constants.ar_invoice_type_cm ,
3293: jai_constants.ar_doc_type_dm
3294: );
3295:
3296: -- Added by Jia Li for inclusive taxes on 2008-01-18

Line 3293: jai_constants.ar_doc_type_dm

3289: AND jtc.tax_type = jrttv.tax_type
3290: AND jrttv.regime_code = jai_constants.tcs_regime
3291: AND trx_types.type IN ( jai_constants.ar_invoice_type_inv , /* Applied to doc has to be either a invoice or DM or CM */
3292: jai_constants.ar_invoice_type_cm ,
3293: jai_constants.ar_doc_type_dm
3294: );
3295:
3296: -- Added by Jia Li for inclusive taxes on 2008-01-18
3297: ----------------------------------------------------------------

Line 3355: AND jrttv.regime_code = jai_constants.tcs_regime

3351: AND acra.cash_receipt_id = jcra.cash_receipt_id
3352: AND jcra.cash_receipt_id = jdt.source_doc_id
3353: AND jdt.tax_type = jrttv.tax_type
3354: AND acra.cash_receipt_id = cp_cash_receipt_id
3355: AND jrttv.regime_code = jai_constants.tcs_regime
3356: AND jcra.confirm_flag = jai_constants.yes
3357: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
3358: /*
3359: ||Get the applied to document CM details

Line 3356: AND jcra.confirm_flag = jai_constants.yes

3352: AND jcra.cash_receipt_id = jdt.source_doc_id
3353: AND jdt.tax_type = jrttv.tax_type
3354: AND acra.cash_receipt_id = cp_cash_receipt_id
3355: AND jrttv.regime_code = jai_constants.tcs_regime
3356: AND jcra.confirm_flag = jai_constants.yes
3357: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
3358: /*
3359: ||Get the applied to document CM details
3360: */

Line 3357: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug

3353: AND jdt.tax_type = jrttv.tax_type
3354: AND acra.cash_receipt_id = cp_cash_receipt_id
3355: AND jrttv.regime_code = jai_constants.tcs_regime
3356: AND jcra.confirm_flag = jai_constants.yes
3357: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
3358: /*
3359: ||Get the applied to document CM details
3360: */
3361: CURSOR cur_get_cm_details (cp_customer_trx_id RA_CUST_TRX_LINE_GL_DIST_ALL.CUSTOMER_TRX_ID%TYPE)

Line 3387: rcta.complete_flag = jai_constants.yes

3383: JAI_AR_TRX_TAX_LINES jrcttl ,
3384: JAI_CMN_TAXES_ALL jtc ,
3385: jai_regime_tax_types_v jrttv
3386: WHERE
3387: rcta.complete_flag = jai_constants.yes
3388: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
3389: AND trx_types.type = jai_constants.ar_invoice_type_cm
3390: AND rcta.customer_trx_id = gl_dist.customer_trx_id
3391: AND gl_dist.account_class = jai_constants.account_class_rec

Line 3389: AND trx_types.type = jai_constants.ar_invoice_type_cm

3385: jai_regime_tax_types_v jrttv
3386: WHERE
3387: rcta.complete_flag = jai_constants.yes
3388: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
3389: AND trx_types.type = jai_constants.ar_invoice_type_cm
3390: AND rcta.customer_trx_id = gl_dist.customer_trx_id
3391: AND gl_dist.account_class = jai_constants.account_class_rec
3392: AND gl_dist.latest_rec_flag = jai_constants.yes
3393: AND rcta.customer_trx_id = jrct.customer_trx_id

Line 3391: AND gl_dist.account_class = jai_constants.account_class_rec

3387: rcta.complete_flag = jai_constants.yes
3388: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
3389: AND trx_types.type = jai_constants.ar_invoice_type_cm
3390: AND rcta.customer_trx_id = gl_dist.customer_trx_id
3391: AND gl_dist.account_class = jai_constants.account_class_rec
3392: AND gl_dist.latest_rec_flag = jai_constants.yes
3393: AND rcta.customer_trx_id = jrct.customer_trx_id
3394: AND jrct.customer_trx_id = jrctl.customer_trx_id
3395: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id

Line 3392: AND gl_dist.latest_rec_flag = jai_constants.yes

3388: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
3389: AND trx_types.type = jai_constants.ar_invoice_type_cm
3390: AND rcta.customer_trx_id = gl_dist.customer_trx_id
3391: AND gl_dist.account_class = jai_constants.account_class_rec
3392: AND gl_dist.latest_rec_flag = jai_constants.yes
3393: AND rcta.customer_trx_id = jrct.customer_trx_id
3394: AND jrct.customer_trx_id = jrctl.customer_trx_id
3395: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
3396: AND jrcttl.tax_id = jtc.tax_id

Line 3399: AND jrttv.regime_code = jai_constants.tcs_regime;

3395: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
3396: AND jrcttl.tax_id = jtc.tax_id
3397: AND jtc.tax_type = jrttv.tax_type
3398: AND rcta.customer_trx_id = cp_customer_trx_id
3399: AND jrttv.regime_code = jai_constants.tcs_regime;
3400:
3401: ln_app_fr_doc_amt NUMBER ;
3402: ld_app_fr_doc_date DATE ;
3403: ln_app_fr_doc_id JAI_RGM_REFS_ALL.SOURCE_DOCUMENT_ID%TYPE ;

Line 3463: lv_process_flag := jai_constants.successful ;

3459: ||', amount_applied -> ' ||p_araa.amount_applied ||fnd_global.local_chr(10)
3460: ||', gl_date -> ' ||p_araa.gl_date ||fnd_global.local_chr(10)
3461: ||', org_id -> ' ||p_araa.org_id
3462: );*/
3463: lv_process_flag := jai_constants.successful ;
3464: lv_process_message := null ;
3465: p_process_flag := lv_process_flag ;
3466: p_process_message := lv_process_message ;
3467: ln_app_fr_doc_amt := NULL ;

Line 3497: ln_app_to_doc_table := jai_constants.ar_inv_lines_table ; /* table JAI_AR_TRX_LINES */

3493: OPEN cur_get_doc_type ( cp_customer_trx_id => p_araa.applied_customer_trx_id ) ;
3494: FETCH cur_get_doc_type INTO ln_app_to_doc_type ;
3495: CLOSE cur_get_doc_type ;
3496:
3497: ln_app_to_doc_table := jai_constants.ar_inv_lines_table ; /* table JAI_AR_TRX_LINES */
3498: ln_app_to_doc_type := rec_cur_get_app_to_det.app_to_doc_type ;
3499: ln_to_organization_id := rec_cur_get_app_to_det.app_to_organization_id ;
3500: ln_to_party_id := rec_cur_get_app_to_det.app_to_customer_id ;
3501: ln_to_party_site_id := rec_cur_get_app_to_det.app_to_customer_site_use_id ;

Line 3506: IF p_document_type = jai_constants.trx_type_rct_app THEN -----------A1

3502:
3503: /*########################################################################################################
3504: || VALIDATE AND GET APPLIED FROM DOCUMENT DETAILS ---- PART -3
3505: ########################################################################################################*/
3506: IF p_document_type = jai_constants.trx_type_rct_app THEN -----------A1
3507: /*
3508: ||Applied from document type is Cash Receipt Application
3509: */
3510: OPEN cur_get_cr_details ( cp_cash_receipt_id => p_araa.cash_receipt_id ) ;

Line 3519: ln_app_fr_doc_type := jai_constants.ar_cash_tax_confirmed ; /* Receipt confirmation */

3515: ln_app_fr_doc_amt := rec_cur_get_cr_details.app_fr_doc_amt ;
3516: ln_exchange_rate := rec_cur_get_cr_details.exchange_rate ;
3517:
3518: ln_app_fr_doc_id := p_araa.cash_receipt_id ;
3519: ln_app_fr_doc_type := jai_constants.ar_cash_tax_confirmed ; /* Receipt confirmation */
3520: ln_app_fr_doc_table := jai_constants.jai_cash_rcpts ; /* table JAI_AR_CASH_RECEIPTS_ALL */
3521:
3522: ln_fr_organization_id := rec_cur_get_cr_details.app_fr_organization_id ;
3523: ln_fr_party_id := rec_cur_get_cr_details.pay_from_customer ;

Line 3520: ln_app_fr_doc_table := jai_constants.jai_cash_rcpts ; /* table JAI_AR_CASH_RECEIPTS_ALL */

3516: ln_exchange_rate := rec_cur_get_cr_details.exchange_rate ;
3517:
3518: ln_app_fr_doc_id := p_araa.cash_receipt_id ;
3519: ln_app_fr_doc_type := jai_constants.ar_cash_tax_confirmed ; /* Receipt confirmation */
3520: ln_app_fr_doc_table := jai_constants.jai_cash_rcpts ; /* table JAI_AR_CASH_RECEIPTS_ALL */
3521:
3522: ln_fr_organization_id := rec_cur_get_cr_details.app_fr_organization_id ;
3523: ln_fr_party_id := rec_cur_get_cr_details.pay_from_customer ;
3524: ln_fr_party_site_id := rec_cur_get_cr_details.customer_site_use_id ;

Line 3526: ELSIF p_document_type = jai_constants.trx_type_cm_app THEN

3522: ln_fr_organization_id := rec_cur_get_cr_details.app_fr_organization_id ;
3523: ln_fr_party_id := rec_cur_get_cr_details.pay_from_customer ;
3524: ln_fr_party_site_id := rec_cur_get_cr_details.customer_site_use_id ;
3525:
3526: ELSIF p_document_type = jai_constants.trx_type_cm_app THEN
3527:
3528: OPEN cur_get_cm_details ( cp_customer_trx_id => p_araa.customer_trx_id ) ;
3529: FETCH cur_get_cm_details INTO rec_cur_get_cm_details ;
3530: CLOSE cur_get_cm_details ;

Line 3543: ln_app_fr_doc_type := jai_constants.ar_invoice_type_cm ; /* 'CM' */

3539: ln_app_fr_doc_amt := rec_cur_get_cm_details.app_fr_doc_amt + ln_total_exclu_amt;-- Modified by Jia Li for inclusive tax on 2008-01-18
3540: ln_exchange_rate := rec_cur_get_cm_details.exchange_rate ;
3541:
3542: ln_app_fr_doc_id := p_araa.customer_trx_id ;
3543: ln_app_fr_doc_type := jai_constants.ar_invoice_type_cm ; /* 'CM' */
3544: ln_app_fr_doc_table := jai_constants.ar_inv_lines_table ; /* table JAI_AR_CASH_RECEIPTS_ALL */
3545:
3546: ln_fr_organization_id := rec_cur_get_cm_details.app_to_organization_id ;
3547: ln_fr_party_id := rec_cur_get_cm_details.app_to_customer_id ;

Line 3544: ln_app_fr_doc_table := jai_constants.ar_inv_lines_table ; /* table JAI_AR_CASH_RECEIPTS_ALL */

3540: ln_exchange_rate := rec_cur_get_cm_details.exchange_rate ;
3541:
3542: ln_app_fr_doc_id := p_araa.customer_trx_id ;
3543: ln_app_fr_doc_type := jai_constants.ar_invoice_type_cm ; /* 'CM' */
3544: ln_app_fr_doc_table := jai_constants.ar_inv_lines_table ; /* table JAI_AR_CASH_RECEIPTS_ALL */
3545:
3546: ln_fr_organization_id := rec_cur_get_cm_details.app_to_organization_id ;
3547: ln_fr_party_id := rec_cur_get_cm_details.app_to_customer_id ;
3548: ln_fr_party_site_id := rec_cur_get_cm_details.app_to_customer_site_use_id ;

Line 3600: IF p_document_type = jai_constants.trx_type_rct_app THEN

3596: ln_app_ref_doc_table := ln_app_fr_doc_table ;
3597: ld_source_document_date := ld_app_fr_doc_date ;
3598: --added the IF block for bug#7393380
3599: -- for receipt application, the apportion factor should be negative.
3600: IF p_document_type = jai_constants.trx_type_rct_app THEN
3601: ln_apportion_factor := -1 * ln_app_amount/nvl(ln_app_fr_doc_amt,1) ;
3602: ELSE
3603: ln_apportion_factor := ln_app_amount/nvl(ln_app_fr_doc_amt,1) ;
3604: END IF;

Line 3627: IF p_document_type = jai_constants.trx_type_rct_app THEN

3623: ln_app_ref_doc_type := ln_app_to_doc_type ;
3624: ln_app_ref_doc_table := ln_app_to_doc_table;
3625: ld_source_document_date := ld_app_to_doc_date;
3626: --added the IF block for bug#7393380
3627: IF p_document_type = jai_constants.trx_type_rct_app THEN
3628: ln_apportion_factor := -1 * (ln_app_amount/nvl(ln_app_to_doc_amt,1)) ;
3629: ELSE
3630: ln_apportion_factor := ln_app_amount/nvl(ln_app_to_doc_amt,1) ;
3631: END IF;

Line 3720: p_table_name => jai_constants.ar_receipt_app ,

3716: p_document_id => p_araa.receivable_application_id ,
3717: p_document_type => p_document_type ,
3718: p_document_line_id => p_araa.receivable_application_id ,
3719: p_document_date => ld_source_document_date ,
3720: p_table_name => jai_constants.ar_receipt_app ,
3721: p_line_amount => ln_app_amount ,
3722: p_document_amount => ln_app_amount ,
3723: p_org_id => p_araa.org_id ,
3724: p_organization_id => ln_organization_id ,

Line 3738: IF lv_process_flag = jai_constants.expected_error OR ---------A2

3734: /*commented by csahoo for bug# 6401388
3735: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3736: pv_log_msg => ' Returned from call to insert_repository_references, lv_process_flag -> '||lv_process_flag
3737: );*/
3738: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3739: lv_process_flag = jai_constants.unexpected_error OR
3740: lv_process_flag = jai_constants.not_applicable
3741: THEN
3742: /*

Line 3739: lv_process_flag = jai_constants.unexpected_error OR

3735: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3736: pv_log_msg => ' Returned from call to insert_repository_references, lv_process_flag -> '||lv_process_flag
3737: );*/
3738: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3739: lv_process_flag = jai_constants.unexpected_error OR
3740: lv_process_flag = jai_constants.not_applicable
3741: THEN
3742: /*
3743: || As Returned status is an error/not applicable hence:-

Line 3740: lv_process_flag = jai_constants.not_applicable

3736: pv_log_msg => ' Returned from call to insert_repository_references, lv_process_flag -> '||lv_process_flag
3737: );*/
3738: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3739: lv_process_flag = jai_constants.unexpected_error OR
3740: lv_process_flag = jai_constants.not_applicable
3741: THEN
3742: /*
3743: || As Returned status is an error/not applicable hence:-
3744: || Set out variables p_process_flag and p_process_message accordingly

Line 3777: IF lv_process_flag = jai_constants.expected_error OR ---------A2

3773: /*commented by csahoo for bug# 6401388
3774: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3775: pv_log_msg => ' Returned from call to copy_taxes_from_source, lv_process_flag -> '||lv_process_flag
3776: );*/
3777: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3778: lv_process_flag = jai_constants.unexpected_error OR
3779: lv_process_flag = jai_constants.not_applicable
3780: THEN
3781: /*

Line 3778: lv_process_flag = jai_constants.unexpected_error OR

3774: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3775: pv_log_msg => ' Returned from call to copy_taxes_from_source, lv_process_flag -> '||lv_process_flag
3776: );*/
3777: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3778: lv_process_flag = jai_constants.unexpected_error OR
3779: lv_process_flag = jai_constants.not_applicable
3780: THEN
3781: /*
3782: || As Returned status is an error/not applicable hence:-

Line 3779: lv_process_flag = jai_constants.not_applicable

3775: pv_log_msg => ' Returned from call to copy_taxes_from_source, lv_process_flag -> '||lv_process_flag
3776: );*/
3777: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3778: lv_process_flag = jai_constants.unexpected_error OR
3779: lv_process_flag = jai_constants.not_applicable
3780: THEN
3781: /*
3782: || As Returned status is an error/not applicable hence:-
3783: || Set out variables p_process_flag and p_process_message accordingly

Line 3854: lv_process_flag := jai_constants.successful ;

3850: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context
3851: , pn_reg_id => ln_reg_id
3852: );*/
3853:
3854: lv_process_flag := jai_constants.successful ;
3855: lv_process_message := null ;
3856:
3857: p_process_flag := lv_process_flag ;
3858: p_process_message := lv_process_message ;

Line 3860: /* IF p_document_type In ( jai_constants.trx_type_rct_unapp ,

3856:
3857: p_process_flag := lv_process_flag ;
3858: p_process_message := lv_process_message ;
3859:
3860: /* IF p_document_type In ( jai_constants.trx_type_rct_unapp ,
3861: jai_constants.trx_type_cm_unapp
3862: )
3863: THEN
3864: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 3861: jai_constants.trx_type_cm_unapp

3857: p_process_flag := lv_process_flag ;
3858: p_process_message := lv_process_message ;
3859:
3860: /* IF p_document_type In ( jai_constants.trx_type_rct_unapp ,
3861: jai_constants.trx_type_cm_unapp
3862: )
3863: THEN
3864: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3865: pv_log_msg => ' Processing the UN APPLICATION record ' ||fnd_global.local_chr(10)

Line 3878: ELSIF p_document_type = jai_constants.trx_type_rct_rvs THEN

3874: ||', amount_applied -> ' ||p_araa.amount_applied ||fnd_global.local_chr(10)
3875: ||', gl_date -> ' ||p_araa.gl_date ||fnd_global.local_chr(10)
3876: ||', org_id -> ' ||p_araa.org_id
3877: );
3878: ELSIF p_document_type = jai_constants.trx_type_rct_rvs THEN
3879: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3880: pv_log_msg => ' Processing the Receipt reversal record ' ||fnd_global.local_chr(10)
3881: ||', p_document_type -> ' ||p_document_type ||fnd_global.local_chr(10)
3882: ||', cash_receipt_id -> ' ||p_acra.cash_receipt_id||fnd_global.local_chr(10)

Line 3894: IF p_document_type = jai_constants.trx_type_rct_rvs THEN

3890: /*########################################################################################################
3891: || DERIVE VALUES BASED ON APPLICATION TYPE
3892: ########################################################################################################*/
3893:
3894: IF p_document_type = jai_constants.trx_type_rct_rvs THEN
3895: ln_new_document_id := p_acra.cash_receipt_id ; /* New document id to be created */
3896: ld_new_document_date := p_acra.reversal_date ;
3897:
3898: ln_source_document_id := p_acra.cash_receipt_id ;

Line 3899: lv_source_document_type := jai_constants.ar_cash_tax_confirmed ; /* Parent Document type */

3895: ln_new_document_id := p_acra.cash_receipt_id ; /* New document id to be created */
3896: ld_new_document_date := p_acra.reversal_date ;
3897:
3898: ln_source_document_id := p_acra.cash_receipt_id ;
3899: lv_source_document_type := jai_constants.ar_cash_tax_confirmed ; /* Parent Document type */
3900:
3901:
3902: ELSIF p_document_type = jai_constants.trx_type_rct_unapp THEN
3903: ln_new_document_id := p_araa.receivable_application_id ; /* New document id to be created */

Line 3902: ELSIF p_document_type = jai_constants.trx_type_rct_unapp THEN

3898: ln_source_document_id := p_acra.cash_receipt_id ;
3899: lv_source_document_type := jai_constants.ar_cash_tax_confirmed ; /* Parent Document type */
3900:
3901:
3902: ELSIF p_document_type = jai_constants.trx_type_rct_unapp THEN
3903: ln_new_document_id := p_araa.receivable_application_id ; /* New document id to be created */
3904: ld_new_document_date := p_araa.apply_date ;
3905:
3906: lv_source_document_type := jai_constants.trx_type_rct_app ; /* Parent Document type */

Line 3906: lv_source_document_type := jai_constants.trx_type_rct_app ; /* Parent Document type */

3902: ELSIF p_document_type = jai_constants.trx_type_rct_unapp THEN
3903: ln_new_document_id := p_araa.receivable_application_id ; /* New document id to be created */
3904: ld_new_document_date := p_araa.apply_date ;
3905:
3906: lv_source_document_type := jai_constants.trx_type_rct_app ; /* Parent Document type */
3907: ln_app_from_document_id := p_araa.cash_receipt_id ;
3908: ln_app_to_document_id := p_araa.applied_customer_trx_id ;
3909:
3910:

Line 3911: ELSIF p_document_type = jai_constants.trx_type_cm_unapp THEN

3907: ln_app_from_document_id := p_araa.cash_receipt_id ;
3908: ln_app_to_document_id := p_araa.applied_customer_trx_id ;
3909:
3910:
3911: ELSIF p_document_type = jai_constants.trx_type_cm_unapp THEN
3912: ln_new_document_id := p_araa.receivable_application_id ; /* New document id to be created */
3913: ld_new_document_date := p_araa.apply_date ;
3914:
3915: lv_source_document_type := jai_constants.trx_type_cm_app ; /* Parent Document type */

Line 3915: lv_source_document_type := jai_constants.trx_type_cm_app ; /* Parent Document type */

3911: ELSIF p_document_type = jai_constants.trx_type_cm_unapp THEN
3912: ln_new_document_id := p_araa.receivable_application_id ; /* New document id to be created */
3913: ld_new_document_date := p_araa.apply_date ;
3914:
3915: lv_source_document_type := jai_constants.trx_type_cm_app ; /* Parent Document type */
3916: ln_app_from_document_id := p_araa.customer_trx_id ;
3917: ln_app_to_document_id := p_araa.applied_customer_trx_id ;
3918:
3919: END IF;

Line 3972: IF lv_process_flag = jai_constants.expected_error OR ---------A2

3968: /*commented by csahoo for bug# 6401388
3969: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3970: pv_log_msg => ' returned from call to copy_references lv_process_flag -> '||lv_process_flag
3971: );*/
3972: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3973: lv_process_flag = jai_constants.unexpected_error OR
3974: lv_process_flag = jai_constants.not_applicable
3975: THEN
3976: /*

Line 3973: lv_process_flag = jai_constants.unexpected_error OR

3969: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3970: pv_log_msg => ' returned from call to copy_references lv_process_flag -> '||lv_process_flag
3971: );*/
3972: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3973: lv_process_flag = jai_constants.unexpected_error OR
3974: lv_process_flag = jai_constants.not_applicable
3975: THEN
3976: /*
3977: || As Returned status is an error/not applicable hence:-

Line 3974: lv_process_flag = jai_constants.not_applicable

3970: pv_log_msg => ' returned from call to copy_references lv_process_flag -> '||lv_process_flag
3971: );*/
3972: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3973: lv_process_flag = jai_constants.unexpected_error OR
3974: lv_process_flag = jai_constants.not_applicable
3975: THEN
3976: /*
3977: || As Returned status is an error/not applicable hence:-
3978: || Set out variables p_process_flag and p_process_message accordingly

Line 3995: p_process_flag := jai_constants.not_applicable;

3991: ELSE
3992: /*
3993: ||Base document not found hence skip the document
3994: */
3995: p_process_flag := jai_constants.not_applicable;
3996: END IF; /* Parent transaction found*/
3997: /*commented by csahoo for bug# 6401388
3998: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3999: pv_log_msg => '**************** PROCEDURE PROCESS_UNAPP_RCPT_REV SUCCESSFULLY COMPLETED ****************'

Line 4091: lv_process_flag := jai_constants.successful ;

4087: ||', p_trx_ref_id -> '||p_trx_ref_id ||fnd_global.local_chr(10)
4088: );*/
4089:
4090:
4091: lv_process_flag := jai_constants.successful ;
4092: lv_process_message := null ;
4093:
4094: p_process_flag := lv_process_flag ;
4095: p_process_message := lv_process_message ;

Line 4136: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,

4132: /*commented by csahoo for bug# 6401388
4133: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
4134: pv_log_msg => ' Derive regime values as they are null '
4135: );*/
4136: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
4137: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
4138: cp_organization_id => p_organization_id
4139: ) ;
4140: FETCH c_get_rgm_attribute INTO ln_regime_id, lv_org_tan_no ;

Line 4137: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,

4133: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
4134: pv_log_msg => ' Derive regime values as they are null '
4135: );*/
4136: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
4137: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
4138: cp_organization_id => p_organization_id
4139: ) ;
4140: FETCH c_get_rgm_attribute INTO ln_regime_id, lv_org_tan_no ;
4141: IF C_GET_RGM_ATTRIBUTE%NOTFOUND THEN

Line 4143: p_process_flag := jai_constants.expected_error;

4139: ) ;
4140: FETCH c_get_rgm_attribute INTO ln_regime_id, lv_org_tan_no ;
4141: IF C_GET_RGM_ATTRIBUTE%NOTFOUND THEN
4142: CLOSE c_get_rgm_attribute;
4143: p_process_flag := jai_constants.expected_error;
4144: p_process_message := 'Org Tan Number needs to be defined for the TCS regime ';
4145: return;
4146: END IF;
4147: CLOSE c_get_rgm_attribute;

Line 4196: ||', party_type -> '||jai_constants.party_type_customer ||fnd_global.local_chr(10)

4192: ||', line_amt -> '||p_line_amount ||fnd_global.local_chr(10)
4193: ||', source_document_amt -> '||p_document_amount ||fnd_global.local_chr(10)
4194: ||', total_tax_amt -> '||NULL ||fnd_global.local_chr(10)
4195: ||', party_id -> '||p_party_id ||fnd_global.local_chr(10)
4196: ||', party_type -> '||jai_constants.party_type_customer ||fnd_global.local_chr(10)
4197: ||', party_site_id -> '||p_party_site_id ||fnd_global.local_chr(10)
4198: ||', item_classification -> '||p_item_classification ||fnd_global.local_chr(10)
4199: ||', org_id -> '||p_org_id ||fnd_global.local_chr(10)
4200: ||', organization_id -> '||p_organization_id ||fnd_global.local_chr(10)

Line 4269: jai_constants.party_type_customer ,

4265: p_line_amount ,
4266: p_document_amount ,
4267: NULL ,
4268: p_party_id ,
4269: jai_constants.party_type_customer ,
4270: p_party_site_id ,
4271: p_item_classification ,
4272: p_org_id ,
4273: p_organization_id ,

Line 4411: lv_process_flag := jai_constants.successful ;

4407: ||', p_process_message -> '||p_process_message ||fnd_global.local_chr(10)
4408: );*/
4409:
4410:
4411: lv_process_flag := jai_constants.successful ;
4412: lv_process_message := null ;
4413:
4414: p_process_flag := lv_process_flag ;
4415: p_process_message := lv_process_message ;

Line 4456: ln_exempted_flag := jai_constants.tax_exmpt_flag_std_rate ;

4452: IF ln_orig_tax_rate IS NULL OR
4453: ln_orig_tax_rate = p_tax_rate
4454: THEN
4455:
4456: ln_exempted_flag := jai_constants.tax_exmpt_flag_std_rate ;
4457:
4458: ELSIF ln_orig_tax_rate > p_tax_rate THEN /*rchandan for bug#4742259*/
4459:
4460: ln_exempted_flag := jai_constants.tax_exmpt_flag_lower_rate ;

Line 4460: ln_exempted_flag := jai_constants.tax_exmpt_flag_lower_rate ;

4456: ln_exempted_flag := jai_constants.tax_exmpt_flag_std_rate ;
4457:
4458: ELSIF ln_orig_tax_rate > p_tax_rate THEN /*rchandan for bug#4742259*/
4459:
4460: ln_exempted_flag := jai_constants.tax_exmpt_flag_lower_rate ;
4461:
4462: ELSIF p_tax_rate = 0 THEN
4463: ln_exempted_flag := jai_constants.tax_exmpt_flag_zero_rate ;
4464: END IF;

Line 4463: ln_exempted_flag := jai_constants.tax_exmpt_flag_zero_rate ;

4459:
4460: ln_exempted_flag := jai_constants.tax_exmpt_flag_lower_rate ;
4461:
4462: ELSIF p_tax_rate = 0 THEN
4463: ln_exempted_flag := jai_constants.tax_exmpt_flag_zero_rate ;
4464: END IF;
4465:
4466:
4467:

Line 4471: ln_tax_modified_by := nvl(p_tax_modified_by ,jai_constants.tax_modified_by_system );

4467:
4468: /*
4469: || Determine the Tax modified by flag flag in case it is null
4470: */
4471: ln_tax_modified_by := nvl(p_tax_modified_by ,jai_constants.tax_modified_by_system );
4472:
4473: /*commented by csahoo for bug# 6401388
4474: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
4475: pv_log_msg => ' VALUES insert into JAI_RGM_TAXES are : - ' ||fnd_global.local_chr(10)

Line 4590: AND jrttv.regime_code = jai_constants.tcs_regime;

4586: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
4587: AND jrctl.customer_trx_line_id = nvl( cp_customer_trx_line_id , jrctl.customer_trx_line_id )
4588: AND jrcttl.tax_id = jtc.tax_id
4589: AND jrttv.tax_type = jtc.tax_type
4590: AND jrttv.regime_code = jai_constants.tcs_regime;
4591:
4592:
4593: /*****
4594: ||Get the receipt tax details

Line 4611: AND jrttv.regime_code = jai_constants.tcs_regime

4607: jai_regime_tax_types_v jrttv
4608: WHERE
4609: jdt.tax_type = jrttv.tax_type
4610: AND jdt.source_doc_id = cp_source_doc_id
4611: AND jrttv.regime_code = jai_constants.tcs_regime
4612: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
4613:
4614: lv_process_flag VARCHAR2(2) ;
4615: lv_process_message VARCHAR2(2000) ;

Line 4612: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug

4608: WHERE
4609: jdt.tax_type = jrttv.tax_type
4610: AND jdt.source_doc_id = cp_source_doc_id
4611: AND jrttv.regime_code = jai_constants.tcs_regime
4612: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
4613:
4614: lv_process_flag VARCHAR2(2) ;
4615: lv_process_message VARCHAR2(2000) ;
4616: ln_apportion_factor NUMBER ;

Line 4638: lv_process_flag := jai_constants.successful ;

4634: ||', p_apportion_factor -> '||p_apportion_factor ||fnd_global.local_chr(10)
4635: ||', p_trx_ref_id -> '||p_trx_ref_id ||fnd_global.local_chr(10)
4636: );*/
4637:
4638: lv_process_flag := jai_constants.successful ;
4639: lv_process_message := null ;
4640:
4641: p_process_flag := lv_process_flag ;
4642: p_process_message := lv_process_message ;

Line 4653: jai_constants.trx_type_inv_comp , /* From Invoice completion */

4649: ########################################################################################################*/
4650:
4651:
4652: IF p_source_document_type IN ( --------------------------A1
4653: jai_constants.trx_type_inv_comp , /* From Invoice completion */
4654: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */
4655: jai_constants.ar_invoice_type_inv , /* From Application */
4656: jai_constants.ar_doc_type_dm , /* From Application */
4657: jai_constants.ar_invoice_type_cm /* From Application */

Line 4654: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */

4650:
4651:
4652: IF p_source_document_type IN ( --------------------------A1
4653: jai_constants.trx_type_inv_comp , /* From Invoice completion */
4654: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */
4655: jai_constants.ar_invoice_type_inv , /* From Application */
4656: jai_constants.ar_doc_type_dm , /* From Application */
4657: jai_constants.ar_invoice_type_cm /* From Application */
4658: )

Line 4655: jai_constants.ar_invoice_type_inv , /* From Application */

4651:
4652: IF p_source_document_type IN ( --------------------------A1
4653: jai_constants.trx_type_inv_comp , /* From Invoice completion */
4654: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */
4655: jai_constants.ar_invoice_type_inv , /* From Application */
4656: jai_constants.ar_doc_type_dm , /* From Application */
4657: jai_constants.ar_invoice_type_cm /* From Application */
4658: )
4659: THEN

Line 4656: jai_constants.ar_doc_type_dm , /* From Application */

4652: IF p_source_document_type IN ( --------------------------A1
4653: jai_constants.trx_type_inv_comp , /* From Invoice completion */
4654: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */
4655: jai_constants.ar_invoice_type_inv , /* From Application */
4656: jai_constants.ar_doc_type_dm , /* From Application */
4657: jai_constants.ar_invoice_type_cm /* From Application */
4658: )
4659: THEN
4660: /***

Line 4657: jai_constants.ar_invoice_type_cm /* From Application */

4653: jai_constants.trx_type_inv_comp , /* From Invoice completion */
4654: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */
4655: jai_constants.ar_invoice_type_inv , /* From Application */
4656: jai_constants.ar_doc_type_dm , /* From Application */
4657: jai_constants.ar_invoice_type_cm /* From Application */
4658: )
4659: THEN
4660: /***
4661: || Source is INVOICE/DM/CM

Line 4687: IF lv_process_flag = jai_constants.expected_error OR ---------A2

4683: p_process_flag => lv_process_flag ,
4684: p_process_message => lv_process_message
4685: );
4686:
4687: IF lv_process_flag = jai_constants.expected_error OR ---------A2
4688: lv_process_flag = jai_constants.unexpected_error OR
4689: lv_process_flag = jai_constants.not_applicable
4690: THEN
4691: /*

Line 4688: lv_process_flag = jai_constants.unexpected_error OR

4684: p_process_message => lv_process_message
4685: );
4686:
4687: IF lv_process_flag = jai_constants.expected_error OR ---------A2
4688: lv_process_flag = jai_constants.unexpected_error OR
4689: lv_process_flag = jai_constants.not_applicable
4690: THEN
4691: /*
4692: || As Returned status is an error/not applicable hence:-

Line 4689: lv_process_flag = jai_constants.not_applicable

4685: );
4686:
4687: IF lv_process_flag = jai_constants.expected_error OR ---------A2
4688: lv_process_flag = jai_constants.unexpected_error OR
4689: lv_process_flag = jai_constants.not_applicable
4690: THEN
4691: /*
4692: || As Returned status is an error/not applicable hence:-
4693: || Set out variables p_process_flag and p_process_message accordingly

Line 4707: ELSIF p_source_document_type = jai_constants.ar_cash_tax_confirmed THEN

4703: return;
4704: END IF; ---------A2
4705: END LOOP;
4706:
4707: ELSIF p_source_document_type = jai_constants.ar_cash_tax_confirmed THEN
4708: /*
4709: ||Source is receipt
4710: */
4711: /*commented by csahoo for bug# 6401388

Line 4731: IF lv_process_flag = jai_constants.expected_error OR ---------A3

4727: p_process_flag => lv_process_flag ,
4728: p_process_message => lv_process_message
4729: );
4730:
4731: IF lv_process_flag = jai_constants.expected_error OR ---------A3
4732: lv_process_flag = jai_constants.unexpected_error OR
4733: lv_process_flag = jai_constants.not_applicable
4734: THEN
4735: /*

Line 4732: lv_process_flag = jai_constants.unexpected_error OR

4728: p_process_message => lv_process_message
4729: );
4730:
4731: IF lv_process_flag = jai_constants.expected_error OR ---------A3
4732: lv_process_flag = jai_constants.unexpected_error OR
4733: lv_process_flag = jai_constants.not_applicable
4734: THEN
4735: /*
4736: || As Returned status is an error/not applicable hence:-

Line 4733: lv_process_flag = jai_constants.not_applicable

4729: );
4730:
4731: IF lv_process_flag = jai_constants.expected_error OR ---------A3
4732: lv_process_flag = jai_constants.unexpected_error OR
4733: lv_process_flag = jai_constants.not_applicable
4734: THEN
4735: /*
4736: || As Returned status is an error/not applicable hence:-
4737: || Set out variables p_process_flag and p_process_message accordingly

Line 4823: lv_process_flag := jai_constants.successful ;

4819: ||', p_new_document_date -> '||p_new_document_date ||fnd_global.local_chr(10)
4820: ||', p_apportion_factor -> '||p_apportion_factor ||fnd_global.local_chr(10)
4821: );*/
4822:
4823: lv_process_flag := jai_constants.successful ;
4824: lv_process_message := null ;
4825:
4826: p_process_flag := lv_process_flag ;
4827: p_process_message := lv_process_message ;

Line 5106: p_process_flag := jai_constants.successful ;

5102: ||', p_complete_flag -> '||p_complete_flag ||fnd_global.local_chr(10)
5103: ||', p_org_id -> '||p_org_id
5104: );*/
5105:
5106: p_process_flag := jai_constants.successful ;
5107: p_process_message := null ;
5108:
5109: ln_user_id := fnd_global.user_id ;
5110: ln_login_id := fnd_global.login_id ;

Line 5121: IF p_complete_flag = jai_constants.yes THEN

5117: FETCH cur_upd_gen_docs INTO lv_rowid, ln_generated_doc_id;
5118:
5119:
5120: IF cur_upd_gen_docs%FOUND THEN
5121: IF p_complete_flag = jai_constants.yes THEN
5122: /*
5123: || Complete flag is 'Y', Invoice is getting COMPLETED
5124: || Set the generated_doc_id to null in case it is not null
5125: */

Line 5147: p_process_flag := jai_constants.not_applicable;

5143: pv_log_msg => 'Skip the TCS ITEM GENDOCS update as :- ' ||fnd_global.local_chr(10)
5144: ||', p_complete_flag -> '||p_complete_flag ||fnd_global.local_chr(10)
5145: ||', ln_generated_doc_id -> '||ln_generated_doc_id
5146: );*/
5147: p_process_flag := jai_constants.not_applicable;
5148: return;
5149: END IF;
5150: END IF;
5151:

Line 5228: AND hzcsu.site_use_code = jai_constants.site_use_bill_to

5224: hz_cust_site_uses_all hzcsu
5225: WHERE
5226: hca.cust_account_id = hzcas.cust_account_id
5227: AND hzcas.cust_acct_site_id = hzcsu.cust_acct_site_id
5228: AND hzcsu.site_use_code = jai_constants.site_use_bill_to
5229: AND hca.cust_account_id = cp_party_id
5230: AND hzcsu.site_use_id = cp_party_site_id ;-- site_use_id is the party_site_id ;
5231:
5232: CURSOR cur_get_sob ( cp_org_id jai_rgm_refs_all.org_id%TYPE )

Line 5286: p_process_flag := jai_constants.successful ;

5282: ||', source_document_type is -> '||p_rgm_ref.source_document_type ||fnd_global.local_chr(10)
5283: ||', org_id -> '||p_rgm_ref.org_id
5284: );*/
5285: lv_process_message:= null ;
5286: p_process_flag := jai_constants.successful ;
5287: p_process_message := lv_process_message ;
5288:
5289: ln_user_id := fnd_global.user_id ;
5290: ln_login_id := fnd_global.login_id ;

Line 5300: p_process_flag := jai_constants.not_applicable ;

5296: /*commented by csahoo for bug# 6401388
5297: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5298: pv_log_msg => 'As transaction total_tax_amt is -> '||p_total_tax_amt||' hence skipping the transaction.'
5299: );*/
5300: p_process_flag := jai_constants.not_applicable ;
5301: return;
5302: END IF;
5303:
5304: /*################################################################################################################

Line 5316: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,

5312:
5313: /*
5314: ||Get the value for the Batch Source Debit Memo
5315: */
5316: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
5317: cp_attribute_code => jai_constants.batch_src_dm ,
5318: cp_organization_id => p_rgm_ref.organization_id
5319: );
5320: FETCH c_get_rgm_attribute INTO ln_regime_id ,lv_batch_src_dm;

Line 5317: cp_attribute_code => jai_constants.batch_src_dm ,

5313: /*
5314: ||Get the value for the Batch Source Debit Memo
5315: */
5316: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
5317: cp_attribute_code => jai_constants.batch_src_dm ,
5318: cp_organization_id => p_rgm_ref.organization_id
5319: );
5320: FETCH c_get_rgm_attribute INTO ln_regime_id ,lv_batch_src_dm;
5321: CLOSE c_get_rgm_attribute ;

Line 5327: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,

5323:
5324: /*
5325: ||Get the value for the Batch Source Credit Memo
5326: */
5327: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
5328: cp_attribute_code => jai_constants.batch_src_cm ,
5329: cp_organization_id => p_rgm_ref.organization_id
5330: );
5331: FETCH c_get_rgm_attribute INTO ln_regime_id ,lv_batch_src_cm;

Line 5328: cp_attribute_code => jai_constants.batch_src_cm ,

5324: /*
5325: ||Get the value for the Batch Source Credit Memo
5326: */
5327: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
5328: cp_attribute_code => jai_constants.batch_src_cm ,
5329: cp_organization_id => p_rgm_ref.organization_id
5330: );
5331: FETCH c_get_rgm_attribute INTO ln_regime_id ,lv_batch_src_cm;
5332: CLOSE c_get_rgm_attribute ;

Line 5344: IF p_rgm_ref.source_document_type in ( jai_constants.ar_cash_tax_confirmed , /* Receipt confirmation */

5340: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5341: pv_log_msg => ' Deriving the batch source name based on the document type'
5342: );*/
5343:
5344: IF p_rgm_ref.source_document_type in ( jai_constants.ar_cash_tax_confirmed , /* Receipt confirmation */
5345: jai_constants.trx_type_rct_unapp , /* Receipt unapplication*/
5346: jai_constants.trx_type_cm_app /* CM application*/
5347: )
5348: THEN

Line 5345: jai_constants.trx_type_rct_unapp , /* Receipt unapplication*/

5341: pv_log_msg => ' Deriving the batch source name based on the document type'
5342: );*/
5343:
5344: IF p_rgm_ref.source_document_type in ( jai_constants.ar_cash_tax_confirmed , /* Receipt confirmation */
5345: jai_constants.trx_type_rct_unapp , /* Receipt unapplication*/
5346: jai_constants.trx_type_cm_app /* CM application*/
5347: )
5348: THEN
5349: lv_batch_src_name := lv_batch_src_dm; /* TCS Debit Memo */

Line 5346: jai_constants.trx_type_cm_app /* CM application*/

5342: );*/
5343:
5344: IF p_rgm_ref.source_document_type in ( jai_constants.ar_cash_tax_confirmed , /* Receipt confirmation */
5345: jai_constants.trx_type_rct_unapp , /* Receipt unapplication*/
5346: jai_constants.trx_type_cm_app /* CM application*/
5347: )
5348: THEN
5349: lv_batch_src_name := lv_batch_src_dm; /* TCS Debit Memo */
5350: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;

Line 5350: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;

5346: jai_constants.trx_type_cm_app /* CM application*/
5347: )
5348: THEN
5349: lv_batch_src_name := lv_batch_src_dm; /* TCS Debit Memo */
5350: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;
5351:
5352: ELSIF p_rgm_ref.source_document_type in ( jai_constants.trx_type_rct_app ,
5353: jai_constants.trx_type_rct_rvs ,
5354: jai_constants.trx_type_cm_unapp

Line 5352: ELSIF p_rgm_ref.source_document_type in ( jai_constants.trx_type_rct_app ,

5348: THEN
5349: lv_batch_src_name := lv_batch_src_dm; /* TCS Debit Memo */
5350: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;
5351:
5352: ELSIF p_rgm_ref.source_document_type in ( jai_constants.trx_type_rct_app ,
5353: jai_constants.trx_type_rct_rvs ,
5354: jai_constants.trx_type_cm_unapp
5355: )
5356:

Line 5353: jai_constants.trx_type_rct_rvs ,

5349: lv_batch_src_name := lv_batch_src_dm; /* TCS Debit Memo */
5350: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;
5351:
5352: ELSIF p_rgm_ref.source_document_type in ( jai_constants.trx_type_rct_app ,
5353: jai_constants.trx_type_rct_rvs ,
5354: jai_constants.trx_type_cm_unapp
5355: )
5356:
5357: THEN

Line 5354: jai_constants.trx_type_cm_unapp

5350: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;
5351:
5352: ELSIF p_rgm_ref.source_document_type in ( jai_constants.trx_type_rct_app ,
5353: jai_constants.trx_type_rct_rvs ,
5354: jai_constants.trx_type_cm_unapp
5355: )
5356:
5357: THEN
5358: lv_batch_src_name := lv_batch_src_cm; /* TCS Credit Memo */

Line 5359: lv_trx_number := jai_constants.tcs_cm_prefix; --'TCS-CM';

5355: )
5356:
5357: THEN
5358: lv_batch_src_name := lv_batch_src_cm; /* TCS Credit Memo */
5359: lv_trx_number := jai_constants.tcs_cm_prefix; --'TCS-CM';
5360:
5361: ELSIF p_rgm_ref.source_document_type = jai_constants.tcs_event_surcharge THEN
5362: /*
5363: ||Document generation is invoked by surcharge. Document type will be derrived from the sign of the document amount.

Line 5361: ELSIF p_rgm_ref.source_document_type = jai_constants.tcs_event_surcharge THEN

5357: THEN
5358: lv_batch_src_name := lv_batch_src_cm; /* TCS Credit Memo */
5359: lv_trx_number := jai_constants.tcs_cm_prefix; --'TCS-CM';
5360:
5361: ELSIF p_rgm_ref.source_document_type = jai_constants.tcs_event_surcharge THEN
5362: /*
5363: ||Document generation is invoked by surcharge. Document type will be derrived from the sign of the document amount.
5364: ||If sign is +VE then it should be a Debit Memo, otherwise it should be a Credit Memo
5365: */

Line 5371: lv_trx_number := jai_constants.tcs_cm_prefix; --'TCS-CM';

5367: IF sign (p_total_tax_amt) = -1 THEN
5368:
5369: /* Credit Memo */
5370: lv_batch_src_name := lv_batch_src_cm;
5371: lv_trx_number := jai_constants.tcs_cm_prefix; --'TCS-CM';
5372: ELSIF sign (p_total_tax_amt) = 1 THEN
5373:
5374: /* Debit Memo */
5375: lv_batch_src_name := lv_batch_src_dm;

Line 5376: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM'

5372: ELSIF sign (p_total_tax_amt) = 1 THEN
5373:
5374: /* Debit Memo */
5375: lv_batch_src_name := lv_batch_src_dm;
5376: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM'
5377: END IF;
5378: ELSE
5379: /*
5380: ||Skip the transaction

Line 5386: p_process_flag := jai_constants.not_applicable;

5382: /*commented by csahoo for bug# 6401388
5383: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5384: pv_log_msg => 'Skip the transaction '
5385: );*/
5386: p_process_flag := jai_constants.not_applicable;
5387: p_process_message := null;
5388: return ;
5389: END IF;
5390:

Line 5404: p_process_flag := jai_constants.expected_error;

5400: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5401: pv_log_msg => 'Batch source definition has not be defined for the inventory organization '||p_rgm_ref.organization_id
5402: );*/
5403:
5404: p_process_flag := jai_constants.expected_error;
5405: lv_process_message := 'Batch source definition has not be defined for the inventory organization '||p_rgm_ref.organization_id;
5406: p_process_message := lv_process_message ;
5407: return;
5408: END IF;

Line 5427: p_process_flag := jai_constants.expected_error;

5423: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5424: pv_log_msg => 'TCS batch source has not been defined '
5425: );*/
5426: CLOSE cur_get_batch_source ;
5427: p_process_flag := jai_constants.expected_error;
5428: lv_process_message := 'TCS batch source has not been defined for '||lv_batch_src_name ||'. Cannot process transaction ';
5429: p_process_message := lv_process_message ;
5430: return;
5431: END IF;

Line 5448: IF rec_cur_get_batch_source.type = jai_constants.ar_doc_type_dm THEN

5444: /*################################################################################################################
5445: || DERIVE THE TERM FOR DM'S ONLY
5446: ################################################################################################################*/
5447:
5448: IF rec_cur_get_batch_source.type = jai_constants.ar_doc_type_dm THEN
5449: ln_term_id := rec_cur_get_batch_source.default_term;
5450: /*
5451: || Throw an error if the term has not been defined for the debit memo Transaction type .
5452: || This check is not required in case of credit memo

Line 5459: p_process_flag := jai_constants.expected_error;

5455: /*commented by csahoo for bug# 6401388
5456: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5457: pv_log_msg => 'Error:- Default term is not defined in the transction type -> '||rec_cur_get_batch_source.name
5458: );*/
5459: p_process_flag := jai_constants.expected_error;
5460: lv_process_message := 'Cannot process transaction. A default term needs to be defined FOR the Transaction TYPE '||rec_cur_get_batch_source.name ;
5461: p_process_message := lv_process_message ;
5462: return;
5463: END IF;

Line 5482: p_process_flag := jai_constants.expected_error;

5478: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5479: pv_log_msg => 'Error:- Set of books not defined for org_id -> '||p_rgm_ref.org_id
5480: );*/
5481:
5482: p_process_flag := jai_constants.expected_error;
5483: lv_process_message := 'Set of books not defined for the org id.';
5484: p_process_message := lv_process_message ;
5485: return;
5486: END IF;

Line 5510: p_process_flag := jai_constants.expected_error;

5506: pv_log_msg => 'Error:- Bill to address not defined for the customer id -> '||p_rgm_ref.party_id
5507: ||' customer site -> '||p_rgm_ref.party_site_id
5508: );*/
5509:
5510: p_process_flag := jai_constants.expected_error;
5511: lv_process_message := 'Bill to address not defined for the customer id -> '||p_rgm_ref.party_id ||' customer site -> '||p_rgm_ref.party_site_id;
5512: p_process_message := lv_process_message ;
5513: return;
5514: END IF;

Line 5528: IF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_positive THEN

5524: || 1.+ve if the creation sign of the document is positive
5525: || 1.-ve if the creation sign of the document is -ve
5526: || If the sign is any sign then for a DM create a +ve amount and CM would ve created with a -ve amount
5527: */
5528: IF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_positive THEN
5529: ln_amount := abs(p_total_tax_amt) * 1;
5530:
5531: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_negative THEN
5532: ln_amount := abs(p_total_tax_amt) * -1;

Line 5531: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_negative THEN

5527: */
5528: IF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_positive THEN
5529: ln_amount := abs(p_total_tax_amt) * 1;
5530:
5531: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_negative THEN
5532: ln_amount := abs(p_total_tax_amt) * -1;
5533:
5534: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_any THEN
5535:

Line 5534: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_any THEN

5530:
5531: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_negative THEN
5532: ln_amount := abs(p_total_tax_amt) * -1;
5533:
5534: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_any THEN
5535:
5536: IF rec_cur_get_batch_source.type = jai_constants.ar_doc_type_dm THEN
5537: ln_amount := abs(p_total_tax_amt) ;
5538:

Line 5536: IF rec_cur_get_batch_source.type = jai_constants.ar_doc_type_dm THEN

5532: ln_amount := abs(p_total_tax_amt) * -1;
5533:
5534: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_any THEN
5535:
5536: IF rec_cur_get_batch_source.type = jai_constants.ar_doc_type_dm THEN
5537: ln_amount := abs(p_total_tax_amt) ;
5538:
5539: ELSIF rec_cur_get_batch_source.type = jai_constants.ar_invoice_type_cm THEN
5540: ln_amount := abs(p_total_tax_amt) * -1;

Line 5539: ELSIF rec_cur_get_batch_source.type = jai_constants.ar_invoice_type_cm THEN

5535:
5536: IF rec_cur_get_batch_source.type = jai_constants.ar_doc_type_dm THEN
5537: ln_amount := abs(p_total_tax_amt) ;
5538:
5539: ELSIF rec_cur_get_batch_source.type = jai_constants.ar_invoice_type_cm THEN
5540: ln_amount := abs(p_total_tax_amt) * -1;
5541: END IF;
5542: END IF;
5543:

Line 5563: ||', line_type -> '|| jai_constants.line_type_line || fnd_global.local_chr(10)

5559: ||', trx_date -> '|| p_rgm_ref.source_document_date || fnd_global.local_chr(10)
5560: ||', trx_number -> '|| lv_trx_number || fnd_global.local_chr(10)
5561: ||', batch_source_name -> '|| lv_batch_src_name || fnd_global.local_chr(10)
5562: ||', cust_trx_type_name -> '|| rec_cur_get_batch_source.name || fnd_global.local_chr(10)
5563: ||', line_type -> '|| jai_constants.line_type_line || fnd_global.local_chr(10)
5564: ||', conversion_rate -> '|| 1 || fnd_global.local_chr(10)
5565: ||', conversion_type -> '|| jai_constants.conversion_type_user || fnd_global.local_chr(10)
5566: ||', interface_line_context -> '|| lv_batch_src_name || fnd_global.local_chr(10)
5567: ||', interface_line_attribute2 -> '|| p_rgm_ref.transaction_id || fnd_global.local_chr(10)

Line 5565: ||', conversion_type -> '|| jai_constants.conversion_type_user || fnd_global.local_chr(10)

5561: ||', batch_source_name -> '|| lv_batch_src_name || fnd_global.local_chr(10)
5562: ||', cust_trx_type_name -> '|| rec_cur_get_batch_source.name || fnd_global.local_chr(10)
5563: ||', line_type -> '|| jai_constants.line_type_line || fnd_global.local_chr(10)
5564: ||', conversion_rate -> '|| 1 || fnd_global.local_chr(10)
5565: ||', conversion_type -> '|| jai_constants.conversion_type_user || fnd_global.local_chr(10)
5566: ||', interface_line_context -> '|| lv_batch_src_name || fnd_global.local_chr(10)
5567: ||', interface_line_attribute2 -> '|| p_rgm_ref.transaction_id || fnd_global.local_chr(10)
5568: ||', currency_code -> '|| jai_constants.func_curr || fnd_global.local_chr(10)
5569: ||', primary_salesrep_id -> '|| -3 || fnd_global.local_chr(10)

Line 5568: ||', currency_code -> '|| jai_constants.func_curr || fnd_global.local_chr(10)

5564: ||', conversion_rate -> '|| 1 || fnd_global.local_chr(10)
5565: ||', conversion_type -> '|| jai_constants.conversion_type_user || fnd_global.local_chr(10)
5566: ||', interface_line_context -> '|| lv_batch_src_name || fnd_global.local_chr(10)
5567: ||', interface_line_attribute2 -> '|| p_rgm_ref.transaction_id || fnd_global.local_chr(10)
5568: ||', currency_code -> '|| jai_constants.func_curr || fnd_global.local_chr(10)
5569: ||', primary_salesrep_id -> '|| -3 || fnd_global.local_chr(10)
5570: ||', tax_code -> '|| jai_constants.tax_code_localization || fnd_global.local_chr(10)
5571: ||', term_id -> '|| ln_term_id || fnd_global.local_chr(10)
5572: ||', warehouse_id -> '|| p_rgm_ref.organization_id || fnd_global.local_chr(10)

Line 5570: ||', tax_code -> '|| jai_constants.tax_code_localization || fnd_global.local_chr(10)

5566: ||', interface_line_context -> '|| lv_batch_src_name || fnd_global.local_chr(10)
5567: ||', interface_line_attribute2 -> '|| p_rgm_ref.transaction_id || fnd_global.local_chr(10)
5568: ||', currency_code -> '|| jai_constants.func_curr || fnd_global.local_chr(10)
5569: ||', primary_salesrep_id -> '|| -3 || fnd_global.local_chr(10)
5570: ||', tax_code -> '|| jai_constants.tax_code_localization || fnd_global.local_chr(10)
5571: ||', term_id -> '|| ln_term_id || fnd_global.local_chr(10)
5572: ||', warehouse_id -> '|| p_rgm_ref.organization_id || fnd_global.local_chr(10)
5573: ||', quantity -> '|| 1 || fnd_global.local_chr(10)
5574: ||', unit_selling_price -> '|| ln_amount || fnd_global.local_chr(10)

Line 5623: jai_constants.line_type_line ,

5619: p_rgm_ref.source_document_date ,
5620: lv_trx_number ,
5621: lv_batch_src_name ,
5622: rec_cur_get_batch_source.name ,
5623: jai_constants.line_type_line ,
5624: 1 ,
5625: jai_constants.conversion_type_user ,
5626: lv_batch_src_name ,
5627: p_rgm_ref.transaction_id ,

Line 5625: jai_constants.conversion_type_user ,

5621: lv_batch_src_name ,
5622: rec_cur_get_batch_source.name ,
5623: jai_constants.line_type_line ,
5624: 1 ,
5625: jai_constants.conversion_type_user ,
5626: lv_batch_src_name ,
5627: p_rgm_ref.transaction_id ,
5628: jai_constants.func_curr ,
5629: -3 ,

Line 5628: jai_constants.func_curr ,

5624: 1 ,
5625: jai_constants.conversion_type_user ,
5626: lv_batch_src_name ,
5627: p_rgm_ref.transaction_id ,
5628: jai_constants.func_curr ,
5629: -3 ,
5630: --jai_constants.tax_code_localization ,
5631: --commented the above and added the following for bug#8517919
5632: NULL ,

Line 5630: --jai_constants.tax_code_localization ,

5626: lv_batch_src_name ,
5627: p_rgm_ref.transaction_id ,
5628: jai_constants.func_curr ,
5629: -3 ,
5630: --jai_constants.tax_code_localization ,
5631: --commented the above and added the following for bug#8517919
5632: NULL ,
5633: ln_term_id ,
5634: p_rgm_ref.organization_id ,

Line 5688: p_organization_type => jai_constants.orgn_type_io ,

5684: *********************************************************************************************************/
5685:
5686: ln_ccid_tax_type_tcs := jai_cmn_rgm_recording_pkg.get_account (
5687: p_regime_id => p_rgm_ref.regime_id ,
5688: p_organization_type => jai_constants.orgn_type_io ,
5689: p_organization_id => p_rgm_ref.organization_id ,
5690: p_location_id => null ,
5691: p_tax_type => jai_constants.tax_type_tcs ,
5692: p_account_name => jai_constants.liability

Line 5691: p_tax_type => jai_constants.tax_type_tcs ,

5687: p_regime_id => p_rgm_ref.regime_id ,
5688: p_organization_type => jai_constants.orgn_type_io ,
5689: p_organization_id => p_rgm_ref.organization_id ,
5690: p_location_id => null ,
5691: p_tax_type => jai_constants.tax_type_tcs ,
5692: p_account_name => jai_constants.liability
5693: );
5694: IF ln_ccid_tax_type_tcs IS NULL THEN
5695: /**********************************************************************************************************

Line 5692: p_account_name => jai_constants.liability

5688: p_organization_type => jai_constants.orgn_type_io ,
5689: p_organization_id => p_rgm_ref.organization_id ,
5690: p_location_id => null ,
5691: p_tax_type => jai_constants.tax_type_tcs ,
5692: p_account_name => jai_constants.liability
5693: );
5694: IF ln_ccid_tax_type_tcs IS NULL THEN
5695: /**********************************************************************************************************
5696: || Code Combination id has been returned as null from the function jai_cmn_rgm_recording_pkg.get_account

Line 5703: p_process_flag := jai_constants.expected_error;

5699: /*commented by csahoo for bug# 6401388
5700: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5701: pv_log_msg => 'Invalid code combination of TCS tax Accounting'
5702: );*/
5703: p_process_flag := jai_constants.expected_error;
5704: lv_process_message := 'Invalid Code combination ,please check the TCS Tax - Tax Accounting Setup';
5705: p_process_message := lv_process_message ;
5706: rollback;
5707: return;

Line 5716: ||', account_class -> '|| jai_constants.account_class_rev ||fnd_global.local_chr(10)

5712: pv_log_msg => 'Inserting values into ra_interface_distributions_all for REV row:- '||fnd_global.local_chr(10)
5713: ||', interface_line_id -> '|| p_rgm_ref.transaction_id ||fnd_global.local_chr(10)
5714: ||', interface_line_context -> '|| lv_batch_src_name ||fnd_global.local_chr(10)
5715: ||', interface_line_attribute2 -> '|| p_rgm_ref.transaction_id ||fnd_global.local_chr(10)
5716: ||', account_class -> '|| jai_constants.account_class_rev ||fnd_global.local_chr(10)
5717: ||', amount -> '|| ln_amount ||fnd_global.local_chr(10)
5718: ||', code_combination_id -> '|| ln_ccid_tax_type_tcs ||fnd_global.local_chr(10)
5719: ||', acctd_amount -> '|| ln_amount ||fnd_global.local_chr(10)
5720: ||', created_by -> '|| ln_user_id ||fnd_global.local_chr(10)

Line 5748: jai_constants.account_class_rev ,

5744: Values (
5745: p_rgm_ref.transaction_id ,
5746: lv_batch_src_name ,
5747: p_rgm_ref.transaction_id ,
5748: jai_constants.account_class_rev ,
5749: ln_amount ,
5750: ln_ccid_tax_type_tcs ,
5751: ln_amount ,
5752: ln_user_id ,

Line 5817: p_process_flag := jai_constants.unexpected_error;

5813:
5814: jai_cmn_debug_contexts_pkg.deregister (pn_reg_id => ln_reg_id);*/
5815: EXCEPTION
5816: WHEN OTHERS THEN
5817: p_process_flag := jai_constants.unexpected_error;
5818: p_process_message := ' Unexpected error occured while processing jai_ar_tcs_rep_pkg.generate_document'||substr(SQLERRM,1,300) ;
5819: /*commented by csahoo for bug# 6401388
5820: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5821: pv_log_msg => 'Unexpected error occured while processing jai_ar_tcs_rep_pkg.generate_document -> '||substr(SQLERRM,1,300)

Line 5921: and confirm_pan = jai_constants.yes;

5917: IS
5918: select pan_no
5919: from JAI_CMN_CUS_ADDRESSES
5920: where customer_id = cp_customer_id
5921: and confirm_pan = jai_constants.yes;
5922:
5923: cursor c_get_cust_typ_lkup_code(cp_customer_id JAI_CMN_CUS_ADDRESSES.customer_id%type)
5924: IS
5925: select tcs_customer_type

Line 5945: and thtyps.threshold_type = jai_constants.thhold_typ_cumulative

5941: where
5942: thslbs.threshold_type_id = thtyps.threshold_type_id
5943: and thtyps.threshold_hdr_id = thhdrs.threshold_hdr_id
5944: and thhdrs.regime_id = cp_regime_id
5945: and thtyps.threshold_type = jai_constants.thhold_typ_cumulative
5946: and thhdrs.customer_type_lookup_code = cp_customer_type_lkup_code
5947: and trunc(cp_source_trx_date) between thtyps.from_date
5948: and nvl(thtyps.to_date, trunc(cp_source_trx_date))
5949: and NVL(thslbs.from_amount,0) = 0;

Line 5995: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,

5991: --Added by Chong for DTC ER 2012/09/11 Get TCS calendar from regime start
5992: ln_fin_year := get_tcs_fin_year('TCS_CALENDAR','TCS', p_ooh.creation_date);
5993: --Added by Chong for DTC ER 2012/09/11 Get TCS calendar from regime end
5994: -- code ported from BL12.1.3 by zhiwei.xin on 15-MAR-2013 end.
5995: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
5996: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
5997: cp_organization_id => p_ooh.ship_from_org_id
5998: ) ;
5999: FETCH c_get_rgm_attribute INTO ln_regime_id, ln_org_tan_no ;

Line 5996: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,

5992: ln_fin_year := get_tcs_fin_year('TCS_CALENDAR','TCS', p_ooh.creation_date);
5993: --Added by Chong for DTC ER 2012/09/11 Get TCS calendar from regime end
5994: -- code ported from BL12.1.3 by zhiwei.xin on 15-MAR-2013 end.
5995: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
5996: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
5997: cp_organization_id => p_ooh.ship_from_org_id
5998: ) ;
5999: FETCH c_get_rgm_attribute INTO ln_regime_id, ln_org_tan_no ;
6000: IF C_GET_RGM_ATTRIBUTE%NOTFOUND THEN

Line 6002: p_process_flag := jai_constants.expected_error;

5998: ) ;
5999: FETCH c_get_rgm_attribute INTO ln_regime_id, ln_org_tan_no ;
6000: IF C_GET_RGM_ATTRIBUTE%NOTFOUND THEN
6001: CLOSE c_get_rgm_attribute;
6002: p_process_flag := jai_constants.expected_error;
6003: p_process_message := 'Org Tan Number needs to be defined for the TCS regime ';
6004: return;
6005: END IF;
6006: CLOSE c_get_rgm_attribute;

Line 6013: p_process_flag := jai_constants.expected_error;

6009: FETCH c_get_customer_pan INTO ln_party_pan_no;
6010:
6011: IF c_get_customer_pan%NOTFOUND THEN
6012: CLOSE c_get_customer_pan;
6013: p_process_flag := jai_constants.expected_error;
6014: p_process_message := 'Party pan no is not available for this party';
6015: RETURN;
6016: END IF;
6017: CLOSE c_get_customer_pan;

Line 6026: p_process_flag := jai_constants.expected_error;

6022: FETCH c_get_cust_typ_lkup_code INTO ln_customer_type_lkup_code;
6023:
6024: IF c_get_cust_typ_lkup_code%NOTFOUND THEN
6025: CLOSE c_get_cust_typ_lkup_code;
6026: p_process_flag := jai_constants.expected_error;
6027: p_process_message := 'Customer type lookup code is not available for this party';
6028: RETURN;
6029: END IF;
6030: CLOSE c_get_cust_typ_lkup_code;

Line 6044: cp_party_type => jai_constants.party_type_customer,

6040: ln_count :=0;
6041:
6042: OPEN get_jai_rgm_thresholds_count ( cp_fin_year => ln_fin_year,
6043: cp_org_tan_no => ln_org_tan_no,
6044: cp_party_type => jai_constants.party_type_customer,
6045: cp_party_id => p_ooh.sold_to_org_id ,
6046: cp_regime_id => ln_regime_id
6047: );
6048: FETCH get_jai_rgm_thresholds_count INTO ln_count;

Line 6055: lr_hdr_record.party_type := jai_constants.party_type_customer ;

6051: lr_hdr_record.threshold_id := ln_threshold_id ;
6052: lr_hdr_record.regime_id := ln_regime_id;
6053: lr_hdr_record.org_tan_no := ln_org_tan_no ;
6054: lr_hdr_record.party_id := p_ooh.sold_to_org_id;
6055: lr_hdr_record.party_type := jai_constants.party_type_customer ;
6056: lr_hdr_record.threshold_slab_id := ln_threshold_slab_id ;
6057: lr_hdr_record.fin_year := ln_fin_year ;
6058: lr_hdr_record.total_threshold_amt := null ;
6059: lr_hdr_record.total_threshold_base_amt := null ;

Line 6092: lv_process_flag := jai_constants.successful ;

6088: /*commented by csahoo for bug# 6401388
6089: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
6090: pn_reg_id => ln_reg_id
6091: );*/
6092: lv_process_flag := jai_constants.successful ;
6093: lv_process_message := null ;
6094:
6095: p_process_flag := lv_process_flag ;
6096: p_process_message := lv_process_message ;

Line 6109: IF p_event = jai_constants.order_booked OR

6105:
6106: /*########################################################################################################
6107: || PROCESS COMPLETED INVOICES ( DEBIT MEMO'S ALSO INCLUDED)
6108: ########################################################################################################*/
6109: IF p_event = jai_constants.order_booked OR
6110: p_event = jai_constants.wsh_ship_confirm
6111: THEN ---------A1
6112: /*commented by csahoo for bug# 6401388
6113: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 6110: p_event = jai_constants.wsh_ship_confirm

6106: /*########################################################################################################
6107: || PROCESS COMPLETED INVOICES ( DEBIT MEMO'S ALSO INCLUDED)
6108: ########################################################################################################*/
6109: IF p_event = jai_constants.order_booked OR
6110: p_event = jai_constants.wsh_ship_confirm
6111: THEN ---------A1
6112: /*commented by csahoo for bug# 6401388
6113: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6114: pv_log_msg => '******************Before call to VALIDATE_SALES_ORDER/SHIP CONFIRM ***************, lv_document_type '||lv_document_type

Line 6126: IF lv_process_flag = jai_constants.not_applicable THEN

6122: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6123: pv_log_msg => '******************Returned from call to VALIDATE_SALES_ORDER/SHIP CONFIRM ***************, lv_process_flag '||lv_process_flag
6124: );*/
6125:
6126: IF lv_process_flag = jai_constants.not_applicable THEN
6127: /*commented by csahoo for bug# 6401388
6128: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6129: pv_log_msg => 'Skip the transaction'
6130: );*/

Line 6134: IF lv_process_flag = jai_constants.expected_error OR ---------A2

6130: );*/
6131: return;
6132: END IF;
6133:
6134: IF lv_process_flag = jai_constants.expected_error OR ---------A2
6135: lv_process_flag = jai_constants.unexpected_error
6136: THEN
6137: /*
6138: || As Returned status is an error/not applicable hence:-

Line 6135: lv_process_flag = jai_constants.unexpected_error

6131: return;
6132: END IF;
6133:
6134: IF lv_process_flag = jai_constants.expected_error OR ---------A2
6135: lv_process_flag = jai_constants.unexpected_error
6136: THEN
6137: /*
6138: || As Returned status is an error/not applicable hence:-
6139: || Set out variables p_process_flag and p_process_message accordingly

Line 6153: IF p_event = jai_constants.order_booked THEN

6149: return;
6150: END IF; --------A1
6151:
6152: --Added by JMEENA for bug#7277211
6153: IF p_event = jai_constants.order_booked THEN
6154: process_sales_order ( p_ooh => p_ooh ,
6155: p_process_flag => lv_process_flag ,
6156: p_process_message => lv_process_message
6157: );

Line 6159: IF lv_process_flag = jai_constants.expected_error OR ---------A2

6155: p_process_flag => lv_process_flag ,
6156: p_process_message => lv_process_message
6157: );
6158:
6159: IF lv_process_flag = jai_constants.expected_error OR ---------A2
6160: lv_process_flag = jai_constants.unexpected_error
6161: THEN
6162: p_process_flag := lv_process_flag ;
6163: p_process_message := lv_process_message ;

Line 6160: lv_process_flag = jai_constants.unexpected_error

6156: p_process_message => lv_process_message
6157: );
6158:
6159: IF lv_process_flag = jai_constants.expected_error OR ---------A2
6160: lv_process_flag = jai_constants.unexpected_error
6161: THEN
6162: p_process_flag := lv_process_flag ;
6163: p_process_message := lv_process_message ;
6164: return;

Line 6174: IF p_event = jai_constants.trx_event_completion THEN ---------B1

6170:
6171: /*########################################################################################################
6172: || PROCESS COMPLETED INVOICES ( DEBIT MEMO'S ALSO INCLUDED)
6173: ########################################################################################################*/
6174: IF p_event = jai_constants.trx_event_completion THEN ---------B1
6175:
6176: /*commented by csahoo for bug# 6401388
6177: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6178: pv_log_msg => '******************Before call to VALIDATE_INVOICE ***************, lv_document_type '||lv_document_type

Line 6190: IF lv_process_flag = jai_constants.not_applicable THEN

6186: /*commented by csahoo for bug# 6401388
6187: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6188: pv_log_msg => '******************Returned from call to VALIDATE_INVOICE ***************, lv_process_flag '||lv_process_flag
6189: );*/
6190: IF lv_process_flag = jai_constants.not_applicable THEN
6191: /*commented by csahoo for bug# 6401388
6192: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6193: pv_log_msg => 'Skip the transaction'
6194: );*/

Line 6198: IF lv_process_flag = jai_constants.expected_error OR ---------B2

6194: );*/
6195: return;
6196: END IF;
6197:
6198: IF lv_process_flag = jai_constants.expected_error OR ---------B2
6199: lv_process_flag = jai_constants.unexpected_error
6200: THEN
6201: /*
6202: || As Returned status is an error/not applicable hence:-

Line 6199: lv_process_flag = jai_constants.unexpected_error

6195: return;
6196: END IF;
6197:
6198: IF lv_process_flag = jai_constants.expected_error OR ---------B2
6199: lv_process_flag = jai_constants.unexpected_error
6200: THEN
6201: /*
6202: || As Returned status is an error/not applicable hence:-
6203: || Set out variables p_process_flag and p_process_message accordingly

Line 6222: IF lv_process_flag = jai_constants.not_applicable THEN

6218: p_process_flag => lv_process_flag ,
6219: p_process_message => lv_process_message
6220: );
6221:
6222: IF lv_process_flag = jai_constants.not_applicable THEN
6223: /*commented by csahoo for bug# 6401388
6224: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6225: pv_log_msg => 'Skip the transaction'
6226: );*/

Line 6232: IF lv_process_flag = jai_constants.expected_error OR ---------B3

6228: return;
6229: END IF;
6230:
6231:
6232: IF lv_process_flag = jai_constants.expected_error OR ---------B3
6233: lv_process_flag = jai_constants.unexpected_error
6234: THEN
6235: /*
6236: || As Returned status is an error/not applicable hence:-

Line 6233: lv_process_flag = jai_constants.unexpected_error

6229: END IF;
6230:
6231:
6232: IF lv_process_flag = jai_constants.expected_error OR ---------B3
6233: lv_process_flag = jai_constants.unexpected_error
6234: THEN
6235: /*
6236: || As Returned status is an error/not applicable hence:-
6237: || Set out variables p_process_flag and p_process_message accordingly

Line 6255: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1

6251: /*########################################################################################################
6252: || PROCESS CONFIRMED RECEIPTS HAVING TCS APPLICABILITY
6253: ########################################################################################################*/
6254:
6255: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
6256: jai_constants.trx_type_rct_rvs
6257: )
6258: THEN
6259: lv_document_type := p_event;

Line 6256: jai_constants.trx_type_rct_rvs

6252: || PROCESS CONFIRMED RECEIPTS HAVING TCS APPLICABILITY
6253: ########################################################################################################*/
6254:
6255: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
6256: jai_constants.trx_type_rct_rvs
6257: )
6258: THEN
6259: lv_document_type := p_event;
6260:

Line 6275: IF lv_process_flag = jai_constants.not_applicable THEN

6271: /*commented by csahoo for bug# 6401388
6272: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6273: pv_log_msg => ' Returned from validate_receipts lv_process_flag: '||lv_process_flag
6274: );*/
6275: IF lv_process_flag = jai_constants.not_applicable THEN
6276: /*commented by csahoo for bug# 6401388
6277: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6278: pv_log_msg => 'Skip the transaction'
6279: );*/

Line 6284: IF lv_process_flag = jai_constants.expected_error OR ---------C2

6280:
6281: return;
6282: END IF;
6283:
6284: IF lv_process_flag = jai_constants.expected_error OR ---------C2
6285: lv_process_flag = jai_constants.unexpected_error
6286: THEN
6287: /*
6288: || As Returned status is an error/not applicable hence:-

Line 6285: lv_process_flag = jai_constants.unexpected_error

6281: return;
6282: END IF;
6283:
6284: IF lv_process_flag = jai_constants.expected_error OR ---------C2
6285: lv_process_flag = jai_constants.unexpected_error
6286: THEN
6287: /*
6288: || As Returned status is an error/not applicable hence:-
6289: || Set out variables p_process_flag and p_process_message accordingly

Line 6316: IF lv_process_flag = jai_constants.not_applicable THEN

6312: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6313: pv_log_msg => ' Returned from process_receipts lv_process_flag: '||lv_process_flag
6314: );*/
6315:
6316: IF lv_process_flag = jai_constants.not_applicable THEN
6317: /*commented by csahoo for bug# 6401388
6318: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6319: pv_log_msg => 'Skip the transaction'
6320: );*/

Line 6325: IF lv_process_flag = jai_constants.expected_error OR ---------C3

6321:
6322: return;
6323: END IF;
6324:
6325: IF lv_process_flag = jai_constants.expected_error OR ---------C3
6326: lv_process_flag = jai_constants.unexpected_error
6327: THEN
6328: /*
6329: || As Returned status is an error/not applicable hence:-

Line 6326: lv_process_flag = jai_constants.unexpected_error

6322: return;
6323: END IF;
6324:
6325: IF lv_process_flag = jai_constants.expected_error OR ---------C3
6326: lv_process_flag = jai_constants.unexpected_error
6327: THEN
6328: /*
6329: || As Returned status is an error/not applicable hence:-
6330: || Set out variables p_process_flag and p_process_message accordingly

Line 6348: IF p_event IN ( jai_constants.ar_cash , ---------D1

6344: /*########################################################################################################
6345: || PROCESS ALL RECEIPT AND CREDIT MEMO APPLICATIONS/UNAPPLICATIONS
6346: ########################################################################################################*/
6347:
6348: IF p_event IN ( jai_constants.ar_cash , ---------D1
6349: jai_constants.ar_invoice_type_cm
6350: )
6351: THEN
6352:

Line 6349: jai_constants.ar_invoice_type_cm

6345: || PROCESS ALL RECEIPT AND CREDIT MEMO APPLICATIONS/UNAPPLICATIONS
6346: ########################################################################################################*/
6347:
6348: IF p_event IN ( jai_constants.ar_cash , ---------D1
6349: jai_constants.ar_invoice_type_cm
6350: )
6351: THEN
6352:
6353: /***********

Line 6374: IF lv_process_flag = jai_constants.not_applicable THEN

6370: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6371: pv_log_msg => ' Returned from validate_app_unapp lv_process_flag: '||lv_process_flag
6372: );*/
6373:
6374: IF lv_process_flag = jai_constants.not_applicable THEN
6375: /*commented by csahoo for bug# 6401388
6376: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6377: pv_log_msg => 'Skip the transaction'
6378: );*/

Line 6383: IF lv_process_flag = jai_constants.expected_error OR ---------D2

6379: return;
6380: END IF;
6381:
6382:
6383: IF lv_process_flag = jai_constants.expected_error OR ---------D2
6384: lv_process_flag = jai_constants.unexpected_error
6385: THEN
6386: /*
6387: || As Returned status is an error/not applicable hence:-

Line 6384: lv_process_flag = jai_constants.unexpected_error

6380: END IF;
6381:
6382:
6383: IF lv_process_flag = jai_constants.expected_error OR ---------D2
6384: lv_process_flag = jai_constants.unexpected_error
6385: THEN
6386: /*
6387: || As Returned status is an error/not applicable hence:-
6388: || Set out variables p_process_flag and p_process_message accordingly

Line 6402: IF lv_document_type IN ( jai_constants.trx_type_rct_app, ---------D3

6398: return;
6399: END IF; ---------D2
6400:
6401:
6402: IF lv_document_type IN ( jai_constants.trx_type_rct_app, ---------D3
6403: jai_constants.trx_type_cm_app
6404: )
6405: THEN
6406: /*commented by csahoo for bug# 6401388

Line 6403: jai_constants.trx_type_cm_app

6399: END IF; ---------D2
6400:
6401:
6402: IF lv_document_type IN ( jai_constants.trx_type_rct_app, ---------D3
6403: jai_constants.trx_type_cm_app
6404: )
6405: THEN
6406: /*commented by csahoo for bug# 6401388
6407: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 6422: ELSIF lv_document_type IN ( jai_constants.trx_type_rct_unapp, ---------D3

6418: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6419: pv_log_msg => ' Returned from process_applications lv_process_flag: '||lv_process_flag
6420: );*/
6421:
6422: ELSIF lv_document_type IN ( jai_constants.trx_type_rct_unapp, ---------D3
6423: jai_constants.trx_type_cm_unapp
6424: )
6425: THEN
6426: /*commented by csahoo for bug# 6401388

Line 6423: jai_constants.trx_type_cm_unapp

6419: pv_log_msg => ' Returned from process_applications lv_process_flag: '||lv_process_flag
6420: );*/
6421:
6422: ELSIF lv_document_type IN ( jai_constants.trx_type_rct_unapp, ---------D3
6423: jai_constants.trx_type_cm_unapp
6424: )
6425: THEN
6426: /*commented by csahoo for bug# 6401388
6427: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 6445: IF lv_process_flag = jai_constants.not_applicable THEN ---------D4

6441: );*/
6442:
6443: END IF; ---------D3
6444:
6445: IF lv_process_flag = jai_constants.not_applicable THEN ---------D4
6446: /*commented by csahoo for bug# 6401388
6447: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6448: pv_log_msg => 'Skip the transaction'
6449: );*/

Line 6454: IF lv_process_flag = jai_constants.expected_error OR ---------D2

6450:
6451: return;
6452: END IF; ---------D4
6453:
6454: IF lv_process_flag = jai_constants.expected_error OR ---------D2
6455: lv_process_flag = jai_constants.unexpected_error
6456: THEN
6457: /*
6458: || As Returned status is an error/not applicable hence:-

Line 6455: lv_process_flag = jai_constants.unexpected_error

6451: return;
6452: END IF; ---------D4
6453:
6454: IF lv_process_flag = jai_constants.expected_error OR ---------D2
6455: lv_process_flag = jai_constants.unexpected_error
6456: THEN
6457: /*
6458: || As Returned status is an error/not applicable hence:-
6459: || Set out variables p_process_flag and p_process_message accordingly

Line 6478: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1

6474: /*########################################################################################################
6475: || CALL PROCEDURE TO GENERATE DOCUMENTS FOR ALL EVENTS EXCEPT INVOICE/DEBIT_MEMO/CREDIT_MEMO_APPLICATION
6476: ########################################################################################################*/
6477:
6478: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
6479: jai_constants.trx_type_rct_rvs ,
6480: jai_constants.ar_cash , ---------D1
6481: jai_constants.ar_invoice_type_cm
6482: )

Line 6479: jai_constants.trx_type_rct_rvs ,

6475: || CALL PROCEDURE TO GENERATE DOCUMENTS FOR ALL EVENTS EXCEPT INVOICE/DEBIT_MEMO/CREDIT_MEMO_APPLICATION
6476: ########################################################################################################*/
6477:
6478: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
6479: jai_constants.trx_type_rct_rvs ,
6480: jai_constants.ar_cash , ---------D1
6481: jai_constants.ar_invoice_type_cm
6482: )
6483: THEN

Line 6480: jai_constants.ar_cash , ---------D1

6476: ########################################################################################################*/
6477:
6478: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
6479: jai_constants.trx_type_rct_rvs ,
6480: jai_constants.ar_cash , ---------D1
6481: jai_constants.ar_invoice_type_cm
6482: )
6483: THEN
6484: /*commented by csahoo for bug# 6401388

Line 6481: jai_constants.ar_invoice_type_cm

6477:
6478: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
6479: jai_constants.trx_type_rct_rvs ,
6480: jai_constants.ar_cash , ---------D1
6481: jai_constants.ar_invoice_type_cm
6482: )
6483: THEN
6484: /*commented by csahoo for bug# 6401388
6485: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 6510: IF lv_process_flag = jai_constants.not_applicable THEN ---------D4

6506: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6507: pv_log_msg => ' Returned from generate_document lv_process_flag: '||lv_process_flag
6508: );*/
6509:
6510: IF lv_process_flag = jai_constants.not_applicable THEN ---------D4
6511: /*commented by csahoo for bug# 6401388
6512: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6513: pv_log_msg => 'Skip the transaction'
6514: );*/

Line 6519: IF lv_process_flag = jai_constants.expected_error OR ---------D2

6515:
6516: return;
6517: END IF; ---------D4
6518:
6519: IF lv_process_flag = jai_constants.expected_error OR ---------D2
6520: lv_process_flag = jai_constants.unexpected_error
6521: THEN
6522: /*
6523: || As Returned status is an error/not applicable hence:-

Line 6520: lv_process_flag = jai_constants.unexpected_error

6516: return;
6517: END IF; ---------D4
6518:
6519: IF lv_process_flag = jai_constants.expected_error OR ---------D2
6520: lv_process_flag = jai_constants.unexpected_error
6521: THEN
6522: /*
6523: || As Returned status is an error/not applicable hence:-
6524: || Set out variables p_process_flag and p_process_message accordingly

Line 6563: IF lv_process_flag = jai_constants.not_applicable THEN

6559: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6560: pv_log_msg => ' Returned from jai_rgm_thhold_proc_pkg.maintain_threshold lv_process_flag: '||lv_process_flag
6561: );*/
6562:
6563: IF lv_process_flag = jai_constants.not_applicable THEN
6564: /*commented by csahoo for bug# 6401388
6565: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
6566: pv_log_msg => 'Skip the transaction'
6567: );*/

Line 6572: IF lv_process_flag = jai_constants.expected_error OR ---------D2

6568:
6569: return;
6570: END IF;
6571:
6572: IF lv_process_flag = jai_constants.expected_error OR ---------D2
6573: lv_process_flag = jai_constants.unexpected_error
6574: THEN
6575: /*
6576: || As Returned status is an error/not applicable hence:-

Line 6573: lv_process_flag = jai_constants.unexpected_error

6569: return;
6570: END IF;
6571:
6572: IF lv_process_flag = jai_constants.expected_error OR ---------D2
6573: lv_process_flag = jai_constants.unexpected_error
6574: THEN
6575: /*
6576: || As Returned status is an error/not applicable hence:-
6577: || Set out variables p_process_flag and p_process_message accordingly

Line 6600: p_process_flag := jai_constants.unexpected_error;

6596:
6597: jai_cmn_debug_contexts_pkg.deregister (pn_reg_id => ln_reg_id);*/
6598: EXCEPTION
6599: WHEN OTHERS THEN
6600: p_process_flag := jai_constants.unexpected_error;
6601: p_process_message := lv_context||' Unexpected error occured while processing jai_ar_tcs_rep_pkg.process_transactions'||SQLERRM ;
6602: /*commented by csahoo for bug# 6401388
6603: jai_cmn_debug_contexts_pkg.print( pn_reg_id => ln_reg_id ,
6604: pv_log_msg => p_process_message ,