2: /* $Header: PSAMFTXB.pls 120.15 2006/09/13 14:00:54 agovil ship $ */
3:
4: g_cust_trx_id ra_customer_trx_all.customer_trx_id%type;
5: g_set_of_books_id ra_customer_trx_all.set_of_books_id%type;
6: g_receivables_ccid ra_cust_trx_line_gl_dist_all.code_combination_id%type;
7: g_run_id NUMBER;
8: --===========================FND_LOG.START=====================================
9: g_state_level NUMBER := FND_LOG.LEVEL_STATEMENT;
10: g_proc_level NUMBER := FND_LOG.LEVEL_PROCEDURE;
44: SELECT A.cust_trx_line_gl_dist_id gl_dist_id,
45: A.code_combination_id rev_ccid,
46: B.mf_receivables_ccid mf_ccid,
47: B.prev_mf_receivables_ccid prev_mf_ccid
48: FROM ra_cust_trx_line_gl_dist_all A,
49: psa_mf_trx_dist_all B
50: WHERE A.cust_trx_line_gl_dist_id = B.cust_trx_line_gl_dist_id
51: AND A.customer_trx_id = g_cust_trx_id;
52: /* bug 2737029
67: FOR UPDATE;
68:
69: l_trx_dist_rec c_trx_dist%rowtype;
70: l_trx_type c_trx_type%rowtype;
71: l_temp_rec_ccid ra_cust_trx_line_gl_dist_all.code_combination_id%type;
72:
73: l_errbuf VARCHAR2(2000);
74: l_retcode VARCHAR2(1);
75:
122: -- ========================= FND LOG ===========================
123:
124: SELECT code_combination_id
125: INTO g_receivables_ccid
126: FROM ra_cust_trx_line_gl_dist_all
127: WHERE customer_trx_id = g_cust_trx_id
128: AND account_class = 'REC'
129: AND account_set_flag = 'N';
130:
296: CURSOR c_trx_gl_dist
297: IS
298: SELECT cust_trx_line_gl_dist_id,
299: code_combination_id
300: FROM ra_cust_trx_line_gl_dist_all y
301: WHERE customer_trx_id = g_cust_trx_id
302: AND account_class <> 'REC'
303: AND NOT EXISTS ( SELECT 'x'
304: FROM psa_mf_trx_dist_all psa
310: WHERE x.customer_trx_line_id = y.customer_trx_line_id
311: AND NVL(extended_amount, 0) <> 0);
312: bug 2737029 */
313:
314: l_revenue_ccid ra_cust_trx_line_gl_dist_all.code_combination_id%type;
315: l_ccid ra_cust_trx_line_gl_dist_all.code_combination_id%type;
316: l_trx_gl_dist_rec c_trx_gl_dist%rowtype;
317: l_rowid ROWID;
318: -- ========================= FND LOG ===========================
311: AND NVL(extended_amount, 0) <> 0);
312: bug 2737029 */
313:
314: l_revenue_ccid ra_cust_trx_line_gl_dist_all.code_combination_id%type;
315: l_ccid ra_cust_trx_line_gl_dist_all.code_combination_id%type;
316: l_trx_gl_dist_rec c_trx_gl_dist%rowtype;
317: l_rowid ROWID;
318: -- ========================= FND LOG ===========================
319: l_full_path VARCHAR2(100) := g_path || 'generate_trx_dist';
331:
332: Delete FROM psa_mf_trx_dist_all
333: WHERE cust_trx_line_gl_dist_id In
334: (SELECT cust_trx_line_gl_dist_id
335: FROM ra_cust_trx_line_gl_dist_all
336: WHERE customer_trx_id = g_cust_trx_id)
337: AND posting_control_id IS NULL;
338:
339: -- ========================= FND LOG ===========================
487: FUNCTION transaction_modified RETURN BOOLEAN IS
488:
489: CURSOR c_core_trx_count IS
490: SELECT count(cust_trx_line_gl_dist_id) core_count
491: FROM ra_cust_trx_line_gl_dist_all
492: WHERE customer_trx_id = g_cust_trx_id
493: AND account_class <> 'REC';
494:
495: CURSOR c_mf_trx_count IS
493: AND account_class <> 'REC';
494:
495: CURSOR c_mf_trx_count IS
496: SELECT count(B.cust_trx_line_gl_dist_id) mf_dist_count
497: FROM ra_cust_trx_line_gl_dist_all A,
498: psa_mf_trx_dist_all B
499: WHERE A.cust_trx_line_gl_dist_id = B.cust_trx_line_gl_dist_id
500: AND A.customer_trx_id = g_cust_trx_id;
501:
526: -- Bug 3671841, Delete statement commented and now placed in PSAMFG2B.pls
527: /*
528: DELETE FROM psa_mf_trx_dist_all
529: WHERE cust_trx_line_gl_dist_id Not In
530: ( SELECT cust_trx_line_gl_dist_id FROM ra_cust_trx_line_gl_dist_all );
531: */
532:
533: -- ========================= FND LOG ===========================
534: psa_utils.debug_other_string(g_state_level,l_full_path,