44: p_Debug_Mode := 3;
45: END IF;
46:
47:
48: ec_debug.enable_debug(p_debug_mode);
49: ec_debug.pl ( 0, 'EC', 'ECE_PYO_START', NULL );
50: ec_debug.push('ECE_AP_TRANSACTION.Extract_PYO_Outbound');
51: ec_debug.pl(3,'Payment Instruction ID ',p_payment_instruction_id );
52: ec_debug.pl(3,'Debug Mode: ',p_debug_mode );
45: END IF;
46:
47:
48: ec_debug.enable_debug(p_debug_mode);
49: ec_debug.pl ( 0, 'EC', 'ECE_PYO_START', NULL );
50: ec_debug.push('ECE_AP_TRANSACTION.Extract_PYO_Outbound');
51: ec_debug.pl(3,'Payment Instruction ID ',p_payment_instruction_id );
52: ec_debug.pl(3,'Debug Mode: ',p_debug_mode );
53:
46:
47:
48: ec_debug.enable_debug(p_debug_mode);
49: ec_debug.pl ( 0, 'EC', 'ECE_PYO_START', NULL );
50: ec_debug.push('ECE_AP_TRANSACTION.Extract_PYO_Outbound');
51: ec_debug.pl(3,'Payment Instruction ID ',p_payment_instruction_id );
52: ec_debug.pl(3,'Debug Mode: ',p_debug_mode );
53:
54: i_Transaction_Type := 'PYO';
47:
48: ec_debug.enable_debug(p_debug_mode);
49: ec_debug.pl ( 0, 'EC', 'ECE_PYO_START', NULL );
50: ec_debug.push('ECE_AP_TRANSACTION.Extract_PYO_Outbound');
51: ec_debug.pl(3,'Payment Instruction ID ',p_payment_instruction_id );
52: ec_debug.pl(3,'Debug Mode: ',p_debug_mode );
53:
54: i_Transaction_Type := 'PYO';
55:
48: ec_debug.enable_debug(p_debug_mode);
49: ec_debug.pl ( 0, 'EC', 'ECE_PYO_START', NULL );
50: ec_debug.push('ECE_AP_TRANSACTION.Extract_PYO_Outbound');
51: ec_debug.pl(3,'Payment Instruction ID ',p_payment_instruction_id );
52: ec_debug.pl(3,'Debug Mode: ',p_debug_mode );
53:
54: i_Transaction_Type := 'PYO';
55:
56: /*
60:
61: insert_into_gt(p_payment_instruction_id);
62:
63:
64: ec_debug.pl (3, 'comes here');
65:
66: /*
67: IF NOT fnd_api.Compatible_API_Call(l_api_version,
68: p_api_version,
68: p_api_version,
69: l_api_name,
70: G_PKG_NAME)
71: THEN
72: ec_debug.pl (3, 'comes here');
73: RAISE fnd_api.g_exc_unexpected_error;
74: END IF;
75:
76: IF fnd_api.to_Boolean(p_init_msg_list) THEN
77: fnd_msg_pub.initialize;
78: END IF;
79:
80: x_return_status := fnd_api.g_ret_sts_success;
81: ec_debug.pl (3, 'comes here');
82: */
83:
84: x_return_status := fnd_api.g_ret_sts_success; -- bug:5512623
85:
88: -- Derive output filename
89: -- IF fnd_global.conc_request_id IS NOT NULL THEN
90:
91: i_file_id := IBY_EC_OP_FILE_NAME_EXT_PUB.get_File_Id(p_payment_instruction_id);
92: ec_debug.pl(3,'File Id returned from ext pub::',i_file_id );
93:
94:
95: IF i_file_id is null THEN
96: BEGIN
97: SELECT ece_output_runs_s.NEXTVAL INTO i_file_id
98: FROM DUAL;
99: EXCEPTION
100: WHEN NO_DATA_FOUND THEN
101: ec_debug.pl ( 0,
102: 'EC',
103: 'ECE_GET_NEXT_SEQ_FAILED',
104: 'PROGRESS_LEVEL',
105: xProgress,
108: );
109: END;
110: END IF;
111:
112: ec_debug.pl (3, 'comes here');
113:
114: ec_debug.pl ( 3, 'File ID ',i_file_id);
115:
116:
110: END IF;
111:
112: ec_debug.pl (3, 'comes here');
113:
114: ec_debug.pl ( 3, 'File ID ',i_file_id);
115:
116:
117: i_Filename := i_Transaction_Type || i_file_id || '.dat';
118:
119:
120: xProgress := 'PYO-10-1005';
121: fnd_profile.get ( 'ECE_OUT_FILE_PATH',
122: cOutput_path );
123: ec_debug.pl ( 3, 'cOutput_Path: ',cOutput_Path );
124:
125:
126:
127:
127:
128:
129:
130: xProgress := 'PYO-10-1030';
131: ec_debug.pl ( 0, 'EC', 'ECE_PAYMENT_BATCH', 'PAYMENT INSTRUCTION ID ', p_payment_instruction_id );
132:
133: fnd_file.put_line(fnd_file.log, 'Calling EC Process Outbound :: START ::'||systimestamp);
134:
135: ec_document.process_outbound(
156: p_data => x_msg_data);
157:
158:
159: IF ec_mapping_utils.ec_get_trans_upgrade_status(i_Transaction_Type) = 'U' THEN
160: ec_debug.pl(0,'EC','ECE_REC_TRANS_PENDING',NULL);
161: END IF;
162:
163: delete_from_gt;
164: ec_debug.pop ( 'ECE_AP_TRANSACTION.Extract_PYO_Outbound' );
160: ec_debug.pl(0,'EC','ECE_REC_TRANS_PENDING',NULL);
161: END IF;
162:
163: delete_from_gt;
164: ec_debug.pop ( 'ECE_AP_TRANSACTION.Extract_PYO_Outbound' );
165: ec_debug.disable_debug;
166: EXCEPTION
167: WHEN fnd_api.g_exc_error THEN
168: ROLLBACK;
161: END IF;
162:
163: delete_from_gt;
164: ec_debug.pop ( 'ECE_AP_TRANSACTION.Extract_PYO_Outbound' );
165: ec_debug.disable_debug;
166: EXCEPTION
167: WHEN fnd_api.g_exc_error THEN
168: ROLLBACK;
169: fnd_file.put_line(fnd_file.log, 'EXCEPTION :: END ::'||systimestamp);
169: fnd_file.put_line(fnd_file.log, 'EXCEPTION :: END ::'||systimestamp);
170: x_return_status := fnd_api.g_ret_sts_error;
171: fnd_msg_pub.count_and_get(p_count => x_msg_count,
172: p_data => x_msg_data);
173: ec_debug.disable_debug;
174: WHEN fnd_api.g_exc_unexpected_error THEN
175: ROLLBACK;
176: fnd_file.put_line(fnd_file.log, 'EXCEPTION :: END ::'||systimestamp);
177: x_return_status := fnd_api.g_ret_sts_unexp_error;
176: fnd_file.put_line(fnd_file.log, 'EXCEPTION :: END ::'||systimestamp);
177: x_return_status := fnd_api.g_ret_sts_unexp_error;
178: fnd_msg_pub.count_and_get(p_count => x_msg_count,
179: p_data => x_msg_data);
180: ec_debug.disable_debug;
181: WHEN OTHERS THEN
182: ROLLBACK;
183: fnd_file.put_line(fnd_file.log, 'EXCEPTION :: END ::'||systimestamp);
184: x_return_status := fnd_api.g_ret_sts_unexp_error;
188: END IF;
189: fnd_msg_pub.count_and_get(p_count => x_msg_count,
190: p_data => x_msg_data);
191:
192: ec_debug.disable_debug;
193: END Extract_PYO_Outbound;
194:
195:
196: PROCEDURE insert_into_gt(p_payment_instruction_id IN NUMBER)
196: PROCEDURE insert_into_gt(p_payment_instruction_id IN NUMBER)
197: IS
198:
199: BEGIN
200: ec_debug.push('ECE_AP_TRANSACTION.insert_into_gt');
201: ec_debug.pl (3, 'Fetching Payment data for Instruction',p_payment_instruction_id);
202: fnd_file.put_line(fnd_file.log, 'Calling insert_into_gt :: START ::'||systimestamp);
203:
204: INSERT INTO IBY_PYO_PAYMENT_GT(COMMUNICATION_METHOD,
197: IS
198:
199: BEGIN
200: ec_debug.push('ECE_AP_TRANSACTION.insert_into_gt');
201: ec_debug.pl (3, 'Fetching Payment data for Instruction',p_payment_instruction_id);
202: fnd_file.put_line(fnd_file.log, 'Calling insert_into_gt :: START ::'||systimestamp);
203:
204: INSERT INTO IBY_PYO_PAYMENT_GT(COMMUNICATION_METHOD,
205: TEST_FLAG,
781: AND ieba.branch_id = bapr.party_id(+)
782: AND ipay.payment_instruction_id = p_payment_instruction_id
783: AND ipay.payment_status = 'INSTRUCTION_CREATED';
784:
785: ec_debug.pl (3, 'Finished fetching Payment data');
786: ec_debug.pl (3, 'Fetching Invoice data');
787: fnd_file.put_line(fnd_file.log, 'Finished fetching Payment Data ::'||systimestamp);
788:
789: INSERT INTO IBY_PYO_INVOICE_GT(PAYMENT_ID,
782: AND ipay.payment_instruction_id = p_payment_instruction_id
783: AND ipay.payment_status = 'INSTRUCTION_CREATED';
784:
785: ec_debug.pl (3, 'Finished fetching Payment data');
786: ec_debug.pl (3, 'Fetching Invoice data');
787: fnd_file.put_line(fnd_file.log, 'Finished fetching Payment Data ::'||systimestamp);
788:
789: INSERT INTO IBY_PYO_INVOICE_GT(PAYMENT_ID,
790: PAYMENT_INSTRUCTION_ID,
956: AND idpa.payment_method_code = ipm.payment_method_code
957: AND ipa.payment_instruction_id = p_payment_instruction_id
958: AND idpa.document_status in ('PAYMENT_CREATED');
959:
960: ec_debug.pop ( 'ECE_AP_TRANSACTION.insert_into_gt');
961: fnd_file.put_line(fnd_file.log, 'Calling insert_into_gt :: END ::'||systimestamp);
962: END insert_into_gt;
963:
964:
963:
964:
965: PROCEDURE delete_from_gt IS
966: BEGIN
967: ec_debug.push('ECE_AP_TRANSACTION.delete_from_gt');
968: fnd_file.put_line(fnd_file.log, 'Calling delete_from_gt :: START ::'||systimestamp);
969: delete from IBY_PYO_PAYMENT_GT;
970: delete from IBY_PYO_INVOICE_GT;
971: fnd_file.put_line(fnd_file.log, 'Calling delete_from_gt :: END ::'||systimestamp);
968: fnd_file.put_line(fnd_file.log, 'Calling delete_from_gt :: START ::'||systimestamp);
969: delete from IBY_PYO_PAYMENT_GT;
970: delete from IBY_PYO_INVOICE_GT;
971: fnd_file.put_line(fnd_file.log, 'Calling delete_from_gt :: END ::'||systimestamp);
972: ec_debug.pop ( 'ECE_AP_TRANSACTION.delete_from_gt');
973: END delete_from_gt;
974:
975: END ece_ap_payment;
976: