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 BINARY_INTEGER;
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 BINARY_INTEGER;
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 94: RA_CUSTOMER_TRX_LINES accordingly.

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

Line 141: corresponding line in ra_customer_trx_lines.

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

Line 144: RA_CUSTOMER_TRX_LINES table to make that search fast enough

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

Line 149: 5) Added deletes for ra_customer_trx_lines and ra_cust_trx_line_gl_dist

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

Line 174: INSERT INTO RA_CUSTOMER_TRX_LINES

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

Line 203: ra_customer_trx_lines_s.nextval,

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

Line 229: RA_CUSTOMER_TRX_LINES plin,

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

Line 231: RA_CUSTOMER_TRX_LINES inv_lin

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

Line 296: FROM RA_CUSTOMER_TRX_LINES tl,

292:
293: DELETE FROM RA_CUST_TRX_LINE_GL_DIST gld
294: WHERE customer_trx_line_id in (
295: SELECT tl.customer_trx_line_id
296: FROM RA_CUSTOMER_TRX_LINES tl,
297: ZX_LINES zx
298: WHERE tl.customer_trx_id = p_customer_trx_id
299: AND tl.line_type = 'TAX'
300: AND tl.tax_line_id IS NOT NULL

Line 313: DELETE FROM RA_CUSTOMER_TRX_LINES

309: END IF;
310:
311: /* NOTE: zx_lines_u2 uses only tax_line_id as key */
312:
313: DELETE FROM RA_CUSTOMER_TRX_LINES
314: WHERE customer_trx_id = p_customer_trx_id
315: AND line_type = 'TAX'
316: AND tax_line_id IN
317: (SELECT tax_line_id

Line 628: RA_CUSTOMER_TRX_LINES TL,

624: NULL merchant_party_tax_reg_number,
625: NULL asset_number
626: FROM
627: RA_CUSTOMER_TRX T,
628: RA_CUSTOMER_TRX_LINES TL,
629: RA_CUST_TRX_TYPES TT,
630: RA_CUST_TRX_LINE_GL_DIST REC
631: WHERE T.customer_trx_id = trx_id
632: AND T.cust_trx_type_id = TT.cust_trx_type_id

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

1129: | set_default_tax_classification
1130: |
1131: | DESCRIPTION
1132: | This routine copies the tax_classification back from
1133: | zx_lines to the corresponding LINE row in ra_customer_trx_lines.
1134: |
1135: |
1136: | ARGUMENTS : IN
1137: | p_request_id IN NUMBER

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

1156: l_rows_needing_update NUMBER;
1157: l_rows_updated NUMBER;
1158:
1159: CURSOR line_to_tax_class(p_request_id NUMBER, p_phase VARCHAR2) IS
1160: select /*+ index (tl RA_CUSTOMER_TRX_LINES_N4) */
1161: tl.customer_trx_line_id,
1162: nvl(tl.tax_classification_code, zx.output_tax_classification_code)
1163: from ra_customer_trx t,
1164: ra_customer_trx_lines tl,

Line 1164: ra_customer_trx_lines tl,

1160: select /*+ index (tl RA_CUSTOMER_TRX_LINES_N4) */
1161: tl.customer_trx_line_id,
1162: nvl(tl.tax_classification_code, zx.output_tax_classification_code)
1163: from ra_customer_trx t,
1164: ra_customer_trx_lines tl,
1165: ra_cust_trx_types tt,
1166: zx_lines_det_factors zx
1167: where t.request_id = p_request_id
1168: and t.cust_trx_type_id = tt.cust_trx_type_id

Line 1196: UPDATE ra_customer_trx_lines

1192:
1193: IF l_rows_needing_update > 0
1194: THEN
1195: FORALL i IN t_line_id.FIRST..t_line_id.LAST
1196: UPDATE ra_customer_trx_lines
1197: SET tax_classification_code = t_class_code(i)
1198: WHERE customer_trx_line_id = t_line_id(i);
1199: END IF;
1200:

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

1425: p_mode IN VARCHAR2,
1426: p_ra_app_id IN NUMBER,
1427: p_gt_id IN OUT NOCOPY number,
1428: p_from_llca_call IN varchar2 DEFAULT 'N',
1429: p_target_line_id IN ra_customer_trx_lines.customer_trx_line_id%TYPE DEFAULT NULL)
1430: IS
1431: l_gt_id NUMBER;
1432: l_return_status_service VARCHAR2(4000);
1433: l_msg_count NUMBER;

Line 1547: ra_customer_trx_lines tl

1543: DECODE(l_mode, 'EDISC', zx.tax_amt, NULL),
1544: DECODE(l_mode, 'UNEDISC',zx.tax_amt, NULL)
1545: FROM
1546: zx_lines zx,
1547: ra_customer_trx_lines tl
1548: WHERE
1549: zx.application_id = p_transaction_rec.application_id
1550: AND zx.entity_code = p_transaction_rec.entity_code
1551: AND zx.event_class_code = p_transaction_rec.event_class_code

Line 1598: ra_customer_trx_lines il

1594: DECODE(l_mode, 'UNEDISC',max(zx.line_amt) -
1595: sum(zx.tax_amt), NULL)
1596: FROM
1597: zx_lines zx,
1598: ra_customer_trx_lines il
1599: WHERE
1600: zx.application_id = p_transaction_rec.application_id
1601: AND zx.entity_code = p_transaction_rec.entity_code
1602: AND zx.event_class_code = p_transaction_rec.event_class_code

Line 2116: RA_CUSTOMER_TRX_LINES LINES,

2112: SR_HRL.location_id poo_location_id
2113: FROM
2114: RA_CUSTOMER_TRX TRX,
2115: RA_CUST_TRX_TYPES TT,
2116: RA_CUSTOMER_TRX_LINES LINES,
2117: AR_SYSTEM_PARAMETERS AR,
2118: FND_CURRENCIES CUR,
2119: HZ_CUST_ACCOUNTS BILL_CUST,
2120: HZ_PARTIES BILL_PARTY,

Line 2319: FROM ra_customer_trx_lines

2315: THEN
2316: BEGIN
2317: SELECT nvl(historical_flag, 'Y')
2318: INTO l_historical_flag
2319: FROM ra_customer_trx_lines
2320: WHERE line_type = 'LINE'
2321: AND customer_trx_id = p_target_id
2322: AND customer_trx_line_id = NVL(p_target_line_id,
2323: customer_trx_line_id)

Line 2393: FROM ra_customer_trx_lines line,

2389: SELECT sum(least(tax_line.extended_amount, line.tax_recoverable)),
2390: sum(nvl(line.tax_recoverable,0))
2391: INTO l_sum,
2392: l_total_tax_recov
2393: FROM ra_customer_trx_lines line,
2394: ra_customer_trx_lines tax_line
2395: WHERE line.customer_trx_id = p_target_id
2396: AND line.line_type = 'LINE'
2397: AND tax_line.link_to_cust_trx_line_id = line.customer_trx_line_id

Line 2394: ra_customer_trx_lines tax_line

2390: sum(nvl(line.tax_recoverable,0))
2391: INTO l_sum,
2392: l_total_tax_recov
2393: FROM ra_customer_trx_lines line,
2394: ra_customer_trx_lines tax_line
2395: WHERE line.customer_trx_id = p_target_id
2396: AND line.line_type = 'LINE'
2397: AND tax_line.link_to_cust_trx_line_id = line.customer_trx_line_id
2398: AND tax_line.line_type = 'TAX';

Line 2414: FROM ra_customer_trx_lines tl

2410: tl.line_recoverable))),
2411: sum(nvl(tl.tax_recoverable,0))
2412: INTO l_sum,
2413: l_total_tax_recov
2414: FROM ra_customer_trx_lines tl
2415: WHERE tl.customer_trx_id = p_target_id
2416: AND tl.customer_trx_line_id =
2417: NVL(p_target_line_id, tl.customer_trx_line_id)
2418: AND tl.line_type = 'LINE';

Line 2444: FROM RA_CUSTOMER_TRX_LINES

2440: allocated for tax. This sql uses link_to in order
2441: to find the tax lines for a given invoice line. */
2442: SELECT LEAST(c_tl.tax_recoverable, sum(extended_amount))
2443: INTO l_tax_amount
2444: FROM RA_CUSTOMER_TRX_LINES
2445: WHERE customer_trx_id = c_tl.inv_trx_id
2446: AND link_to_cust_trx_line_id = c_tl.inv_trx_line_id
2447: AND line_type = 'TAX';
2448:

Line 2743: UPDATE RA_CUSTOMER_TRX_LINES

2739:
2740: l_prorated_line := t_prorated_amt(c_tax_lines.adjusted_doc_line_id)
2741: - l_prorated_tax;
2742:
2743: UPDATE RA_CUSTOMER_TRX_LINES
2744: SET line_recoverable = line_recoverable + l_prorated_line,
2745: tax_recoverable = tax_recoverable + l_prorated_tax,
2746: last_updated_by = arp_standard.profile.user_id,
2747: last_update_date = sysdate

Line 2937: RA_CUSTOMER_TRX_LINES line,

2933: currency.precision precision,
2934: currency.minimum_accountable_unit mau
2935: FROM RA_CUSTOMER_TRX header,
2936: FND_CURRENCIES currency,
2937: RA_CUSTOMER_TRX_LINES line,
2938: RA_CUSTOMER_TRX_LINES tax
2939: WHERE header.CUSTOMER_TRX_ID = p_trx_id
2940: AND line.CUSTOMER_TRX_ID = header.CUSTOMER_TRX_ID
2941: AND line.LINE_TYPE = 'LINE'

