DBA Data[Home] [Help]

APPS.JAI_AR_TCS_REP_PKG dependencies on JAI_CONSTANTS

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

90: AND jspl.delivery_id = p_delivery_id
91: AND jspl.delivery_detail_id = p_delivery_detail_id
92: AND jsptl.tax_id = jtc.tax_id
93: AND jtc.tax_type = jrttv.tax_type
94: AND jrttv.regime_code = jai_constants.tcs_regime;
95:
96: CURSOR cur_get_order_num( cp_hdr_id JAI_OM_WSH_LINES_ALL.ORDER_HEADER_ID%TYPE)
97: IS
98: SELECT

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

123: v_std_text := 'India Localization Entry for sales order #' ;
124: v_ref_23 := 'jai_ar_tcs_rep_pkg.wsh_interim_accounting';
125: v_ref_24 := 'wsh_new_deliveries';
126: v_ref_25 := 'delivery_id';
127: lv_source_name := jai_constants.tcs_source ; -- modified by csahoo for bug#6155839
128: lv_category_name := 'Receivables India' ; -- modified by csahoo for bug#6155839
129:
130:
131:

Line 139: p_process_flag := jai_constants.successful ;

135: /*commented by csahoo for bug# 6401388
136: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
137: pn_reg_id => ln_reg_id
138: );*/
139: p_process_flag := jai_constants.successful ;
140: p_process_message := null ;
141:
142: OPEN cur_get_order_num( cp_hdr_id => p_order_header_id );
143: FETCH cur_get_order_num INTO ln_order_number;

Line 170: p_organization_type => jai_constants.orgn_type_io ,

166: pv_log_msg => 'Before call to jai_cmn_rgm_recording_pkg.get_account for int liab'
167: );*/
168: v_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
169: p_regime_id => rec_cur_get_picking_taxes.regime_id ,
170: p_organization_type => jai_constants.orgn_type_io ,
171: p_organization_id => p_organization_id ,
172: p_location_id => p_location_id ,
173: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
174: p_account_name => jai_constants.liability

Line 174: p_account_name => jai_constants.liability

170: p_organization_type => jai_constants.orgn_type_io ,
171: p_organization_id => p_organization_id ,
172: p_location_id => p_location_id ,
173: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
174: p_account_name => jai_constants.liability
175: );
176:
177: /*commented by csahoo for bug# 6401388
178: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 183: p_organization_type => jai_constants.orgn_type_io ,

179: pv_log_msg => 'Before call to jai_cmn_rgm_recording_pkg.get_account for liab'
180: );*/
181: v_int_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
182: p_regime_id => rec_cur_get_picking_taxes.regime_id ,
183: p_organization_type => jai_constants.orgn_type_io ,
184: p_organization_id => p_organization_id ,
185: p_location_id => p_location_id ,
186: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
187: p_account_name => jai_constants.liability_interim

Line 187: p_account_name => jai_constants.liability_interim

183: p_organization_type => jai_constants.orgn_type_io ,
184: p_organization_id => p_organization_id ,
185: p_location_id => p_location_id ,
186: p_tax_type => rec_cur_get_picking_taxes.tax_type ,
187: p_account_name => jai_constants.liability_interim
188: );
189:
190:
191:

Line 203: p_process_flag := jai_constants.expected_error;

199: /*commented by csahoo for bug# 6401388
200: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
201: pv_log_msg => 'Error in call to jai_cmn_rgm_recording_pkg.get_account'
202: );*/
203: p_process_flag := jai_constants.expected_error;
204: p_process_message := 'Invalid Code combination ,please check the TCS Tax - Tax Accounting Setup';
205: return;
206: END IF;
207:

Line 309: p_process_flag := jai_constants.unexpected_error;

305: jai_cmn_debug_contexts_pkg.deregister (pn_reg_id => ln_reg_id);*/
306:
307: EXCEPTION
308: WHEN OTHERS THEN
309: p_process_flag := jai_constants.unexpected_error;
310: p_process_message := 'Unexpected error in the jai_ar_tcs_rep_pkg.wsh_interim_accounting '||substr(sqlerrm,1,300);
311:
312: END wsh_interim_accounting;
313:

Line 344: AND jrttv.regime_code = jai_constants.tcs_regime

340: jrct.customer_trx_id = jrctl.customer_trx_id
341: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
342: AND jrcttl.tax_id = jtc.tax_id
343: AND jtc.tax_type = jrttv.tax_type
344: AND jrttv.regime_code = jai_constants.tcs_regime
345: AND jrct.customer_trx_id = cp_customer_trx_id
346: AND jrctl.customer_trx_line_id = nvl( cp_customer_trx_line_id , jrctl.customer_trx_line_id );
347:
348: v_ref_10 GL_INTERFACE.REFERENCE10%TYPE ;

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

364: lv_member_name := 'AR_ACCOUNTING';
365: v_ref_23 := 'jai_ar_tcs_rep_pkg.ar_accounting';
366: v_ref_24 := 'ra_customer_trx_all' ;
367: v_ref_25 := 'customer_trx_id' ;
368: lv_source_name := jai_constants.tcs_source ; -- modified by csahoo for bug#6155839
369: lv_category_name := 'Receivables India' ; -- modified by csahoo for bug#6155839
370: set_debug_context;
371:
372:

Line 376: p_process_flag := jai_constants.successful ;

372:
373: /* jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
374: pn_reg_id => ln_reg_id
375: ); --commmented by CSahoo, BUG#5631784*/
376: p_process_flag := jai_constants.successful ;
377: p_process_message := null ;
378:
379: v_ref_26 := nvl(p_ract.customer_trx_id,p_ractl.customer_trx_id) ;
380:

Line 408: p_organization_type => jai_constants.orgn_type_io ,

404: pv_log_msg => 'Before call to jai_cmn_rgm_recording_pkg.get_account for int liab'
405: );*/
406: v_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
407: p_regime_id => rec_cur_get_inv_det.regime_id ,
408: p_organization_type => jai_constants.orgn_type_io ,
409: p_organization_id => rec_cur_get_inv_det.organization_id ,
410: p_location_id => rec_cur_get_inv_det.location_id ,
411: p_tax_type => rec_cur_get_inv_det.tax_type ,
412: p_account_name => jai_constants.liability

Line 412: p_account_name => jai_constants.liability

408: p_organization_type => jai_constants.orgn_type_io ,
409: p_organization_id => rec_cur_get_inv_det.organization_id ,
410: p_location_id => rec_cur_get_inv_det.location_id ,
411: p_tax_type => rec_cur_get_inv_det.tax_type ,
412: p_account_name => jai_constants.liability
413: );
414:
415: /*commented by csahoo for bug# 6401388
416: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 421: p_organization_type => jai_constants.orgn_type_io ,

417: pv_log_msg => 'Before call to jai_cmn_rgm_recording_pkg.get_account for liab'
418: );*/
419: v_int_liab_acc_ccid := jai_cmn_rgm_recording_pkg.get_account (
420: p_regime_id => rec_cur_get_inv_det.regime_id ,
421: p_organization_type => jai_constants.orgn_type_io ,
422: p_organization_id => rec_cur_get_inv_det.organization_id ,
423: p_location_id => rec_cur_get_inv_det.location_id ,
424: p_tax_type => rec_cur_get_inv_det.tax_type ,
425: p_account_name => jai_constants.liability_interim

Line 425: p_account_name => jai_constants.liability_interim

421: p_organization_type => jai_constants.orgn_type_io ,
422: p_organization_id => rec_cur_get_inv_det.organization_id ,
423: p_location_id => rec_cur_get_inv_det.location_id ,
424: p_tax_type => rec_cur_get_inv_det.tax_type ,
425: p_account_name => jai_constants.liability_interim
426: );
427:
428:
429:

Line 441: p_process_flag := jai_constants.expected_error;

437: /*commented by csahoo for bug# 6401388
438: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
439: pv_log_msg => 'Error in call to jai_cmn_rgm_recording_pkg.get_account'
440: );*/
441: p_process_flag := jai_constants.expected_error;
442: p_process_message := 'Invalid Code combination ,please check the TCS Tax - Tax Accounting Setup';
443: return;
444: END IF;
445:

Line 548: p_process_flag := jai_constants.unexpected_error;

544: jai_cmn_debug_contexts_pkg.deregister (pn_reg_id => ln_reg_id);*/
545:
546: EXCEPTION
547: WHEN OTHERS THEN
548: p_process_flag := jai_constants.unexpected_error;
549: p_process_message := 'Unexpected error in the jai_ar_tcs_rep_pkg.man_ar_completion_accounting '||substr(sqlerrm,1,300);
550:
551: END ar_accounting;
552:

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

574: jsl.header_id = cp_header_id
575: AND jsl.line_id = jstl.line_id
576: AND jtc.tax_id = jstl.tax_id
577: AND jtc.tax_type = jrttv.tax_type
578: AND jrttv.regime_code = jai_constants.tcs_regime; /* Applied to doc has got TCS type of tax*/
579:
580:
581:
582: /*

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

601: WHERE
602: jsl.line_id = jstl.line_id
603: AND jtc.tax_id = jstl.tax_id
604: AND jtc.tax_type = jrttv.tax_type
605: AND jrttv.regime_code = jai_constants.tcs_regime /* Applied to doc has got TCS type of tax*/
606: );
607:
608: /*******
609: || Validate that the inventory_items for all lines of the sales order should have the same TCS item classification

Line 644: lv_process_flag := jai_constants.successful ;

640: /*commented by csahoo for bug# 6401388
641: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
642: pn_reg_id => ln_reg_id
643: );*/
644: lv_process_flag := jai_constants.successful ;
645: lv_process_message := null ;
646:
647: p_process_flag := lv_process_flag ;
648: p_process_message := lv_process_message ;

Line 657: IF ln_event = jai_constants.order_booked AND

653:
654: /*
655: ||Check that the order has a flow status code as booked else skip the transaction
656: */
657: IF ln_event = jai_constants.order_booked AND
658: p_ooh.flow_status_code <> jai_constants.order_booked
659: THEN
660: /*commented by csahoo for bug# 6401388
661: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 658: p_ooh.flow_status_code <> jai_constants.order_booked

654: /*
655: ||Check that the order has a flow status code as booked else skip the transaction
656: */
657: IF ln_event = jai_constants.order_booked AND
658: p_ooh.flow_status_code <> jai_constants.order_booked
659: THEN
660: /*commented by csahoo for bug# 6401388
661: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
662: 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 664: p_process_flag := jai_constants.not_applicable ;

660: /*commented by csahoo for bug# 6401388
661: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
662: pv_log_msg => ' Skip the transaction as order has a flow status code as '|| p_ooh.flow_status_code ||' which is different from BOOKED '
663: );*/
664: p_process_flag := jai_constants.not_applicable ;
665: return;
666:
667: END IF;
668:

Line 681: p_process_flag := jai_constants.not_applicable ;

677: /*commented by csahoo for bug# 6401388
678: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
679: pv_log_msg => ' Skip as order does not have TCS type of taxes '
680: );*/
681: p_process_flag := jai_constants.not_applicable ;
682: return;
683: END IF;
684: CLOSE cur_chk_tcs_applicable;
685:

Line 691: IF ln_event IN ( jai_constants.order_booked ,

687:
688: /*########################################################################################################
689: || VALIDATE THAT ALL LINES SHOULD HAVE TCS OR NIETHER SHOUD HAVE ANY - PART - 2
690: ########################################################################################################*/
691: IF ln_event IN ( jai_constants.order_booked ,
692: jai_constants.wsh_ship_confirm
693: )
694: THEN
695:

Line 692: jai_constants.wsh_ship_confirm

688: /*########################################################################################################
689: || VALIDATE THAT ALL LINES SHOULD HAVE TCS OR NIETHER SHOUD HAVE ANY - PART - 2
690: ########################################################################################################*/
691: IF ln_event IN ( jai_constants.order_booked ,
692: jai_constants.wsh_ship_confirm
693: )
694: THEN
695:
696: /****************

Line 715: p_process_flag := jai_constants.expected_error;

711: 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)
712: ||', lv_process_flag -> '|| lv_process_flag ||fnd_global.local_chr(10)
713: ||', lv_process_message -> '||lv_process_message
714: );*/
715: p_process_flag := jai_constants.expected_error;
716: p_process_message := 'Cannot Book/Ship the Sales Order as some lines do not have TCS type of taxes ';
717: return;
718: CLOSE cur_chk_tcs_for_all_lines ;
719: END IF;

Line 735: p_regime_code => jai_constants.tcs_regime ,

731: /*
732: ||Get the value for the item classification pertaining to the IO and inventory item combination
733: */
734: jai_inv_items_pkg.jai_get_attrib (
735: p_regime_code => jai_constants.tcs_regime ,
736: p_organization_id => p_ooh.ship_from_org_id , -- Organization id of the Selling organization (warehouse_id)
737: p_inventory_item_id => rec_cur_validate_all_items.inventory_item_id ,
738: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
739: p_attribute_value => lv_item_classification ,

Line 738: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,

734: jai_inv_items_pkg.jai_get_attrib (
735: p_regime_code => jai_constants.tcs_regime ,
736: p_organization_id => p_ooh.ship_from_org_id , -- Organization id of the Selling organization (warehouse_id)
737: p_inventory_item_id => rec_cur_validate_all_items.inventory_item_id ,
738: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
739: p_attribute_value => lv_item_classification ,
740: p_process_flag => lv_process_flag ,
741: p_process_msg => lv_process_message
742: );

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

740: p_process_flag => lv_process_flag ,
741: p_process_msg => lv_process_message
742: );
743:
744: IF lv_process_flag = jai_constants.expected_error OR ---------A2
745: lv_process_flag = jai_constants.unexpected_error
746: THEN
747: /*
748: || As Returned status is an error/not applicable hence:-

Line 745: lv_process_flag = jai_constants.unexpected_error

741: p_process_msg => lv_process_message
742: );
743:
744: IF lv_process_flag = jai_constants.expected_error OR ---------A2
745: lv_process_flag = jai_constants.unexpected_error
746: THEN
747: /*
748: || As Returned status is an error/not applicable hence:-
749: || Set out variables p_process_flag and p_process_message accordingly

Line 783: p_process_flag := jai_constants.expected_error ;

779: ||', lv_process_flag -> '|| lv_process_flag ||fnd_global.local_chr(10)
780: ||', lv_process_message -> '||lv_process_message
781: );*/
782:
783: p_process_flag := jai_constants.expected_error ;
784: 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' ;
785: return;
786: END IF;
787: END LOOP;

Line 824: AND gl_dist.account_class = jai_constants.account_class_rec

820: JAI_CMN_TAXES_ALL jtc ,
821: jai_regime_tax_types_v jrttv
822: WHERE
823: gl_dist.customer_trx_id = jrct.customer_trx_id
824: AND gl_dist.account_class = jai_constants.account_class_rec
825: AND gl_dist.latest_rec_flag = jai_constants.yes
826: AND jrct.customer_trx_id = cp_customer_trx_id
827: AND jrct.customer_trx_id = jrctl.customer_trx_id
828: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id

Line 825: AND gl_dist.latest_rec_flag = jai_constants.yes

821: jai_regime_tax_types_v jrttv
822: WHERE
823: gl_dist.customer_trx_id = jrct.customer_trx_id
824: AND gl_dist.account_class = jai_constants.account_class_rec
825: AND gl_dist.latest_rec_flag = jai_constants.yes
826: AND jrct.customer_trx_id = cp_customer_trx_id
827: AND jrct.customer_trx_id = jrctl.customer_trx_id
828: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
829: AND jtc.tax_id = jrcttl.tax_id

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

827: AND jrct.customer_trx_id = jrctl.customer_trx_id
828: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
829: AND jtc.tax_id = jrcttl.tax_id
830: AND jtc.tax_type = jrttv.tax_type
831: AND jrttv.regime_code = jai_constants.tcs_regime; /* Applied to doc has got TCS type of tax*/
832:
833:
834: /*
835: ||Get the trx type of the document

Line 881: AND jrttv.regime_code = jai_constants.tcs_regime

877: WHERE
878: jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
879: AND jtc.tax_id = jrcttl.tax_id
880: AND jtc.tax_type = jrttv.tax_type
881: AND jrttv.regime_code = jai_constants.tcs_regime
882: );
883:
884:
885: /*

Line 902: AND jrttv.tax_type = jai_constants.tax_type_tcs_surcharge

898: jrctl.customer_trx_id = cp_customer_trx_id
899: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
900: AND jrcttl.tax_id = jtc.tax_id
901: AND jtc.tax_type = jrttv.tax_type
902: AND jrttv.tax_type = jai_constants.tax_type_tcs_surcharge
903: AND jrttv.regime_code = jai_constants.tcs_regime;
904:
905:
906:

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

899: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
900: AND jrcttl.tax_id = jtc.tax_id
901: AND jtc.tax_type = jrttv.tax_type
902: AND jrttv.tax_type = jai_constants.tax_type_tcs_surcharge
903: AND jrttv.regime_code = jai_constants.tcs_regime;
904:
905:
906:
907: /*******

Line 949: lv_process_flag := jai_constants.successful ;

945: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
946: pn_reg_id => ln_reg_id
947: );*/
948:
949: lv_process_flag := jai_constants.successful ;
950: lv_process_message := null ;
951:
952: p_process_flag := lv_process_flag ;
953: p_process_message := lv_process_message ;

Line 1044: p_process_flag := jai_constants.not_applicable;

1040: /*commented by csahoo for bug# 6401388
1041: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1042: pv_log_msg => ' Current document is a CM hence SKIP'
1043: );*/
1044: p_process_flag := jai_constants.not_applicable;
1045: return;
1046: END IF;
1047:
1048: /*########################################################################################################

Line 1052: IF ln_event = jai_constants.trx_event_completion THEN

1048: /*########################################################################################################
1049: || VALIDATIONS FOR INVOICE COMPLETION PART - 4
1050: ########################################################################################################*/
1051:
1052: IF ln_event = jai_constants.trx_event_completion THEN
1053:
1054: /*commented by csahoo for bug# 6401388
1055: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1056: pv_log_msg => ' Event is -> '||ln_event

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

1060: || DERIVE DOCUMENT TYPE - PART - 4.1
1061: ########################################################################################################*/
1062:
1063:
1064: IF p_ract.complete_flag = jai_constants.yes THEN
1065:
1066: /*commented by csahoo for bug# 6401388
1067: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1068: pv_log_msg => ' Complete -> '||p_ract.complete_flag

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

1067: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1068: pv_log_msg => ' Complete -> '||p_ract.complete_flag
1069: );*/
1070:
1071: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm) THEN
1072: /*
1073: ||Invoice/DM completion
1074: */
1075: lv_doc_type := jai_constants.trx_type_inv_comp;

Line 1075: lv_doc_type := jai_constants.trx_type_inv_comp;

1071: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm) THEN
1072: /*
1073: ||Invoice/DM completion
1074: */
1075: lv_doc_type := jai_constants.trx_type_inv_comp;
1076: ELSE
1077: /*commented by csahoo for bug# 6401388
1078: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1079: pv_log_msg => ' Skip as type -> '||lv_trx_type ||' not applicable for TCS processing '

Line 1081: p_process_flag := jai_constants.not_applicable;

1077: /*commented by csahoo for bug# 6401388
1078: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1079: pv_log_msg => ' Skip as type -> '||lv_trx_type ||' not applicable for TCS processing '
1080: );*/
1081: p_process_flag := jai_constants.not_applicable;
1082: return;
1083: END IF;
1084:
1085: ELSIF p_ract.complete_flag = jai_constants.no THEN

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

1081: p_process_flag := jai_constants.not_applicable;
1082: return;
1083: END IF;
1084:
1085: ELSIF p_ract.complete_flag = jai_constants.no THEN
1086: /*
1087: ||
1088: */
1089: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm) THEN

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

1085: ELSIF p_ract.complete_flag = jai_constants.no THEN
1086: /*
1087: ||
1088: */
1089: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm) THEN
1090: /*
1091: ||Invoice/DM incompletion
1092: */
1093: lv_doc_type := jai_constants.trx_type_inv_incomp;

Line 1093: lv_doc_type := jai_constants.trx_type_inv_incomp;

1089: IF lv_trx_type IN (jai_constants.ar_invoice_type_inv,jai_constants.ar_doc_type_dm) THEN
1090: /*
1091: ||Invoice/DM incompletion
1092: */
1093: lv_doc_type := jai_constants.trx_type_inv_incomp;
1094: ELSE
1095: /*commented by csahoo for bug# 6401388
1096: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1097: pv_log_msg => ' Skip as type -> '||lv_trx_type ||' not applicable for TCS processing '

Line 1099: p_process_flag := jai_constants.not_applicable;

1095: /*commented by csahoo for bug# 6401388
1096: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1097: pv_log_msg => ' Skip as type -> '||lv_trx_type ||' not applicable for TCS processing '
1098: );*/
1099: p_process_flag := jai_constants.not_applicable;
1100: return;
1101: END IF;
1102: END IF;
1103:

Line 1114: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,

1110: /*******
1111: || Validate that an invoice cannot be incompleted if the TCS
1112: || for the same has already been settled
1113: ********/
1114: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1115: jai_constants.ar_doc_type_dm
1116: ) AND
1117: lv_doc_type = jai_constants.trx_type_inv_incomp
1118:

Line 1115: jai_constants.ar_doc_type_dm

1111: || Validate that an invoice cannot be incompleted if the TCS
1112: || for the same has already been settled
1113: ********/
1114: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1115: jai_constants.ar_doc_type_dm
1116: ) AND
1117: lv_doc_type = jai_constants.trx_type_inv_incomp
1118:
1119: THEN -----------------A1

Line 1117: lv_doc_type = jai_constants.trx_type_inv_incomp

1113: ********/
1114: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1115: jai_constants.ar_doc_type_dm
1116: ) AND
1117: lv_doc_type = jai_constants.trx_type_inv_incomp
1118:
1119: THEN -----------------A1
1120: /*
1121: ||Trx type is invoice or Debit memo

Line 1132: p_process_flag := jai_constants.expected_error;

1128: pv_log_msg => 'Error :- Cannot Incomplete the invoice if it has already been settled '||fnd_global.local_chr(10)
1129: ||', lv_process_flag -> '|| lv_process_flag ||fnd_global.local_chr(10)
1130: ||', lv_process_message -> '||lv_process_message
1131: );*/
1132: p_process_flag := jai_constants.expected_error;
1133: p_process_message := 'Cannot incomplete the Invoice/Debit Memo as TCS taxes have already been settled';
1134: return;
1135: END IF;
1136: CLOSE cur_chk_tcs_settlement;

Line 1144: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,

1140:
1141: /*########################################################################################################
1142: || INVOICE COMPLETION VALIDATIONS - PART - 4.2
1143: ########################################################################################################*/
1144: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1145: jai_constants.ar_doc_type_dm
1146: ) AND
1147: lv_doc_type = jai_constants.trx_type_inv_comp
1148: THEN -----------------A3

Line 1145: jai_constants.ar_doc_type_dm

1141: /*########################################################################################################
1142: || INVOICE COMPLETION VALIDATIONS - PART - 4.2
1143: ########################################################################################################*/
1144: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1145: jai_constants.ar_doc_type_dm
1146: ) AND
1147: lv_doc_type = jai_constants.trx_type_inv_comp
1148: THEN -----------------A3
1149: /****************

Line 1147: lv_doc_type = jai_constants.trx_type_inv_comp

1143: ########################################################################################################*/
1144: IF lv_trx_type IN ( jai_constants.ar_invoice_type_inv,
1145: jai_constants.ar_doc_type_dm
1146: ) AND
1147: lv_doc_type = jai_constants.trx_type_inv_comp
1148: THEN -----------------A3
1149: /****************
1150: || Event is completion
1151: || Validate that all lines have TCS type of taxes

Line 1168: p_process_flag := jai_constants.expected_error;

1164: pv_log_msg => 'Error :- Cannot complete the invoice if some lines have TCS type of tax and some dont '||fnd_global.local_chr(10)
1165: ||', lv_process_flag -> '|| lv_process_flag ||fnd_global.local_chr(10)
1166: ||', lv_process_message -> '||lv_process_message
1167: );*/
1168: p_process_flag := jai_constants.expected_error;
1169: p_process_message := 'Cannot complete the Invoice/Debit Memo as some lines of the document do not have TCS type of taxes ';
1170: return;
1171: CLOSE cur_chk_tcs_for_all_lines ;
1172: END IF;

Line 1186: p_regime_code => jai_constants.tcs_regime ,

1182: /*
1183: ||Get the value for the item classification pertaining to the IO and inventory item combination
1184: */
1185: jai_inv_items_pkg.jai_get_attrib (
1186: p_regime_code => jai_constants.tcs_regime ,
1187: p_organization_id => rec_cur_validate_all_items.organization_id ,
1188: p_inventory_item_id => rec_cur_validate_all_items.inventory_item_id ,
1189: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
1190: p_attribute_value => lv_item_classification ,

Line 1189: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,

1185: jai_inv_items_pkg.jai_get_attrib (
1186: p_regime_code => jai_constants.tcs_regime ,
1187: p_organization_id => rec_cur_validate_all_items.organization_id ,
1188: p_inventory_item_id => rec_cur_validate_all_items.inventory_item_id ,
1189: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
1190: p_attribute_value => lv_item_classification ,
1191: p_process_flag => lv_process_flag ,
1192: p_process_msg => lv_process_message
1193: );

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

1191: p_process_flag => lv_process_flag ,
1192: p_process_msg => lv_process_message
1193: );
1194:
1195: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1196: lv_process_flag = jai_constants.unexpected_error
1197: THEN
1198: /*
1199: || As Returned status is an error/not applicable hence:-

Line 1196: lv_process_flag = jai_constants.unexpected_error

1192: p_process_msg => lv_process_message
1193: );
1194:
1195: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1196: lv_process_flag = jai_constants.unexpected_error
1197: THEN
1198: /*
1199: || As Returned status is an error/not applicable hence:-
1200: || Set out variables p_process_flag and p_process_message accordingly

Line 1234: p_process_flag := jai_constants.expected_error ;

1230: ||', lv_process_flag -> '|| lv_process_flag ||fnd_global.local_chr(10)
1231: ||', lv_process_message -> '||lv_process_message
1232: );*/
1233:
1234: p_process_flag := jai_constants.expected_error ;
1235: 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' ;
1236: return;
1237: END IF;
1238:

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

1245: OPEN cur_chk_tcs_sur_tax ( cp_customer_trx_id => p_ract.customer_trx_id );
1246: FETCH cur_chk_tcs_sur_tax INTO ln_surcharge_cnt;
1247: CLOSE cur_chk_tcs_sur_tax ;
1248:
1249: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
1250: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
1251: cp_organization_id => ln_organization_id
1252: ) ;
1253: FETCH c_get_rgm_attribute INTO ln_regime_id, lv_org_tan_no ;

Line 1250: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,

1246: FETCH cur_chk_tcs_sur_tax INTO ln_surcharge_cnt;
1247: CLOSE cur_chk_tcs_sur_tax ;
1248:
1249: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
1250: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
1251: cp_organization_id => ln_organization_id
1252: ) ;
1253: FETCH c_get_rgm_attribute INTO ln_regime_id, lv_org_tan_no ;
1254: CLOSE c_get_rgm_attribute;

Line 1259: p_party_type => jai_constants.party_type_customer ,

1255:
1256: jai_rgm_thhold_proc_pkg.get_threshold_slab_id (
1257: p_regime_id => ln_regime_id ,
1258: p_org_tan_no => lv_org_tan_no ,
1259: p_party_type => jai_constants.party_type_customer ,
1260: p_party_id => nvl(p_ract.ship_to_customer_id,p_ract.bill_to_customer_id) ,
1261: p_source_trx_date => ld_source_doc_date ,
1262: p_org_id => p_ract.org_id ,
1263: p_threshold_slab_id => ln_threshold_slab_id ,

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

1264: p_process_flag => lv_process_flag ,
1265: p_process_message => lv_process_message
1266: );
1267:
1268: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1269: lv_process_flag = jai_constants.unexpected_error OR
1270: lv_process_flag = jai_constants.not_applicable
1271: THEN
1272: /*

Line 1269: lv_process_flag = jai_constants.unexpected_error OR

1265: p_process_message => lv_process_message
1266: );
1267:
1268: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1269: lv_process_flag = jai_constants.unexpected_error OR
1270: lv_process_flag = jai_constants.not_applicable
1271: THEN
1272: /*
1273: || As Returned status is an error/not applicable hence:-

Line 1270: lv_process_flag = jai_constants.not_applicable

1266: );
1267:
1268: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1269: lv_process_flag = jai_constants.unexpected_error OR
1270: lv_process_flag = jai_constants.not_applicable
1271: THEN
1272: /*
1273: || As Returned status is an error/not applicable hence:-
1274: || Set out variables p_process_flag and p_process_message accordingly

Line 1289: p_process_flag := jai_constants.expected_error ;

1285: ||IF threshold level is up and surcharge type of taxes not present
1286: || on the invoice line then error
1287: */
1288: IF ln_surcharge_cnt = 0 THEN /* Surcharge does not exist */
1289: p_process_flag := jai_constants.expected_error ;
1290: p_process_message := 'Cannot complete invoice as surcharge is applicable however TCS Surcharge tax is not found on the document' ;
1291: return;
1292: END IF;
1293: ELSE

Line 1299: p_process_flag := jai_constants.expected_error ;

1295: ||IF threshold level is down and surcharge type of taxes are present
1296: || on the invoice line then error
1297: */
1298: IF ln_surcharge_cnt = 1 THEN /* Surcharge exist */
1299: p_process_flag := jai_constants.expected_error ;
1300: p_process_message := 'Cannot complete invoice as surcharge is not applicable however TCS Surcharge tax is found on the document' ;
1301: return;
1302: END IF;
1303: END IF;

Line 1344: rcta.complete_flag = jai_constants.yes

1340: JAI_AR_TRX_TAX_LINES jrcttl ,
1341: JAI_CMN_TAXES_ALL jtc ,
1342: jai_regime_tax_types_v jrttv
1343: WHERE
1344: rcta.complete_flag = jai_constants.yes
1345: AND rcta.customer_trx_id = cp_customer_trx_id
1346: AND gl_dist.customer_trx_id = rcta.customer_trx_id
1347: AND gl_dist.account_class = jai_constants.account_class_rec
1348: AND gl_dist.latest_rec_flag = jai_constants.yes

Line 1347: AND gl_dist.account_class = jai_constants.account_class_rec

1343: WHERE
1344: rcta.complete_flag = jai_constants.yes
1345: AND rcta.customer_trx_id = cp_customer_trx_id
1346: AND gl_dist.customer_trx_id = rcta.customer_trx_id
1347: AND gl_dist.account_class = jai_constants.account_class_rec
1348: AND gl_dist.latest_rec_flag = jai_constants.yes
1349: AND rcta.customer_trx_id = jrct.customer_trx_id
1350: AND jrct.customer_trx_id = jrctl.customer_trx_id
1351: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id

Line 1348: AND gl_dist.latest_rec_flag = jai_constants.yes

1344: rcta.complete_flag = jai_constants.yes
1345: AND rcta.customer_trx_id = cp_customer_trx_id
1346: AND gl_dist.customer_trx_id = rcta.customer_trx_id
1347: AND gl_dist.account_class = jai_constants.account_class_rec
1348: AND gl_dist.latest_rec_flag = jai_constants.yes
1349: AND rcta.customer_trx_id = jrct.customer_trx_id
1350: AND jrct.customer_trx_id = jrctl.customer_trx_id
1351: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
1352: AND jtc.tax_id = jrcttl.tax_id

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

1350: AND jrct.customer_trx_id = jrctl.customer_trx_id
1351: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
1352: AND jtc.tax_id = jrcttl.tax_id
1353: AND jrttv.tax_type = jtc.tax_type /* Applied to doc has got TCS type of tax*/
1354: AND jrttv.regime_code = jai_constants.tcs_regime;
1355:
1356: /*
1357: ||Get the sign of the Cash receipt document
1358: */

Line 1378: account_class = jai_constants.account_class_rec

1374: sign(nvl(amount,0)) app_fr_sign
1375: FROM
1376: ra_cust_trx_line_gl_dist_all
1377: WHERE
1378: account_class = jai_constants.account_class_rec
1379: AND latest_rec_flag = jai_constants.yes
1380: AND customer_trx_id = cp_cm_customer_trx_id;
1381:
1382: /*

Line 1379: AND latest_rec_flag = jai_constants.yes

1375: FROM
1376: ra_cust_trx_line_gl_dist_all
1377: WHERE
1378: account_class = jai_constants.account_class_rec
1379: AND latest_rec_flag = jai_constants.yes
1380: AND customer_trx_id = cp_cm_customer_trx_id;
1381:
1382: /*
1383: || Check that the Cash receipt has got TCS type of confirmed taxes

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

1395: WHERE
1396: jcra.cash_receipt_id = acra.cash_receipt_id
1397: AND jcra.cash_receipt_id = cp_cash_receipt_id
1398: AND jcra.cash_receipt_id = jdt.source_doc_id
1399: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
1400: AND jcra.confirm_flag = jai_constants.yes
1401: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1402: AND jrttv.regime_code = jai_constants.tcs_regime
1403: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug

Line 1400: AND jcra.confirm_flag = jai_constants.yes

1396: jcra.cash_receipt_id = acra.cash_receipt_id
1397: AND jcra.cash_receipt_id = cp_cash_receipt_id
1398: AND jcra.cash_receipt_id = jdt.source_doc_id
1399: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
1400: AND jcra.confirm_flag = jai_constants.yes
1401: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1402: AND jrttv.regime_code = jai_constants.tcs_regime
1403: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
1404:

Line 1402: AND jrttv.regime_code = jai_constants.tcs_regime

1398: AND jcra.cash_receipt_id = jdt.source_doc_id
1399: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
1400: AND jcra.confirm_flag = jai_constants.yes
1401: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1402: AND jrttv.regime_code = jai_constants.tcs_regime
1403: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
1404:
1405:
1406: /*

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

1399: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
1400: AND jcra.confirm_flag = jai_constants.yes
1401: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1402: AND jrttv.regime_code = jai_constants.tcs_regime
1403: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
1404:
1405:
1406: /*
1407: || Get the application details for the current unapplications from the repository

Line 1455: lv_process_flag := jai_constants.successful ;

1451: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
1452: pn_reg_id => ln_reg_id
1453: );*/
1454:
1455: lv_process_flag := jai_constants.successful ;
1456: lv_process_message := null ;
1457:
1458: p_process_flag := lv_process_flag ;
1459: p_process_message := lv_process_message ;

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

1476: /*########################################################################################################
1477: || CHECK TCS APPLICABILITY ON APPLIED FROM DOCUMENTS AND DERIVE APPLICATION TYPE - PART -2
1478: ########################################################################################################*/
1479:
1480: IF p_araa.application_type IN (jai_constants.ar_cash ,
1481: jai_constants.ar_status_activity
1482: ) AND -------------A1
1483: p_araa.cash_receipt_id IS NOT NULL
1484: THEN

Line 1481: jai_constants.ar_status_activity

1477: || CHECK TCS APPLICABILITY ON APPLIED FROM DOCUMENTS AND DERIVE APPLICATION TYPE - PART -2
1478: ########################################################################################################*/
1479:
1480: IF p_araa.application_type IN (jai_constants.ar_cash ,
1481: jai_constants.ar_status_activity
1482: ) AND -------------A1
1483: p_araa.cash_receipt_id IS NOT NULL
1484: THEN
1485: /*

Line 1503: p_process_flag := jai_constants.not_applicable ;

1499: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1500: pv_log_msg => ' Skip As TCS not applicable ON Derived from documents '
1501: );*/
1502: CLOSE cur_chk_crtcs_applicable;
1503: p_process_flag := jai_constants.not_applicable ;
1504: return ;
1505: ELSE
1506: /*
1507: ||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 1514: IF p_araa.status = jai_constants.ar_status_activity THEN

1510: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1511: pv_log_msg => 'TCS is applicable'
1512: );*/
1513:
1514: IF p_araa.status = jai_constants.ar_status_activity THEN
1515: /*
1516: || As current receivable application is an activity indicating a receipt to receipt getting applied to another receipt
1517: || or Credit Memo hence stop this processing as otherwise this would lead to down stream TCS data corruption.
1518: */

Line 1523: p_process_flag := jai_constants.expected_error;

1519: /*commented by csahoo for bug# 6401388
1520: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1521: pv_log_msg => 'Cannot apply a RECEIPT to any other document (any of them having TCS applicability) other than a Invoice or Debit Memo'
1522: );*/
1523: p_process_flag := jai_constants.expected_error;
1524: p_process_message := 'Cannot apply a RECEIPT to any other document (any of them having TCS applicability) other than a Invoice or Debit Memo';
1525: return;
1526:
1527: END IF;

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

1540: || IF sign of amount field of receivable application is the same as the sign of the cash receipt amount
1541: || then application is receipt application else it would be receipt un application
1542: */
1543: IF ln_sign_of_app = ln_sign_of_app_fr_doc THEN
1544: lv_app_doc_type := jai_constants.trx_type_rct_app ; /* Event is 'RECEIPT_APPLICATION' */
1545: ELSE
1546: lv_app_doc_type := jai_constants.trx_type_rct_unapp ;/* Event is 'RECEIPT_UNAPPLICATION' */
1547: END IF;
1548:

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

1542: */
1543: IF ln_sign_of_app = ln_sign_of_app_fr_doc THEN
1544: lv_app_doc_type := jai_constants.trx_type_rct_app ; /* Event is 'RECEIPT_APPLICATION' */
1545: ELSE
1546: lv_app_doc_type := jai_constants.trx_type_rct_unapp ;/* Event is 'RECEIPT_UNAPPLICATION' */
1547: END IF;
1548:
1549:
1550: ELSIF p_araa.application_type = jai_constants.ar_invoice_type_cm AND -------------A1

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

1546: lv_app_doc_type := jai_constants.trx_type_rct_unapp ;/* Event is 'RECEIPT_UNAPPLICATION' */
1547: END IF;
1548:
1549:
1550: ELSIF p_araa.application_type = jai_constants.ar_invoice_type_cm AND -------------A1
1551: p_araa.customer_trx_id IS NOT NULL
1552: THEN
1553: /*
1554: ||Application is Credit Memo

Line 1570: p_process_flag := jai_constants.not_applicable ;

1566: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1567: pv_log_msg => ' Skip As TCS not applicable ON Derived from documents '
1568: );*/
1569: CLOSE cur_chk_tcs_applicable;
1570: p_process_flag := jai_constants.not_applicable ;
1571: return;
1572: END IF;
1573: CLOSE cur_chk_tcs_applicable;
1574:

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

1583: || IF sign of amount field of receivable application is the same as the sign of the Credit Memo amount
1584: || then application is Credit Memo Application else it would be Credit Memo Unapplication
1585: */
1586: IF ln_sign_of_app = ln_sign_of_app_fr_doc THEN
1587: lv_app_doc_type := jai_constants.trx_type_cm_app ; /* Event is 'CREDIT_MEMO_APPLICATION' */
1588: ELSE
1589: lv_app_doc_type := jai_constants.trx_type_cm_unapp ;/* Event is 'CREDIT_MEMO_UNAPPLICATION' */
1590: END IF;
1591:

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

1585: */
1586: IF ln_sign_of_app = ln_sign_of_app_fr_doc THEN
1587: lv_app_doc_type := jai_constants.trx_type_cm_app ; /* Event is 'CREDIT_MEMO_APPLICATION' */
1588: ELSE
1589: lv_app_doc_type := jai_constants.trx_type_cm_unapp ;/* Event is 'CREDIT_MEMO_UNAPPLICATION' */
1590: END IF;
1591:
1592: /*
1593: ||Get the value for the item classification pertaining to the IO and inventory item combination

Line 1596: p_regime_code => jai_constants.tcs_regime ,

1592: /*
1593: ||Get the value for the item classification pertaining to the IO and inventory item combination
1594: */
1595: jai_inv_items_pkg.jai_get_attrib (
1596: p_regime_code => jai_constants.tcs_regime ,
1597: p_organization_id => ln_app_fr_organization_id ,
1598: p_inventory_item_id => ln_app_fr_inventory_item_id ,
1599: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
1600: p_attribute_value => ln_app_fr_itm_class ,

Line 1599: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,

1595: jai_inv_items_pkg.jai_get_attrib (
1596: p_regime_code => jai_constants.tcs_regime ,
1597: p_organization_id => ln_app_fr_organization_id ,
1598: p_inventory_item_id => ln_app_fr_inventory_item_id ,
1599: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
1600: p_attribute_value => ln_app_fr_itm_class ,
1601: p_process_flag => lv_process_flag ,
1602: p_process_msg => lv_process_message
1603: );

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

1601: p_process_flag => lv_process_flag ,
1602: p_process_msg => lv_process_message
1603: );
1604:
1605: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1606: lv_process_flag = jai_constants.unexpected_error
1607: THEN
1608: /*
1609: || As Returned status is an error hence:-

Line 1606: lv_process_flag = jai_constants.unexpected_error

1602: p_process_msg => lv_process_message
1603: );
1604:
1605: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1606: lv_process_flag = jai_constants.unexpected_error
1607: THEN
1608: /*
1609: || As Returned status is an error hence:-
1610: || Set out variables p_process_flag and p_process_message accordingly

Line 1632: p_process_flag := jai_constants.not_applicable ;

1628: /*commented by csahoo for bug# 6401388
1629: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1630: pv_log_msg => ' Skip as scenario is niether CASH nor CM '
1631: );*/
1632: p_process_flag := jai_constants.not_applicable ;
1633: return;
1634: END IF; -------------A1
1635:
1636: /*commented by csahoo for bug# 6401388

Line 1655: p_process_flag := jai_constants.not_applicable ;

1651: FETCH cur_chk_tcs_applicable INTO ln_app_to_organization_id, ln_app_to_inventory_item_id, ln_app_to_amount ;
1652:
1653: IF CUR_CHK_TCS_APPLICABLE%NOTFOUND THEN
1654: CLOSE cur_chk_tcs_applicable;
1655: p_process_flag := jai_constants.not_applicable ;
1656: /*commented by csahoo for bug# 6401388
1657: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1658: pv_log_msg => ' Skip the processing as TCS is not applicable on the transaction'
1659: );*/

Line 1668: p_regime_code => jai_constants.tcs_regime ,

1664: /*
1665: ||Get the value for the item classification pertaining to the IO and inventory item combination
1666: */
1667: jai_inv_items_pkg.jai_get_attrib (
1668: p_regime_code => jai_constants.tcs_regime ,
1669: p_organization_id => ln_app_to_organization_id ,
1670: p_inventory_item_id => ln_app_to_inventory_item_id ,
1671: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
1672: p_attribute_value => ln_app_to_itm_class ,

Line 1671: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,

1667: jai_inv_items_pkg.jai_get_attrib (
1668: p_regime_code => jai_constants.tcs_regime ,
1669: p_organization_id => ln_app_to_organization_id ,
1670: p_inventory_item_id => ln_app_to_inventory_item_id ,
1671: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
1672: p_attribute_value => ln_app_to_itm_class ,
1673: p_process_flag => lv_process_flag ,
1674: p_process_msg => lv_process_message
1675: );

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

1673: p_process_flag => lv_process_flag ,
1674: p_process_msg => lv_process_message
1675: );
1676:
1677: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1678: lv_process_flag = jai_constants.unexpected_error
1679: THEN
1680: /*
1681: || As Returned status is an error hence:-

Line 1678: lv_process_flag = jai_constants.unexpected_error

1674: p_process_msg => lv_process_message
1675: );
1676:
1677: IF lv_process_flag = jai_constants.expected_error OR ---------A2
1678: lv_process_flag = jai_constants.unexpected_error
1679: THEN
1680: /*
1681: || As Returned status is an error hence:-
1682: || Set out variables p_process_flag and p_process_message accordingly

Line 1706: IF lv_app_doc_type IN ( jai_constants.trx_type_rct_app ,

1702: || All lines of the applied from and to documents should belong to the same item classification.
1703: || Do not allow a transaction if this rule is not followed.
1704: */
1705:
1706: IF lv_app_doc_type IN ( jai_constants.trx_type_rct_app ,
1707: jai_constants.trx_type_cm_app
1708: )
1709: THEN
1710: IF ln_app_fr_itm_class <> ln_app_to_itm_class THEN

Line 1707: jai_constants.trx_type_cm_app

1703: || Do not allow a transaction if this rule is not followed.
1704: */
1705:
1706: IF lv_app_doc_type IN ( jai_constants.trx_type_rct_app ,
1707: jai_constants.trx_type_cm_app
1708: )
1709: THEN
1710: IF ln_app_fr_itm_class <> ln_app_to_itm_class THEN
1711:

Line 1718: p_process_flag := jai_constants.expected_error ;

1714: pv_log_msg => ' Item classification for the application from and to item class do not match hence error '||fnd_global.local_chr(10)
1715: ||', p_process_flag -> '|| p_process_flag
1716: ||', lv_process_message -> '|| lv_process_message
1717: );*/
1718: p_process_flag := jai_constants.expected_error ;
1719: p_process_message := 'Application is not allowed as the APPLIED FROM and TO DOCUMENTS have different item classifications.';
1720: return;
1721: END IF;
1722: END IF;

Line 1736: p_process_flag := jai_constants.expected_error ;

1732: ||', applied to amount -> '|| ln_app_to_amount ||fnd_global.local_chr(10)
1733: ||', p_process_flag -> '|| p_process_flag ||fnd_global.local_chr(10)
1734: ||', lv_process_message -> '|| lv_process_message
1735: );*/
1736: p_process_flag := jai_constants.expected_error ;
1737: p_process_message := 'Over Application of a document to other is not allowed if both the taxes have TCS type of taxes .';
1738: return;
1739: END IF;
1740:

Line 1750: IF lv_app_doc_type = jai_constants.trx_type_rct_unapp THEN

1746: /*########################################################################################################
1747: || RESTRICTIONS ON RECEIPT UNAPPLICATION
1748: ########################################################################################################*/
1749:
1750: IF lv_app_doc_type = jai_constants.trx_type_rct_unapp THEN
1751: /*
1752: ||Validate that the parent receipt application record is present in the repository.
1753: */
1754: OPEN cur_chk_parent_rec ( cp_applied_fr_doc_id => p_araa.cash_receipt_id ,

Line 1770: p_process_flag := jai_constants.not_applicable ;

1766: pv_log_msg => 'Skip,case For unapplication, Parent transaction record is not present in the repository'||fnd_global.local_chr(10)
1767: ||', p_process_flag -> '|| p_process_flag ||fnd_global.local_chr(10)
1768: );*/
1769:
1770: p_process_flag := jai_constants.not_applicable ;
1771: return;
1772: END IF;
1773:
1774: CLOSE cur_chk_parent_rec;

Line 1780: p_process_flag := jai_constants.expected_error ;

1776: IF rec_cur_chk_parent_rec.settlement_id is NOT NULL THEN
1777: /*
1778: || Original Application already settled hence
1779: */
1780: p_process_flag := jai_constants.expected_error ;
1781: p_process_message := 'Parent application has already been settled. hence cannot unapply';
1782: /*commented by csahoo for bug# 6401388
1783: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1784: pv_log_msg => ' Error :-Parent application has already been settled. hence cannot unapply'||fnd_global.local_chr(10)

Line 1799: IF lv_app_doc_type = jai_constants.trx_type_cm_unapp THEN

1795: /*########################################################################################################
1796: || RESTRICTIONS ON CREDIT MEMO UNAPPLICATION
1797: ########################################################################################################*/
1798:
1799: IF lv_app_doc_type = jai_constants.trx_type_cm_unapp THEN
1800: /*
1801: ||Validate that the parent credit memo application record is present in the repository.
1802: */
1803: OPEN cur_chk_parent_rec ( cp_applied_fr_doc_id => p_araa.customer_trx_id ,

Line 1817: p_process_flag := jai_constants.not_applicable ;

1813: pv_log_msg => ' Skip the processing as TCS is not applicable on the transaction'||fnd_global.local_chr(10)
1814: ||', p_process_flag -> '|| p_process_flag
1815: );*/
1816: CLOSE cur_chk_parent_rec;
1817: p_process_flag := jai_constants.not_applicable ;
1818: return;
1819: END IF;
1820:
1821: CLOSE cur_chk_parent_rec;

Line 1833: p_process_flag := jai_constants.expected_error ;

1829: pv_log_msg => ' Error :-Parent application has already been settled. hence cannot unapply'||fnd_global.local_chr(10)
1830: ||', p_process_flag -> '|| p_process_flag
1831: ||', lv_process_message -> '|| lv_process_message
1832: );*/
1833: p_process_flag := jai_constants.expected_error ;
1834: p_process_message := 'Parent application has already been settled. hence cannot unapply';
1835: return;
1836: END IF;
1837: END IF;

Line 1881: AND jrttv.regime_code = jai_constants.tcs_regime

1877: WHERE
1878: jcra.cash_receipt_id = cp_cash_receipt_id
1879: AND jcra.cash_receipt_id = jdt.source_doc_id
1880: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1881: AND jrttv.regime_code = jai_constants.tcs_regime
1882: AND jcra.confirm_flag = jai_constants.yes
1883: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
1884:
1885: /*

Line 1882: AND jcra.confirm_flag = jai_constants.yes

1878: jcra.cash_receipt_id = cp_cash_receipt_id
1879: AND jcra.cash_receipt_id = jdt.source_doc_id
1880: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1881: AND jrttv.regime_code = jai_constants.tcs_regime
1882: AND jcra.confirm_flag = jai_constants.yes
1883: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
1884:
1885: /*
1886: ||Get the last record pertaining to the cash receipt confirmation

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

1879: AND jcra.cash_receipt_id = jdt.source_doc_id
1880: AND jdt.tax_type = jrttv.tax_type /* Applied to doc has got TCS type of tax*/
1881: AND jrttv.regime_code = jai_constants.tcs_regime
1882: AND jcra.confirm_flag = jai_constants.yes
1883: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
1884:
1885: /*
1886: ||Get the last record pertaining to the cash receipt confirmation
1887: */

Line 1933: lv_process_flag := jai_constants.successful ;

1929: ||', p_acra.amount -> '||p_acra.amount ||fnd_global.local_chr(10)
1930: ||', p_acra.type -> '||p_acra.type ||fnd_global.local_chr(10)
1931: );*/
1932:
1933: lv_process_flag := jai_constants.successful ;
1934: lv_process_message := null ;
1935:
1936: p_process_flag := lv_process_flag ;
1937: p_process_message := lv_process_message ;

Line 1955: p_process_flag := jai_constants.not_applicable;

1951: OPEN cur_chk_tcs_applicable ( cp_cash_receipt_id => p_acra.cash_receipt_id );
1952: FETCH cur_chk_tcs_applicable INTO ln_exists;
1953: IF cur_chk_tcs_applicable%NOTFOUND THEN
1954: CLOSE cur_chk_tcs_applicable ;
1955: p_process_flag := jai_constants.not_applicable;
1956: return;
1957: END IF;
1958: CLOSE cur_chk_tcs_applicable ;
1959:

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

1960: /*########################################################################################################
1961: || VALIDATIONS FOR RECEIPT REVERSAL
1962: ########################################################################################################*/
1963:
1964: IF p_document_type = jai_constants.trx_type_rct_rvs THEN /* 'RECEIPT_REVERSAL' */
1965: /*
1966: || Check that an original record with cash receipt confirmation exists in the repository.
1967: || In case it does not exist, then error out the record as it need not hit the repository
1968: || If it exists then check whether it has been settled . If yes then throw an error

Line 1975: cp_source_document_type => jai_constants.ar_cash_tax_confirmed

1971: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1972: pv_log_msg => 'Validate for Receipt Reversal '
1973: );*/
1974: OPEN cur_chk_tcs_settlement ( cp_source_document_id => p_acra.cash_receipt_id ,
1975: cp_source_document_type => jai_constants.ar_cash_tax_confirmed
1976: );
1977: FETCH cur_chk_tcs_settlement INTO rec_cur_chk_tcs_settlement;
1978: IF CUR_CHK_TCS_SETTLEMENT%NOTFOUND THEN
1979: /*

Line 1987: p_process_flag := jai_constants.expected_error;

1983: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
1984: pv_log_msg => 'Original Receipt Confirmation records does not exists in the repository. Cannot reverse receipt'
1985: );*/
1986: CLOSE cur_chk_tcs_settlement;
1987: p_process_flag := jai_constants.expected_error;
1988: p_process_message := 'Cannot reverse the receipt as the receipt confirmation record does not exists in the repository ';
1989: return;
1990: ELSE
1991: /*

Line 2003: p_process_flag := jai_constants.expected_error;

1999: /*commented by csahoo for bug# 6401388
2000: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2001: pv_log_msg => ' TCS On the original confirmed receipt has been settled. CAnnot reverse the receipt'
2002: );*/
2003: p_process_flag := jai_constants.expected_error;
2004: p_process_message := 'Cannot reverse the receipt as the tcs taxes pertaining to the receipt have been confirmed ';
2005: return;
2006: END IF;
2007: END IF;

Line 2042: AND rct.account_class = jai_constants.account_class_rec

2038: ra_cust_trx_line_gl_dist_all rct
2039: , jai_ar_trx_lines jatl --added by eric for inclusive tax
2040: WHERE jatl.customer_trx_id = rct.customer_trx_id --added by eric for inclusive tax
2041: AND rct.customer_trx_id = p_ract.customer_trx_id
2042: AND rct.account_class = jai_constants.account_class_rec
2043: AND rct.latest_rec_flag = jai_constants.yes;
2044:
2045: -- Added by Jia Li for inclusive taxes on 2008-01-18
2046: ----------------------------------------------------------------

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

2039: , jai_ar_trx_lines jatl --added by eric for inclusive tax
2040: WHERE jatl.customer_trx_id = rct.customer_trx_id --added by eric for inclusive tax
2041: AND rct.customer_trx_id = p_ract.customer_trx_id
2042: AND rct.account_class = jai_constants.account_class_rec
2043: AND rct.latest_rec_flag = jai_constants.yes;
2044:
2045: -- Added by Jia Li for inclusive taxes on 2008-01-18
2046: ----------------------------------------------------------------
2047: CURSOR cur_get_inv_exclu_amt

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

2100: WHERE
2101: jrcttl.link_to_cust_trx_line_id = cp_customer_trx_line_id
2102: AND jrcttl.tax_id = jtc.tax_id
2103: AND jrttv.tax_type = jtc.tax_type
2104: AND jrttv.regime_code = jai_constants.tcs_regime;
2105:
2106: CURSOR cur_get_no_of_rows
2107: IS
2108: SELECT

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

2113: customer_trx_id = p_ract.customer_trx_id ;
2114:
2115: ln_row_count NUMBER(3) ;
2116: ln_line_counter NUMBER(3) := 0 ;
2117: ln_last_line_flag VARCHAR2(1) := jai_constants.no ;
2118: lv_process_flag VARCHAR2(2) ;
2119: lv_process_message VARCHAR2(2000) ;
2120: lv_document_type VARCHAR2(100) ;
2121: ln_trx_ref_id JAI_RGM_REFS_ALL.TRX_REF_ID%TYPE ;

Line 2138: lv_process_flag := jai_constants.successful ;

2134: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context
2135: , pn_reg_id => ln_reg_id
2136: );*/
2137:
2138: lv_process_flag := jai_constants.successful ;
2139: lv_process_message := null ;
2140:
2141: p_process_flag := lv_process_flag ;
2142: p_process_message := lv_process_message ;

Line 2150: IF p_document_type IN ( jai_constants.trx_type_inv_comp ,

2146: ||Check that the document is of type
2147: ||Confirmed cash receipt
2148: *******/
2149:
2150: IF p_document_type IN ( jai_constants.trx_type_inv_comp ,
2151: jai_constants.trx_type_inv_incomp
2152: )
2153: THEN ---------A1
2154: /*########################################################################################################

Line 2151: jai_constants.trx_type_inv_incomp

2147: ||Confirmed cash receipt
2148: *******/
2149:
2150: IF p_document_type IN ( jai_constants.trx_type_inv_comp ,
2151: jai_constants.trx_type_inv_incomp
2152: )
2153: THEN ---------A1
2154: /*########################################################################################################
2155: || DERIVE VALUES AND INSERT COMPLETED INVOICES INTO JAI_RGM_TRX_REFS_ALL TABLE ---- PART -1

Line 2174: IF p_document_type = jai_constants.trx_type_inv_incomp THEN

2170:
2171: ln_total_inv_amount := ln_total_inv_amount + ln_total_inv_exclu_amt;
2172: ----------------------------------------------------------------------
2173:
2174: IF p_document_type = jai_constants.trx_type_inv_incomp THEN
2175: /*
2176: ||Reverse the sign of the amount if the invoice is gettin incompleted.
2177: */
2178: ln_total_inv_amount := ln_total_inv_amount * (-1);

Line 2192: p_regime_code => jai_constants.tcs_regime ,

2188: /*
2189: ||Get the value for the item classification pertaining to the IO and inventory item combination
2190: */
2191: jai_inv_items_pkg.jai_get_attrib (
2192: p_regime_code => jai_constants.tcs_regime ,
2193: p_organization_id => rec_cur_get_inv_line_det.organization_id ,
2194: p_inventory_item_id => rec_cur_get_inv_line_det.inventory_item_id ,
2195: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
2196: p_attribute_value => lv_item_classification ,

Line 2195: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,

2191: jai_inv_items_pkg.jai_get_attrib (
2192: p_regime_code => jai_constants.tcs_regime ,
2193: p_organization_id => rec_cur_get_inv_line_det.organization_id ,
2194: p_inventory_item_id => rec_cur_get_inv_line_det.inventory_item_id ,
2195: p_attribute_code => jai_constants.rgm_attr_cd_itm_class ,
2196: p_attribute_value => lv_item_classification ,
2197: p_process_flag => lv_process_flag ,
2198: p_process_msg => lv_process_message
2199: );

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

2198: p_process_msg => lv_process_message
2199: );
2200:
2201:
2202: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2203: lv_process_flag = jai_constants.unexpected_error
2204: THEN
2205: /*
2206: || As Returned status is an error/not applicable hence:-

Line 2203: lv_process_flag = jai_constants.unexpected_error

2199: );
2200:
2201:
2202: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2203: lv_process_flag = jai_constants.unexpected_error
2204: THEN
2205: /*
2206: || As Returned status is an error/not applicable hence:-
2207: || Set out variables p_process_flag and p_process_message accordingly

Line 2215: IF p_document_type = jai_constants.trx_type_inv_incomp THEN

2211: p_process_message := lv_process_message ;
2212: return;
2213: END IF; ---------A2
2214:
2215: IF p_document_type = jai_constants.trx_type_inv_incomp THEN
2216: /*
2217: ||Reverse the sign of the amount if the invoice is getting incompleted.
2218: */
2219: rec_cur_get_inv_line_det.line_amount := rec_cur_get_inv_line_det.line_amount * (-1);

Line 2247: p_table_name => jai_constants.ar_inv_lines_table ,

2243: p_document_id => p_ract.customer_trx_id ,
2244: p_document_type => p_document_type ,
2245: p_document_line_id => rec_cur_get_inv_line_det.customer_trx_line_id ,
2246: p_document_date => ld_document_date ,
2247: p_table_name => jai_constants.ar_inv_lines_table ,
2248: p_line_amount => rec_cur_get_inv_line_det.line_amount * nvl( p_ract.exchange_rate , 1 ) ,
2249: p_document_amount => ln_total_inv_amount ,
2250: p_org_id => p_ract.org_id ,
2251: p_organization_id => rec_cur_get_inv_line_det.organization_id ,

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

2256: p_process_flag => lv_process_flag ,
2257: p_process_message => lv_process_message
2258: );
2259:
2260: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2261: lv_process_flag = jai_constants.unexpected_error
2262: THEN
2263: /*
2264: || As Returned status is an error/not applicable hence:-

Line 2261: lv_process_flag = jai_constants.unexpected_error

2257: p_process_message => lv_process_message
2258: );
2259:
2260: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2261: lv_process_flag = jai_constants.unexpected_error
2262: THEN
2263: /*
2264: || As Returned status is an error/not applicable hence:-
2265: || Set out variables p_process_flag and p_process_message accordingly

Line 2277: IF p_document_type = jai_constants.trx_type_inv_incomp THEN

2273: /*########################################################################################################
2274: || INSERT INVOICE TAXES INTO JAI_RGM_TAXES TABLE ---- PART -2
2275: ########################################################################################################*/
2276:
2277: IF p_document_type = jai_constants.trx_type_inv_incomp THEN
2278: /*
2279: ||Reverse the sign of the amount if the invoice is getting incompleted.
2280: */
2281: ln_apportion_factor := -1;

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

2291: p_process_flag => lv_process_flag ,
2292: p_process_message => lv_process_message
2293: );
2294:
2295: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2296: lv_process_flag = jai_constants.unexpected_error OR
2297: lv_process_flag = jai_constants.not_applicable
2298: THEN
2299: /*

Line 2296: lv_process_flag = jai_constants.unexpected_error OR

2292: p_process_message => lv_process_message
2293: );
2294:
2295: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2296: lv_process_flag = jai_constants.unexpected_error OR
2297: lv_process_flag = jai_constants.not_applicable
2298: THEN
2299: /*
2300: || As Returned status is an error/not applicable hence:-

Line 2297: lv_process_flag = jai_constants.not_applicable

2293: );
2294:
2295: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2296: lv_process_flag = jai_constants.unexpected_error OR
2297: lv_process_flag = jai_constants.not_applicable
2298: THEN
2299: /*
2300: || As Returned status is an error/not applicable hence:-
2301: || Set out variables p_process_flag and p_process_message accordingly

Line 2362: AND jrttv.regime_code = jai_constants.tcs_regime

2358: WHERE
2359: jdt.tax_id = jtc.tax_id
2360: AND jtc.tax_type = jrttv.tax_type
2361: AND jdt.source_doc_id = p_acra.cash_receipt_id
2362: AND jrttv.regime_code = jai_constants.tcs_regime
2363: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
2364:
2365: /*****
2366: || Get all the applications for which Cash Receipt has got TCS type of taxes

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

2359: jdt.tax_id = jtc.tax_id
2360: AND jtc.tax_type = jrttv.tax_type
2361: AND jdt.source_doc_id = p_acra.cash_receipt_id
2362: AND jrttv.regime_code = jai_constants.tcs_regime
2363: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
2364:
2365: /*****
2366: || Get all the applications for which Cash Receipt has got TCS type of taxes
2367: || and the corresponding invoice also have got TCS type of tax.

Line 2382: AND ra.display = jai_constants.yes

2378: ra.cash_receipt_id = jcra.cash_receipt_id
2379: AND ra.cash_receipt_id = cp_cash_receipt_id
2380: AND ra.status = 'APP'
2381: AND ra.application_type = 'CASH'
2382: AND ra.display = jai_constants.yes
2383: AND jcra.confirm_flag = jai_constants.yes
2384: AND exists ( SELECT /* TCS type of taxes exist for the receipt */
2385: 1
2386: FROM

Line 2383: AND jcra.confirm_flag = jai_constants.yes

2379: AND ra.cash_receipt_id = cp_cash_receipt_id
2380: AND ra.status = 'APP'
2381: AND ra.application_type = 'CASH'
2382: AND ra.display = jai_constants.yes
2383: AND jcra.confirm_flag = jai_constants.yes
2384: AND exists ( SELECT /* TCS type of taxes exist for the receipt */
2385: 1
2386: FROM
2387: jai_cmn_document_taxes jdt ,

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

2387: jai_cmn_document_taxes jdt ,
2388: jai_regime_tax_types_v jrttv
2389: WHERE
2390: jdt.source_doc_id = jcra.cash_receipt_id
2391: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
2392: AND jdt.tax_type = jrttv.tax_type
2393: AND jrttv.regime_code = jai_constants.tcs_regime
2394: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash --added by eric for a bug
2395: )

Line 2393: AND jrttv.regime_code = jai_constants.tcs_regime

2389: WHERE
2390: jdt.source_doc_id = jcra.cash_receipt_id
2391: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
2392: AND jdt.tax_type = jrttv.tax_type
2393: AND jrttv.regime_code = jai_constants.tcs_regime
2394: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash --added by eric for a bug
2395: )
2396: AND exists ( SELECT /* TCS type of taxes exist for the corresponding Invoice */
2397: 1

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

2390: jdt.source_doc_id = jcra.cash_receipt_id
2391: AND jdt.source_table_name = jai_constants.jai_cash_rcpts /* 'JAI_AR_CASH_RECEIPTS_ALL' */
2392: AND jdt.tax_type = jrttv.tax_type
2393: AND jrttv.regime_code = jai_constants.tcs_regime
2394: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash --added by eric for a bug
2395: )
2396: AND exists ( SELECT /* TCS type of taxes exist for the corresponding Invoice */
2397: 1
2398: FROM

Line 2408: AND jrttv.regime_code = jai_constants.tcs_regime

2404: jrctl.customer_trx_id = ra.applied_customer_trx_id
2405: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
2406: AND jrcttl.tax_id = jtc.tax_id
2407: AND jtc.tax_type = jrttv.tax_type
2408: AND jrttv.regime_code = jai_constants.tcs_regime
2409: );
2410:
2411: /********
2412: || Get the details of the source receipt

Line 2461: lv_process_flag := jai_constants.successful ;

2457: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context
2458: , pn_reg_id => ln_reg_id
2459: );*/
2460:
2461: lv_process_flag := jai_constants.successful ;
2462: lv_process_message := null ;
2463:
2464: p_process_flag := lv_process_flag ;
2465: p_process_message := lv_process_message ;

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

2472: ||Confirmed cash receipt
2473:
2474: *******/
2475:
2476: IF p_document_type = jai_constants.ar_cash_tax_confirmed THEN ---------C1
2477: /*commented by csahoo for bug# 6401388
2478: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2479: pv_log_msg => ' Confirmation processing for the receipts with the following details'||fnd_global.local_chr(10)
2480: ||', p_acra.receipt_number -> '||p_acra.receipt_number ||fnd_global.local_chr(10)

Line 2522: p_table_name => jai_constants.jai_cash_rcpts ,

2518: p_document_id => p_acra.cash_receipt_id ,
2519: p_document_type => p_document_type ,
2520: p_document_line_id => p_acra.cash_receipt_id ,
2521: p_document_date => rec_cur_get_cr_details.gl_date ,
2522: p_table_name => jai_constants.jai_cash_rcpts ,
2523: p_line_amount => ln_rcpt_amount ,
2524: p_document_amount => ln_rcpt_amount ,
2525: p_org_id => p_acra.org_id ,
2526: p_organization_id => rec_cur_get_cr_details.organization_id ,

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

2536: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2537: pv_log_msg => ' Return from insert_repository_references '
2538: );*/
2539:
2540: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2541: lv_process_flag = jai_constants.unexpected_error OR
2542: lv_process_flag = jai_constants.not_applicable
2543: THEN
2544: /*

Line 2541: lv_process_flag = jai_constants.unexpected_error OR

2537: pv_log_msg => ' Return from insert_repository_references '
2538: );*/
2539:
2540: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2541: lv_process_flag = jai_constants.unexpected_error OR
2542: lv_process_flag = jai_constants.not_applicable
2543: THEN
2544: /*
2545: || As Returned status is an error/not applicable hence:-

Line 2542: lv_process_flag = jai_constants.not_applicable

2538: );*/
2539:
2540: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2541: lv_process_flag = jai_constants.unexpected_error OR
2542: lv_process_flag = jai_constants.not_applicable
2543: THEN
2544: /*
2545: || As Returned status is an error/not applicable hence:-
2546: || Set out variables p_process_flag and p_process_message accordingly

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

2579: /*commented by csahoo for bug# 6401388
2580: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2581: pv_log_msg => ' Return from copy_taxes_from_source '
2582: );*/
2583: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2584: lv_process_flag = jai_constants.unexpected_error OR
2585: lv_process_flag = jai_constants.not_applicable
2586: THEN
2587: /*

Line 2584: lv_process_flag = jai_constants.unexpected_error OR

2580: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2581: pv_log_msg => ' Return from copy_taxes_from_source '
2582: );*/
2583: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2584: lv_process_flag = jai_constants.unexpected_error OR
2585: lv_process_flag = jai_constants.not_applicable
2586: THEN
2587: /*
2588: || As Returned status is an error/not applicable hence:-

Line 2585: lv_process_flag = jai_constants.not_applicable

2581: pv_log_msg => ' Return from copy_taxes_from_source '
2582: );*/
2583: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2584: lv_process_flag = jai_constants.unexpected_error OR
2585: lv_process_flag = jai_constants.not_applicable
2586: THEN
2587: /*
2588: || As Returned status is an error/not applicable hence:-
2589: || Set out variables p_process_flag and p_process_message accordingly

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

2633: /*commented by csahoo for bug# 6401388
2634: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2635: pv_log_msg => ' Return from jai_ar_tcs_rep_pkg.process_transactions '
2636: );*/
2637: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2638: lv_process_flag = jai_constants.unexpected_error OR
2639: lv_process_flag = jai_constants.not_applicable
2640: THEN
2641: /*

Line 2638: lv_process_flag = jai_constants.unexpected_error OR

2634: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2635: pv_log_msg => ' Return from jai_ar_tcs_rep_pkg.process_transactions '
2636: );*/
2637: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2638: lv_process_flag = jai_constants.unexpected_error OR
2639: lv_process_flag = jai_constants.not_applicable
2640: THEN
2641: /*
2642: || As Returned status is an error/not applicable hence:-

Line 2639: lv_process_flag = jai_constants.not_applicable

2635: pv_log_msg => ' Return from jai_ar_tcs_rep_pkg.process_transactions '
2636: );*/
2637: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2638: lv_process_flag = jai_constants.unexpected_error OR
2639: lv_process_flag = jai_constants.not_applicable
2640: THEN
2641: /*
2642: || As Returned status is an error/not applicable hence:-
2643: || Set out variables p_process_flag and p_process_message accordingly

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

2664: /*########################################################################################################
2665: || PROCESS AR CASH RECEIPT REVERSALS ---- PART -4
2666: ########################################################################################################*/
2667:
2668: ELSIF p_document_type = jai_constants.trx_type_rct_rvs THEN ---------C1
2669: /*commented by csahoo for bug# 6401388
2670: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2671: pv_log_msg => ' Start of receipt reversal processing '
2672: );*/

Line 2674: cp_source_document_type => jai_constants.ar_cash_tax_confirmed

2670: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
2671: pv_log_msg => ' Start of receipt reversal processing '
2672: );*/
2673: OPEN cur_get_parent_transaction ( cp_source_document_id => p_acra.cash_receipt_id ,
2674: cp_source_document_type => jai_constants.ar_cash_tax_confirmed
2675: ) ;
2676:
2677: FETCH cur_get_parent_transaction INTO ln_parent_transaction_id;
2678: /*

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

2692: p_apportion_factor => -1 ,/* As reversal cannot be partial */
2693: p_process_flag => lv_process_flag ,
2694: p_process_message => lv_process_message
2695: );
2696: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2697: lv_process_flag = jai_constants.unexpected_error OR
2698: lv_process_flag = jai_constants.not_applicable
2699: THEN
2700: /*

Line 2697: lv_process_flag = jai_constants.unexpected_error OR

2693: p_process_flag => lv_process_flag ,
2694: p_process_message => lv_process_message
2695: );
2696: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2697: lv_process_flag = jai_constants.unexpected_error OR
2698: lv_process_flag = jai_constants.not_applicable
2699: THEN
2700: /*
2701: || As Returned status is an error/not applicable hence:-

Line 2698: lv_process_flag = jai_constants.not_applicable

2694: p_process_message => lv_process_message
2695: );
2696: IF lv_process_flag = jai_constants.expected_error OR ---------A2
2697: lv_process_flag = jai_constants.unexpected_error OR
2698: lv_process_flag = jai_constants.not_applicable
2699: THEN
2700: /*
2701: || As Returned status is an error/not applicable hence:-
2702: || Set out variables p_process_flag and p_process_message accordingly

Line 2759: AND rcta.complete_flag = jai_constants.yes

2755: JAI_CMN_TAXES_ALL jtc ,
2756: jai_regime_tax_types_v jrttv
2757: WHERE
2758: rcta.customer_trx_id = cp_applied_customer_trx_id
2759: AND rcta.complete_flag = jai_constants.yes
2760: AND rcta.customer_trx_id = gl_dist.customer_trx_id
2761: AND gl_dist.account_class = jai_constants.account_class_rec
2762: AND gl_dist.latest_rec_flag = jai_constants.yes
2763: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id

Line 2761: AND gl_dist.account_class = jai_constants.account_class_rec

2757: WHERE
2758: rcta.customer_trx_id = cp_applied_customer_trx_id
2759: AND rcta.complete_flag = jai_constants.yes
2760: AND rcta.customer_trx_id = gl_dist.customer_trx_id
2761: AND gl_dist.account_class = jai_constants.account_class_rec
2762: AND gl_dist.latest_rec_flag = jai_constants.yes
2763: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
2764: AND rcta.customer_trx_id = jrct.customer_trx_id
2765: AND jrct.customer_trx_id = jrctl.customer_trx_id

Line 2762: AND gl_dist.latest_rec_flag = jai_constants.yes

2758: rcta.customer_trx_id = cp_applied_customer_trx_id
2759: AND rcta.complete_flag = jai_constants.yes
2760: AND rcta.customer_trx_id = gl_dist.customer_trx_id
2761: AND gl_dist.account_class = jai_constants.account_class_rec
2762: AND gl_dist.latest_rec_flag = jai_constants.yes
2763: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
2764: AND rcta.customer_trx_id = jrct.customer_trx_id
2765: AND jrct.customer_trx_id = jrctl.customer_trx_id
2766: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id

Line 2769: AND jrttv.regime_code = jai_constants.tcs_regime

2765: AND jrct.customer_trx_id = jrctl.customer_trx_id
2766: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
2767: AND jrcttl.tax_id = jtc.tax_id
2768: AND jtc.tax_type = jrttv.tax_type
2769: AND jrttv.regime_code = jai_constants.tcs_regime
2770: AND trx_types.type IN ( jai_constants.ar_invoice_type_inv , /* Applied to doc has to be either a invoice or DM or CM */
2771: jai_constants.ar_invoice_type_cm ,
2772: jai_constants.ar_doc_type_dm
2773: );

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

2766: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
2767: AND jrcttl.tax_id = jtc.tax_id
2768: AND jtc.tax_type = jrttv.tax_type
2769: AND jrttv.regime_code = jai_constants.tcs_regime
2770: AND trx_types.type IN ( jai_constants.ar_invoice_type_inv , /* Applied to doc has to be either a invoice or DM or CM */
2771: jai_constants.ar_invoice_type_cm ,
2772: jai_constants.ar_doc_type_dm
2773: );
2774:

Line 2771: jai_constants.ar_invoice_type_cm ,

2767: AND jrcttl.tax_id = jtc.tax_id
2768: AND jtc.tax_type = jrttv.tax_type
2769: AND jrttv.regime_code = jai_constants.tcs_regime
2770: AND trx_types.type IN ( jai_constants.ar_invoice_type_inv , /* Applied to doc has to be either a invoice or DM or CM */
2771: jai_constants.ar_invoice_type_cm ,
2772: jai_constants.ar_doc_type_dm
2773: );
2774:
2775: -- Added by Jia Li for inclusive taxes on 2008-01-18

Line 2772: jai_constants.ar_doc_type_dm

2768: AND jtc.tax_type = jrttv.tax_type
2769: AND jrttv.regime_code = jai_constants.tcs_regime
2770: AND trx_types.type IN ( jai_constants.ar_invoice_type_inv , /* Applied to doc has to be either a invoice or DM or CM */
2771: jai_constants.ar_invoice_type_cm ,
2772: jai_constants.ar_doc_type_dm
2773: );
2774:
2775: -- Added by Jia Li for inclusive taxes on 2008-01-18
2776: ----------------------------------------------------------------

Line 2834: AND jrttv.regime_code = jai_constants.tcs_regime

2830: AND acra.cash_receipt_id = jcra.cash_receipt_id
2831: AND jcra.cash_receipt_id = jdt.source_doc_id
2832: AND jdt.tax_type = jrttv.tax_type
2833: AND acra.cash_receipt_id = cp_cash_receipt_id
2834: AND jrttv.regime_code = jai_constants.tcs_regime
2835: AND jcra.confirm_flag = jai_constants.yes
2836: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
2837: /*
2838: ||Get the applied to document CM details

Line 2835: AND jcra.confirm_flag = jai_constants.yes

2831: AND jcra.cash_receipt_id = jdt.source_doc_id
2832: AND jdt.tax_type = jrttv.tax_type
2833: AND acra.cash_receipt_id = cp_cash_receipt_id
2834: AND jrttv.regime_code = jai_constants.tcs_regime
2835: AND jcra.confirm_flag = jai_constants.yes
2836: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
2837: /*
2838: ||Get the applied to document CM details
2839: */

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

2832: AND jdt.tax_type = jrttv.tax_type
2833: AND acra.cash_receipt_id = cp_cash_receipt_id
2834: AND jrttv.regime_code = jai_constants.tcs_regime
2835: AND jcra.confirm_flag = jai_constants.yes
2836: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
2837: /*
2838: ||Get the applied to document CM details
2839: */
2840: CURSOR cur_get_cm_details (cp_customer_trx_id RA_CUST_TRX_LINE_GL_DIST_ALL.CUSTOMER_TRX_ID%TYPE)

Line 2862: rcta.complete_flag = jai_constants.yes

2858: JAI_AR_TRX_TAX_LINES jrcttl ,
2859: JAI_CMN_TAXES_ALL jtc ,
2860: jai_regime_tax_types_v jrttv
2861: WHERE
2862: rcta.complete_flag = jai_constants.yes
2863: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
2864: AND trx_types.type = jai_constants.ar_invoice_type_cm
2865: AND rcta.customer_trx_id = gl_dist.customer_trx_id
2866: AND gl_dist.account_class = jai_constants.account_class_rec

Line 2864: AND trx_types.type = jai_constants.ar_invoice_type_cm

2860: jai_regime_tax_types_v jrttv
2861: WHERE
2862: rcta.complete_flag = jai_constants.yes
2863: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
2864: AND trx_types.type = jai_constants.ar_invoice_type_cm
2865: AND rcta.customer_trx_id = gl_dist.customer_trx_id
2866: AND gl_dist.account_class = jai_constants.account_class_rec
2867: AND gl_dist.latest_rec_flag = jai_constants.yes
2868: AND rcta.customer_trx_id = jrct.customer_trx_id

Line 2866: AND gl_dist.account_class = jai_constants.account_class_rec

2862: rcta.complete_flag = jai_constants.yes
2863: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
2864: AND trx_types.type = jai_constants.ar_invoice_type_cm
2865: AND rcta.customer_trx_id = gl_dist.customer_trx_id
2866: AND gl_dist.account_class = jai_constants.account_class_rec
2867: AND gl_dist.latest_rec_flag = jai_constants.yes
2868: AND rcta.customer_trx_id = jrct.customer_trx_id
2869: AND jrct.customer_trx_id = jrctl.customer_trx_id
2870: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id

Line 2867: AND gl_dist.latest_rec_flag = jai_constants.yes

2863: AND trx_types.cust_trx_type_id = rcta.cust_trx_type_id
2864: AND trx_types.type = jai_constants.ar_invoice_type_cm
2865: AND rcta.customer_trx_id = gl_dist.customer_trx_id
2866: AND gl_dist.account_class = jai_constants.account_class_rec
2867: AND gl_dist.latest_rec_flag = jai_constants.yes
2868: AND rcta.customer_trx_id = jrct.customer_trx_id
2869: AND jrct.customer_trx_id = jrctl.customer_trx_id
2870: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
2871: AND jrcttl.tax_id = jtc.tax_id

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

2870: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
2871: AND jrcttl.tax_id = jtc.tax_id
2872: AND jtc.tax_type = jrttv.tax_type
2873: AND rcta.customer_trx_id = cp_customer_trx_id
2874: AND jrttv.regime_code = jai_constants.tcs_regime;
2875:
2876: ln_app_fr_doc_amt NUMBER ;
2877: ld_app_fr_doc_date DATE ;
2878: ln_app_fr_doc_id JAI_RGM_REFS_ALL.SOURCE_DOCUMENT_ID%TYPE ;

Line 2938: lv_process_flag := jai_constants.successful ;

2934: ||', amount_applied -> ' ||p_araa.amount_applied ||fnd_global.local_chr(10)
2935: ||', gl_date -> ' ||p_araa.gl_date ||fnd_global.local_chr(10)
2936: ||', org_id -> ' ||p_araa.org_id
2937: );*/
2938: lv_process_flag := jai_constants.successful ;
2939: lv_process_message := null ;
2940: p_process_flag := lv_process_flag ;
2941: p_process_message := lv_process_message ;
2942: ln_app_fr_doc_amt := NULL ;

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

2968: OPEN cur_get_doc_type ( cp_customer_trx_id => p_araa.applied_customer_trx_id ) ;
2969: FETCH cur_get_doc_type INTO ln_app_to_doc_type ;
2970: CLOSE cur_get_doc_type ;
2971:
2972: ln_app_to_doc_table := jai_constants.ar_inv_lines_table ; /* table JAI_AR_TRX_LINES */
2973: ln_app_to_doc_type := rec_cur_get_app_to_det.app_to_doc_type ;
2974: ln_to_organization_id := rec_cur_get_app_to_det.app_to_organization_id ;
2975: ln_to_party_id := rec_cur_get_app_to_det.app_to_customer_id ;
2976: ln_to_party_site_id := rec_cur_get_app_to_det.app_to_customer_site_use_id ;

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

2977:
2978: /*########################################################################################################
2979: || VALIDATE AND GET APPLIED FROM DOCUMENT DETAILS ---- PART -3
2980: ########################################################################################################*/
2981: IF p_document_type = jai_constants.trx_type_rct_app THEN -----------A1
2982: /*
2983: ||Applied from document type is Cash Receipt Application
2984: */
2985: OPEN cur_get_cr_details ( cp_cash_receipt_id => p_araa.cash_receipt_id ) ;

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

2990: ln_app_fr_doc_amt := rec_cur_get_cr_details.app_fr_doc_amt ;
2991: ln_exchange_rate := rec_cur_get_cr_details.exchange_rate ;
2992:
2993: ln_app_fr_doc_id := p_araa.cash_receipt_id ;
2994: ln_app_fr_doc_type := jai_constants.ar_cash_tax_confirmed ; /* Receipt confirmation */
2995: ln_app_fr_doc_table := jai_constants.jai_cash_rcpts ; /* table JAI_AR_CASH_RECEIPTS_ALL */
2996:
2997: ln_fr_organization_id := rec_cur_get_cr_details.app_fr_organization_id ;
2998: ln_fr_party_id := rec_cur_get_cr_details.pay_from_customer ;

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

2991: ln_exchange_rate := rec_cur_get_cr_details.exchange_rate ;
2992:
2993: ln_app_fr_doc_id := p_araa.cash_receipt_id ;
2994: ln_app_fr_doc_type := jai_constants.ar_cash_tax_confirmed ; /* Receipt confirmation */
2995: ln_app_fr_doc_table := jai_constants.jai_cash_rcpts ; /* table JAI_AR_CASH_RECEIPTS_ALL */
2996:
2997: ln_fr_organization_id := rec_cur_get_cr_details.app_fr_organization_id ;
2998: ln_fr_party_id := rec_cur_get_cr_details.pay_from_customer ;
2999: ln_fr_party_site_id := rec_cur_get_cr_details.customer_site_use_id ;

Line 3001: ELSIF p_document_type = jai_constants.trx_type_cm_app THEN

2997: ln_fr_organization_id := rec_cur_get_cr_details.app_fr_organization_id ;
2998: ln_fr_party_id := rec_cur_get_cr_details.pay_from_customer ;
2999: ln_fr_party_site_id := rec_cur_get_cr_details.customer_site_use_id ;
3000:
3001: ELSIF p_document_type = jai_constants.trx_type_cm_app THEN
3002:
3003: OPEN cur_get_cm_details ( cp_customer_trx_id => p_araa.customer_trx_id ) ;
3004: FETCH cur_get_cm_details INTO rec_cur_get_cm_details ;
3005: CLOSE cur_get_cm_details ;

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

3014: 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
3015: ln_exchange_rate := rec_cur_get_cm_details.exchange_rate ;
3016:
3017: ln_app_fr_doc_id := p_araa.customer_trx_id ;
3018: ln_app_fr_doc_type := jai_constants.ar_invoice_type_cm ; /* 'CM' */
3019: ln_app_fr_doc_table := jai_constants.ar_inv_lines_table ; /* table JAI_AR_CASH_RECEIPTS_ALL */
3020:
3021: ln_fr_organization_id := rec_cur_get_cm_details.app_to_organization_id ;
3022: ln_fr_party_id := rec_cur_get_cm_details.app_to_customer_id ;

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

3015: ln_exchange_rate := rec_cur_get_cm_details.exchange_rate ;
3016:
3017: ln_app_fr_doc_id := p_araa.customer_trx_id ;
3018: ln_app_fr_doc_type := jai_constants.ar_invoice_type_cm ; /* 'CM' */
3019: ln_app_fr_doc_table := jai_constants.ar_inv_lines_table ; /* table JAI_AR_CASH_RECEIPTS_ALL */
3020:
3021: ln_fr_organization_id := rec_cur_get_cm_details.app_to_organization_id ;
3022: ln_fr_party_id := rec_cur_get_cm_details.app_to_customer_id ;
3023: ln_fr_party_site_id := rec_cur_get_cm_details.app_to_customer_site_use_id ;

Line 3184: p_table_name => jai_constants.ar_receipt_app ,

3180: p_document_id => p_araa.receivable_application_id ,
3181: p_document_type => p_document_type ,
3182: p_document_line_id => p_araa.receivable_application_id ,
3183: p_document_date => ld_source_document_date ,
3184: p_table_name => jai_constants.ar_receipt_app ,
3185: p_line_amount => ln_app_amount ,
3186: p_document_amount => ln_app_amount ,
3187: p_org_id => p_araa.org_id ,
3188: p_organization_id => ln_organization_id ,

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

3198: /*commented by csahoo for bug# 6401388
3199: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3200: pv_log_msg => ' Returned from call to insert_repository_references, lv_process_flag -> '||lv_process_flag
3201: );*/
3202: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3203: lv_process_flag = jai_constants.unexpected_error OR
3204: lv_process_flag = jai_constants.not_applicable
3205: THEN
3206: /*

Line 3203: lv_process_flag = jai_constants.unexpected_error OR

3199: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3200: pv_log_msg => ' Returned from call to insert_repository_references, lv_process_flag -> '||lv_process_flag
3201: );*/
3202: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3203: lv_process_flag = jai_constants.unexpected_error OR
3204: lv_process_flag = jai_constants.not_applicable
3205: THEN
3206: /*
3207: || As Returned status is an error/not applicable hence:-

Line 3204: lv_process_flag = jai_constants.not_applicable

3200: pv_log_msg => ' Returned from call to insert_repository_references, lv_process_flag -> '||lv_process_flag
3201: );*/
3202: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3203: lv_process_flag = jai_constants.unexpected_error OR
3204: lv_process_flag = jai_constants.not_applicable
3205: THEN
3206: /*
3207: || As Returned status is an error/not applicable hence:-
3208: || Set out variables p_process_flag and p_process_message accordingly

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

3237: /*commented by csahoo for bug# 6401388
3238: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3239: pv_log_msg => ' Returned from call to copy_taxes_from_source, lv_process_flag -> '||lv_process_flag
3240: );*/
3241: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3242: lv_process_flag = jai_constants.unexpected_error OR
3243: lv_process_flag = jai_constants.not_applicable
3244: THEN
3245: /*

Line 3242: lv_process_flag = jai_constants.unexpected_error OR

3238: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3239: pv_log_msg => ' Returned from call to copy_taxes_from_source, lv_process_flag -> '||lv_process_flag
3240: );*/
3241: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3242: lv_process_flag = jai_constants.unexpected_error OR
3243: lv_process_flag = jai_constants.not_applicable
3244: THEN
3245: /*
3246: || As Returned status is an error/not applicable hence:-

Line 3243: lv_process_flag = jai_constants.not_applicable

3239: pv_log_msg => ' Returned from call to copy_taxes_from_source, lv_process_flag -> '||lv_process_flag
3240: );*/
3241: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3242: lv_process_flag = jai_constants.unexpected_error OR
3243: lv_process_flag = jai_constants.not_applicable
3244: THEN
3245: /*
3246: || As Returned status is an error/not applicable hence:-
3247: || Set out variables p_process_flag and p_process_message accordingly

Line 3318: lv_process_flag := jai_constants.successful ;

3314: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context
3315: , pn_reg_id => ln_reg_id
3316: );*/
3317:
3318: lv_process_flag := jai_constants.successful ;
3319: lv_process_message := null ;
3320:
3321: p_process_flag := lv_process_flag ;
3322: p_process_message := lv_process_message ;

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

3320:
3321: p_process_flag := lv_process_flag ;
3322: p_process_message := lv_process_message ;
3323:
3324: /* IF p_document_type In ( jai_constants.trx_type_rct_unapp ,
3325: jai_constants.trx_type_cm_unapp
3326: )
3327: THEN
3328: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 3325: jai_constants.trx_type_cm_unapp

3321: p_process_flag := lv_process_flag ;
3322: p_process_message := lv_process_message ;
3323:
3324: /* IF p_document_type In ( jai_constants.trx_type_rct_unapp ,
3325: jai_constants.trx_type_cm_unapp
3326: )
3327: THEN
3328: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3329: pv_log_msg => ' Processing the UN APPLICATION record ' ||fnd_global.local_chr(10)

Line 3342: ELSIF p_document_type = jai_constants.trx_type_rct_rvs THEN

3338: ||', amount_applied -> ' ||p_araa.amount_applied ||fnd_global.local_chr(10)
3339: ||', gl_date -> ' ||p_araa.gl_date ||fnd_global.local_chr(10)
3340: ||', org_id -> ' ||p_araa.org_id
3341: );
3342: ELSIF p_document_type = jai_constants.trx_type_rct_rvs THEN
3343: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3344: pv_log_msg => ' Processing the Receipt reversal record ' ||fnd_global.local_chr(10)
3345: ||', p_document_type -> ' ||p_document_type ||fnd_global.local_chr(10)
3346: ||', cash_receipt_id -> ' ||p_acra.cash_receipt_id||fnd_global.local_chr(10)

Line 3358: IF p_document_type = jai_constants.trx_type_rct_rvs THEN

3354: /*########################################################################################################
3355: || DERIVE VALUES BASED ON APPLICATION TYPE
3356: ########################################################################################################*/
3357:
3358: IF p_document_type = jai_constants.trx_type_rct_rvs THEN
3359: ln_new_document_id := p_acra.cash_receipt_id ; /* New document id to be created */
3360: ld_new_document_date := p_acra.reversal_date ;
3361:
3362: ln_source_document_id := p_acra.cash_receipt_id ;

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

3359: ln_new_document_id := p_acra.cash_receipt_id ; /* New document id to be created */
3360: ld_new_document_date := p_acra.reversal_date ;
3361:
3362: ln_source_document_id := p_acra.cash_receipt_id ;
3363: lv_source_document_type := jai_constants.ar_cash_tax_confirmed ; /* Parent Document type */
3364:
3365:
3366: ELSIF p_document_type = jai_constants.trx_type_rct_unapp THEN
3367: ln_new_document_id := p_araa.receivable_application_id ; /* New document id to be created */

Line 3366: ELSIF p_document_type = jai_constants.trx_type_rct_unapp THEN

3362: ln_source_document_id := p_acra.cash_receipt_id ;
3363: lv_source_document_type := jai_constants.ar_cash_tax_confirmed ; /* Parent Document type */
3364:
3365:
3366: ELSIF p_document_type = jai_constants.trx_type_rct_unapp THEN
3367: ln_new_document_id := p_araa.receivable_application_id ; /* New document id to be created */
3368: ld_new_document_date := p_araa.apply_date ;
3369:
3370: lv_source_document_type := jai_constants.trx_type_rct_app ; /* Parent Document type */

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

3366: ELSIF p_document_type = jai_constants.trx_type_rct_unapp THEN
3367: ln_new_document_id := p_araa.receivable_application_id ; /* New document id to be created */
3368: ld_new_document_date := p_araa.apply_date ;
3369:
3370: lv_source_document_type := jai_constants.trx_type_rct_app ; /* Parent Document type */
3371: ln_app_from_document_id := p_araa.cash_receipt_id ;
3372: ln_app_to_document_id := p_araa.applied_customer_trx_id ;
3373:
3374:

Line 3375: ELSIF p_document_type = jai_constants.trx_type_cm_unapp THEN

3371: ln_app_from_document_id := p_araa.cash_receipt_id ;
3372: ln_app_to_document_id := p_araa.applied_customer_trx_id ;
3373:
3374:
3375: ELSIF p_document_type = jai_constants.trx_type_cm_unapp THEN
3376: ln_new_document_id := p_araa.receivable_application_id ; /* New document id to be created */
3377: ld_new_document_date := p_araa.apply_date ;
3378:
3379: lv_source_document_type := jai_constants.trx_type_cm_app ; /* Parent Document type */

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

3375: ELSIF p_document_type = jai_constants.trx_type_cm_unapp THEN
3376: ln_new_document_id := p_araa.receivable_application_id ; /* New document id to be created */
3377: ld_new_document_date := p_araa.apply_date ;
3378:
3379: lv_source_document_type := jai_constants.trx_type_cm_app ; /* Parent Document type */
3380: ln_app_from_document_id := p_araa.customer_trx_id ;
3381: ln_app_to_document_id := p_araa.applied_customer_trx_id ;
3382:
3383: END IF;

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

3432: /*commented by csahoo for bug# 6401388
3433: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3434: pv_log_msg => ' returned from call to copy_references lv_process_flag -> '||lv_process_flag
3435: );*/
3436: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3437: lv_process_flag = jai_constants.unexpected_error OR
3438: lv_process_flag = jai_constants.not_applicable
3439: THEN
3440: /*

Line 3437: lv_process_flag = jai_constants.unexpected_error OR

3433: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3434: pv_log_msg => ' returned from call to copy_references lv_process_flag -> '||lv_process_flag
3435: );*/
3436: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3437: lv_process_flag = jai_constants.unexpected_error OR
3438: lv_process_flag = jai_constants.not_applicable
3439: THEN
3440: /*
3441: || As Returned status is an error/not applicable hence:-

Line 3438: lv_process_flag = jai_constants.not_applicable

3434: pv_log_msg => ' returned from call to copy_references lv_process_flag -> '||lv_process_flag
3435: );*/
3436: IF lv_process_flag = jai_constants.expected_error OR ---------A2
3437: lv_process_flag = jai_constants.unexpected_error OR
3438: lv_process_flag = jai_constants.not_applicable
3439: THEN
3440: /*
3441: || As Returned status is an error/not applicable hence:-
3442: || Set out variables p_process_flag and p_process_message accordingly

Line 3459: p_process_flag := jai_constants.not_applicable;

3455: ELSE
3456: /*
3457: ||Base document not found hence skip the document
3458: */
3459: p_process_flag := jai_constants.not_applicable;
3460: END IF; /* Parent transaction found*/
3461: /*commented by csahoo for bug# 6401388
3462: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3463: pv_log_msg => '**************** PROCEDURE PROCESS_UNAPP_RCPT_REV SUCCESSFULLY COMPLETED ****************'

Line 3555: lv_process_flag := jai_constants.successful ;

3551: ||', p_trx_ref_id -> '||p_trx_ref_id ||fnd_global.local_chr(10)
3552: );*/
3553:
3554:
3555: lv_process_flag := jai_constants.successful ;
3556: lv_process_message := null ;
3557:
3558: p_process_flag := lv_process_flag ;
3559: p_process_message := lv_process_message ;

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

3591: /*commented by csahoo for bug# 6401388
3592: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3593: pv_log_msg => ' Derive regime values as they are null '
3594: );*/
3595: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
3596: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
3597: cp_organization_id => p_organization_id
3598: ) ;
3599: FETCH c_get_rgm_attribute INTO ln_regime_id, lv_org_tan_no ;

Line 3596: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,

3592: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3593: pv_log_msg => ' Derive regime values as they are null '
3594: );*/
3595: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
3596: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
3597: cp_organization_id => p_organization_id
3598: ) ;
3599: FETCH c_get_rgm_attribute INTO ln_regime_id, lv_org_tan_no ;
3600: IF C_GET_RGM_ATTRIBUTE%NOTFOUND THEN

Line 3602: p_process_flag := jai_constants.expected_error;

3598: ) ;
3599: FETCH c_get_rgm_attribute INTO ln_regime_id, lv_org_tan_no ;
3600: IF C_GET_RGM_ATTRIBUTE%NOTFOUND THEN
3601: CLOSE c_get_rgm_attribute;
3602: p_process_flag := jai_constants.expected_error;
3603: p_process_message := 'Org Tan Number needs to be defined for the TCS regime ';
3604: return;
3605: END IF;
3606: CLOSE c_get_rgm_attribute;

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

3651: ||', line_amt -> '||p_line_amount ||fnd_global.local_chr(10)
3652: ||', source_document_amt -> '||p_document_amount ||fnd_global.local_chr(10)
3653: ||', total_tax_amt -> '||NULL ||fnd_global.local_chr(10)
3654: ||', party_id -> '||p_party_id ||fnd_global.local_chr(10)
3655: ||', party_type -> '||jai_constants.party_type_customer ||fnd_global.local_chr(10)
3656: ||', party_site_id -> '||p_party_site_id ||fnd_global.local_chr(10)
3657: ||', item_classification -> '||p_item_classification ||fnd_global.local_chr(10)
3658: ||', org_id -> '||p_org_id ||fnd_global.local_chr(10)
3659: ||', organization_id -> '||p_organization_id ||fnd_global.local_chr(10)

Line 3728: jai_constants.party_type_customer ,

3724: p_line_amount ,
3725: p_document_amount ,
3726: NULL ,
3727: p_party_id ,
3728: jai_constants.party_type_customer ,
3729: p_party_site_id ,
3730: p_item_classification ,
3731: p_org_id ,
3732: p_organization_id ,

Line 3840: lv_process_flag := jai_constants.successful ;

3836: ||', p_process_message -> '||p_process_message ||fnd_global.local_chr(10)
3837: );*/
3838:
3839:
3840: lv_process_flag := jai_constants.successful ;
3841: lv_process_message := null ;
3842:
3843: p_process_flag := lv_process_flag ;
3844: p_process_message := lv_process_message ;

Line 3885: ln_exempted_flag := jai_constants.tax_exmpt_flag_std_rate ;

3881: IF ln_orig_tax_rate IS NULL OR
3882: ln_orig_tax_rate = p_tax_rate
3883: THEN
3884:
3885: ln_exempted_flag := jai_constants.tax_exmpt_flag_std_rate ;
3886:
3887: ELSIF ln_orig_tax_rate > p_tax_rate THEN /*rchandan for bug#4742259*/
3888:
3889: ln_exempted_flag := jai_constants.tax_exmpt_flag_lower_rate ;

Line 3889: ln_exempted_flag := jai_constants.tax_exmpt_flag_lower_rate ;

3885: ln_exempted_flag := jai_constants.tax_exmpt_flag_std_rate ;
3886:
3887: ELSIF ln_orig_tax_rate > p_tax_rate THEN /*rchandan for bug#4742259*/
3888:
3889: ln_exempted_flag := jai_constants.tax_exmpt_flag_lower_rate ;
3890:
3891: ELSIF p_tax_rate = 0 THEN
3892: ln_exempted_flag := jai_constants.tax_exmpt_flag_zero_rate ;
3893: END IF;

Line 3892: ln_exempted_flag := jai_constants.tax_exmpt_flag_zero_rate ;

3888:
3889: ln_exempted_flag := jai_constants.tax_exmpt_flag_lower_rate ;
3890:
3891: ELSIF p_tax_rate = 0 THEN
3892: ln_exempted_flag := jai_constants.tax_exmpt_flag_zero_rate ;
3893: END IF;
3894:
3895:
3896:

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

3896:
3897: /*
3898: || Determine the Tax modified by flag flag in case it is null
3899: */
3900: ln_tax_modified_by := nvl(p_tax_modified_by ,jai_constants.tax_modified_by_system );
3901:
3902: /*commented by csahoo for bug# 6401388
3903: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
3904: pv_log_msg => ' VALUES insert into JAI_RGM_TAXES are : - ' ||fnd_global.local_chr(10)

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

4015: AND jrctl.customer_trx_line_id = jrcttl.link_to_cust_trx_line_id
4016: AND jrctl.customer_trx_line_id = nvl( cp_customer_trx_line_id , jrctl.customer_trx_line_id )
4017: AND jrcttl.tax_id = jtc.tax_id
4018: AND jrttv.tax_type = jtc.tax_type
4019: AND jrttv.regime_code = jai_constants.tcs_regime;
4020:
4021:
4022: /*****
4023: ||Get the receipt tax details

Line 4040: AND jrttv.regime_code = jai_constants.tcs_regime

4036: jai_regime_tax_types_v jrttv
4037: WHERE
4038: jdt.tax_type = jrttv.tax_type
4039: AND jdt.source_doc_id = cp_source_doc_id
4040: AND jrttv.regime_code = jai_constants.tcs_regime
4041: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
4042:
4043: lv_process_flag VARCHAR2(2) ;
4044: lv_process_message VARCHAR2(2000) ;

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

4037: WHERE
4038: jdt.tax_type = jrttv.tax_type
4039: AND jdt.source_doc_id = cp_source_doc_id
4040: AND jrttv.regime_code = jai_constants.tcs_regime
4041: AND jdt.source_doc_type = JAI_CONSTANTS.ar_cash; --added by eric for a bug
4042:
4043: lv_process_flag VARCHAR2(2) ;
4044: lv_process_message VARCHAR2(2000) ;
4045: ln_apportion_factor NUMBER ;

Line 4067: lv_process_flag := jai_constants.successful ;

4063: ||', p_apportion_factor -> '||p_apportion_factor ||fnd_global.local_chr(10)
4064: ||', p_trx_ref_id -> '||p_trx_ref_id ||fnd_global.local_chr(10)
4065: );*/
4066:
4067: lv_process_flag := jai_constants.successful ;
4068: lv_process_message := null ;
4069:
4070: p_process_flag := lv_process_flag ;
4071: p_process_message := lv_process_message ;

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

4078: ########################################################################################################*/
4079:
4080:
4081: IF p_source_document_type IN ( --------------------------A1
4082: jai_constants.trx_type_inv_comp , /* From Invoice completion */
4083: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */
4084: jai_constants.ar_invoice_type_inv , /* From Application */
4085: jai_constants.ar_doc_type_dm , /* From Application */
4086: jai_constants.ar_invoice_type_cm /* From Application */

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

4079:
4080:
4081: IF p_source_document_type IN ( --------------------------A1
4082: jai_constants.trx_type_inv_comp , /* From Invoice completion */
4083: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */
4084: jai_constants.ar_invoice_type_inv , /* From Application */
4085: jai_constants.ar_doc_type_dm , /* From Application */
4086: jai_constants.ar_invoice_type_cm /* From Application */
4087: )

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

4080:
4081: IF p_source_document_type IN ( --------------------------A1
4082: jai_constants.trx_type_inv_comp , /* From Invoice completion */
4083: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */
4084: jai_constants.ar_invoice_type_inv , /* From Application */
4085: jai_constants.ar_doc_type_dm , /* From Application */
4086: jai_constants.ar_invoice_type_cm /* From Application */
4087: )
4088: THEN

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

4081: IF p_source_document_type IN ( --------------------------A1
4082: jai_constants.trx_type_inv_comp , /* From Invoice completion */
4083: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */
4084: jai_constants.ar_invoice_type_inv , /* From Application */
4085: jai_constants.ar_doc_type_dm , /* From Application */
4086: jai_constants.ar_invoice_type_cm /* From Application */
4087: )
4088: THEN
4089: /***

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

4082: jai_constants.trx_type_inv_comp , /* From Invoice completion */
4083: jai_constants.trx_type_inv_incomp , /* From Invoice Incompletion */
4084: jai_constants.ar_invoice_type_inv , /* From Application */
4085: jai_constants.ar_doc_type_dm , /* From Application */
4086: jai_constants.ar_invoice_type_cm /* From Application */
4087: )
4088: THEN
4089: /***
4090: || Source is INVOICE/DM/CM

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

4112: p_process_flag => lv_process_flag ,
4113: p_process_message => lv_process_message
4114: );
4115:
4116: IF lv_process_flag = jai_constants.expected_error OR ---------A2
4117: lv_process_flag = jai_constants.unexpected_error OR
4118: lv_process_flag = jai_constants.not_applicable
4119: THEN
4120: /*

Line 4117: lv_process_flag = jai_constants.unexpected_error OR

4113: p_process_message => lv_process_message
4114: );
4115:
4116: IF lv_process_flag = jai_constants.expected_error OR ---------A2
4117: lv_process_flag = jai_constants.unexpected_error OR
4118: lv_process_flag = jai_constants.not_applicable
4119: THEN
4120: /*
4121: || As Returned status is an error/not applicable hence:-

Line 4118: lv_process_flag = jai_constants.not_applicable

4114: );
4115:
4116: IF lv_process_flag = jai_constants.expected_error OR ---------A2
4117: lv_process_flag = jai_constants.unexpected_error OR
4118: lv_process_flag = jai_constants.not_applicable
4119: THEN
4120: /*
4121: || As Returned status is an error/not applicable hence:-
4122: || Set out variables p_process_flag and p_process_message accordingly

Line 4136: ELSIF p_source_document_type = jai_constants.ar_cash_tax_confirmed THEN

4132: return;
4133: END IF; ---------A2
4134: END LOOP;
4135:
4136: ELSIF p_source_document_type = jai_constants.ar_cash_tax_confirmed THEN
4137: /*
4138: ||Source is receipt
4139: */
4140: /*commented by csahoo for bug# 6401388

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

4156: p_process_flag => lv_process_flag ,
4157: p_process_message => lv_process_message
4158: );
4159:
4160: IF lv_process_flag = jai_constants.expected_error OR ---------A3
4161: lv_process_flag = jai_constants.unexpected_error OR
4162: lv_process_flag = jai_constants.not_applicable
4163: THEN
4164: /*

Line 4161: lv_process_flag = jai_constants.unexpected_error OR

4157: p_process_message => lv_process_message
4158: );
4159:
4160: IF lv_process_flag = jai_constants.expected_error OR ---------A3
4161: lv_process_flag = jai_constants.unexpected_error OR
4162: lv_process_flag = jai_constants.not_applicable
4163: THEN
4164: /*
4165: || As Returned status is an error/not applicable hence:-

Line 4162: lv_process_flag = jai_constants.not_applicable

4158: );
4159:
4160: IF lv_process_flag = jai_constants.expected_error OR ---------A3
4161: lv_process_flag = jai_constants.unexpected_error OR
4162: lv_process_flag = jai_constants.not_applicable
4163: THEN
4164: /*
4165: || As Returned status is an error/not applicable hence:-
4166: || Set out variables p_process_flag and p_process_message accordingly

Line 4252: lv_process_flag := jai_constants.successful ;

4248: ||', p_new_document_date -> '||p_new_document_date ||fnd_global.local_chr(10)
4249: ||', p_apportion_factor -> '||p_apportion_factor ||fnd_global.local_chr(10)
4250: );*/
4251:
4252: lv_process_flag := jai_constants.successful ;
4253: lv_process_message := null ;
4254:
4255: p_process_flag := lv_process_flag ;
4256: p_process_message := lv_process_message ;

Line 4535: p_process_flag := jai_constants.successful ;

4531: ||', p_complete_flag -> '||p_complete_flag ||fnd_global.local_chr(10)
4532: ||', p_org_id -> '||p_org_id
4533: );*/
4534:
4535: p_process_flag := jai_constants.successful ;
4536: p_process_message := null ;
4537:
4538: ln_user_id := fnd_global.user_id ;
4539: ln_login_id := fnd_global.login_id ;

Line 4550: IF p_complete_flag = jai_constants.yes THEN

4546: FETCH cur_upd_gen_docs INTO lv_rowid, ln_generated_doc_id;
4547:
4548:
4549: IF cur_upd_gen_docs%FOUND THEN
4550: IF p_complete_flag = jai_constants.yes THEN
4551: /*
4552: || Complete flag is 'Y', Invoice is getting COMPLETED
4553: || Set the generated_doc_id to null in case it is not null
4554: */

Line 4576: p_process_flag := jai_constants.not_applicable;

4572: pv_log_msg => 'Skip the TCS ITEM GENDOCS update as :- ' ||fnd_global.local_chr(10)
4573: ||', p_complete_flag -> '||p_complete_flag ||fnd_global.local_chr(10)
4574: ||', ln_generated_doc_id -> '||ln_generated_doc_id
4575: );*/
4576: p_process_flag := jai_constants.not_applicable;
4577: return;
4578: END IF;
4579: END IF;
4580:

Line 4657: AND hzcsu.site_use_code = jai_constants.site_use_bill_to

4653: hz_cust_site_uses_all hzcsu
4654: WHERE
4655: hca.cust_account_id = hzcas.cust_account_id
4656: AND hzcas.cust_acct_site_id = hzcsu.cust_acct_site_id
4657: AND hzcsu.site_use_code = jai_constants.site_use_bill_to
4658: AND hca.cust_account_id = cp_party_id
4659: AND hzcsu.site_use_id = cp_party_site_id ;-- site_use_id is the party_site_id ;
4660:
4661: CURSOR cur_get_sob ( cp_org_id jai_rgm_refs_all.org_id%TYPE )

Line 4706: p_process_flag := jai_constants.successful ;

4702: ||', source_document_type is -> '||p_rgm_ref.source_document_type ||fnd_global.local_chr(10)
4703: ||', org_id -> '||p_rgm_ref.org_id
4704: );*/
4705: lv_process_message:= null ;
4706: p_process_flag := jai_constants.successful ;
4707: p_process_message := lv_process_message ;
4708:
4709: ln_user_id := fnd_global.user_id ;
4710: ln_login_id := fnd_global.login_id ;

Line 4720: p_process_flag := jai_constants.not_applicable ;

4716: /*commented by csahoo for bug# 6401388
4717: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
4718: pv_log_msg => 'As transaction total_tax_amt is -> '||p_total_tax_amt||' hence skipping the transaction.'
4719: );*/
4720: p_process_flag := jai_constants.not_applicable ;
4721: return;
4722: END IF;
4723:
4724: /*################################################################################################################

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

4732:
4733: /*
4734: ||Get the value for the Batch Source Debit Memo
4735: */
4736: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
4737: cp_attribute_code => jai_constants.batch_src_dm ,
4738: cp_organization_id => p_rgm_ref.organization_id
4739: );
4740: FETCH c_get_rgm_attribute INTO ln_regime_id ,lv_batch_src_dm;

Line 4737: cp_attribute_code => jai_constants.batch_src_dm ,

4733: /*
4734: ||Get the value for the Batch Source Debit Memo
4735: */
4736: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
4737: cp_attribute_code => jai_constants.batch_src_dm ,
4738: cp_organization_id => p_rgm_ref.organization_id
4739: );
4740: FETCH c_get_rgm_attribute INTO ln_regime_id ,lv_batch_src_dm;
4741: CLOSE c_get_rgm_attribute ;

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

4743:
4744: /*
4745: ||Get the value for the Batch Source Credit Memo
4746: */
4747: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
4748: cp_attribute_code => jai_constants.batch_src_cm ,
4749: cp_organization_id => p_rgm_ref.organization_id
4750: );
4751: FETCH c_get_rgm_attribute INTO ln_regime_id ,lv_batch_src_cm;

Line 4748: cp_attribute_code => jai_constants.batch_src_cm ,

4744: /*
4745: ||Get the value for the Batch Source Credit Memo
4746: */
4747: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
4748: cp_attribute_code => jai_constants.batch_src_cm ,
4749: cp_organization_id => p_rgm_ref.organization_id
4750: );
4751: FETCH c_get_rgm_attribute INTO ln_regime_id ,lv_batch_src_cm;
4752: CLOSE c_get_rgm_attribute ;

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

4760: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
4761: pv_log_msg => ' Deriving the batch source name based on the document type'
4762: );*/
4763:
4764: IF p_rgm_ref.source_document_type in ( jai_constants.ar_cash_tax_confirmed , /* Receipt confirmation */
4765: jai_constants.trx_type_rct_unapp , /* Receipt unapplication*/
4766: jai_constants.trx_type_cm_app /* CM application*/
4767: )
4768: THEN

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

4761: pv_log_msg => ' Deriving the batch source name based on the document type'
4762: );*/
4763:
4764: IF p_rgm_ref.source_document_type in ( jai_constants.ar_cash_tax_confirmed , /* Receipt confirmation */
4765: jai_constants.trx_type_rct_unapp , /* Receipt unapplication*/
4766: jai_constants.trx_type_cm_app /* CM application*/
4767: )
4768: THEN
4769: lv_batch_src_name := lv_batch_src_dm; /* TCS Debit Memo */

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

4762: );*/
4763:
4764: IF p_rgm_ref.source_document_type in ( jai_constants.ar_cash_tax_confirmed , /* Receipt confirmation */
4765: jai_constants.trx_type_rct_unapp , /* Receipt unapplication*/
4766: jai_constants.trx_type_cm_app /* CM application*/
4767: )
4768: THEN
4769: lv_batch_src_name := lv_batch_src_dm; /* TCS Debit Memo */
4770: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;

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

4766: jai_constants.trx_type_cm_app /* CM application*/
4767: )
4768: THEN
4769: lv_batch_src_name := lv_batch_src_dm; /* TCS Debit Memo */
4770: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;
4771:
4772: ELSIF p_rgm_ref.source_document_type in ( jai_constants.trx_type_rct_app ,
4773: jai_constants.trx_type_rct_rvs ,
4774: jai_constants.trx_type_cm_unapp

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

4768: THEN
4769: lv_batch_src_name := lv_batch_src_dm; /* TCS Debit Memo */
4770: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;
4771:
4772: ELSIF p_rgm_ref.source_document_type in ( jai_constants.trx_type_rct_app ,
4773: jai_constants.trx_type_rct_rvs ,
4774: jai_constants.trx_type_cm_unapp
4775: )
4776:

Line 4773: jai_constants.trx_type_rct_rvs ,

4769: lv_batch_src_name := lv_batch_src_dm; /* TCS Debit Memo */
4770: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;
4771:
4772: ELSIF p_rgm_ref.source_document_type in ( jai_constants.trx_type_rct_app ,
4773: jai_constants.trx_type_rct_rvs ,
4774: jai_constants.trx_type_cm_unapp
4775: )
4776:
4777: THEN

Line 4774: jai_constants.trx_type_cm_unapp

4770: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM' ;
4771:
4772: ELSIF p_rgm_ref.source_document_type in ( jai_constants.trx_type_rct_app ,
4773: jai_constants.trx_type_rct_rvs ,
4774: jai_constants.trx_type_cm_unapp
4775: )
4776:
4777: THEN
4778: lv_batch_src_name := lv_batch_src_cm; /* TCS Credit Memo */

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

4775: )
4776:
4777: THEN
4778: lv_batch_src_name := lv_batch_src_cm; /* TCS Credit Memo */
4779: lv_trx_number := jai_constants.tcs_cm_prefix; --'TCS-CM';
4780:
4781: ELSIF p_rgm_ref.source_document_type = jai_constants.tcs_event_surcharge THEN
4782: /*
4783: ||Document generation is invoked by surcharge. Document type will be derrived from the sign of the document amount.

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

4777: THEN
4778: lv_batch_src_name := lv_batch_src_cm; /* TCS Credit Memo */
4779: lv_trx_number := jai_constants.tcs_cm_prefix; --'TCS-CM';
4780:
4781: ELSIF p_rgm_ref.source_document_type = jai_constants.tcs_event_surcharge THEN
4782: /*
4783: ||Document generation is invoked by surcharge. Document type will be derrived from the sign of the document amount.
4784: ||If sign is +VE then it should be a Debit Memo, otherwise it should be a Credit Memo
4785: */

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

4787: IF sign (p_total_tax_amt) = -1 THEN
4788:
4789: /* Credit Memo */
4790: lv_batch_src_name := lv_batch_src_cm;
4791: lv_trx_number := jai_constants.tcs_cm_prefix; --'TCS-CM';
4792: ELSIF sign (p_total_tax_amt) = 1 THEN
4793:
4794: /* Debit Memo */
4795: lv_batch_src_name := lv_batch_src_dm;

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

4792: ELSIF sign (p_total_tax_amt) = 1 THEN
4793:
4794: /* Debit Memo */
4795: lv_batch_src_name := lv_batch_src_dm;
4796: lv_trx_number := jai_constants.tcs_dm_prefix; --'TCS-DM'
4797: END IF;
4798: ELSE
4799: /*
4800: ||Skip the transaction

Line 4806: p_process_flag := jai_constants.not_applicable;

4802: /*commented by csahoo for bug# 6401388
4803: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
4804: pv_log_msg => 'Skip the transaction '
4805: );*/
4806: p_process_flag := jai_constants.not_applicable;
4807: p_process_message := null;
4808: return ;
4809: END IF;
4810:

Line 4824: p_process_flag := jai_constants.expected_error;

4820: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
4821: pv_log_msg => 'Batch source definition has not be defined for the inventory organization '||p_rgm_ref.organization_id
4822: );*/
4823:
4824: p_process_flag := jai_constants.expected_error;
4825: lv_process_message := 'Batch source definition has not be defined for the inventory organization '||p_rgm_ref.organization_id;
4826: p_process_message := lv_process_message ;
4827: return;
4828: END IF;

Line 4847: p_process_flag := jai_constants.expected_error;

4843: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
4844: pv_log_msg => 'TCS batch source has not been defined '
4845: );*/
4846: CLOSE cur_get_batch_source ;
4847: p_process_flag := jai_constants.expected_error;
4848: lv_process_message := 'TCS batch source has not been defined for '||lv_batch_src_name ||'. Cannot process transaction ';
4849: p_process_message := lv_process_message ;
4850: return;
4851: END IF;

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

4864: /*################################################################################################################
4865: || DERIVE THE TERM FOR DM'S ONLY
4866: ################################################################################################################*/
4867:
4868: IF rec_cur_get_batch_source.type = jai_constants.ar_doc_type_dm THEN
4869: ln_term_id := rec_cur_get_batch_source.default_term;
4870: /*
4871: || Throw an error if the term has not been defined for the debit memo Transaction type .
4872: || This check is not required in case of credit memo

Line 4879: p_process_flag := jai_constants.expected_error;

4875: /*commented by csahoo for bug# 6401388
4876: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
4877: pv_log_msg => 'Error:- Default term is not defined in the transction type -> '||rec_cur_get_batch_source.name
4878: );*/
4879: p_process_flag := jai_constants.expected_error;
4880: lv_process_message := 'Cannot process transaction. A default term needs to be defined FOR the Transaction TYPE '||rec_cur_get_batch_source.name ;
4881: p_process_message := lv_process_message ;
4882: return;
4883: END IF;

Line 4902: p_process_flag := jai_constants.expected_error;

4898: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
4899: pv_log_msg => 'Error:- Set of books not defined for org_id -> '||p_rgm_ref.org_id
4900: );*/
4901:
4902: p_process_flag := jai_constants.expected_error;
4903: lv_process_message := 'Set of books not defined for the org id.';
4904: p_process_message := lv_process_message ;
4905: return;
4906: END IF;

Line 4930: p_process_flag := jai_constants.expected_error;

4926: pv_log_msg => 'Error:- Bill to address not defined for the customer id -> '||p_rgm_ref.party_id
4927: ||' customer site -> '||p_rgm_ref.party_site_id
4928: );*/
4929:
4930: p_process_flag := jai_constants.expected_error;
4931: 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;
4932: p_process_message := lv_process_message ;
4933: return;
4934: END IF;

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

4944: || 1.+ve if the creation sign of the document is positive
4945: || 1.-ve if the creation sign of the document is -ve
4946: || If the sign is any sign then for a DM create a +ve amount and CM would ve created with a -ve amount
4947: */
4948: IF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_positive THEN
4949: ln_amount := abs(p_total_tax_amt) * 1;
4950:
4951: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_negative THEN
4952: ln_amount := abs(p_total_tax_amt) * -1;

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

4947: */
4948: IF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_positive THEN
4949: ln_amount := abs(p_total_tax_amt) * 1;
4950:
4951: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_negative THEN
4952: ln_amount := abs(p_total_tax_amt) * -1;
4953:
4954: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_any THEN
4955:

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

4950:
4951: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_negative THEN
4952: ln_amount := abs(p_total_tax_amt) * -1;
4953:
4954: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_any THEN
4955:
4956: IF rec_cur_get_batch_source.type = jai_constants.ar_doc_type_dm THEN
4957: ln_amount := abs(p_total_tax_amt) ;
4958:

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

4952: ln_amount := abs(p_total_tax_amt) * -1;
4953:
4954: ELSIF rec_cur_get_batch_source.creation_sign = jai_constants.creation_sign_any THEN
4955:
4956: IF rec_cur_get_batch_source.type = jai_constants.ar_doc_type_dm THEN
4957: ln_amount := abs(p_total_tax_amt) ;
4958:
4959: ELSIF rec_cur_get_batch_source.type = jai_constants.ar_invoice_type_cm THEN
4960: ln_amount := abs(p_total_tax_amt) * -1;

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

4955:
4956: IF rec_cur_get_batch_source.type = jai_constants.ar_doc_type_dm THEN
4957: ln_amount := abs(p_total_tax_amt) ;
4958:
4959: ELSIF rec_cur_get_batch_source.type = jai_constants.ar_invoice_type_cm THEN
4960: ln_amount := abs(p_total_tax_amt) * -1;
4961: END IF;
4962: END IF;
4963:

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

4979: ||', trx_date -> '|| p_rgm_ref.source_document_date || fnd_global.local_chr(10)
4980: ||', trx_number -> '|| lv_trx_number || fnd_global.local_chr(10)
4981: ||', batch_source_name -> '|| lv_batch_src_name || fnd_global.local_chr(10)
4982: ||', cust_trx_type_name -> '|| rec_cur_get_batch_source.name || fnd_global.local_chr(10)
4983: ||', line_type -> '|| jai_constants.line_type_line || fnd_global.local_chr(10)
4984: ||', conversion_rate -> '|| 1 || fnd_global.local_chr(10)
4985: ||', conversion_type -> '|| jai_constants.conversion_type_user || fnd_global.local_chr(10)
4986: ||', interface_line_context -> '|| lv_batch_src_name || fnd_global.local_chr(10)
4987: ||', interface_line_attribute2 -> '|| p_rgm_ref.transaction_id || fnd_global.local_chr(10)

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

4981: ||', batch_source_name -> '|| lv_batch_src_name || fnd_global.local_chr(10)
4982: ||', cust_trx_type_name -> '|| rec_cur_get_batch_source.name || fnd_global.local_chr(10)
4983: ||', line_type -> '|| jai_constants.line_type_line || fnd_global.local_chr(10)
4984: ||', conversion_rate -> '|| 1 || fnd_global.local_chr(10)
4985: ||', conversion_type -> '|| jai_constants.conversion_type_user || fnd_global.local_chr(10)
4986: ||', interface_line_context -> '|| lv_batch_src_name || fnd_global.local_chr(10)
4987: ||', interface_line_attribute2 -> '|| p_rgm_ref.transaction_id || fnd_global.local_chr(10)
4988: ||', currency_code -> '|| jai_constants.func_curr || fnd_global.local_chr(10)
4989: ||', primary_salesrep_id -> '|| -3 || fnd_global.local_chr(10)

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

4984: ||', conversion_rate -> '|| 1 || fnd_global.local_chr(10)
4985: ||', conversion_type -> '|| jai_constants.conversion_type_user || fnd_global.local_chr(10)
4986: ||', interface_line_context -> '|| lv_batch_src_name || fnd_global.local_chr(10)
4987: ||', interface_line_attribute2 -> '|| p_rgm_ref.transaction_id || fnd_global.local_chr(10)
4988: ||', currency_code -> '|| jai_constants.func_curr || fnd_global.local_chr(10)
4989: ||', primary_salesrep_id -> '|| -3 || fnd_global.local_chr(10)
4990: ||', tax_code -> '|| jai_constants.tax_code_localization || fnd_global.local_chr(10)
4991: ||', term_id -> '|| ln_term_id || fnd_global.local_chr(10)
4992: ||', warehouse_id -> '|| p_rgm_ref.organization_id || fnd_global.local_chr(10)

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

4986: ||', interface_line_context -> '|| lv_batch_src_name || fnd_global.local_chr(10)
4987: ||', interface_line_attribute2 -> '|| p_rgm_ref.transaction_id || fnd_global.local_chr(10)
4988: ||', currency_code -> '|| jai_constants.func_curr || fnd_global.local_chr(10)
4989: ||', primary_salesrep_id -> '|| -3 || fnd_global.local_chr(10)
4990: ||', tax_code -> '|| jai_constants.tax_code_localization || fnd_global.local_chr(10)
4991: ||', term_id -> '|| ln_term_id || fnd_global.local_chr(10)
4992: ||', warehouse_id -> '|| p_rgm_ref.organization_id || fnd_global.local_chr(10)
4993: ||', quantity -> '|| 1 || fnd_global.local_chr(10)
4994: ||', unit_selling_price -> '|| ln_amount || fnd_global.local_chr(10)

Line 5043: jai_constants.line_type_line ,

5039: p_rgm_ref.source_document_date ,
5040: lv_trx_number ,
5041: lv_batch_src_name ,
5042: rec_cur_get_batch_source.name ,
5043: jai_constants.line_type_line ,
5044: 1 ,
5045: jai_constants.conversion_type_user ,
5046: lv_batch_src_name ,
5047: p_rgm_ref.transaction_id ,

Line 5045: jai_constants.conversion_type_user ,

5041: lv_batch_src_name ,
5042: rec_cur_get_batch_source.name ,
5043: jai_constants.line_type_line ,
5044: 1 ,
5045: jai_constants.conversion_type_user ,
5046: lv_batch_src_name ,
5047: p_rgm_ref.transaction_id ,
5048: jai_constants.func_curr ,
5049: -3 ,

Line 5048: jai_constants.func_curr ,

5044: 1 ,
5045: jai_constants.conversion_type_user ,
5046: lv_batch_src_name ,
5047: p_rgm_ref.transaction_id ,
5048: jai_constants.func_curr ,
5049: -3 ,
5050: jai_constants.tax_code_localization ,
5051: ln_term_id ,
5052: p_rgm_ref.organization_id ,

Line 5050: jai_constants.tax_code_localization ,

5046: lv_batch_src_name ,
5047: p_rgm_ref.transaction_id ,
5048: jai_constants.func_curr ,
5049: -3 ,
5050: jai_constants.tax_code_localization ,
5051: ln_term_id ,
5052: p_rgm_ref.organization_id ,
5053: p_rgm_ref.org_id , -- Date 19-jun-2007 by sacsethi for bug 6137956
5054: 1 ,

Line 5076: p_organization_type => jai_constants.orgn_type_io ,

5072: *********************************************************************************************************/
5073:
5074: ln_ccid_tax_type_tcs := jai_cmn_rgm_recording_pkg.get_account (
5075: p_regime_id => p_rgm_ref.regime_id ,
5076: p_organization_type => jai_constants.orgn_type_io ,
5077: p_organization_id => p_rgm_ref.organization_id ,
5078: p_location_id => null ,
5079: p_tax_type => jai_constants.tax_type_tcs ,
5080: p_account_name => jai_constants.liability

Line 5079: p_tax_type => jai_constants.tax_type_tcs ,

5075: p_regime_id => p_rgm_ref.regime_id ,
5076: p_organization_type => jai_constants.orgn_type_io ,
5077: p_organization_id => p_rgm_ref.organization_id ,
5078: p_location_id => null ,
5079: p_tax_type => jai_constants.tax_type_tcs ,
5080: p_account_name => jai_constants.liability
5081: );
5082: IF ln_ccid_tax_type_tcs IS NULL THEN
5083: /**********************************************************************************************************

Line 5080: p_account_name => jai_constants.liability

5076: p_organization_type => jai_constants.orgn_type_io ,
5077: p_organization_id => p_rgm_ref.organization_id ,
5078: p_location_id => null ,
5079: p_tax_type => jai_constants.tax_type_tcs ,
5080: p_account_name => jai_constants.liability
5081: );
5082: IF ln_ccid_tax_type_tcs IS NULL THEN
5083: /**********************************************************************************************************
5084: || Code Combination id has been returned as null from the function jai_cmn_rgm_recording_pkg.get_account

Line 5091: p_process_flag := jai_constants.expected_error;

5087: /*commented by csahoo for bug# 6401388
5088: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5089: pv_log_msg => 'Invalid code combination of TCS tax Accounting'
5090: );*/
5091: p_process_flag := jai_constants.expected_error;
5092: lv_process_message := 'Invalid Code combination ,please check the TCS Tax - Tax Accounting Setup';
5093: p_process_message := lv_process_message ;
5094: rollback;
5095: return;

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

5100: pv_log_msg => 'Inserting values into ra_interface_distributions_all for REV row:- '||fnd_global.local_chr(10)
5101: ||', interface_line_id -> '|| p_rgm_ref.transaction_id ||fnd_global.local_chr(10)
5102: ||', interface_line_context -> '|| lv_batch_src_name ||fnd_global.local_chr(10)
5103: ||', interface_line_attribute2 -> '|| p_rgm_ref.transaction_id ||fnd_global.local_chr(10)
5104: ||', account_class -> '|| jai_constants.account_class_rev ||fnd_global.local_chr(10)
5105: ||', amount -> '|| ln_amount ||fnd_global.local_chr(10)
5106: ||', code_combination_id -> '|| ln_ccid_tax_type_tcs ||fnd_global.local_chr(10)
5107: ||', acctd_amount -> '|| ln_amount ||fnd_global.local_chr(10)
5108: ||', created_by -> '|| ln_user_id ||fnd_global.local_chr(10)

Line 5136: jai_constants.account_class_rev ,

5132: Values (
5133: p_rgm_ref.transaction_id ,
5134: lv_batch_src_name ,
5135: p_rgm_ref.transaction_id ,
5136: jai_constants.account_class_rev ,
5137: ln_amount ,
5138: ln_ccid_tax_type_tcs ,
5139: ln_amount ,
5140: ln_user_id ,

Line 5205: p_process_flag := jai_constants.unexpected_error;

5201:
5202: jai_cmn_debug_contexts_pkg.deregister (pn_reg_id => ln_reg_id);*/
5203: EXCEPTION
5204: WHEN OTHERS THEN
5205: p_process_flag := jai_constants.unexpected_error;
5206: p_process_message := ' Unexpected error occured while processing jai_ar_tcs_rep_pkg.generate_document'||substr(SQLERRM,1,300) ;
5207: /*commented by csahoo for bug# 6401388
5208: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5209: pv_log_msg => 'Unexpected error occured while processing jai_ar_tcs_rep_pkg.generate_document -> '||substr(SQLERRM,1,300)

Line 5309: and confirm_pan = jai_constants.yes;

5305: IS
5306: select pan_no
5307: from JAI_CMN_CUS_ADDRESSES
5308: where customer_id = cp_customer_id
5309: and confirm_pan = jai_constants.yes;
5310:
5311: cursor c_get_cust_typ_lkup_code(cp_customer_id JAI_CMN_CUS_ADDRESSES.customer_id%type)
5312: IS
5313: select tcs_customer_type

Line 5333: and thtyps.threshold_type = jai_constants.thhold_typ_cumulative

5329: where
5330: thslbs.threshold_type_id = thtyps.threshold_type_id
5331: and thtyps.threshold_hdr_id = thhdrs.threshold_hdr_id
5332: and thhdrs.regime_id = cp_regime_id
5333: and thtyps.threshold_type = jai_constants.thhold_typ_cumulative
5334: and thhdrs.customer_type_lookup_code = cp_customer_type_lkup_code
5335: and trunc(cp_source_trx_date) between thtyps.from_date
5336: and nvl(thtyps.to_date, trunc(cp_source_trx_date))
5337: and NVL(thslbs.from_amount,0) = 0;

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

5374:
5375: FETCH get_tcs_fin_year INTO ln_fin_year;
5376: CLOSE get_tcs_fin_year;
5377:
5378: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
5379: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
5380: cp_organization_id => p_ooh.ship_from_org_id
5381: ) ;
5382: FETCH c_get_rgm_attribute INTO ln_regime_id, ln_org_tan_no ;

Line 5379: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,

5375: FETCH get_tcs_fin_year INTO ln_fin_year;
5376: CLOSE get_tcs_fin_year;
5377:
5378: OPEN c_get_rgm_attribute ( cp_regime_code => jai_constants.tcs_regime ,
5379: cp_attribute_code => jai_constants.rgm_attr_code_org_tan ,
5380: cp_organization_id => p_ooh.ship_from_org_id
5381: ) ;
5382: FETCH c_get_rgm_attribute INTO ln_regime_id, ln_org_tan_no ;
5383: IF C_GET_RGM_ATTRIBUTE%NOTFOUND THEN

Line 5385: p_process_flag := jai_constants.expected_error;

5381: ) ;
5382: FETCH c_get_rgm_attribute INTO ln_regime_id, ln_org_tan_no ;
5383: IF C_GET_RGM_ATTRIBUTE%NOTFOUND THEN
5384: CLOSE c_get_rgm_attribute;
5385: p_process_flag := jai_constants.expected_error;
5386: p_process_message := 'Org Tan Number needs to be defined for the TCS regime ';
5387: return;
5388: END IF;
5389: CLOSE c_get_rgm_attribute;

Line 5396: p_process_flag := jai_constants.expected_error;

5392: FETCH c_get_customer_pan INTO ln_party_pan_no;
5393:
5394: IF c_get_customer_pan%NOTFOUND THEN
5395: CLOSE c_get_customer_pan;
5396: p_process_flag := jai_constants.expected_error;
5397: p_process_message := 'Party pan no is not available for this party';
5398: RETURN;
5399: END IF;
5400: CLOSE c_get_customer_pan;

Line 5409: p_process_flag := jai_constants.expected_error;

5405: FETCH c_get_cust_typ_lkup_code INTO ln_customer_type_lkup_code;
5406:
5407: IF c_get_cust_typ_lkup_code%NOTFOUND THEN
5408: CLOSE c_get_cust_typ_lkup_code;
5409: p_process_flag := jai_constants.expected_error;
5410: p_process_message := 'Customer type lookup code is not available for this party';
5411: RETURN;
5412: END IF;
5413: CLOSE c_get_cust_typ_lkup_code;

Line 5427: cp_party_type => jai_constants.party_type_customer,

5423: ln_count :=0;
5424:
5425: OPEN get_jai_rgm_thresholds_count ( cp_fin_year => ln_fin_year,
5426: cp_org_tan_no => ln_org_tan_no,
5427: cp_party_type => jai_constants.party_type_customer,
5428: cp_party_id => p_ooh.sold_to_org_id ,
5429: cp_regime_id => ln_regime_id
5430: );
5431: FETCH get_jai_rgm_thresholds_count INTO ln_count;

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

5434: lr_hdr_record.threshold_id := ln_threshold_id ;
5435: lr_hdr_record.regime_id := ln_regime_id;
5436: lr_hdr_record.org_tan_no := ln_org_tan_no ;
5437: lr_hdr_record.party_id := p_ooh.sold_to_org_id;
5438: lr_hdr_record.party_type := jai_constants.party_type_customer ;
5439: lr_hdr_record.threshold_slab_id := ln_threshold_slab_id ;
5440: lr_hdr_record.fin_year := ln_fin_year ;
5441: lr_hdr_record.total_threshold_amt := null ;
5442: lr_hdr_record.total_threshold_base_amt := null ;

Line 5475: lv_process_flag := jai_constants.successful ;

5471: /*commented by csahoo for bug# 6401388
5472: jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context ,
5473: pn_reg_id => ln_reg_id
5474: );*/
5475: lv_process_flag := jai_constants.successful ;
5476: lv_process_message := null ;
5477:
5478: p_process_flag := lv_process_flag ;
5479: p_process_message := lv_process_message ;

Line 5492: IF p_event = jai_constants.order_booked OR

5488:
5489: /*########################################################################################################
5490: || PROCESS COMPLETED INVOICES ( DEBIT MEMO'S ALSO INCLUDED)
5491: ########################################################################################################*/
5492: IF p_event = jai_constants.order_booked OR
5493: p_event = jai_constants.wsh_ship_confirm
5494: THEN ---------A1
5495: /*commented by csahoo for bug# 6401388
5496: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

Line 5493: p_event = jai_constants.wsh_ship_confirm

5489: /*########################################################################################################
5490: || PROCESS COMPLETED INVOICES ( DEBIT MEMO'S ALSO INCLUDED)
5491: ########################################################################################################*/
5492: IF p_event = jai_constants.order_booked OR
5493: p_event = jai_constants.wsh_ship_confirm
5494: THEN ---------A1
5495: /*commented by csahoo for bug# 6401388
5496: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5497: pv_log_msg => '******************Before call to VALIDATE_SALES_ORDER/SHIP CONFIRM ***************, lv_document_type '||lv_document_type

Line 5509: IF lv_process_flag = jai_constants.not_applicable THEN

5505: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5506: pv_log_msg => '******************Returned from call to VALIDATE_SALES_ORDER/SHIP CONFIRM ***************, lv_process_flag '||lv_process_flag
5507: );*/
5508:
5509: IF lv_process_flag = jai_constants.not_applicable THEN
5510: /*commented by csahoo for bug# 6401388
5511: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5512: pv_log_msg => 'Skip the transaction'
5513: );*/

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

5513: );*/
5514: return;
5515: END IF;
5516:
5517: IF lv_process_flag = jai_constants.expected_error OR ---------A2
5518: lv_process_flag = jai_constants.unexpected_error
5519: THEN
5520: /*
5521: || As Returned status is an error/not applicable hence:-

Line 5518: lv_process_flag = jai_constants.unexpected_error

5514: return;
5515: END IF;
5516:
5517: IF lv_process_flag = jai_constants.expected_error OR ---------A2
5518: lv_process_flag = jai_constants.unexpected_error
5519: THEN
5520: /*
5521: || As Returned status is an error/not applicable hence:-
5522: || Set out variables p_process_flag and p_process_message accordingly

Line 5536: IF p_event = jai_constants.order_booked THEN

5532: return;
5533: END IF; --------A1
5534:
5535: --Added by JMEENA for bug#7277211
5536: IF p_event = jai_constants.order_booked THEN
5537: process_sales_order ( p_ooh => p_ooh ,
5538: p_process_flag => lv_process_flag ,
5539: p_process_message => lv_process_message
5540: );

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

5538: p_process_flag => lv_process_flag ,
5539: p_process_message => lv_process_message
5540: );
5541:
5542: IF lv_process_flag = jai_constants.expected_error OR ---------A2
5543: lv_process_flag = jai_constants.unexpected_error
5544: THEN
5545: p_process_flag := lv_process_flag ;
5546: p_process_message := lv_process_message ;

Line 5543: lv_process_flag = jai_constants.unexpected_error

5539: p_process_message => lv_process_message
5540: );
5541:
5542: IF lv_process_flag = jai_constants.expected_error OR ---------A2
5543: lv_process_flag = jai_constants.unexpected_error
5544: THEN
5545: p_process_flag := lv_process_flag ;
5546: p_process_message := lv_process_message ;
5547: return;

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

5553:
5554: /*########################################################################################################
5555: || PROCESS COMPLETED INVOICES ( DEBIT MEMO'S ALSO INCLUDED)
5556: ########################################################################################################*/
5557: IF p_event = jai_constants.trx_event_completion THEN ---------B1
5558:
5559: /*commented by csahoo for bug# 6401388
5560: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5561: pv_log_msg => '******************Before call to VALIDATE_INVOICE ***************, lv_document_type '||lv_document_type

Line 5573: IF lv_process_flag = jai_constants.not_applicable THEN

5569: /*commented by csahoo for bug# 6401388
5570: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5571: pv_log_msg => '******************Returned from call to VALIDATE_INVOICE ***************, lv_process_flag '||lv_process_flag
5572: );*/
5573: IF lv_process_flag = jai_constants.not_applicable THEN
5574: /*commented by csahoo for bug# 6401388
5575: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5576: pv_log_msg => 'Skip the transaction'
5577: );*/

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

5577: );*/
5578: return;
5579: END IF;
5580:
5581: IF lv_process_flag = jai_constants.expected_error OR ---------B2
5582: lv_process_flag = jai_constants.unexpected_error
5583: THEN
5584: /*
5585: || As Returned status is an error/not applicable hence:-

Line 5582: lv_process_flag = jai_constants.unexpected_error

5578: return;
5579: END IF;
5580:
5581: IF lv_process_flag = jai_constants.expected_error OR ---------B2
5582: lv_process_flag = jai_constants.unexpected_error
5583: THEN
5584: /*
5585: || As Returned status is an error/not applicable hence:-
5586: || Set out variables p_process_flag and p_process_message accordingly

Line 5605: IF lv_process_flag = jai_constants.not_applicable THEN

5601: p_process_flag => lv_process_flag ,
5602: p_process_message => lv_process_message
5603: );
5604:
5605: IF lv_process_flag = jai_constants.not_applicable THEN
5606: /*commented by csahoo for bug# 6401388
5607: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5608: pv_log_msg => 'Skip the transaction'
5609: );*/

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

5611: return;
5612: END IF;
5613:
5614:
5615: IF lv_process_flag = jai_constants.expected_error OR ---------B3
5616: lv_process_flag = jai_constants.unexpected_error
5617: THEN
5618: /*
5619: || As Returned status is an error/not applicable hence:-

Line 5616: lv_process_flag = jai_constants.unexpected_error

5612: END IF;
5613:
5614:
5615: IF lv_process_flag = jai_constants.expected_error OR ---------B3
5616: lv_process_flag = jai_constants.unexpected_error
5617: THEN
5618: /*
5619: || As Returned status is an error/not applicable hence:-
5620: || Set out variables p_process_flag and p_process_message accordingly

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

5634: /*########################################################################################################
5635: || PROCESS CONFIRMED RECEIPTS HAVING TCS APPLICABILITY
5636: ########################################################################################################*/
5637:
5638: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
5639: jai_constants.trx_type_rct_rvs
5640: )
5641: THEN
5642: lv_document_type := p_event;

Line 5639: jai_constants.trx_type_rct_rvs

5635: || PROCESS CONFIRMED RECEIPTS HAVING TCS APPLICABILITY
5636: ########################################################################################################*/
5637:
5638: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
5639: jai_constants.trx_type_rct_rvs
5640: )
5641: THEN
5642: lv_document_type := p_event;
5643:

Line 5658: IF lv_process_flag = jai_constants.not_applicable THEN

5654: /*commented by csahoo for bug# 6401388
5655: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5656: pv_log_msg => ' Returned from validate_receipts lv_process_flag: '||lv_process_flag
5657: );*/
5658: IF lv_process_flag = jai_constants.not_applicable THEN
5659: /*commented by csahoo for bug# 6401388
5660: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5661: pv_log_msg => 'Skip the transaction'
5662: );*/

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

5663:
5664: return;
5665: END IF;
5666:
5667: IF lv_process_flag = jai_constants.expected_error OR ---------C2
5668: lv_process_flag = jai_constants.unexpected_error
5669: THEN
5670: /*
5671: || As Returned status is an error/not applicable hence:-

Line 5668: lv_process_flag = jai_constants.unexpected_error

5664: return;
5665: END IF;
5666:
5667: IF lv_process_flag = jai_constants.expected_error OR ---------C2
5668: lv_process_flag = jai_constants.unexpected_error
5669: THEN
5670: /*
5671: || As Returned status is an error/not applicable hence:-
5672: || Set out variables p_process_flag and p_process_message accordingly

Line 5699: IF lv_process_flag = jai_constants.not_applicable THEN

5695: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5696: pv_log_msg => ' Returned from process_receipts lv_process_flag: '||lv_process_flag
5697: );*/
5698:
5699: IF lv_process_flag = jai_constants.not_applicable THEN
5700: /*commented by csahoo for bug# 6401388
5701: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5702: pv_log_msg => 'Skip the transaction'
5703: );*/

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

5704:
5705: return;
5706: END IF;
5707:
5708: IF lv_process_flag = jai_constants.expected_error OR ---------C3
5709: lv_process_flag = jai_constants.unexpected_error
5710: THEN
5711: /*
5712: || As Returned status is an error/not applicable hence:-

Line 5709: lv_process_flag = jai_constants.unexpected_error

5705: return;
5706: END IF;
5707:
5708: IF lv_process_flag = jai_constants.expected_error OR ---------C3
5709: lv_process_flag = jai_constants.unexpected_error
5710: THEN
5711: /*
5712: || As Returned status is an error/not applicable hence:-
5713: || Set out variables p_process_flag and p_process_message accordingly

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

5727: /*########################################################################################################
5728: || PROCESS ALL RECEIPT AND CREDIT MEMO APPLICATIONS/UNAPPLICATIONS
5729: ########################################################################################################*/
5730:
5731: IF p_event IN ( jai_constants.ar_cash , ---------D1
5732: jai_constants.ar_invoice_type_cm
5733: )
5734: THEN
5735:

Line 5732: jai_constants.ar_invoice_type_cm

5728: || PROCESS ALL RECEIPT AND CREDIT MEMO APPLICATIONS/UNAPPLICATIONS
5729: ########################################################################################################*/
5730:
5731: IF p_event IN ( jai_constants.ar_cash , ---------D1
5732: jai_constants.ar_invoice_type_cm
5733: )
5734: THEN
5735:
5736: /***********

Line 5757: IF lv_process_flag = jai_constants.not_applicable THEN

5753: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5754: pv_log_msg => ' Returned from validate_app_unapp lv_process_flag: '||lv_process_flag
5755: );*/
5756:
5757: IF lv_process_flag = jai_constants.not_applicable THEN
5758: /*commented by csahoo for bug# 6401388
5759: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5760: pv_log_msg => 'Skip the transaction'
5761: );*/

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

5762: return;
5763: END IF;
5764:
5765:
5766: IF lv_process_flag = jai_constants.expected_error OR ---------D2
5767: lv_process_flag = jai_constants.unexpected_error
5768: THEN
5769: /*
5770: || As Returned status is an error/not applicable hence:-

Line 5767: lv_process_flag = jai_constants.unexpected_error

5763: END IF;
5764:
5765:
5766: IF lv_process_flag = jai_constants.expected_error OR ---------D2
5767: lv_process_flag = jai_constants.unexpected_error
5768: THEN
5769: /*
5770: || As Returned status is an error/not applicable hence:-
5771: || Set out variables p_process_flag and p_process_message accordingly

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

5781: return;
5782: END IF; ---------D2
5783:
5784:
5785: IF lv_document_type IN ( jai_constants.trx_type_rct_app, ---------D3
5786: jai_constants.trx_type_cm_app
5787: )
5788: THEN
5789: /*commented by csahoo for bug# 6401388

Line 5786: jai_constants.trx_type_cm_app

5782: END IF; ---------D2
5783:
5784:
5785: IF lv_document_type IN ( jai_constants.trx_type_rct_app, ---------D3
5786: jai_constants.trx_type_cm_app
5787: )
5788: THEN
5789: /*commented by csahoo for bug# 6401388
5790: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

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

5801: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5802: pv_log_msg => ' Returned from process_applications lv_process_flag: '||lv_process_flag
5803: );*/
5804:
5805: ELSIF lv_document_type IN ( jai_constants.trx_type_rct_unapp, ---------D3
5806: jai_constants.trx_type_cm_unapp
5807: )
5808: THEN
5809: /*commented by csahoo for bug# 6401388

Line 5806: jai_constants.trx_type_cm_unapp

5802: pv_log_msg => ' Returned from process_applications lv_process_flag: '||lv_process_flag
5803: );*/
5804:
5805: ELSIF lv_document_type IN ( jai_constants.trx_type_rct_unapp, ---------D3
5806: jai_constants.trx_type_cm_unapp
5807: )
5808: THEN
5809: /*commented by csahoo for bug# 6401388
5810: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

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

5824: );*/
5825:
5826: END IF; ---------D3
5827:
5828: IF lv_process_flag = jai_constants.not_applicable THEN ---------D4
5829: /*commented by csahoo for bug# 6401388
5830: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5831: pv_log_msg => 'Skip the transaction'
5832: );*/

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

5833:
5834: return;
5835: END IF; ---------D4
5836:
5837: IF lv_process_flag = jai_constants.expected_error OR ---------D2
5838: lv_process_flag = jai_constants.unexpected_error
5839: THEN
5840: /*
5841: || As Returned status is an error/not applicable hence:-

Line 5838: lv_process_flag = jai_constants.unexpected_error

5834: return;
5835: END IF; ---------D4
5836:
5837: IF lv_process_flag = jai_constants.expected_error OR ---------D2
5838: lv_process_flag = jai_constants.unexpected_error
5839: THEN
5840: /*
5841: || As Returned status is an error/not applicable hence:-
5842: || Set out variables p_process_flag and p_process_message accordingly

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

5857: /*########################################################################################################
5858: || CALL PROCEDURE TO GENERATE DOCUMENTS FOR ALL EVENTS EXCEPT INVOICE/DEBIT_MEMO/CREDIT_MEMO_APPLICATION
5859: ########################################################################################################*/
5860:
5861: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
5862: jai_constants.trx_type_rct_rvs ,
5863: jai_constants.ar_cash , ---------D1
5864: jai_constants.ar_invoice_type_cm
5865: )

Line 5862: jai_constants.trx_type_rct_rvs ,

5858: || CALL PROCEDURE TO GENERATE DOCUMENTS FOR ALL EVENTS EXCEPT INVOICE/DEBIT_MEMO/CREDIT_MEMO_APPLICATION
5859: ########################################################################################################*/
5860:
5861: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
5862: jai_constants.trx_type_rct_rvs ,
5863: jai_constants.ar_cash , ---------D1
5864: jai_constants.ar_invoice_type_cm
5865: )
5866: THEN

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

5859: ########################################################################################################*/
5860:
5861: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
5862: jai_constants.trx_type_rct_rvs ,
5863: jai_constants.ar_cash , ---------D1
5864: jai_constants.ar_invoice_type_cm
5865: )
5866: THEN
5867: /*commented by csahoo for bug# 6401388

Line 5864: jai_constants.ar_invoice_type_cm

5860:
5861: IF p_event IN ( jai_constants.ar_cash_tax_confirmed , ---------C1
5862: jai_constants.trx_type_rct_rvs ,
5863: jai_constants.ar_cash , ---------D1
5864: jai_constants.ar_invoice_type_cm
5865: )
5866: THEN
5867: /*commented by csahoo for bug# 6401388
5868: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,

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

5889: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5890: pv_log_msg => ' Returned from generate_document lv_process_flag: '||lv_process_flag
5891: );*/
5892:
5893: IF lv_process_flag = jai_constants.not_applicable THEN ---------D4
5894: /*commented by csahoo for bug# 6401388
5895: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5896: pv_log_msg => 'Skip the transaction'
5897: );*/

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

5898:
5899: return;
5900: END IF; ---------D4
5901:
5902: IF lv_process_flag = jai_constants.expected_error OR ---------D2
5903: lv_process_flag = jai_constants.unexpected_error
5904: THEN
5905: /*
5906: || As Returned status is an error/not applicable hence:-

Line 5903: lv_process_flag = jai_constants.unexpected_error

5899: return;
5900: END IF; ---------D4
5901:
5902: IF lv_process_flag = jai_constants.expected_error OR ---------D2
5903: lv_process_flag = jai_constants.unexpected_error
5904: THEN
5905: /*
5906: || As Returned status is an error/not applicable hence:-
5907: || Set out variables p_process_flag and p_process_message accordingly

Line 5946: IF lv_process_flag = jai_constants.not_applicable THEN

5942: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5943: pv_log_msg => ' Returned from jai_rgm_thhold_proc_pkg.maintain_threshold lv_process_flag: '||lv_process_flag
5944: );*/
5945:
5946: IF lv_process_flag = jai_constants.not_applicable THEN
5947: /*commented by csahoo for bug# 6401388
5948: jai_cmn_debug_contexts_pkg.print ( pn_reg_id => ln_reg_id ,
5949: pv_log_msg => 'Skip the transaction'
5950: );*/

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

5951:
5952: return;
5953: END IF;
5954:
5955: IF lv_process_flag = jai_constants.expected_error OR ---------D2
5956: lv_process_flag = jai_constants.unexpected_error
5957: THEN
5958: /*
5959: || As Returned status is an error/not applicable hence:-

Line 5956: lv_process_flag = jai_constants.unexpected_error

5952: return;
5953: END IF;
5954:
5955: IF lv_process_flag = jai_constants.expected_error OR ---------D2
5956: lv_process_flag = jai_constants.unexpected_error
5957: THEN
5958: /*
5959: || As Returned status is an error/not applicable hence:-
5960: || Set out variables p_process_flag and p_process_message accordingly

Line 5983: p_process_flag := jai_constants.unexpected_error;

5979:
5980: jai_cmn_debug_contexts_pkg.deregister (pn_reg_id => ln_reg_id);*/
5981: EXCEPTION
5982: WHEN OTHERS THEN
5983: p_process_flag := jai_constants.unexpected_error;
5984: p_process_message := lv_context||' Unexpected error occured while processing jai_ar_tcs_rep_pkg.process_transactions'||SQLERRM ;
5985: /*commented by csahoo for bug# 6401388
5986: jai_cmn_debug_contexts_pkg.print( pn_reg_id => ln_reg_id ,
5987: pv_log_msg => p_process_message ,