382: WHERE statement_number = G_statement_number
383: AND bank_account_num = G_bank_account_num;
384: BEGIN
385: IF l_DEBUG in ('Y', 'C') THEN
386: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Insert_Hdr');
387:
388: cep_standard.debug('Statement Number -'||G_statement_number||'.');
389: cep_standard.debug('Bank Account Num -'||G_bank_account_num||'.');
390: cep_standard.debug('Statement_date -'||G_statement_date||'.');
384: BEGIN
385: IF l_DEBUG in ('Y', 'C') THEN
386: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Insert_Hdr');
387:
388: cep_standard.debug('Statement Number -'||G_statement_number||'.');
389: cep_standard.debug('Bank Account Num -'||G_bank_account_num||'.');
390: cep_standard.debug('Statement_date -'||G_statement_date||'.');
391: cep_standard.debug('Bank Name -'||G_bank_name||'.');
392: cep_standard.debug('Bank Branch Name -'||G_bank_branch_name||'.');
385: IF l_DEBUG in ('Y', 'C') THEN
386: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Insert_Hdr');
387:
388: cep_standard.debug('Statement Number -'||G_statement_number||'.');
389: cep_standard.debug('Bank Account Num -'||G_bank_account_num||'.');
390: cep_standard.debug('Statement_date -'||G_statement_date||'.');
391: cep_standard.debug('Bank Name -'||G_bank_name||'.');
392: cep_standard.debug('Bank Branch Name -'||G_bank_branch_name||'.');
393: cep_standard.debug('Begin Bal -'||G_control_begin_balance||'.');
386: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Insert_Hdr');
387:
388: cep_standard.debug('Statement Number -'||G_statement_number||'.');
389: cep_standard.debug('Bank Account Num -'||G_bank_account_num||'.');
390: cep_standard.debug('Statement_date -'||G_statement_date||'.');
391: cep_standard.debug('Bank Name -'||G_bank_name||'.');
392: cep_standard.debug('Bank Branch Name -'||G_bank_branch_name||'.');
393: cep_standard.debug('Begin Bal -'||G_control_begin_balance||'.');
394: cep_standard.debug('End Bal -'||G_control_end_balance||'.');
387:
388: cep_standard.debug('Statement Number -'||G_statement_number||'.');
389: cep_standard.debug('Bank Account Num -'||G_bank_account_num||'.');
390: cep_standard.debug('Statement_date -'||G_statement_date||'.');
391: cep_standard.debug('Bank Name -'||G_bank_name||'.');
392: cep_standard.debug('Bank Branch Name -'||G_bank_branch_name||'.');
393: cep_standard.debug('Begin Bal -'||G_control_begin_balance||'.');
394: cep_standard.debug('End Bal -'||G_control_end_balance||'.');
395: cep_standard.debug('Cashflow Bal -'||G_cashflow_balance||'.');
388: cep_standard.debug('Statement Number -'||G_statement_number||'.');
389: cep_standard.debug('Bank Account Num -'||G_bank_account_num||'.');
390: cep_standard.debug('Statement_date -'||G_statement_date||'.');
391: cep_standard.debug('Bank Name -'||G_bank_name||'.');
392: cep_standard.debug('Bank Branch Name -'||G_bank_branch_name||'.');
393: cep_standard.debug('Begin Bal -'||G_control_begin_balance||'.');
394: cep_standard.debug('End Bal -'||G_control_end_balance||'.');
395: cep_standard.debug('Cashflow Bal -'||G_cashflow_balance||'.');
396: cep_standard.debug('Int Calc Bal -'||G_int_calc_balance||'.');
389: cep_standard.debug('Bank Account Num -'||G_bank_account_num||'.');
390: cep_standard.debug('Statement_date -'||G_statement_date||'.');
391: cep_standard.debug('Bank Name -'||G_bank_name||'.');
392: cep_standard.debug('Bank Branch Name -'||G_bank_branch_name||'.');
393: cep_standard.debug('Begin Bal -'||G_control_begin_balance||'.');
394: cep_standard.debug('End Bal -'||G_control_end_balance||'.');
395: cep_standard.debug('Cashflow Bal -'||G_cashflow_balance||'.');
396: cep_standard.debug('Int Calc Bal -'||G_int_calc_balance||'.');
397: cep_standard.debug('Average close ledger mtd -'||G_average_close_ledger_mtd||'.');
390: cep_standard.debug('Statement_date -'||G_statement_date||'.');
391: cep_standard.debug('Bank Name -'||G_bank_name||'.');
392: cep_standard.debug('Bank Branch Name -'||G_bank_branch_name||'.');
393: cep_standard.debug('Begin Bal -'||G_control_begin_balance||'.');
394: cep_standard.debug('End Bal -'||G_control_end_balance||'.');
395: cep_standard.debug('Cashflow Bal -'||G_cashflow_balance||'.');
396: cep_standard.debug('Int Calc Bal -'||G_int_calc_balance||'.');
397: cep_standard.debug('Average close ledger mtd -'||G_average_close_ledger_mtd||'.');
398: cep_standard.debug('Average close ledger ytd -'||G_average_close_ledger_ytd||'.');
391: cep_standard.debug('Bank Name -'||G_bank_name||'.');
392: cep_standard.debug('Bank Branch Name -'||G_bank_branch_name||'.');
393: cep_standard.debug('Begin Bal -'||G_control_begin_balance||'.');
394: cep_standard.debug('End Bal -'||G_control_end_balance||'.');
395: cep_standard.debug('Cashflow Bal -'||G_cashflow_balance||'.');
396: cep_standard.debug('Int Calc Bal -'||G_int_calc_balance||'.');
397: cep_standard.debug('Average close ledger mtd -'||G_average_close_ledger_mtd||'.');
398: cep_standard.debug('Average close ledger ytd -'||G_average_close_ledger_ytd||'.');
399: cep_standard.debug('Average close available mtd -'||G_average_close_available_mtd||'.');
392: cep_standard.debug('Bank Branch Name -'||G_bank_branch_name||'.');
393: cep_standard.debug('Begin Bal -'||G_control_begin_balance||'.');
394: cep_standard.debug('End Bal -'||G_control_end_balance||'.');
395: cep_standard.debug('Cashflow Bal -'||G_cashflow_balance||'.');
396: cep_standard.debug('Int Calc Bal -'||G_int_calc_balance||'.');
397: cep_standard.debug('Average close ledger mtd -'||G_average_close_ledger_mtd||'.');
398: cep_standard.debug('Average close ledger ytd -'||G_average_close_ledger_ytd||'.');
399: cep_standard.debug('Average close available mtd -'||G_average_close_available_mtd||'.');
400: cep_standard.debug('Average close available ytd -'||G_average_close_available_ytd||'.');
393: cep_standard.debug('Begin Bal -'||G_control_begin_balance||'.');
394: cep_standard.debug('End Bal -'||G_control_end_balance||'.');
395: cep_standard.debug('Cashflow Bal -'||G_cashflow_balance||'.');
396: cep_standard.debug('Int Calc Bal -'||G_int_calc_balance||'.');
397: cep_standard.debug('Average close ledger mtd -'||G_average_close_ledger_mtd||'.');
398: cep_standard.debug('Average close ledger ytd -'||G_average_close_ledger_ytd||'.');
399: cep_standard.debug('Average close available mtd -'||G_average_close_available_mtd||'.');
400: cep_standard.debug('Average close available ytd -'||G_average_close_available_ytd||'.');
401: cep_standard.debug('One Day Float -'||G_one_day_float||'.');
394: cep_standard.debug('End Bal -'||G_control_end_balance||'.');
395: cep_standard.debug('Cashflow Bal -'||G_cashflow_balance||'.');
396: cep_standard.debug('Int Calc Bal -'||G_int_calc_balance||'.');
397: cep_standard.debug('Average close ledger mtd -'||G_average_close_ledger_mtd||'.');
398: cep_standard.debug('Average close ledger ytd -'||G_average_close_ledger_ytd||'.');
399: cep_standard.debug('Average close available mtd -'||G_average_close_available_mtd||'.');
400: cep_standard.debug('Average close available ytd -'||G_average_close_available_ytd||'.');
401: cep_standard.debug('One Day Float -'||G_one_day_float||'.');
402: cep_standard.debug('Two Day Float -'||G_two_day_float||'.');
395: cep_standard.debug('Cashflow Bal -'||G_cashflow_balance||'.');
396: cep_standard.debug('Int Calc Bal -'||G_int_calc_balance||'.');
397: cep_standard.debug('Average close ledger mtd -'||G_average_close_ledger_mtd||'.');
398: cep_standard.debug('Average close ledger ytd -'||G_average_close_ledger_ytd||'.');
399: cep_standard.debug('Average close available mtd -'||G_average_close_available_mtd||'.');
400: cep_standard.debug('Average close available ytd -'||G_average_close_available_ytd||'.');
401: cep_standard.debug('One Day Float -'||G_one_day_float||'.');
402: cep_standard.debug('Two Day Float -'||G_two_day_float||'.');
403: cep_standard.debug('Total DR -'||G_control_total_dr||'.');
396: cep_standard.debug('Int Calc Bal -'||G_int_calc_balance||'.');
397: cep_standard.debug('Average close ledger mtd -'||G_average_close_ledger_mtd||'.');
398: cep_standard.debug('Average close ledger ytd -'||G_average_close_ledger_ytd||'.');
399: cep_standard.debug('Average close available mtd -'||G_average_close_available_mtd||'.');
400: cep_standard.debug('Average close available ytd -'||G_average_close_available_ytd||'.');
401: cep_standard.debug('One Day Float -'||G_one_day_float||'.');
402: cep_standard.debug('Two Day Float -'||G_two_day_float||'.');
403: cep_standard.debug('Total DR -'||G_control_total_dr||'.');
404: cep_standard.debug('Total CR -'||G_control_total_cr||'.');
397: cep_standard.debug('Average close ledger mtd -'||G_average_close_ledger_mtd||'.');
398: cep_standard.debug('Average close ledger ytd -'||G_average_close_ledger_ytd||'.');
399: cep_standard.debug('Average close available mtd -'||G_average_close_available_mtd||'.');
400: cep_standard.debug('Average close available ytd -'||G_average_close_available_ytd||'.');
401: cep_standard.debug('One Day Float -'||G_one_day_float||'.');
402: cep_standard.debug('Two Day Float -'||G_two_day_float||'.');
403: cep_standard.debug('Total DR -'||G_control_total_dr||'.');
404: cep_standard.debug('Total CR -'||G_control_total_cr||'.');
405: cep_standard.debug('Total DR Line cnt -'||G_control_dr_line_count||'.');
398: cep_standard.debug('Average close ledger ytd -'||G_average_close_ledger_ytd||'.');
399: cep_standard.debug('Average close available mtd -'||G_average_close_available_mtd||'.');
400: cep_standard.debug('Average close available ytd -'||G_average_close_available_ytd||'.');
401: cep_standard.debug('One Day Float -'||G_one_day_float||'.');
402: cep_standard.debug('Two Day Float -'||G_two_day_float||'.');
403: cep_standard.debug('Total DR -'||G_control_total_dr||'.');
404: cep_standard.debug('Total CR -'||G_control_total_cr||'.');
405: cep_standard.debug('Total DR Line cnt -'||G_control_dr_line_count||'.');
406: cep_standard.debug('Total CR Line cnt -'||G_control_cr_line_count||'.');
399: cep_standard.debug('Average close available mtd -'||G_average_close_available_mtd||'.');
400: cep_standard.debug('Average close available ytd -'||G_average_close_available_ytd||'.');
401: cep_standard.debug('One Day Float -'||G_one_day_float||'.');
402: cep_standard.debug('Two Day Float -'||G_two_day_float||'.');
403: cep_standard.debug('Total DR -'||G_control_total_dr||'.');
404: cep_standard.debug('Total CR -'||G_control_total_cr||'.');
405: cep_standard.debug('Total DR Line cnt -'||G_control_dr_line_count||'.');
406: cep_standard.debug('Total CR Line cnt -'||G_control_cr_line_count||'.');
407: cep_standard.debug('Currency Code -'||G_hdr_currency_code||'.');
400: cep_standard.debug('Average close available ytd -'||G_average_close_available_ytd||'.');
401: cep_standard.debug('One Day Float -'||G_one_day_float||'.');
402: cep_standard.debug('Two Day Float -'||G_two_day_float||'.');
403: cep_standard.debug('Total DR -'||G_control_total_dr||'.');
404: cep_standard.debug('Total CR -'||G_control_total_cr||'.');
405: cep_standard.debug('Total DR Line cnt -'||G_control_dr_line_count||'.');
406: cep_standard.debug('Total CR Line cnt -'||G_control_cr_line_count||'.');
407: cep_standard.debug('Currency Code -'||G_hdr_currency_code||'.');
408: cep_standard.debug('Bank Account ID -'||to_char(G_sub_account_id)||'.');
401: cep_standard.debug('One Day Float -'||G_one_day_float||'.');
402: cep_standard.debug('Two Day Float -'||G_two_day_float||'.');
403: cep_standard.debug('Total DR -'||G_control_total_dr||'.');
404: cep_standard.debug('Total CR -'||G_control_total_cr||'.');
405: cep_standard.debug('Total DR Line cnt -'||G_control_dr_line_count||'.');
406: cep_standard.debug('Total CR Line cnt -'||G_control_cr_line_count||'.');
407: cep_standard.debug('Currency Code -'||G_hdr_currency_code||'.');
408: cep_standard.debug('Bank Account ID -'||to_char(G_sub_account_id)||'.');
409: cep_standard.debug('Bank Branch ID -'||to_char(G_sub_branch_id)||'.');
402: cep_standard.debug('Two Day Float -'||G_two_day_float||'.');
403: cep_standard.debug('Total DR -'||G_control_total_dr||'.');
404: cep_standard.debug('Total CR -'||G_control_total_cr||'.');
405: cep_standard.debug('Total DR Line cnt -'||G_control_dr_line_count||'.');
406: cep_standard.debug('Total CR Line cnt -'||G_control_cr_line_count||'.');
407: cep_standard.debug('Currency Code -'||G_hdr_currency_code||'.');
408: cep_standard.debug('Bank Account ID -'||to_char(G_sub_account_id)||'.');
409: cep_standard.debug('Bank Branch ID -'||to_char(G_sub_branch_id)||'.');
410: cep_standard.debug('GL Date -'||to_char(G_gl_date, 'DD-MON-YY')||'.');
403: cep_standard.debug('Total DR -'||G_control_total_dr||'.');
404: cep_standard.debug('Total CR -'||G_control_total_cr||'.');
405: cep_standard.debug('Total DR Line cnt -'||G_control_dr_line_count||'.');
406: cep_standard.debug('Total CR Line cnt -'||G_control_cr_line_count||'.');
407: cep_standard.debug('Currency Code -'||G_hdr_currency_code||'.');
408: cep_standard.debug('Bank Account ID -'||to_char(G_sub_account_id)||'.');
409: cep_standard.debug('Bank Branch ID -'||to_char(G_sub_branch_id)||'.');
410: cep_standard.debug('GL Date -'||to_char(G_gl_date, 'DD-MON-YY')||'.');
411: cep_standard.debug('Org ID -'||G_org_id||'.');
404: cep_standard.debug('Total CR -'||G_control_total_cr||'.');
405: cep_standard.debug('Total DR Line cnt -'||G_control_dr_line_count||'.');
406: cep_standard.debug('Total CR Line cnt -'||G_control_cr_line_count||'.');
407: cep_standard.debug('Currency Code -'||G_hdr_currency_code||'.');
408: cep_standard.debug('Bank Account ID -'||to_char(G_sub_account_id)||'.');
409: cep_standard.debug('Bank Branch ID -'||to_char(G_sub_branch_id)||'.');
410: cep_standard.debug('GL Date -'||to_char(G_gl_date, 'DD-MON-YY')||'.');
411: cep_standard.debug('Org ID -'||G_org_id||'.');
412: cep_standard.debug('Format Type -'||G_format_type||'.');
405: cep_standard.debug('Total DR Line cnt -'||G_control_dr_line_count||'.');
406: cep_standard.debug('Total CR Line cnt -'||G_control_cr_line_count||'.');
407: cep_standard.debug('Currency Code -'||G_hdr_currency_code||'.');
408: cep_standard.debug('Bank Account ID -'||to_char(G_sub_account_id)||'.');
409: cep_standard.debug('Bank Branch ID -'||to_char(G_sub_branch_id)||'.');
410: cep_standard.debug('GL Date -'||to_char(G_gl_date, 'DD-MON-YY')||'.');
411: cep_standard.debug('Org ID -'||G_org_id||'.');
412: cep_standard.debug('Format Type -'||G_format_type||'.');
413: END IF;
406: cep_standard.debug('Total CR Line cnt -'||G_control_cr_line_count||'.');
407: cep_standard.debug('Currency Code -'||G_hdr_currency_code||'.');
408: cep_standard.debug('Bank Account ID -'||to_char(G_sub_account_id)||'.');
409: cep_standard.debug('Bank Branch ID -'||to_char(G_sub_branch_id)||'.');
410: cep_standard.debug('GL Date -'||to_char(G_gl_date, 'DD-MON-YY')||'.');
411: cep_standard.debug('Org ID -'||G_org_id||'.');
412: cep_standard.debug('Format Type -'||G_format_type||'.');
413: END IF;
414:
407: cep_standard.debug('Currency Code -'||G_hdr_currency_code||'.');
408: cep_standard.debug('Bank Account ID -'||to_char(G_sub_account_id)||'.');
409: cep_standard.debug('Bank Branch ID -'||to_char(G_sub_branch_id)||'.');
410: cep_standard.debug('GL Date -'||to_char(G_gl_date, 'DD-MON-YY')||'.');
411: cep_standard.debug('Org ID -'||G_org_id||'.');
412: cep_standard.debug('Format Type -'||G_format_type||'.');
413: END IF;
414:
415: IF G_format_type = 'SWIFT940' THEN
408: cep_standard.debug('Bank Account ID -'||to_char(G_sub_account_id)||'.');
409: cep_standard.debug('Bank Branch ID -'||to_char(G_sub_branch_id)||'.');
410: cep_standard.debug('GL Date -'||to_char(G_gl_date, 'DD-MON-YY')||'.');
411: cep_standard.debug('Org ID -'||G_org_id||'.');
412: cep_standard.debug('Format Type -'||G_format_type||'.');
413: END IF;
414:
415: IF G_format_type = 'SWIFT940' THEN
416: l_statement_number := G_statement_number || ' - ' || to_char(G_statement_date);
557: ELSIF G_process_option = 'IMPORT' THEN
558: l_program_name := 'ARPLABIM';
559: END IF;
560:
561: cep_standard.debug('Process Option -'||G_process_option);
562: cep_standard.debug('Program Name -'||l_program_name);
563:
564: l_req_data := fnd_conc_global.request_data;
565:
558: l_program_name := 'ARPLABIM';
559: END IF;
560:
561: cep_standard.debug('Process Option -'||G_process_option);
562: cep_standard.debug('Program Name -'||l_program_name);
563:
564: l_req_data := fnd_conc_global.request_data;
565:
566: if(l_req_data IS NOT NULL)THEN
601: '','','','','','','','','','',
602: '','','','','','','','','','');
603: IF l_request_id = 0 THEN
604: IF l_DEBUG in ('Y', 'C') THEN
605: cep_standard.debug(FND_MESSAGE.get);
606: cep_standard.debug('EXCEPTION: Fail to submit cuncurrent request for '|| l_program_name);
607: END IF;
608: RAISE ldr_exception;
609: END IF;
602: '','','','','','','','','','');
603: IF l_request_id = 0 THEN
604: IF l_DEBUG in ('Y', 'C') THEN
605: cep_standard.debug(FND_MESSAGE.get);
606: cep_standard.debug('EXCEPTION: Fail to submit cuncurrent request for '|| l_program_name);
607: END IF;
608: RAISE ldr_exception;
609: END IF;
610: ELSE
615: -- END IF; --org_id
616: END IF;
617: END IF;
618: IF l_DEBUG in ('Y', 'C') THEN
619: cep_standard.debug('<
621: EXCEPTION
622: WHEN ldr_exception THEN
623: RAISE;
623: RAISE;
624: WHEN OTHERS THEN
625: l_err := SQLCODE;
626: IF l_DEBUG in ('Y', 'C') THEN
627: cep_standard.debug('EXCEPTION: CE_BANK_STATEMENT_LOADER.Insert_Hdr - '|| to_char(l_err));
628: END IF;
629: RAISE;
630: END Insert_Hdr;
631:
791: l_return_tmp VARCHAR2(255);
792: l_concatenate_format_flag VARCHAR2(1);
793: BEGIN
794: IF l_DEBUG in ('Y', 'C') THEN
795: cep_standard.debug('>> Get_Formatted_String' );
796: cep_standard.debug('X_string = '|| X_string );
797: END IF;
798:
799:
792: l_concatenate_format_flag VARCHAR2(1);
793: BEGIN
794: IF l_DEBUG in ('Y', 'C') THEN
795: cep_standard.debug('>> Get_Formatted_String' );
796: cep_standard.debug('X_string = '|| X_string );
797: END IF;
798:
799:
800: l_tmp_format := LTRIM(RTRIM(G_predefined_format));
803: l_concatenate_format_flag := nvl(G_concatenate_format_flag, 'N');
804: --l_concatenate_format_flag := 'Y';
805:
806: IF l_DEBUG in ('Y', 'C') THEN
807: cep_standard.debug('G_concatenate_format_flag = '||G_concatenate_format_flag||'.');
808: cep_standard.debug('G_predefined_format = '||G_predefined_format||'.');
809: cep_standard.debug('l_pos = '||l_pos||'.');
810:
811: END IF;
804: --l_concatenate_format_flag := 'Y';
805:
806: IF l_DEBUG in ('Y', 'C') THEN
807: cep_standard.debug('G_concatenate_format_flag = '||G_concatenate_format_flag||'.');
808: cep_standard.debug('G_predefined_format = '||G_predefined_format||'.');
809: cep_standard.debug('l_pos = '||l_pos||'.');
810:
811: END IF;
812:
805:
806: IF l_DEBUG in ('Y', 'C') THEN
807: cep_standard.debug('G_concatenate_format_flag = '||G_concatenate_format_flag||'.');
808: cep_standard.debug('G_predefined_format = '||G_predefined_format||'.');
809: cep_standard.debug('l_pos = '||l_pos||'.');
810:
811: END IF;
812:
813:
814: WHILE l_pos <> 0 LOOP
815: l_format := LTRIM(RTRIM(SUBSTR(l_tmp_format, 1, l_pos-1)));
816:
817: -- DBMS_OUTPUT.put_line('l_format 1: '||l_format);
818: cep_standard.debug('l_format 1 = '||l_format||'.');
819:
820: IF (l_concatenate_format_flag = 'Y') THEN
821: IF l_return IS NOT NULL THEN
822: l_return := l_return || '/' || Find_Formatted_String(l_tmp_format, x_string);
821: IF l_return IS NOT NULL THEN
822: l_return := l_return || '/' || Find_Formatted_String(l_tmp_format, x_string);
823:
824: IF l_DEBUG in ('Y', 'C') THEN
825: cep_standard.debug('l_return not null = '||l_return||'.');
826: END IF;
827: ELSE
828: l_return := Find_Formatted_String(l_tmp_format, x_string);
829:
827: ELSE
828: l_return := Find_Formatted_String(l_tmp_format, x_string);
829:
830: IF l_DEBUG in ('Y', 'C') THEN
831: cep_standard.debug('l_return null = '||l_return||'.');
832: END IF;
833: END IF;
834: ELSE
835: l_return := Find_Formatted_String(l_format, X_string);
833: END IF;
834: ELSE
835: l_return := Find_Formatted_String(l_format, X_string);
836:
837: cep_standard.debug('concat = N - l_return = '||l_return||'.');
838:
839: IF l_return IS NOT NULL THEN
840: --l_return := Find_Formatted_String(l_format, X_string);
841: --RETURN l_return;
839: IF l_return IS NOT NULL THEN
840: --l_return := Find_Formatted_String(l_format, X_string);
841: --RETURN l_return;
842: IF l_DEBUG in ('Y', 'C') THEN
843: cep_standard.debug('concat = N - l_return not null = '||l_return||'.');
844: END IF;
845:
846: RETURN rtrim(l_return, '/');
847:
848: END IF;
849: END IF;
850:
851: IF l_return IS NOT NULL THEN
852: cep_standard.debug('l_return = '||l_return||'.');
853: END IF;
854:
855: l_tmp_format := SUBSTR(l_tmp_format, l_pos+1);
856: l_pos := INSTR(l_tmp_format, ',');
856: l_pos := INSTR(l_tmp_format, ',');
857: END LOOP;
858:
859: IF l_DEBUG in ('Y', 'C') THEN
860: cep_standard.debug('l_tmp_format 2 = '||l_tmp_format||'.');
861: END IF;
862:
863: IF (l_concatenate_format_flag = 'Y') THEN
864: IF l_return IS NOT NULL THEN
872: END IF;
873:
874: IF l_DEBUG in ('Y', 'C') THEN
875: l_return_tmp := rtrim(l_return, '/');
876: cep_standard.debug('l_return_tmp = '||l_return_tmp||'.');
877: END IF;
878:
879: RETURN rtrim(l_return, '/');
880:
901: l_row_id ROWID;
902: l_statement_number VARCHAR2(50);
903: BEGIN
904: IF l_DEBUG in ('Y', 'C') THEN
905: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Insert_Line');
906:
907: cep_standard.debug('Line_number -'||to_char(G_line_number)||'.');
908: cep_standard.debug('Statement Number -'||G_statement_number||'.');
909: cep_standard.debug('bank Account Num -'||G_bank_account_num||'.');
903: BEGIN
904: IF l_DEBUG in ('Y', 'C') THEN
905: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Insert_Line');
906:
907: cep_standard.debug('Line_number -'||to_char(G_line_number)||'.');
908: cep_standard.debug('Statement Number -'||G_statement_number||'.');
909: cep_standard.debug('bank Account Num -'||G_bank_account_num||'.');
910: cep_standard.debug('Trx_date -'||G_trx_date||'.');
911: cep_standard.debug('Trx_code -'||G_trx_code||'.');
904: IF l_DEBUG in ('Y', 'C') THEN
905: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Insert_Line');
906:
907: cep_standard.debug('Line_number -'||to_char(G_line_number)||'.');
908: cep_standard.debug('Statement Number -'||G_statement_number||'.');
909: cep_standard.debug('bank Account Num -'||G_bank_account_num||'.');
910: cep_standard.debug('Trx_date -'||G_trx_date||'.');
911: cep_standard.debug('Trx_code -'||G_trx_code||'.');
912: cep_standard.debug('Amount -'||to_char(G_amount)||'.');
905: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Insert_Line');
906:
907: cep_standard.debug('Line_number -'||to_char(G_line_number)||'.');
908: cep_standard.debug('Statement Number -'||G_statement_number||'.');
909: cep_standard.debug('bank Account Num -'||G_bank_account_num||'.');
910: cep_standard.debug('Trx_date -'||G_trx_date||'.');
911: cep_standard.debug('Trx_code -'||G_trx_code||'.');
912: cep_standard.debug('Amount -'||to_char(G_amount)||'.');
913: cep_standard.debug('Trx Text -'||G_trx_text||'.');
906:
907: cep_standard.debug('Line_number -'||to_char(G_line_number)||'.');
908: cep_standard.debug('Statement Number -'||G_statement_number||'.');
909: cep_standard.debug('bank Account Num -'||G_bank_account_num||'.');
910: cep_standard.debug('Trx_date -'||G_trx_date||'.');
911: cep_standard.debug('Trx_code -'||G_trx_code||'.');
912: cep_standard.debug('Amount -'||to_char(G_amount)||'.');
913: cep_standard.debug('Trx Text -'||G_trx_text||'.');
914: cep_standard.debug('Customer Text -'||G_customer_text||'.');
907: cep_standard.debug('Line_number -'||to_char(G_line_number)||'.');
908: cep_standard.debug('Statement Number -'||G_statement_number||'.');
909: cep_standard.debug('bank Account Num -'||G_bank_account_num||'.');
910: cep_standard.debug('Trx_date -'||G_trx_date||'.');
911: cep_standard.debug('Trx_code -'||G_trx_code||'.');
912: cep_standard.debug('Amount -'||to_char(G_amount)||'.');
913: cep_standard.debug('Trx Text -'||G_trx_text||'.');
914: cep_standard.debug('Customer Text -'||G_customer_text||'.');
915: cep_standard.debug('Invoice Text -'||G_invoice_text||'.');
908: cep_standard.debug('Statement Number -'||G_statement_number||'.');
909: cep_standard.debug('bank Account Num -'||G_bank_account_num||'.');
910: cep_standard.debug('Trx_date -'||G_trx_date||'.');
911: cep_standard.debug('Trx_code -'||G_trx_code||'.');
912: cep_standard.debug('Amount -'||to_char(G_amount)||'.');
913: cep_standard.debug('Trx Text -'||G_trx_text||'.');
914: cep_standard.debug('Customer Text -'||G_customer_text||'.');
915: cep_standard.debug('Invoice Text -'||G_invoice_text||'.');
916: cep_standard.debug('Bank Account Text -'||G_bank_account_text||'.');
909: cep_standard.debug('bank Account Num -'||G_bank_account_num||'.');
910: cep_standard.debug('Trx_date -'||G_trx_date||'.');
911: cep_standard.debug('Trx_code -'||G_trx_code||'.');
912: cep_standard.debug('Amount -'||to_char(G_amount)||'.');
913: cep_standard.debug('Trx Text -'||G_trx_text||'.');
914: cep_standard.debug('Customer Text -'||G_customer_text||'.');
915: cep_standard.debug('Invoice Text -'||G_invoice_text||'.');
916: cep_standard.debug('Bank Account Text -'||G_bank_account_text||'.');
917: cep_standard.debug('Effective Date -'||G_effective_date||'.');
910: cep_standard.debug('Trx_date -'||G_trx_date||'.');
911: cep_standard.debug('Trx_code -'||G_trx_code||'.');
912: cep_standard.debug('Amount -'||to_char(G_amount)||'.');
913: cep_standard.debug('Trx Text -'||G_trx_text||'.');
914: cep_standard.debug('Customer Text -'||G_customer_text||'.');
915: cep_standard.debug('Invoice Text -'||G_invoice_text||'.');
916: cep_standard.debug('Bank Account Text -'||G_bank_account_text||'.');
917: cep_standard.debug('Effective Date -'||G_effective_date||'.');
918: cep_standard.debug('Currency Code -'||G_line_currency_code||'.');
911: cep_standard.debug('Trx_code -'||G_trx_code||'.');
912: cep_standard.debug('Amount -'||to_char(G_amount)||'.');
913: cep_standard.debug('Trx Text -'||G_trx_text||'.');
914: cep_standard.debug('Customer Text -'||G_customer_text||'.');
915: cep_standard.debug('Invoice Text -'||G_invoice_text||'.');
916: cep_standard.debug('Bank Account Text -'||G_bank_account_text||'.');
917: cep_standard.debug('Effective Date -'||G_effective_date||'.');
918: cep_standard.debug('Currency Code -'||G_line_currency_code||'.');
919: cep_standard.debug('Exchange Rate -'||G_exchange_rate||'.');
912: cep_standard.debug('Amount -'||to_char(G_amount)||'.');
913: cep_standard.debug('Trx Text -'||G_trx_text||'.');
914: cep_standard.debug('Customer Text -'||G_customer_text||'.');
915: cep_standard.debug('Invoice Text -'||G_invoice_text||'.');
916: cep_standard.debug('Bank Account Text -'||G_bank_account_text||'.');
917: cep_standard.debug('Effective Date -'||G_effective_date||'.');
918: cep_standard.debug('Currency Code -'||G_line_currency_code||'.');
919: cep_standard.debug('Exchange Rate -'||G_exchange_rate||'.');
920: cep_standard.debug('Bank Trx Number -'||G_bank_trx_number||'.');
913: cep_standard.debug('Trx Text -'||G_trx_text||'.');
914: cep_standard.debug('Customer Text -'||G_customer_text||'.');
915: cep_standard.debug('Invoice Text -'||G_invoice_text||'.');
916: cep_standard.debug('Bank Account Text -'||G_bank_account_text||'.');
917: cep_standard.debug('Effective Date -'||G_effective_date||'.');
918: cep_standard.debug('Currency Code -'||G_line_currency_code||'.');
919: cep_standard.debug('Exchange Rate -'||G_exchange_rate||'.');
920: cep_standard.debug('Bank Trx Number -'||G_bank_trx_number||'.');
921: cep_standard.debug('Created By -'||G_user_id||'.');
914: cep_standard.debug('Customer Text -'||G_customer_text||'.');
915: cep_standard.debug('Invoice Text -'||G_invoice_text||'.');
916: cep_standard.debug('Bank Account Text -'||G_bank_account_text||'.');
917: cep_standard.debug('Effective Date -'||G_effective_date||'.');
918: cep_standard.debug('Currency Code -'||G_line_currency_code||'.');
919: cep_standard.debug('Exchange Rate -'||G_exchange_rate||'.');
920: cep_standard.debug('Bank Trx Number -'||G_bank_trx_number||'.');
921: cep_standard.debug('Created By -'||G_user_id||'.');
922: cep_standard.debug('Creation Date -'||to_char(SYSDATE)||'.');
915: cep_standard.debug('Invoice Text -'||G_invoice_text||'.');
916: cep_standard.debug('Bank Account Text -'||G_bank_account_text||'.');
917: cep_standard.debug('Effective Date -'||G_effective_date||'.');
918: cep_standard.debug('Currency Code -'||G_line_currency_code||'.');
919: cep_standard.debug('Exchange Rate -'||G_exchange_rate||'.');
920: cep_standard.debug('Bank Trx Number -'||G_bank_trx_number||'.');
921: cep_standard.debug('Created By -'||G_user_id||'.');
922: cep_standard.debug('Creation Date -'||to_char(SYSDATE)||'.');
923: cep_standard.debug('User Ex Rate -'||G_user_exchange_rate_type||'.');
916: cep_standard.debug('Bank Account Text -'||G_bank_account_text||'.');
917: cep_standard.debug('Effective Date -'||G_effective_date||'.');
918: cep_standard.debug('Currency Code -'||G_line_currency_code||'.');
919: cep_standard.debug('Exchange Rate -'||G_exchange_rate||'.');
920: cep_standard.debug('Bank Trx Number -'||G_bank_trx_number||'.');
921: cep_standard.debug('Created By -'||G_user_id||'.');
922: cep_standard.debug('Creation Date -'||to_char(SYSDATE)||'.');
923: cep_standard.debug('User Ex Rate -'||G_user_exchange_rate_type||'.');
924: cep_standard.debug('Exchange rate Date-'||G_exchange_rate_date||'.');
917: cep_standard.debug('Effective Date -'||G_effective_date||'.');
918: cep_standard.debug('Currency Code -'||G_line_currency_code||'.');
919: cep_standard.debug('Exchange Rate -'||G_exchange_rate||'.');
920: cep_standard.debug('Bank Trx Number -'||G_bank_trx_number||'.');
921: cep_standard.debug('Created By -'||G_user_id||'.');
922: cep_standard.debug('Creation Date -'||to_char(SYSDATE)||'.');
923: cep_standard.debug('User Ex Rate -'||G_user_exchange_rate_type||'.');
924: cep_standard.debug('Exchange rate Date-'||G_exchange_rate_date||'.');
925: cep_standard.debug('Original_Amount -'||G_original_amount||'.');
918: cep_standard.debug('Currency Code -'||G_line_currency_code||'.');
919: cep_standard.debug('Exchange Rate -'||G_exchange_rate||'.');
920: cep_standard.debug('Bank Trx Number -'||G_bank_trx_number||'.');
921: cep_standard.debug('Created By -'||G_user_id||'.');
922: cep_standard.debug('Creation Date -'||to_char(SYSDATE)||'.');
923: cep_standard.debug('User Ex Rate -'||G_user_exchange_rate_type||'.');
924: cep_standard.debug('Exchange rate Date-'||G_exchange_rate_date||'.');
925: cep_standard.debug('Original_Amount -'||G_original_amount||'.');
926: cep_standard.debug('Charges_Amount -'||G_charges_amount||'.');
919: cep_standard.debug('Exchange Rate -'||G_exchange_rate||'.');
920: cep_standard.debug('Bank Trx Number -'||G_bank_trx_number||'.');
921: cep_standard.debug('Created By -'||G_user_id||'.');
922: cep_standard.debug('Creation Date -'||to_char(SYSDATE)||'.');
923: cep_standard.debug('User Ex Rate -'||G_user_exchange_rate_type||'.');
924: cep_standard.debug('Exchange rate Date-'||G_exchange_rate_date||'.');
925: cep_standard.debug('Original_Amount -'||G_original_amount||'.');
926: cep_standard.debug('Charges_Amount -'||G_charges_amount||'.');
927:
920: cep_standard.debug('Bank Trx Number -'||G_bank_trx_number||'.');
921: cep_standard.debug('Created By -'||G_user_id||'.');
922: cep_standard.debug('Creation Date -'||to_char(SYSDATE)||'.');
923: cep_standard.debug('User Ex Rate -'||G_user_exchange_rate_type||'.');
924: cep_standard.debug('Exchange rate Date-'||G_exchange_rate_date||'.');
925: cep_standard.debug('Original_Amount -'||G_original_amount||'.');
926: cep_standard.debug('Charges_Amount -'||G_charges_amount||'.');
927:
928: cep_standard.debug('Insert Line'||to_char(G_line_number));
921: cep_standard.debug('Created By -'||G_user_id||'.');
922: cep_standard.debug('Creation Date -'||to_char(SYSDATE)||'.');
923: cep_standard.debug('User Ex Rate -'||G_user_exchange_rate_type||'.');
924: cep_standard.debug('Exchange rate Date-'||G_exchange_rate_date||'.');
925: cep_standard.debug('Original_Amount -'||G_original_amount||'.');
926: cep_standard.debug('Charges_Amount -'||G_charges_amount||'.');
927:
928: cep_standard.debug('Insert Line'||to_char(G_line_number));
929: END IF;
922: cep_standard.debug('Creation Date -'||to_char(SYSDATE)||'.');
923: cep_standard.debug('User Ex Rate -'||G_user_exchange_rate_type||'.');
924: cep_standard.debug('Exchange rate Date-'||G_exchange_rate_date||'.');
925: cep_standard.debug('Original_Amount -'||G_original_amount||'.');
926: cep_standard.debug('Charges_Amount -'||G_charges_amount||'.');
927:
928: cep_standard.debug('Insert Line'||to_char(G_line_number));
929: END IF;
930:
924: cep_standard.debug('Exchange rate Date-'||G_exchange_rate_date||'.');
925: cep_standard.debug('Original_Amount -'||G_original_amount||'.');
926: cep_standard.debug('Charges_Amount -'||G_charges_amount||'.');
927:
928: cep_standard.debug('Insert Line'||to_char(G_line_number));
929: END IF;
930:
931: IF G_format_type = 'SWIFT940' THEN
932: l_statement_number := G_statement_number || ' - ' || to_char(sysdate);
987: NULL, NULL, NULL, NULL, NULL,
988: NULL, NULL, NULL, NULL, NULL);
989: END IF;
990: IF l_DEBUG in ('Y', 'C') THEN
991: cep_standard.debug('<
993: EXCEPTION
994: WHEN OTHERS THEN
995: l_err := SQLCODE;
993: EXCEPTION
994: WHEN OTHERS THEN
995: l_err := SQLCODE;
996: IF l_DEBUG in ('Y', 'C') THEN
997: cep_standard.debug('EXCEPTION: CE_BANK_STATEMENT_LOADER.Insert_Line - '|| to_char(l_err));
998: END IF;
999: RAISE;
1000: END Insert_Line;
1001:
1205: return(l_result);
1206: EXCEPTION
1207: WHEN OTHERS THEN
1208: IF l_DEBUG in ('Y', 'C') THEN
1209: cep_standard.debug('EXCEPTION: Get_Value - X_pos '|| to_char(X_pos)||', X_rec_no '|| to_char(X_rec_no));
1210: END IF;
1211: RAISE;
1212: END Get_Value;
1213:
1263: X_position := 0;
1264: WHEN OTHERS THEN
1265: l_err := SQLCODE;
1266: IF l_DEBUG in ('Y', 'C') THEN
1267: cep_standard.debug('EXCEPTION: Lookup_Pos - '|| to_char(l_err));
1268: END IF;
1269: RAISE;
1270: END Lookup_Pos;
1271:
1462:
1463: l_str VARCHAR2(2000);
1464: BEGIN
1465: IF l_DEBUG in ('Y', 'C') THEN
1466: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Decode_Line_BAI');
1467: END IF;
1468:
1469: OPEN C_rec;
1470: FETCH C_rec
1497: G_original_amount := to_number(Lookup_Val('L', X_rec_no, 'ORIGINAL_AMOUNT', l_rec_len)) / G_line_precision;
1498: G_charges_amount := to_number(Lookup_Val('L', X_rec_no, 'CHARGES_AMOUNT', l_rec_len)) / G_line_precision;
1499:
1500: IF l_DEBUG in ('Y', 'C') THEN
1501: cep_standard.debug('<
1503: EXCEPTION
1504: WHEN OTHERS THEN
1505: l_err := SQLCODE;
1506: FND_MESSAGE.set_name('CE', 'CE_RECORD_FAIL');
1507: FND_MESSAGE.set_token('ERR', to_char(l_err));
1508: CE_SQLLDR_ERRORS_PKG.insert_row(G_statement_number, G_bank_account_num, nvl(X_rec_no, 0), fnd_message.get);
1509: IF l_DEBUG in ('Y', 'C') THEN
1510: cep_standard.debug('EXCEPTION: CE_BANK_STATEMENT_LOADER.Decode_Line_BAI - '|| to_char(l_err));
1511: END IF;
1512: END Decode_Line_BAI;
1513:
1514: /* ---------------------------------------------------------------------
1699:
1700: EXCEPTION
1701: WHEN OTHERS THEN
1702: IF l_DEBUG in ('Y', 'C') THEN
1703: cep_standard.debug('EXCEPTION: Find_Columns - X_cnt '|| to_char(X_cnt)||', X_rec_no '|| to_char(X_rec_no));
1704: END IF;
1705: RAISE;
1706: END Find_Columns;
1707:
1737: l_temp_val5 VARCHAR2(100);
1738: l_err NUMBER;
1739: BEGIN
1740: IF l_DEBUG in ('Y', 'C') THEN
1741: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Decode_Hdr_BAI');
1742: END IF;
1743:
1744: IF X_rec_id in ('3','03') THEN
1745: l_cnt := 3;
1869: END IF;
1870: END LOOP;
1871:
1872: IF l_DEBUG in ('Y', 'C') THEN
1873: cep_standard.debug('<
1875: EXCEPTION -- Bug 3608257 added this EXCEPTION section
1876: WHEN OTHERS THEN
1877: l_err := SQLCODE;
1877: l_err := SQLCODE;
1878: FND_MESSAGE.set_name('CE', 'CE_RECORD_FAIL');
1879: FND_MESSAGE.set_token('ERR', to_char(l_err));
1880: CE_SQLLDR_ERRORS_PKG.insert_row(G_statement_number, G_bank_account_num, nvl(X_rec_no, 0), fnd_message.get);
1881: cep_standard.debug('EXCEPTION: CE_BANK_STATEMENT_LOADER.Decode_Hdr_BAI - '|| to_char(l_err));
1882: END Decode_Hdr_BAI;
1883:
1884: /* ---------------------------------------------------------------------
1885: | PRIVATE FUNCTION |
1927: l_rec ce_stmt_int_tmp%rowtype; -- Bug 3228203
1928:
1929: BEGIN
1930: IF l_DEBUG in ('Y', 'C') THEN
1931: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Load_BAI');
1932: END IF;
1933:
1934: FOR C_rec IN C_tmp_tbl LOOP
1935: G_rec_no := C_rec.rec_no;
1934: FOR C_rec IN C_tmp_tbl LOOP
1935: G_rec_no := C_rec.rec_no;
1936:
1937: IF l_DEBUG in ('Y', 'C') THEN
1938: cep_standard.debug('CE_BANK_STATEMENT_LOADER.Load_BAI - G_rec_no = '||G_rec_no );
1939: END IF;
1940:
1941: IF ( G_rec_no = 1 AND
1942: C_rec.rec_id_no <> '01' ) THEN
1955: END IF;
1956: ELSIF C_rec.rec_id_no = '02' THEN
1957:
1958: IF l_DEBUG in ('Y', 'C') THEN
1959: cep_standard.debug('>>C_rec.rec_id_no = 02');
1960: END IF;
1961:
1962: G_statement_number := lookup_val('H', C_rec.rec_no, 'STATEMENT_NUMBER');
1963:
1961:
1962: G_statement_number := lookup_val('H', C_rec.rec_no, 'STATEMENT_NUMBER');
1963:
1964: IF l_DEBUG in ('Y', 'C') THEN
1965: cep_standard.debug('G_statement_number = '|| G_statement_number);
1966: END IF;
1967:
1968: G_statement_date := CONV_TIMESTAMP(lookup_val('H', C_rec.rec_no, 'STATEMENT_DATE') || ' ' || lookup_val('H', C_rec.rec_no, 'STATEMENT_TIMESTAMP'));
1969:
1967:
1968: G_statement_date := CONV_TIMESTAMP(lookup_val('H', C_rec.rec_no, 'STATEMENT_DATE') || ' ' || lookup_val('H', C_rec.rec_no, 'STATEMENT_TIMESTAMP'));
1969:
1970: IF l_DEBUG in ('Y', 'C') THEN
1971: cep_standard.debug('G_statement_date = '|| G_statement_date);
1972: END IF;
1973:
1974: IF G_statement_number IS NULL THEN
1975: FND_MESSAGE.set_name('CE', 'CE_SQLLDR_MISS_REQ_FIELD');
1995: IF (G_gl_date_source = 'STATEMENT') THEN
1996: G_gl_date := trunc(G_statement_date);
1997: END IF;
1998: IF l_DEBUG in ('Y', 'C') THEN
1999: cep_standard.debug('<
2001:
2002: ELSIF C_rec.rec_id_no = '03' THEN
2003: l_rec_cnt := 1;
2038: G_trx_code := lookup_val('L', C_rec.rec_no, 'TRX_CODE');
2039: G_amount := to_number(lookup_val('L', C_rec.rec_no, 'AMOUNT'))/G_line_precision;
2040:
2041: IF l_DEBUG in ('Y', 'C') THEN
2042: cep_standard.debug('Decode_Line_BAI(C_rec.rec_no) = ' );
2043: END IF;
2044:
2045: Decode_Line_BAI(C_rec.rec_no);
2046:
2125: G_include_indicator := C_rec1.include_format_ind;
2126: G_concatenate_format_flag := C_rec1.concatenate_format_flag;
2127:
2128: IF l_DEBUG in ('Y', 'C') THEN
2129: cep_standard.debug('C_rec.rec_id_no = 88 and l_last_rid = 16 ' );
2130: cep_standard.debug('G_predefined_format = '||G_predefined_format||'.');
2131: cep_standard.debug('G_include_indicator = '||G_include_indicator||'.');
2132: cep_standard.debug('G_concatenate_format_flag = '||G_concatenate_format_flag||'.');
2133: END IF;
2126: G_concatenate_format_flag := C_rec1.concatenate_format_flag;
2127:
2128: IF l_DEBUG in ('Y', 'C') THEN
2129: cep_standard.debug('C_rec.rec_id_no = 88 and l_last_rid = 16 ' );
2130: cep_standard.debug('G_predefined_format = '||G_predefined_format||'.');
2131: cep_standard.debug('G_include_indicator = '||G_include_indicator||'.');
2132: cep_standard.debug('G_concatenate_format_flag = '||G_concatenate_format_flag||'.');
2133: END IF;
2134:
2127:
2128: IF l_DEBUG in ('Y', 'C') THEN
2129: cep_standard.debug('C_rec.rec_id_no = 88 and l_last_rid = 16 ' );
2130: cep_standard.debug('G_predefined_format = '||G_predefined_format||'.');
2131: cep_standard.debug('G_include_indicator = '||G_include_indicator||'.');
2132: cep_standard.debug('G_concatenate_format_flag = '||G_concatenate_format_flag||'.');
2133: END IF;
2134:
2135: IF ( C_rec1.column_name = 'BANK_TRX_NUMBER' AND
2128: IF l_DEBUG in ('Y', 'C') THEN
2129: cep_standard.debug('C_rec.rec_id_no = 88 and l_last_rid = 16 ' );
2130: cep_standard.debug('G_predefined_format = '||G_predefined_format||'.');
2131: cep_standard.debug('G_include_indicator = '||G_include_indicator||'.');
2132: cep_standard.debug('G_concatenate_format_flag = '||G_concatenate_format_flag||'.');
2133: END IF;
2134:
2135: IF ( C_rec1.column_name = 'BANK_TRX_NUMBER' AND
2136: G_bank_trx_number IS NULL ) THEN
2164: G_charges_amount := Get_Formatted_String(C_rec.column1);
2165: END IF;
2166:
2167: IF l_DEBUG in ('Y', 'C') THEN
2168: cep_standard.debug('C_rec1.column_name = '||C_rec1.column_name||'.');
2169: cep_standard.debug('G_bank_trx_number = '||G_bank_trx_number||'.');
2170: cep_standard.debug('G_invoice_text = '||G_invoice_text ||'.');
2171: cep_standard.debug('G_customer_text = '||G_customer_text ||'.');
2172: cep_standard.debug('G_bank_account_text = '||G_bank_account_text ||'.');
2165: END IF;
2166:
2167: IF l_DEBUG in ('Y', 'C') THEN
2168: cep_standard.debug('C_rec1.column_name = '||C_rec1.column_name||'.');
2169: cep_standard.debug('G_bank_trx_number = '||G_bank_trx_number||'.');
2170: cep_standard.debug('G_invoice_text = '||G_invoice_text ||'.');
2171: cep_standard.debug('G_customer_text = '||G_customer_text ||'.');
2172: cep_standard.debug('G_bank_account_text = '||G_bank_account_text ||'.');
2173: cep_standard.debug('G_line_currency_code = '||G_line_currency_code ||'.');
2166:
2167: IF l_DEBUG in ('Y', 'C') THEN
2168: cep_standard.debug('C_rec1.column_name = '||C_rec1.column_name||'.');
2169: cep_standard.debug('G_bank_trx_number = '||G_bank_trx_number||'.');
2170: cep_standard.debug('G_invoice_text = '||G_invoice_text ||'.');
2171: cep_standard.debug('G_customer_text = '||G_customer_text ||'.');
2172: cep_standard.debug('G_bank_account_text = '||G_bank_account_text ||'.');
2173: cep_standard.debug('G_line_currency_code = '||G_line_currency_code ||'.');
2174: cep_standard.debug('G_user_exchange_rate_type = '||G_user_exchange_rate_type ||'.');
2167: IF l_DEBUG in ('Y', 'C') THEN
2168: cep_standard.debug('C_rec1.column_name = '||C_rec1.column_name||'.');
2169: cep_standard.debug('G_bank_trx_number = '||G_bank_trx_number||'.');
2170: cep_standard.debug('G_invoice_text = '||G_invoice_text ||'.');
2171: cep_standard.debug('G_customer_text = '||G_customer_text ||'.');
2172: cep_standard.debug('G_bank_account_text = '||G_bank_account_text ||'.');
2173: cep_standard.debug('G_line_currency_code = '||G_line_currency_code ||'.');
2174: cep_standard.debug('G_user_exchange_rate_type = '||G_user_exchange_rate_type ||'.');
2175: cep_standard.debug('G_exchange_rate_date = '||G_exchange_rate_date ||'.');
2168: cep_standard.debug('C_rec1.column_name = '||C_rec1.column_name||'.');
2169: cep_standard.debug('G_bank_trx_number = '||G_bank_trx_number||'.');
2170: cep_standard.debug('G_invoice_text = '||G_invoice_text ||'.');
2171: cep_standard.debug('G_customer_text = '||G_customer_text ||'.');
2172: cep_standard.debug('G_bank_account_text = '||G_bank_account_text ||'.');
2173: cep_standard.debug('G_line_currency_code = '||G_line_currency_code ||'.');
2174: cep_standard.debug('G_user_exchange_rate_type = '||G_user_exchange_rate_type ||'.');
2175: cep_standard.debug('G_exchange_rate_date = '||G_exchange_rate_date ||'.');
2176: cep_standard.debug('G_exchange_rate = '||G_exchange_rate ||'.');
2169: cep_standard.debug('G_bank_trx_number = '||G_bank_trx_number||'.');
2170: cep_standard.debug('G_invoice_text = '||G_invoice_text ||'.');
2171: cep_standard.debug('G_customer_text = '||G_customer_text ||'.');
2172: cep_standard.debug('G_bank_account_text = '||G_bank_account_text ||'.');
2173: cep_standard.debug('G_line_currency_code = '||G_line_currency_code ||'.');
2174: cep_standard.debug('G_user_exchange_rate_type = '||G_user_exchange_rate_type ||'.');
2175: cep_standard.debug('G_exchange_rate_date = '||G_exchange_rate_date ||'.');
2176: cep_standard.debug('G_exchange_rate = '||G_exchange_rate ||'.');
2177: cep_standard.debug('G_original_amount = '||G_original_amount ||'.');
2170: cep_standard.debug('G_invoice_text = '||G_invoice_text ||'.');
2171: cep_standard.debug('G_customer_text = '||G_customer_text ||'.');
2172: cep_standard.debug('G_bank_account_text = '||G_bank_account_text ||'.');
2173: cep_standard.debug('G_line_currency_code = '||G_line_currency_code ||'.');
2174: cep_standard.debug('G_user_exchange_rate_type = '||G_user_exchange_rate_type ||'.');
2175: cep_standard.debug('G_exchange_rate_date = '||G_exchange_rate_date ||'.');
2176: cep_standard.debug('G_exchange_rate = '||G_exchange_rate ||'.');
2177: cep_standard.debug('G_original_amount = '||G_original_amount ||'.');
2178: cep_standard.debug('G_charges_amount = '||G_charges_amount||'.');
2171: cep_standard.debug('G_customer_text = '||G_customer_text ||'.');
2172: cep_standard.debug('G_bank_account_text = '||G_bank_account_text ||'.');
2173: cep_standard.debug('G_line_currency_code = '||G_line_currency_code ||'.');
2174: cep_standard.debug('G_user_exchange_rate_type = '||G_user_exchange_rate_type ||'.');
2175: cep_standard.debug('G_exchange_rate_date = '||G_exchange_rate_date ||'.');
2176: cep_standard.debug('G_exchange_rate = '||G_exchange_rate ||'.');
2177: cep_standard.debug('G_original_amount = '||G_original_amount ||'.');
2178: cep_standard.debug('G_charges_amount = '||G_charges_amount||'.');
2179: END IF;
2172: cep_standard.debug('G_bank_account_text = '||G_bank_account_text ||'.');
2173: cep_standard.debug('G_line_currency_code = '||G_line_currency_code ||'.');
2174: cep_standard.debug('G_user_exchange_rate_type = '||G_user_exchange_rate_type ||'.');
2175: cep_standard.debug('G_exchange_rate_date = '||G_exchange_rate_date ||'.');
2176: cep_standard.debug('G_exchange_rate = '||G_exchange_rate ||'.');
2177: cep_standard.debug('G_original_amount = '||G_original_amount ||'.');
2178: cep_standard.debug('G_charges_amount = '||G_charges_amount||'.');
2179: END IF;
2180:
2173: cep_standard.debug('G_line_currency_code = '||G_line_currency_code ||'.');
2174: cep_standard.debug('G_user_exchange_rate_type = '||G_user_exchange_rate_type ||'.');
2175: cep_standard.debug('G_exchange_rate_date = '||G_exchange_rate_date ||'.');
2176: cep_standard.debug('G_exchange_rate = '||G_exchange_rate ||'.');
2177: cep_standard.debug('G_original_amount = '||G_original_amount ||'.');
2178: cep_standard.debug('G_charges_amount = '||G_charges_amount||'.');
2179: END IF;
2180:
2181: UPDATE ce_statement_lines_interface
2174: cep_standard.debug('G_user_exchange_rate_type = '||G_user_exchange_rate_type ||'.');
2175: cep_standard.debug('G_exchange_rate_date = '||G_exchange_rate_date ||'.');
2176: cep_standard.debug('G_exchange_rate = '||G_exchange_rate ||'.');
2177: cep_standard.debug('G_original_amount = '||G_original_amount ||'.');
2178: cep_standard.debug('G_charges_amount = '||G_charges_amount||'.');
2179: END IF;
2180:
2181: UPDATE ce_statement_lines_interface
2182: SET bank_trx_number = G_bank_trx_number,
2223: END IF;
2224:
2225: END LOOP;
2226: IF l_DEBUG in ('Y', 'C') THEN
2227: cep_standard.debug('<
2229: EXCEPTION
2230: WHEN OTHERS THEN
2231: l_err := SQLCODE;
2229: EXCEPTION
2230: WHEN OTHERS THEN
2231: l_err := SQLCODE;
2232: IF l_DEBUG in ('Y', 'C') THEN
2233: cep_standard.debug('EXCEPTION: CE_BANK_STATEMENT_LOADER.Load_BAI - '|| to_char(l_err) ||
2234: ' Rec no - '|| nvl(G_rec_no, 0));
2235: END IF;
2236: RAISE;
2237: END Load_BAI2;
2254: X_column_name VARCHAR2) IS
2255: l_err NUMBER;
2256: BEGIN
2257: IF l_DEBUG in ('Y', 'C') THEN
2258: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Decode_Hdr_Other');
2259: END IF;
2260:
2261: IF X_column_name = 'STATEMENT_NUMBER' THEN
2262: G_statement_number := Lookup_Val('H', X_rec_no, X_column_name);
2277: G_bank_branch_name := Lookup_Val('H', X_rec_no, X_column_name);
2278: END IF;
2279: ELSIF X_column_name = 'CONTROL_BEGIN_BALANCE' THEN
2280: IF l_DEBUG in ('Y', 'C') THEN
2281: cep_standard.debug('Decode_Hdr_Other: ' || 'G_hdr_precision: ' || to_char(G_hdr_precision));
2282: END IF;
2283: G_control_begin_balance := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2284: ELSIF X_column_name = 'CONTROL_END_BALANCE' THEN
2285: IF l_DEBUG in ('Y', 'C') THEN
2282: END IF;
2283: G_control_begin_balance := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2284: ELSIF X_column_name = 'CONTROL_END_BALANCE' THEN
2285: IF l_DEBUG in ('Y', 'C') THEN
2286: cep_standard.debug('Decode_Hdr_Other: ' || 'G_hdr_precision: ' || to_char(G_hdr_precision));
2287: END IF;
2288: G_control_end_balance := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2289: ELSIF X_column_name = 'AVAILABLE_BALANCE' THEN
2290: IF l_DEBUG in ('Y', 'C') THEN
2287: END IF;
2288: G_control_end_balance := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2289: ELSIF X_column_name = 'AVAILABLE_BALANCE' THEN
2290: IF l_DEBUG in ('Y', 'C') THEN
2291: cep_standard.debug('Decode_Hdr_Other: ' || 'G_hdr_precision: ' || to_char(G_hdr_precision));
2292: END IF;
2293: G_cashflow_balance := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2294: ELSIF X_column_name = 'VALUE_DATED_BALANCE' THEN
2295: IF l_DEBUG in ('Y', 'C') THEN
2292: END IF;
2293: G_cashflow_balance := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2294: ELSIF X_column_name = 'VALUE_DATED_BALANCE' THEN
2295: IF l_DEBUG in ('Y', 'C') THEN
2296: cep_standard.debug('Decode_Hdr_Other: ' || 'G_hdr_precision: ' || to_char(G_hdr_precision));
2297: END IF;
2298: G_int_calc_balance := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2299: ELSIF X_column_name = 'ONE_DAY_FLOAT' THEN
2300: IF l_DEBUG in ('Y', 'C') THEN
2297: END IF;
2298: G_int_calc_balance := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2299: ELSIF X_column_name = 'ONE_DAY_FLOAT' THEN
2300: IF l_DEBUG in ('Y', 'C') THEN
2301: cep_standard.debug('Decode_Hdr_Other: ' || 'G_hdr_precision: ' || to_char(G_hdr_precision));
2302: END IF;
2303: G_one_day_float := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2304: ELSIF X_column_name = 'TWO_DAY_FLOAT' THEN
2305: IF l_DEBUG in ('Y', 'C') THEN
2302: END IF;
2303: G_one_day_float := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2304: ELSIF X_column_name = 'TWO_DAY_FLOAT' THEN
2305: IF l_DEBUG in ('Y', 'C') THEN
2306: cep_standard.debug('Decode_Hdr_Other: ' || 'G_hdr_precision: ' || to_char(G_hdr_precision));
2307: END IF;
2308: G_two_day_float := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2309: ELSIF X_column_name = 'CONTROL_TOTAL_DR' THEN
2310: G_control_total_dr := fnd_number.canonical_to_number(Lookup_Val('H', X_rec_no, X_column_name)) / G_hdr_precision;
2327: G_gl_date := G_statement_date;
2328: END IF;
2329:
2330: IF l_DEBUG in ('Y', 'C') THEN
2331: cep_standard.debug('<
2333: EXCEPTION
2334: WHEN OTHERS THEN
2335: l_err := SQLCODE;
2336: FND_MESSAGE.set_name('CE', 'CE_RECORD_FAIL');
2337: FND_MESSAGE.set_token('ERR', to_char(l_err));
2338: CE_SQLLDR_ERRORS_PKG.insert_row(G_statement_number, G_bank_account_num, nvl(X_rec_no, 0), fnd_message.get);
2339: IF l_DEBUG in ('Y', 'C') THEN
2340: cep_standard.debug('EXCEPTION: CE_BANK_STATEMENT_LOADER.Decode_Hdr_Other - '|| to_char(l_err));
2341: END IF;
2342: END Decode_Hdr_Other;
2343:
2344: /* ---------------------------------------------------------------------
2360: l_err NUMBER;
2361: REQ_FIELD_MISSING EXCEPTION;
2362: BEGIN
2363: IF l_DEBUG in ('Y', 'C') THEN
2364: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Decode_Line_Other');
2365: END IF;
2366:
2367: IF X_column_name = 'LINE_NUMBER' THEN
2368: G_line_number := NVL(to_number(Lookup_Val('L', X_rec_no, X_column_name)), G_line_number);
2397: ELSIF X_column_name = 'BANK_ACCOUNT_TEXT' THEN
2398: G_bank_account_text := Lookup_Val('L', X_rec_no, X_column_name);
2399: END IF;
2400: IF l_DEBUG in ('Y', 'C') THEN
2401: cep_standard.debug('<
2403: EXCEPTION
2404: WHEN OTHERS THEN
2405: l_err := SQLCODE;
2406: FND_MESSAGE.set_name('CE', 'CE_RECORD_FAIL');
2407: FND_MESSAGE.set_token('ERR', to_char(l_err));
2408: CE_SQLLDR_ERRORS_PKG.insert_row(G_statement_number, G_bank_account_num, nvl(X_rec_no, 0), fnd_message.get);
2409: IF l_DEBUG in ('Y', 'C') THEN
2410: cep_standard.debug('EXCEPTION: CE_BANK_STATEMENT_LOADER.Decode_Line_Other - '||to_char(l_err));
2411: END IF;
2412: END Decode_Line_Other;
2413:
2414: FUNCTION Get_Main_Rec_ID (X_hdr_or_line VARCHAR2) RETURN VARCHAR2 IS
2458: WHEN OTHERS THEN
2459: l_err := SQLCODE;
2460: IF X_hdr_or_Line = 'L' THEN
2461: IF l_DEBUG in ('Y', 'C') THEN
2462: cep_standard.debug('Get_Main_Rec_ID: ' || 'EXCEPTION: Fail finding the record id of major line which contains
2463: the main line information - '|| to_char(l_err) ||
2464: ' Rec no - '|| nvl(G_rec_no, 0));
2465: END IF;
2466: ELSE
2464: ' Rec no - '|| nvl(G_rec_no, 0));
2465: END IF;
2466: ELSE
2467: IF l_DEBUG in ('Y', 'C') THEN
2468: cep_standard.debug('Get_Main_Rec_ID: ' || 'EXCEPTION: Fail finding the record id of major line which contains
2469: the main header information - ' || to_char(l_err) ||
2470: ' Rec no - '|| nvl(G_rec_no, 0));
2471: END IF;
2472: END IF;
2505:
2506: INVALID_ACCOUNT EXCEPTION;
2507: BEGIN
2508: IF l_DEBUG in ('Y', 'C') THEN
2509: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Load_Others');
2510: END IF;
2511:
2512: l_line_rec_id := Get_Main_Rec_ID('L');
2513: l_hdr_rec_id := Get_Main_Rec_ID('H');
2545: ELSIF ( G_hdr_precision <> 1 AND G_precision = 1 )THEN
2546: G_precision := G_hdr_precision;
2547: END IF;
2548: IF l_DEBUG in ('Y', 'C') THEN
2549: cep_standard.debug('G_precision: ' || to_char(G_precision));
2550: cep_standard.debug('G_hdr_precision: ' || to_char(G_hdr_precision));
2551: END IF;
2552:
2553: FOR C_hdr IN C_hdr_tbl(C_rec.rec_id_no) LOOP
2546: G_precision := G_hdr_precision;
2547: END IF;
2548: IF l_DEBUG in ('Y', 'C') THEN
2549: cep_standard.debug('G_precision: ' || to_char(G_precision));
2550: cep_standard.debug('G_hdr_precision: ' || to_char(G_hdr_precision));
2551: END IF;
2552:
2553: FOR C_hdr IN C_hdr_tbl(C_rec.rec_id_no) LOOP
2554: Decode_Hdr_Other(C_rec.rec_no, C_hdr.column_name);
2597: l_line_num := l_line_num + 1;
2598: END IF;
2599: ELSIF l_hdr_or_line = 'B' THEN
2600: IF l_DEBUG in ('Y', 'C') THEN
2601: cep_standard.debug('This rec_id '|| C_rec.rec_id_no ||' is assigned for both header and line');
2602: END IF;
2603: FND_MESSAGE.set_name('CE', 'CE_RECID_IN_HDR_LINE');
2604: FND_MESSAGE.set_token('RECID', C_rec.rec_id_no);
2605: CE_SQLLDR_ERRORS_PKG.insert_row(G_statement_number, G_bank_account_num, G_rec_no, fnd_message.get, 'E');
2623: Insert_Hdr;
2624: END IF;
2625: END IF;
2626: IF l_DEBUG in ('Y', 'C') THEN
2627: cep_standard.debug('<
2629: EXCEPTION
2630: WHEN INVALID_ACCOUNT THEN
2631: null;
2631: null;
2632: WHEN OTHERS THEN
2633: l_err := SQLCODE;
2634: IF l_DEBUG in ('Y', 'C') THEN
2635: cep_standard.debug('EXCEPTION: CE_BANK_STATEMENT_LOADER.Load_Others - '||to_char(l_err)||
2636: 'Rec no - '|| nvl(G_rec_no, 0));
2637: END IF;
2638: RAISE;
2639: END Load_Others;
2884: G_gl_date := SYSDATE;
2885: END IF;
2886:
2887: IF l_DEBUG in ('Y', 'C') THEN
2888: cep_standard.enable_debug(G_debug_path,
2889: G_debug_file || '-LBS');
2890: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Load_Bank_Statement');
2891: END IF;
2892: --
2886:
2887: IF l_DEBUG in ('Y', 'C') THEN
2888: cep_standard.enable_debug(G_debug_path,
2889: G_debug_file || '-LBS');
2890: cep_standard.debug('>>CE_BANK_STATEMENT_LOADER.Load_Bank_Statement');
2891: END IF;
2892: --
2893: -- Wait until SQL*Loader program is completed.
2894: --
2952: --
2953: G_precision := Get_Precision(nvl(l_precision, 0));
2954:
2955: IF l_DEBUG in ('Y', 'C') THEN
2956: cep_standard.debug('Load_Bank_Statement: ' || 'Format Type:'||l_format_type);
2957: cep_standard.debug('>>G_format_type= '||G_format_type);
2958: END IF;
2959:
2960:
2953: G_precision := Get_Precision(nvl(l_precision, 0));
2954:
2955: IF l_DEBUG in ('Y', 'C') THEN
2956: cep_standard.debug('Load_Bank_Statement: ' || 'Format Type:'||l_format_type);
2957: cep_standard.debug('>>G_format_type= '||G_format_type);
2958: END IF;
2959:
2960:
2961: IF G_format_type = 'BAI2' THEN
2959:
2960:
2961: IF G_format_type = 'BAI2' THEN
2962: IF l_DEBUG in ('Y', 'C') THEN
2963: cep_standard.debug('>>call Load_BAI2');
2964: END IF;
2965: Load_BAI2;
2966: ELSIF G_format_type = 'SWIFT940' THEN
2967: IF l_DEBUG in ('Y', 'C') THEN
2964: END IF;
2965: Load_BAI2;
2966: ELSIF G_format_type = 'SWIFT940' THEN
2967: IF l_DEBUG in ('Y', 'C') THEN
2968: cep_standard.debug('>>call Load_SWIFT940');
2969: END IF;
2970: Load_SWIFT940;
2971: ELSE
2972: IF l_DEBUG in ('Y', 'C') THEN
2969: END IF;
2970: Load_SWIFT940;
2971: ELSE
2972: IF l_DEBUG in ('Y', 'C') THEN
2973: cep_standard.debug('>>call Load_Others');
2974: END IF;
2975: Load_Others;
2976: END IF;
2977: Delete_Orphaned_Lines;
2989:
2990: CE_BANK_STMT_SQL_LDR.Print_Report(G_map_id, G_data_file_name);
2991:
2992: IF l_DEBUG in ('Y', 'C') THEN
2993: cep_standard.debug('<
2995: IF G_display_debug = 'Y' THEN
2996: cep_standard.disable_debug(G_display_debug);
2997: END IF;
2992: IF l_DEBUG in ('Y', 'C') THEN
2993: cep_standard.debug('<
2995: IF G_display_debug = 'Y' THEN
2996: cep_standard.disable_debug(G_display_debug);
2997: END IF;
2998: EXCEPTION
2999: WHEN SQL_LOADER_ERROR THEN
3000: IF l_DEBUG in ('Y', 'C') THEN
2997: END IF;
2998: EXCEPTION
2999: WHEN SQL_LOADER_ERROR THEN
3000: IF l_DEBUG in ('Y', 'C') THEN
3001: cep_standard.debug('EXCEPTION: Load_Bank_Statement - Sql*Loader was not finished');
3002: END IF;
3003: FND_MESSAGE.set_name('CE', 'CE_SQLLOADER_FAIL');
3004: CE_SQLLDR_ERRORS_PKG.insert_row(G_statement_number, G_bank_account_num, 0, fnd_message.get, 'E');
3005: CE_BANK_STMT_SQL_LDR.Print_Report(G_map_id, G_data_file_name);
3010: CE_BANK_STMT_SQL_LDR.Print_Report(G_map_id, G_data_file_name);
3011: WHEN OTHERS THEN
3012: l_err := SQLCODE;
3013: IF l_DEBUG in ('Y', 'C') THEN
3014: cep_standard.debug('EXCEPTION: Load_Bank_Statement - '||to_char(l_err));
3015: END IF;
3016: RAISE;
3017: END Load_Bank_Statement;
3018: