66:
67: TYPE select_ips_rec_type IS RECORD
68: (
69: customer_trx_id NUMBER(15),
70: trx_number ra_customer_trx.trx_number%type,
71: cust_trx_type_id NUMBER(15),
72: trx_type ra_cust_trx_types.type%type,
73: trx_date DATE,
74: gl_date DATE,
74: gl_date DATE,
75: customer_id NUMBER(15),
76: site_use_id NUMBER(15),
77: reversed_cash_receipt_id NUMBER(15),
78: currency_code ra_customer_trx.invoice_currency_code%type,
79: precision NUMBER,
80: min_acc_unit NUMBER,
81: exchange_rate_type ra_customer_trx.exchange_rate_type%type,
82: exchange_rate NUMBER,
77: reversed_cash_receipt_id NUMBER(15),
78: currency_code ra_customer_trx.invoice_currency_code%type,
79: precision NUMBER,
80: min_acc_unit NUMBER,
81: exchange_rate_type ra_customer_trx.exchange_rate_type%type,
82: exchange_rate NUMBER,
83: exchange_date DATE,
84: term_id NUMBER(15),
85: first_installment_code ra_terms.first_installment_code%type,
96:
97: TYPE select_ira_rec_type IS RECORD
98: (
99: customer_trx_id NUMBER(15),
100: trx_number ra_customer_trx.trx_number%type,
101: cust_trx_type_id NUMBER(15),
102: post_to_gl_flag ra_cust_trx_types.post_to_gl%type,
103: credit_method ra_customer_trx.credit_method_for_installments%type,
104: trx_date DATE,
99: customer_trx_id NUMBER(15),
100: trx_number ra_customer_trx.trx_number%type,
101: cust_trx_type_id NUMBER(15),
102: post_to_gl_flag ra_cust_trx_types.post_to_gl%type,
103: credit_method ra_customer_trx.credit_method_for_installments%type,
104: trx_date DATE,
105: gl_date DATE,
106: customer_id NUMBER(15),
107: site_use_id NUMBER(15),
104: trx_date DATE,
105: gl_date DATE,
106: customer_id NUMBER(15),
107: site_use_id NUMBER(15),
108: currency_code ra_customer_trx.invoice_currency_code%type,
109: precision NUMBER,
110: min_acc_unit NUMBER,
111: exchange_rate_type ra_customer_trx.exchange_rate_type%type,
112: exchange_rate NUMBER,
107: site_use_id NUMBER(15),
108: currency_code ra_customer_trx.invoice_currency_code%type,
109: precision NUMBER,
110: min_acc_unit NUMBER,
111: exchange_rate_type ra_customer_trx.exchange_rate_type%type,
112: exchange_rate NUMBER,
113: exchange_date DATE,
114: rec_acctd_amount NUMBER,
115: total_cm_line_amount NUMBER,
145: adjusted_trx_id NUMBER(15),
146: subsequent_trx_id NUMBER(15),
147: commitment_trx_id NUMBER(15),
148: commitment_type ra_cust_trx_types.type%type,
149: ps_currency_code ra_customer_trx.invoice_currency_code%type,
150: ps_exchange_rate NUMBER,
151: ps_precision NUMBER,
152: ps_min_acc_unit NUMBER,
153: code_combination_id NUMBER(15),
179: precision NUMBER,
180: min_acc_unit NUMBER,
181: adjusted_trx_id NUMBER(15),
182: invoice_trx_id NUMBER(15),
183: ps_currency_code ra_customer_trx.invoice_currency_code%type,
184: ps_exchange_rate NUMBER,
185: ps_precision NUMBER,
186: ps_min_acc_unit NUMBER,
187: commitment_code NUMBER(15),
518: FROM
519: ra_terms t,
520: ra_terms_lines tl,
521: ra_cust_trx_types ctt,
522: ra_customer_trx ct,
523: ra_cust_trx_line_gl_dist ctlgd,
524: fnd_currencies c,
525: ra_customer_trx_lines ctl
526: WHERE ct.customer_trx_id = :customer_trx_id
521: ra_cust_trx_types ctt,
522: ra_customer_trx ct,
523: ra_cust_trx_line_gl_dist ctlgd,
524: fnd_currencies c,
525: ra_customer_trx_lines ctl
526: WHERE ct.customer_trx_id = :customer_trx_id
527: AND ctl.customer_trx_id = ctlgd.customer_trx_id
528: AND ctlgd.account_class = ''REC''
529: AND ctlgd.latest_rec_flag = ''Y''
1577: ar_payment_schedules ps,
1578: ar_adjustments adj,
1579: ra_cust_trx_types ctt,
1580: ra_cust_trx_line_gl_dist ctlgd,
1581: ra_customer_trx ct,
1582: fnd_currencies c,
1583: fnd_currencies c_inv,
1584: ra_customer_trx ct_inv,
1585: ra_cust_trx_line_gl_dist ctlgd_inv,
1580: ra_cust_trx_line_gl_dist ctlgd,
1581: ra_customer_trx ct,
1582: fnd_currencies c,
1583: fnd_currencies c_inv,
1584: ra_customer_trx ct_inv,
1585: ra_cust_trx_line_gl_dist ctlgd_inv,
1586: ra_customer_trx_lines ctl
1587: WHERE ct.customer_trx_id = :customer_trx_id
1588: and ctl.customer_trx_id = ct.customer_trx_id
1582: fnd_currencies c,
1583: fnd_currencies c_inv,
1584: ra_customer_trx ct_inv,
1585: ra_cust_trx_line_gl_dist ctlgd_inv,
1586: ra_customer_trx_lines ctl
1587: WHERE ct.customer_trx_id = :customer_trx_id
1588: and ctl.customer_trx_id = ct.customer_trx_id
1589: AND ct.cust_trx_type_id = ctt.cust_trx_type_id
1590: AND ctt.type = ''CM''
2842:
2843: /*Bug :2246098-Used a bind var for insert*/
2844:
2845: select ct.default_ussgl_transaction_code into l_ussgl_transaction_code
2846: from ra_customer_trx ct
2847: WHERE ct.customer_trx_id=p_select_rec.customer_trx_id;
2848:
2849: dbms_sql.bind_variable( p_insert_ra_c,
2850: 'user_id',
3622: ar_adjustments adj,
3623: fnd_currencies c,
3624: ra_terms t,
3625: ra_terms_lines tl,
3626: ra_customer_trx ct_com,
3627: ra_customer_trx_lines ctl_com,
3628: ra_customer_trx ct_ps,
3629: fnd_currencies c_ps,
3630: ra_customer_trx_lines ctl,
3623: fnd_currencies c,
3624: ra_terms t,
3625: ra_terms_lines tl,
3626: ra_customer_trx ct_com,
3627: ra_customer_trx_lines ctl_com,
3628: ra_customer_trx ct_ps,
3629: fnd_currencies c_ps,
3630: ra_customer_trx_lines ctl,
3631: ra_customer_trx ct,
3624: ra_terms t,
3625: ra_terms_lines tl,
3626: ra_customer_trx ct_com,
3627: ra_customer_trx_lines ctl_com,
3628: ra_customer_trx ct_ps,
3629: fnd_currencies c_ps,
3630: ra_customer_trx_lines ctl,
3631: ra_customer_trx ct,
3632: ra_cust_trx_line_gl_dist ctlgd
3626: ra_customer_trx ct_com,
3627: ra_customer_trx_lines ctl_com,
3628: ra_customer_trx ct_ps,
3629: fnd_currencies c_ps,
3630: ra_customer_trx_lines ctl,
3631: ra_customer_trx ct,
3632: ra_cust_trx_line_gl_dist ctlgd
3633: WHERE ct.customer_trx_id = :customer_trx_id
3634: and ctl.customer_trx_id = ct.customer_trx_id
3627: ra_customer_trx_lines ctl_com,
3628: ra_customer_trx ct_ps,
3629: fnd_currencies c_ps,
3630: ra_customer_trx_lines ctl,
3631: ra_customer_trx ct,
3632: ra_cust_trx_line_gl_dist ctlgd
3633: WHERE ct.customer_trx_id = :customer_trx_id
3634: and ctl.customer_trx_id = ct.customer_trx_id
3635: and ctlgd.customer_trx_id = ct.customer_trx_id
3637: and ctlgd.latest_rec_flag = ''Y''
3638: and ctl.line_type = ''LINE''
3639: and exists
3640: (select ''x''
3641: from ra_customer_trx trx
3642: where trx.customer_trx_id = ctl.customer_trx_id)
3643: and ctl.initial_customer_trx_line_id is not null
3644: and ct.invoice_currency_code = c.currency_code
3645: and ct.cust_trx_type_id = ctt.cust_trx_type_id
4177: /* Bug 3570404
4178: Guarantees use SELECT in build_ups_sql differently.
4179: The joins to PS are for the GUAR rather than the target
4180: invoice. This means that we have to use the line totals
4181: from ra_customer_trx_lines instead. */
4182: l_line_remaining := p_select_rec.total_line_amount;
4183:
4184: /* Following columns are not used for GUARs - but
4185: I choose to initialize them for clarity */
5198: ar_adjustments adj,
5199: ar_adjustments adjd,
5200: fnd_currencies c,
5201: fnd_currencies c_ps,
5202: ra_customer_trx ct_com,
5203: ra_customer_trx ct_inv,
5204: ra_customer_trx_lines ctl,
5205: ra_customer_trx ct,
5206: ra_cust_trx_line_gl_dist ctlgd
5199: ar_adjustments adjd,
5200: fnd_currencies c,
5201: fnd_currencies c_ps,
5202: ra_customer_trx ct_com,
5203: ra_customer_trx ct_inv,
5204: ra_customer_trx_lines ctl,
5205: ra_customer_trx ct,
5206: ra_cust_trx_line_gl_dist ctlgd
5207: WHERE ct.customer_trx_id = :customer_trx_id
5200: fnd_currencies c,
5201: fnd_currencies c_ps,
5202: ra_customer_trx ct_com,
5203: ra_customer_trx ct_inv,
5204: ra_customer_trx_lines ctl,
5205: ra_customer_trx ct,
5206: ra_cust_trx_line_gl_dist ctlgd
5207: WHERE ct.customer_trx_id = :customer_trx_id
5208: and ctl.customer_trx_id = ct.customer_trx_id
5201: fnd_currencies c_ps,
5202: ra_customer_trx ct_com,
5203: ra_customer_trx ct_inv,
5204: ra_customer_trx_lines ctl,
5205: ra_customer_trx ct,
5206: ra_cust_trx_line_gl_dist ctlgd
5207: WHERE ct.customer_trx_id = :customer_trx_id
5208: and ctl.customer_trx_id = ct.customer_trx_id
5209: and ctlgd.customer_trx_id = ct.customer_trx_id
5211: and ctlgd.latest_rec_flag = ''Y''
5212: and ctl.line_type = ''LINE''
5213: and exists
5214: (select ''x''
5215: from ra_customer_trx h
5216: where h.customer_trx_id = ctl.customer_trx_id)
5217: and ct.invoice_currency_code = c.currency_code
5218: and ct.cust_trx_type_id = ctt.cust_trx_type_id
5219: and ctt.type = ''CM''
5904:
5905: select nvl(sum(adj.line_adjusted),0)
5906: into l_cm_adjustment_total
5907: from ar_adjustments adj,
5908: ra_customer_trx ocm
5909: where adj.customer_trx_id = p_select_rec.adjusted_trx_id
5910: and adj.subsequent_trx_id = ocm.customer_trx_id
5911: and ocm.previous_customer_trx_id = p_select_rec.invoice_trx_id;
5912: