DBA Data[Home] [Help]

APPS.ARP_ETAX_UTIL dependencies on RA_CUSTOMER_TRX_LINES

Line 9: g_tax_customer_trx_line_id ra_customer_trx_lines.customer_trx_line_id%type;

5: | Package Globals
6: +=======================================================================*/
7:
8: /* caching values for get_tax_account function */
9: g_tax_customer_trx_line_id ra_customer_trx_lines.customer_trx_line_id%type;
10: g_tax_rate_id NUMBER;
11: g_tax_account_ccid gl_code_combinations.code_combination_id%type;
12: g_interim_tax_ccid gl_code_combinations.code_combination_id%type;
13: g_adj_ccid gl_code_combinations.code_combination_id%type := -1;

Line 33: TABLE OF ra_customer_trx_lines_all.line_recoverable%type

29: pg_so_org_id VARCHAR2(20);
30: pg_org_id NUMBER;
31:
32: TYPE number_table_type IS
33: TABLE OF ra_customer_trx_lines_all.line_recoverable%type
34: INDEX BY VARCHAR2(100); --Bug 9763252
35:
36: TYPE l_line_id_type IS TABLE OF
37: ra_customer_trx_lines_all.customer_trx_line_id%type

Line 37: ra_customer_trx_lines_all.customer_trx_line_id%type

33: TABLE OF ra_customer_trx_lines_all.line_recoverable%type
34: INDEX BY VARCHAR2(100); --Bug 9763252
35:
36: TYPE l_line_id_type IS TABLE OF
37: ra_customer_trx_lines_all.customer_trx_line_id%type
38: INDEX BY BINARY_INTEGER;
39:
40: TYPE l_tax_classif_type IS TABLE OF
41: ra_customer_trx_lines_all.tax_classification_code%type

Line 41: ra_customer_trx_lines_all.tax_classification_code%type

37: ra_customer_trx_lines_all.customer_trx_line_id%type
38: INDEX BY BINARY_INTEGER;
39:
40: TYPE l_tax_classif_type IS TABLE OF
41: ra_customer_trx_lines_all.tax_classification_code%type
42: INDEX BY BINARY_INTEGER;
43:
44: /*========================================================================
45: | Prototype Declarations Procedures

Line 95: RA_CUSTOMER_TRX_LINES accordingly.

91: END IF;
92: END;
93:
94: /* Procedure to retrieve TAX lines from ZX and populate
95: RA_CUSTOMER_TRX_LINES accordingly.
96:
97: During later testing, we discovered that this procedure actually
98: needs to remove existing tax lines and distributions and create
99: new tax lines. At this point, we are leaving the call to autoaccounting

Line 142: corresponding line in ra_customer_trx_lines.

138: 3-MAR-05 along with my suggestion which was to have them add
139: a 45th column for link_to_trx_line_id or perhaps applied_to_trx_line_id
140: The idea for this is that they pass me the eTax line_id of the target
141: tax line and I use that to fetch the customer_trx_line_id of the
142: corresponding line in ra_customer_trx_lines.
143:
144: However, I'll probably need an index based on tax_line_id in
145: RA_CUSTOMER_TRX_LINES table to make that search fast enough
146:

Line 145: RA_CUSTOMER_TRX_LINES table to make that search fast enough

141: tax line and I use that to fetch the customer_trx_line_id of the
142: corresponding line in ra_customer_trx_lines.
143:
144: However, I'll probably need an index based on tax_line_id in
145: RA_CUSTOMER_TRX_LINES table to make that search fast enough
146:
147: 4) Changed from trx_line_id to trx_id per djancis. We have to
148: build all tax lines each time.
149:

Line 150: 5) Added deletes for ra_customer_trx_lines and ra_cust_trx_line_gl_dist

146:
147: 4) Changed from trx_line_id to trx_id per djancis. We have to
148: build all tax lines each time.
149:
150: 5) Added deletes for ra_customer_trx_lines and ra_cust_trx_line_gl_dist
151: tables.
152:
153: 6) Added logic to populate previous_customer_trx_line_id of CM
154: tax lines. Used Navigator to tweak for improved perf.

Line 175: INSERT INTO RA_CUSTOMER_TRX_LINES

171: End Dev Notes */
172:
173: /* Bug 5152340 - Removed delete logic to its own procedure */
174:
175: INSERT INTO RA_CUSTOMER_TRX_LINES
176: (
177: CUSTOMER_TRX_LINE_ID,
178: LAST_UPDATE_DATE,
179: LAST_UPDATED_BY,

Line 204: ra_customer_trx_lines_s.nextval,

200: PREVIOUS_CUSTOMER_TRX_ID, -- 5125882
201: ORG_ID
202: )
203: SELECT
204: ra_customer_trx_lines_s.nextval,
205: sysdate,
206: arp_standard.profile.user_id,
207: sysdate,
208: arp_standard.profile.user_id,

Line 230: RA_CUSTOMER_TRX_LINES plin,

226: inv_lin.customer_trx_line_id, -- invoice tax line id
227: inv_lin.customer_trx_id, -- inv trx_id, 5125882
228: plin.org_id
229: FROM ZX_LINES zxt,
230: RA_CUSTOMER_TRX_LINES plin,
231: ZX_LINES inv_zxt,
232: RA_CUSTOMER_TRX_LINES inv_lin
233: WHERE
234: zxt.application_id = 222

Line 232: RA_CUSTOMER_TRX_LINES inv_lin

228: plin.org_id
229: FROM ZX_LINES zxt,
230: RA_CUSTOMER_TRX_LINES plin,
231: ZX_LINES inv_zxt,
232: RA_CUSTOMER_TRX_LINES inv_lin
233: WHERE
234: zxt.application_id = 222
235: AND zxt.entity_code = 'TRANSACTIONS'
236: AND zxt.event_class_code in ('INVOICE','DEBIT_MEMO','CREDIT_MEMO')

Line 321: FROM RA_CUSTOMER_TRX_LINES tl,

317:
318: DELETE FROM RA_CUST_TRX_LINE_GL_DIST gld
319: WHERE customer_trx_line_id in (
320: SELECT tl.customer_trx_line_id
321: FROM RA_CUSTOMER_TRX_LINES tl,
322: ZX_LINES zx
323: WHERE tl.customer_trx_id = p_customer_trx_id
324: AND tl.line_type = 'TAX'
325: AND tl.tax_line_id IS NOT NULL

Line 338: DELETE FROM RA_CUSTOMER_TRX_LINES

334: END IF;
335:
336: /* NOTE: zx_lines_u2 uses only tax_line_id as key */
337:
338: DELETE FROM RA_CUSTOMER_TRX_LINES
339: WHERE customer_trx_id = p_customer_trx_id
340: AND line_type = 'TAX'
341: AND tax_line_id IN
342: (SELECT tax_line_id

Line 655: RA_CUSTOMER_TRX_LINES TL,

651: NULL merchant_party_tax_reg_number,
652: NULL asset_number
653: FROM
654: RA_CUSTOMER_TRX T,
655: RA_CUSTOMER_TRX_LINES TL,
656: RA_CUST_TRX_TYPES TT,
657: RA_CUST_TRX_LINE_GL_DIST REC
658: WHERE T.customer_trx_id = trx_id
659: AND T.cust_trx_type_id = TT.cust_trx_type_id

Line 1174: | zx_lines to the corresponding LINE row in ra_customer_trx_lines.

1170: | set_default_tax_classification
1171: |
1172: | DESCRIPTION
1173: | This routine copies the tax_classification back from
1174: | zx_lines to the corresponding LINE row in ra_customer_trx_lines.
1175: |
1176: |
1177: | ARGUMENTS : IN
1178: | p_request_id IN NUMBER

Line 1201: select /*+ index (tl RA_CUSTOMER_TRX_LINES_N4) */

1197: l_rows_needing_update NUMBER;
1198: l_rows_updated NUMBER;
1199:
1200: CURSOR line_to_tax_class(p_request_id NUMBER, p_phase VARCHAR2) IS
1201: select /*+ index (tl RA_CUSTOMER_TRX_LINES_N4) */
1202: tl.customer_trx_line_id,
1203: nvl(tl.tax_classification_code, zx.output_tax_classification_code)
1204: from ra_customer_trx t,
1205: ra_customer_trx_lines tl,

Line 1205: ra_customer_trx_lines tl,

1201: select /*+ index (tl RA_CUSTOMER_TRX_LINES_N4) */
1202: tl.customer_trx_line_id,
1203: nvl(tl.tax_classification_code, zx.output_tax_classification_code)
1204: from ra_customer_trx t,
1205: ra_customer_trx_lines tl,
1206: zx_lines_det_factors zx
1207: where t.request_id = p_request_id
1208: and t.customer_trx_id = tl.customer_trx_id
1209: and tl.line_type = 'LINE'

Line 1235: UPDATE ra_customer_trx_lines

1231:
1232: IF l_rows_needing_update > 0
1233: THEN
1234: FORALL i IN t_line_id.FIRST..t_line_id.LAST
1235: UPDATE ra_customer_trx_lines
1236: SET tax_classification_code = t_class_code(i)
1237: WHERE customer_trx_line_id = t_line_id(i);
1238: END IF;
1239:

Line 1493: p_target_line_id IN ra_customer_trx_lines.customer_trx_line_id%TYPE DEFAULT NULL)

1489: p_mode IN VARCHAR2,
1490: p_ra_app_id IN NUMBER,
1491: p_gt_id IN OUT NOCOPY number,
1492: p_from_llca_call IN varchar2 DEFAULT 'N',
1493: p_target_line_id IN ra_customer_trx_lines.customer_trx_line_id%TYPE DEFAULT NULL)
1494: IS
1495: l_gt_id NUMBER;
1496: l_return_status_service VARCHAR2(4000);
1497: l_msg_count NUMBER;

Line 1611: ra_customer_trx_lines tl

1607: DECODE(l_mode, 'EDISC', zx.tax_amt, NULL),
1608: DECODE(l_mode, 'UNEDISC',zx.tax_amt, NULL)
1609: FROM
1610: zx_lines zx,
1611: ra_customer_trx_lines tl
1612: WHERE
1613: zx.application_id = p_transaction_rec.application_id
1614: AND zx.entity_code = p_transaction_rec.entity_code
1615: AND zx.event_class_code = p_transaction_rec.event_class_code

Line 1662: ra_customer_trx_lines il

1658: DECODE(l_mode, 'UNEDISC',max(zx.line_amt) -
1659: sum(zx.tax_amt), NULL)
1660: FROM
1661: zx_lines zx,
1662: ra_customer_trx_lines il
1663: WHERE
1664: zx.application_id = p_transaction_rec.application_id
1665: AND zx.entity_code = p_transaction_rec.entity_code
1666: AND zx.event_class_code = p_transaction_rec.event_class_code

Line 2185: RA_CUSTOMER_TRX_LINES LINES,

2181: SR_HRL.location_id poo_location_id
2182: FROM
2183: RA_CUSTOMER_TRX TRX,
2184: RA_CUST_TRX_TYPES TT,
2185: RA_CUSTOMER_TRX_LINES LINES,
2186: AR_SYSTEM_PARAMETERS AR,
2187: FND_CURRENCIES CUR,
2188: HZ_CUST_ACCOUNTS BILL_CUST,
2189: HZ_PARTIES BILL_PARTY,

Line 2427: FROM ra_customer_trx_lines line,

2423: SELECT sum(least(tax_line.extended_amount, nvl(line.tax_recoverable, tax_line.extended_amount))),
2424: sum(nvl(line.tax_recoverable,0))
2425: INTO l_sum,
2426: l_total_tax_recov
2427: FROM ra_customer_trx_lines line,
2428: ra_customer_trx_lines tax_line
2429: WHERE line.customer_trx_id = p_target_id
2430: AND line.line_type = 'LINE'
2431: AND tax_line.link_to_cust_trx_line_id = line.customer_trx_line_id

Line 2428: ra_customer_trx_lines tax_line

2424: sum(nvl(line.tax_recoverable,0))
2425: INTO l_sum,
2426: l_total_tax_recov
2427: FROM ra_customer_trx_lines line,
2428: ra_customer_trx_lines tax_line
2429: WHERE line.customer_trx_id = p_target_id
2430: AND line.line_type = 'LINE'
2431: AND tax_line.link_to_cust_trx_line_id = line.customer_trx_line_id
2432: AND tax_line.line_type = 'TAX';

Line 2448: FROM ra_customer_trx_lines tl

2444: tl.line_recoverable))),
2445: sum(nvl(tl.tax_recoverable,0))
2446: INTO l_sum,
2447: l_total_tax_recov
2448: FROM ra_customer_trx_lines tl
2449: WHERE tl.customer_trx_id = p_target_id
2450: AND tl.customer_trx_line_id =
2451: NVL(p_target_line_id, tl.customer_trx_line_id)
2452: AND tl.line_type = 'LINE';

Line 2501: FROM RA_CUSTOMER_TRX_LINES

2497: allocated for tax. This sql uses link_to in order
2498: to find the tax lines for a given invoice line. */
2499: SELECT LEAST(nvl(c_tl.tax_recoverable, sum(extended_amount)), sum(extended_amount))
2500: INTO l_tax_amount
2501: FROM RA_CUSTOMER_TRX_LINES
2502: WHERE customer_trx_id = c_tl.inv_trx_id
2503: AND link_to_cust_trx_line_id = c_tl.inv_trx_line_id
2504: AND line_type = 'TAX';
2505:

Line 2800: UPDATE RA_CUSTOMER_TRX_LINES

2796:
2797: l_prorated_line := t_prorated_amt(c_tax_lines.adjusted_doc_line_id)
2798: - l_prorated_tax;
2799:
2800: UPDATE RA_CUSTOMER_TRX_LINES
2801: SET line_recoverable = line_recoverable + l_prorated_line,
2802: tax_recoverable = tax_recoverable + l_prorated_tax,
2803: last_updated_by = arp_standard.profile.user_id,
2804: last_update_date = sysdate

Line 2999: RA_CUSTOMER_TRX_LINES line,

2995: currency.precision precision,
2996: currency.minimum_accountable_unit mau
2997: FROM RA_CUSTOMER_TRX header,
2998: FND_CURRENCIES currency,
2999: RA_CUSTOMER_TRX_LINES line,
3000: RA_CUSTOMER_TRX_LINES tax
3001: WHERE header.CUSTOMER_TRX_ID = p_trx_id
3002: AND line.CUSTOMER_TRX_ID = header.CUSTOMER_TRX_ID
3003: AND line.LINE_TYPE = 'LINE'

Line 3000: RA_CUSTOMER_TRX_LINES tax

2996: currency.minimum_accountable_unit mau
2997: FROM RA_CUSTOMER_TRX header,
2998: FND_CURRENCIES currency,
2999: RA_CUSTOMER_TRX_LINES line,
3000: RA_CUSTOMER_TRX_LINES tax
3001: WHERE header.CUSTOMER_TRX_ID = p_trx_id
3002: AND line.CUSTOMER_TRX_ID = header.CUSTOMER_TRX_ID
3003: AND line.LINE_TYPE = 'LINE'
3004: AND tax.LINK_TO_CUST_TRX_LINE_ID = line.CUSTOMER_TRX_LINE_ID

Line 3022: RA_CUSTOMER_TRX_LINES line

3018: currency.precision precision,
3019: currency.minimum_accountable_unit mau
3020: FROM RA_CUSTOMER_TRX header,
3021: FND_CURRENCIES currency,
3022: RA_CUSTOMER_TRX_LINES line
3023: WHERE header.CUSTOMER_TRX_ID = p_trx_id
3024: AND line.CUSTOMER_TRX_ID = header.CUSTOMER_TRX_ID
3025: AND line.LINE_TYPE = 'LINE'
3026: AND nvl(line.gross_extended_amount,0) <> 0

Line 3030: FROM ra_customer_trx_lines tax

3026: AND nvl(line.gross_extended_amount,0) <> 0
3027: AND header.INVOICE_CURRENCY_CODE = currency.CURRENCY_CODE
3028: AND NOT EXISTS
3029: (SELECT 'any tax line'
3030: FROM ra_customer_trx_lines tax
3031: WHERE tax.customer_trx_id = line.customer_trx_id
3032: AND tax.link_to_cust_trx_line_id =
3033: line.customer_trx_line_id
3034: AND tax.line_type = 'TAX');

Line 3037: SELECT /*+ index (line RA_CUSTOMER_TRX_LINES_N4) */

3033: line.customer_trx_line_id
3034: AND tax.line_type = 'TAX');
3035:
3036: CURSOR c_req(p_request_id NUMBER) IS
3037: SELECT /*+ index (line RA_CUSTOMER_TRX_LINES_N4) */
3038: line.CUSTOMER_TRX_LINE_ID customer_trx_line_id,
3039: sum(decode(line.extended_amount, 0, 0,
3040: tax.extended_amount)) inclusive_amount,
3041: header.invoice_currency_code currency_code,

Line 3047: RA_CUSTOMER_TRX_LINES line,

3043: currency.precision precision,
3044: currency.minimum_accountable_unit mau
3045: FROM RA_CUSTOMER_TRX header,
3046: FND_CURRENCIES currency,
3047: RA_CUSTOMER_TRX_LINES line,
3048: RA_CUSTOMER_TRX_LINES tax
3049: WHERE header.REQUEST_ID = p_request_id
3050: AND NVL(header.PREVIOUS_CUSTOMER_TRX_ID, -99) =
3051: DECODE(p_phase, 'CM', header.PREVIOUS_CUSTOMER_TRX_ID, -99)

Line 3048: RA_CUSTOMER_TRX_LINES tax

3044: currency.minimum_accountable_unit mau
3045: FROM RA_CUSTOMER_TRX header,
3046: FND_CURRENCIES currency,
3047: RA_CUSTOMER_TRX_LINES line,
3048: RA_CUSTOMER_TRX_LINES tax
3049: WHERE header.REQUEST_ID = p_request_id
3050: AND NVL(header.PREVIOUS_CUSTOMER_TRX_ID, -99) =
3051: DECODE(p_phase, 'CM', header.PREVIOUS_CUSTOMER_TRX_ID, -99)
3052: AND line.CUSTOMER_TRX_ID = header.CUSTOMER_TRX_ID

Line 3196: UPDATE ra_customer_trx_lines mtl

3192:
3193: IF p_trx_id IS NOT NULL
3194: THEN
3195:
3196: UPDATE ra_customer_trx_lines mtl
3197: SET line_recoverable = extended_amount,
3198: tax_recoverable = (select sum(extended_amount)
3199: from ra_customer_trx_lines sqtl
3200: where sqtl.link_to_cust_trx_line_id =

Line 3199: from ra_customer_trx_lines sqtl

3195:
3196: UPDATE ra_customer_trx_lines mtl
3197: SET line_recoverable = extended_amount,
3198: tax_recoverable = (select sum(extended_amount)
3199: from ra_customer_trx_lines sqtl
3200: where sqtl.link_to_cust_trx_line_id =
3201: mtl.customer_trx_line_id
3202: and sqtl.customer_trx_id =
3203: mtl.customer_trx_id

Line 3215: UPDATE ra_customer_trx_lines mtl

3211: /* mode logic is different here. if CM, then we need to join
3212: by previous_customer_trx_id, otherwise, NVL to -99. This allows this
3213: logic to be called for invoice copy (by request_id) but with phase not
3214: specified */
3215: UPDATE ra_customer_trx_lines mtl
3216: SET line_recoverable = extended_amount,
3217: tax_recoverable = (select sum(extended_amount)
3218: from ra_customer_trx_lines sqtl
3219: where sqtl.link_to_cust_trx_line_id =

Line 3218: from ra_customer_trx_lines sqtl

3214: specified */
3215: UPDATE ra_customer_trx_lines mtl
3216: SET line_recoverable = extended_amount,
3217: tax_recoverable = (select sum(extended_amount)
3218: from ra_customer_trx_lines sqtl
3219: where sqtl.link_to_cust_trx_line_id =
3220: mtl.customer_trx_line_id
3221: and sqtl.customer_trx_id =
3222: mtl.customer_trx_id

Line 3347: ra_customer_trx_lines ar_tax,

3343: l_tax_rate_id,
3344: l_sob_id,
3345: l_gl_date
3346: FROM
3347: ra_customer_trx_lines ar_tax,
3348: ra_cust_trx_line_gl_dist ar_rec
3349: WHERE
3350: ar_tax.customer_trx_line_id = p_subject_id
3351: AND ar_tax.customer_trx_id = ar_rec.customer_trx_id