Line 2938: RA_CUSTOMER_TRX_LINES tax

2934: currency.minimum_accountable_unit mau
2935: FROM RA_CUSTOMER_TRX header,
2936: FND_CURRENCIES currency,
2937: RA_CUSTOMER_TRX_LINES line,
2938: RA_CUSTOMER_TRX_LINES tax
2939: WHERE header.CUSTOMER_TRX_ID = p_trx_id
2940: AND line.CUSTOMER_TRX_ID = header.CUSTOMER_TRX_ID
2941: AND line.LINE_TYPE = 'LINE'
2942: AND tax.LINK_TO_CUST_TRX_LINE_ID = line.CUSTOMER_TRX_LINE_ID

Line 2960: RA_CUSTOMER_TRX_LINES line

2956: currency.precision precision,
2957: currency.minimum_accountable_unit mau
2958: FROM RA_CUSTOMER_TRX header,
2959: FND_CURRENCIES currency,
2960: RA_CUSTOMER_TRX_LINES line
2961: WHERE header.CUSTOMER_TRX_ID = p_trx_id
2962: AND line.CUSTOMER_TRX_ID = header.CUSTOMER_TRX_ID
2963: AND line.LINE_TYPE = 'LINE'
2964: AND nvl(line.gross_extended_amount,0) <> 0

Line 2968: FROM ra_customer_trx_lines tax

2964: AND nvl(line.gross_extended_amount,0) <> 0
2965: AND header.INVOICE_CURRENCY_CODE = currency.CURRENCY_CODE
2966: AND NOT EXISTS
2967: (SELECT 'any tax line'
2968: FROM ra_customer_trx_lines tax
2969: WHERE tax.customer_trx_id = line.customer_trx_id
2970: AND tax.link_to_cust_trx_line_id =
2971: line.customer_trx_line_id
2972: AND tax.line_type = 'TAX');

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

2971: line.customer_trx_line_id
2972: AND tax.line_type = 'TAX');
2973:
2974: CURSOR c_req(p_request_id NUMBER) IS
2975: SELECT /*+ index (line RA_CUSTOMER_TRX_LINES_N4) */
2976: line.CUSTOMER_TRX_LINE_ID customer_trx_line_id,
2977: sum(decode(line.extended_amount, 0, 0,
2978: tax.extended_amount)) inclusive_amount,
2979: header.invoice_currency_code currency_code,

Line 2985: RA_CUSTOMER_TRX_LINES line,

2981: currency.precision precision,
2982: currency.minimum_accountable_unit mau
2983: FROM RA_CUSTOMER_TRX header,
2984: FND_CURRENCIES currency,
2985: RA_CUSTOMER_TRX_LINES line,
2986: RA_CUSTOMER_TRX_LINES tax
2987: WHERE header.REQUEST_ID = p_request_id
2988: AND NVL(header.PREVIOUS_CUSTOMER_TRX_ID, -99) =
2989: DECODE(p_phase, 'CM', header.PREVIOUS_CUSTOMER_TRX_ID, -99)

Line 2986: RA_CUSTOMER_TRX_LINES tax

2982: currency.minimum_accountable_unit mau
2983: FROM RA_CUSTOMER_TRX header,
2984: FND_CURRENCIES currency,
2985: RA_CUSTOMER_TRX_LINES line,
2986: RA_CUSTOMER_TRX_LINES tax
2987: WHERE header.REQUEST_ID = p_request_id
2988: AND NVL(header.PREVIOUS_CUSTOMER_TRX_ID, -99) =
2989: DECODE(p_phase, 'CM', header.PREVIOUS_CUSTOMER_TRX_ID, -99)
2990: AND line.CUSTOMER_TRX_ID = header.CUSTOMER_TRX_ID

Line 3134: UPDATE ra_customer_trx_lines mtl

3130:
3131: IF p_trx_id IS NOT NULL
3132: THEN
3133:
3134: UPDATE ra_customer_trx_lines mtl
3135: SET line_recoverable = extended_amount,
3136: tax_recoverable = (select sum(extended_amount)
3137: from ra_customer_trx_lines sqtl
3138: where sqtl.link_to_cust_trx_line_id =

Line 3137: from ra_customer_trx_lines sqtl

3133:
3134: UPDATE ra_customer_trx_lines mtl
3135: SET line_recoverable = extended_amount,
3136: tax_recoverable = (select sum(extended_amount)
3137: from ra_customer_trx_lines sqtl
3138: where sqtl.link_to_cust_trx_line_id =
3139: mtl.customer_trx_line_id
3140: and sqtl.customer_trx_id =
3141: mtl.customer_trx_id

Line 3153: UPDATE ra_customer_trx_lines mtl

3149: /* mode logic is different here. if CM, then we need to join
3150: by previous_customer_trx_id, otherwise, NVL to -99. This allows this
3151: logic to be called for invoice copy (by request_id) but with phase not
3152: specified */
3153: UPDATE ra_customer_trx_lines mtl
3154: SET line_recoverable = extended_amount,
3155: tax_recoverable = (select sum(extended_amount)
3156: from ra_customer_trx_lines sqtl
3157: where sqtl.link_to_cust_trx_line_id =

Line 3156: from ra_customer_trx_lines sqtl

3152: specified */
3153: UPDATE ra_customer_trx_lines mtl
3154: SET line_recoverable = extended_amount,
3155: tax_recoverable = (select sum(extended_amount)
3156: from ra_customer_trx_lines sqtl
3157: where sqtl.link_to_cust_trx_line_id =
3158: mtl.customer_trx_line_id
3159: and sqtl.customer_trx_id =
3160: mtl.customer_trx_id

Line 3285: ra_customer_trx_lines ar_tax,

3281: l_tax_rate_id,
3282: l_sob_id,
3283: l_gl_date
3284: FROM
3285: ra_customer_trx_lines ar_tax,
3286: ra_cust_trx_line_gl_dist ar_rec
3287: WHERE
3288: ar_tax.customer_trx_line_id = p_subject_id
3289: AND ar_tax.customer_trx_id = ar_rec.customer_trx_id