DBA Data[Home] [Help]

APPS.AR_INVOICE_UTILS dependencies on AR_TRX_LINES_GT

Line 1143: FROM ar_trx_lines_gt lgt,

1139: SELECT lgt.trx_header_id,
1140: lgt.trx_line_id,
1141: arp_standard.fnd_message('AR_INAPI_RULE_INFO_UNNECESSARY'),
1142: NVL(lgt.accounting_rule_id, lgt.accounting_rule_duration)
1143: FROM ar_trx_lines_gt lgt,
1144: ar_trx_header_gt hgt
1145: WHERE (lgt.accounting_rule_id IS NOT NULL
1146: OR lgt.accounting_rule_duration IS NOT NULL)
1147: AND lgt.trx_header_id = hgt.trx_header_id

Line 1160: FROM ar_trx_lines_gt gt

1156: SELECT trx_header_id,
1157: trx_line_id,
1158: arp_standard.fnd_message('AR_INAPI_INV_MASTER_LINE_TYPE'),
1159: link_to_trx_line_id
1160: FROM ar_trx_lines_gt gt
1161: WHERE gt.link_to_trx_line_id IS NOT NULL
1162: AND NOT EXISTS
1163: (SELECT 'X'
1164: FROM ar_trx_lines_gt gt2

Line 1164: FROM ar_trx_lines_gt gt2

1160: FROM ar_trx_lines_gt gt
1161: WHERE gt.link_to_trx_line_id IS NOT NULL
1162: AND NOT EXISTS
1163: (SELECT 'X'
1164: FROM ar_trx_lines_gt gt2
1165: WHERE gt2.trx_line_id = gt.link_to_trx_line_id
1166: AND gt2.line_type = 'LINE');
1167:
1168: -- Sub Lines can not have a line type of 'LINE'

Line 1178: FROM ar_trx_lines_gt gt

1174: SELECT trx_header_id,
1175: trx_line_id,
1176: arp_standard.fnd_message('AR_INAPI_INVALID_SUB_LINE_TYPE'),
1177: link_to_trx_line_id
1178: FROM ar_trx_lines_gt gt
1179: WHERE gt.link_to_trx_line_id IS NOT NULL
1180: AND gt.line_type NOT IN ('TAX', 'FREIGHT');
1181:
1182:

Line 1239: FROM ar_trx_lines_gt lgt

1235: SELECT trx_header_id,
1236: trx_line_id,
1237: arp_standard.fnd_message('AR_TAX_CHOOSE_YES_NO'),
1238: amount_includes_tax_flag
1239: FROM ar_trx_lines_gt lgt
1240: WHERE amount_includes_tax_flag IS NOT NULL
1241: AND amount_includes_tax_flag NOT IN ('Y', 'N');
1242:
1243: -- validate_bfb;

Line 1277: FROM ar_trx_lines_gt lgt

1273: null
1274: FROM ar_trx_header_gt gt
1275: WHERE NOT EXISTS
1276: (SELECT 'X'
1277: FROM ar_trx_lines_gt lgt
1278: WHERE lgt.trx_header_id = gt.trx_header_id);
1279:
1280: -- Every line level row should have a corresponding header level row.
1281: INSERT INTO ar_trx_errors_gt (

Line 1290: FROM ar_trx_lines_gt lgt

1286: SELECT trx_header_id,
1287: trx_line_id,
1288: arp_standard.fnd_message('AR_INAPI_ORPHAN_LINES'),
1289: null
1290: FROM ar_trx_lines_gt lgt
1291: WHERE NOT EXISTS
1292: (SELECT 'X'
1293: FROM ar_trx_header_gt hgt
1294: WHERE hgt.trx_header_id = lgt.trx_header_id);

Line 1306: FROM ar_trx_lines_gt lgt

1302: SELECT trx_header_id,
1303: trx_line_id,
1304: arp_standard.fnd_message('AR_INAPI_LINE_NUMS_NOT_UNIQUE'),
1305: lgt.line_number
1306: FROM ar_trx_lines_gt lgt
1307: WHERE EXISTS
1308: (SELECT 'X'
1309: FROM ar_trx_lines_gt lgt2
1310: WHERE lgt2.trx_header_id = lgt.trx_header_id

Line 1309: FROM ar_trx_lines_gt lgt2

1305: lgt.line_number
1306: FROM ar_trx_lines_gt lgt
1307: WHERE EXISTS
1308: (SELECT 'X'
1309: FROM ar_trx_lines_gt lgt2
1310: WHERE lgt2.trx_header_id = lgt.trx_header_id
1311: AND lgt2.line_number = lgt.line_number
1312: AND lgt2.line_type = lgt.line_type
1313: GROUP BY lgt2.trx_header_id, lgt2.line_number

Line 1326: FROM ar_trx_lines_gt lgt

1322: SELECT trx_header_id,
1323: trx_line_id,
1324: arp_standard.fnd_message('AR_INAPI_LINE_ID_NOT_UNIQUE'),
1325: null
1326: FROM ar_trx_lines_gt lgt
1327: WHERE EXISTS
1328: (SELECT 'X'
1329: FROM ar_trx_lines_gt lgt2
1330: WHERE lgt2.trx_header_id = lgt.trx_header_id

Line 1329: FROM ar_trx_lines_gt lgt2

1325: null
1326: FROM ar_trx_lines_gt lgt
1327: WHERE EXISTS
1328: (SELECT 'X'
1329: FROM ar_trx_lines_gt lgt2
1330: WHERE lgt2.trx_header_id = lgt.trx_header_id
1331: AND lgt2.trx_line_id = lgt.trx_line_id
1332: GROUP BY lgt2.trx_header_id, lgt2.trx_line_id
1333: HAVING count(*) > 1);

Line 4045: FROM ar_trx_lines_gt gt

4041: SELECT trx_header_id,
4042: trx_line_id,
4043: arp_standard.fnd_message('AR_INAPI_UOM_NOT_REQ'),
4044: gt.uom_code
4045: FROM ar_trx_lines_gt gt
4046: WHERE gt.uom_code IS NOT NULL
4047: AND gt.line_type <> 'LINE';
4048:
4049: -- UOM Code not allowed for CM

Line 4060: FROM ar_trx_lines_gt gt, ar_trx_header_gt gt2

4056: SELECT gt.trx_header_id,
4057: gt.trx_line_id,
4058: arp_standard.fnd_message('AR_INAPI_CM_UOM_NOT_ALLOWED'),
4059: gt.uom_code
4060: FROM ar_trx_lines_gt gt, ar_trx_header_gt gt2
4061: WHERE gt.uom_code IS NOT NULL
4062: AND gt.line_type = 'LINE'
4063: AND gt2.trx_header_id = gt.trx_header_id
4064: AND gt2.trx_class = 'CM'; -- added for ER 5869149

Line 4075: FROM ar_trx_lines_gt gt , ar_trx_header_gt gt2

4071: SELECT gt.trx_header_id,
4072: gt.trx_line_id,
4073: arp_standard.fnd_message('AR_INAPI_INVALID_UOM'),
4074: gt.uom_code
4075: FROM ar_trx_lines_gt gt , ar_trx_header_gt gt2
4076: WHERE gt.uom_code IS NOT NULL
4077: AND gt.line_type = 'LINE'
4078: AND gt2.trx_header_id = gt.trx_header_id
4079: AND gt2.trx_class <> 'CM' -- added for ER 5869149

Line 4160: FROM ar_trx_lines_gt gt

4156: SELECT trx_header_id,
4157: trx_line_id,
4158: arp_standard.fnd_message('AR_INAPI_INVALID_TAX_LINE'),
4159: gt.vat_tax_id
4160: FROM ar_trx_lines_gt gt
4161: WHERE extended_amount IS NULL
4162: AND line_type in ('TAX', 'FREIGHT');
4163:
4164: INSERT INTO ar_trx_errors_gt

Line 4173: FROM ar_trx_lines_gt gt

4169: SELECT trx_header_id,
4170: trx_line_id,
4171: arp_standard.fnd_message('AR_INAPI_QTY_NOT_ALLOWED'),
4172: gt.vat_tax_id
4173: FROM ar_trx_lines_gt gt
4174: WHERE line_type in ('TAX', 'FREIGHT')
4175: AND (quantity_invoiced IS NOT NULL
4176: OR unit_selling_price IS NOT NULL );
4177:

Line 4193: FROM ar_trx_lines_gt gt

4189: gt.tax || ', ' ||
4190: gt.tax_status_code || ', ' ||
4191: gt.tax_rate_code || ', ' ||
4192: gt.tax_jurisdiction_code
4193: FROM ar_trx_lines_gt gt
4194: WHERE line_type = 'TAX'
4195: AND gt.tax_regime_code ||
4196: gt.tax ||
4197: gt.tax_status_code ||

Line 4251: FROM ar_trx_lines_gt

4247: SELECT trx_header_id,
4248: trx_line_id,
4249: arp_standard.fnd_message('AR_INAPI_INV_TAX_EXEMPT_FLAG'),
4250: tax_exempt_flag
4251: FROM ar_trx_lines_gt
4252: WHERE tax_exempt_flag IS NOT NULL
4253: AND NOT EXISTS
4254: ( select 'X'
4255: from ar_lookups AL1

Line 4274: FROM ar_trx_lines_gt

4270: error_message)
4271: SELECT trx_header_id,
4272: trx_line_id,
4273: arp_standard.fnd_message('AR_INAPI_REASON_NOT_REQ')
4274: FROM ar_trx_lines_gt
4275: WHERE tax_exempt_flag = 'E'
4276: AND TAX_EXEMPT_REASON_CODE IS NULL;
4277:
4278: -- Also in case of 'R' and 'S' reason code and tax_exempt_number is not required.

Line 4279: UPDATE ar_trx_lines_gt

4275: WHERE tax_exempt_flag = 'E'
4276: AND TAX_EXEMPT_REASON_CODE IS NULL;
4277:
4278: -- Also in case of 'R' and 'S' reason code and tax_exempt_number is not required.
4279: UPDATE ar_trx_lines_gt
4280: SET TAX_EXEMPT_REASON_CODE = null,
4281: tax_exempt_number = null
4282: WHERE tax_exempt_flag in ( 'R', 'S');
4283:

Line 4294: FROM ar_trx_lines_gt

4290: SELECT trx_header_id,
4291: trx_line_id,
4292: arp_standard.fnd_message('AR_INAPI_INVALID_TAX_EXEMPT_CODE'),
4293: TAX_EXEMPT_REASON_CODE
4294: FROM ar_trx_lines_gt
4295: WHERE TAX_EXEMPT_REASON_CODE IS NOT null
4296: AND NOT EXISTS (
4297: SELECT 'X'
4298: FROM ar_lookups

Line 4340: FROM ar_trx_lines_gt gt

4336: SELECT trx_header_id,
4337: trx_line_id,
4338: arp_standard.fnd_message('AR_INAPI_REASON_NOT_REQ'),
4339: gt.reason_code
4340: FROM ar_trx_lines_gt gt
4341: WHERE gt.reason_code IS NOT NULL
4342: AND gt.line_type = 'TAX';
4343:
4344:

Line 4354: FROM ar_trx_lines_gt gt

4350: SELECT trx_header_id,
4351: trx_line_id,
4352: arp_standard.fnd_message('AR_INAPI_INVALID_REASON'),
4353: gt.reason_code
4354: FROM ar_trx_lines_gt gt
4355: WHERE gt.reason_code IS NOT NULL
4356: AND NOT EXISTS (
4357: select 'X'
4358: from ar_lookups

Line 4395: FROM ar_trx_lines_gt gt

4391: ( trx_header_id,
4392: error_message)
4393: SELECT trx_header_id,
4394: arp_standard.fnd_message('AR_INAPI_INV_DESC_NULL')
4395: FROM ar_trx_lines_gt gt
4396: WHERE gt.description IS NULL
4397: AND gt.inventory_item_id IS NULL
4398: AND gt.memo_line_id IS NULL
4399: AND gt.line_type = 'LINE';

Line 4408: FROM ar_trx_lines_gt gt

4404: error_message)
4405: SELECT trx_header_id,
4406: trx_line_id,
4407: arp_standard.fnd_message('AR_DAPI_MEMO_NAME_INVALID')
4408: FROM ar_trx_lines_gt gt
4409: WHERE gt.memo_line_id IS NOT NULL
4410: AND gt.line_type = 'LINE'
4411: AND NOT EXISTS (
4412: SELECT 'X'

Line 4427: UPDATE ar_trx_lines_gt gt

4423: ar_memo_lines_tl. Removed rownum = 1. This was
4424: just masking issues that would arise due to
4425: cartesian join. */
4426:
4427: UPDATE ar_trx_lines_gt gt
4428: SET description = ( SELECT description
4429: FROM ar_memo_lines_tl
4430: WHERE memo_line_id = gt.memo_line_id
4431: AND language = USERENV('LANG')

Line 4467: FROM ar_trx_lines_gt gt ,

4463: ( trx_header_id,
4464: error_message)
4465: SELECT gt.trx_header_id,
4466: arp_standard.fnd_message('AR_INAPI_QTY_NOT_NULL')
4467: FROM ar_trx_lines_gt gt ,
4468: ar_trx_header_gt gt2
4469: WHERE gt.quantity_invoiced IS NULL
4470: AND gt.trx_header_id = gt2.trx_header_id
4471: AND gt2.trx_class <> 'CM' -- added for ER 5869149

Line 4502: FROM ar_trx_lines_gt gt ,

4498: ( trx_header_id,
4499: error_message)
4500: SELECT gt.trx_header_id,
4501: arp_standard.fnd_message('AR_INAPI_UNIT_PRICE_NOT_NULL')
4502: FROM ar_trx_lines_gt gt ,
4503: ar_trx_header_gt gt2
4504: WHERE gt.unit_selling_price IS NULL
4505: AND gt.trx_header_id = gt2.trx_header_id
4506: AND gt2.trx_class <> 'CM' -- Added for ER 5869149

Line 4536: FROM ar_trx_lines_gt gt

4532: invalid_value )
4533: SELECT trx_header_id,
4534: arp_standard.fnd_message('AR_INAPI_INAVLID_LINE_TYPE'),
4535: gt.line_type
4536: FROM ar_trx_lines_gt gt
4537: WHERE gt.line_type not in ('LINE', 'TAX', 'FREIGHT');
4538: IF pg_debug = 'Y'
4539: THEN
4540: debug ('AR_INVOICE_UTILS.validate_line_type (-)' );

Line 4566: FROM ar_trx_lines_gt gt

4562: ( trx_header_id,
4563: error_message)
4564: SELECT trx_header_id,
4565: arp_standard.fnd_message('AR_INAPI_LINE_NUM_NOT_NULL')
4566: FROM ar_trx_lines_gt gt
4567: WHERE gt.line_number IS NULL;
4568:
4569: -- check for duplicate line number
4570: /* INSERT INTO ar_trx_errors_gt

Line 4575: FROM ar_trx_lines_gt gt

4571: ( trx_header_id,
4572: error_message
4573: SELECT trx_header_id,
4574: 'Duplicate Line Number'
4575: FROM ar_trx_lines_gt gt
4576: WHERE gt.line_number IS NOT NULL
4577: AND ; */
4578: IF pg_debug = 'Y'
4579: THEN

Line 4601: FROM ar_trx_lines_gt

4597: l_allow_freight_flag ra_cust_trx_types.allow_freight_flag%type;
4598: l_cust_trx_type_id ra_cust_trx_types.cust_trx_type_id%type;
4599: CURSOR c_freight IS
4600: SELECT trx_header_id, count(*) number_of_freight_lines
4601: FROM ar_trx_lines_gt
4602: WHERE line_type = 'FREIGHT'
4603: group by trx_header_id;
4604:
4605: BEGIN

Line 4621: FROM ar_trx_lines_gt gt

4617: error_message)
4618: SELECT trx_header_id,
4619: trx_line_id,
4620: arp_standard.fnd_message('AR_INAPI_HDR_ID_NOT_NULL')
4621: FROM ar_trx_lines_gt gt
4622: WHERE gt.trx_header_id IS NULL
4623: OR gt.trx_line_id IS NULL;
4624:
4625: -- Now check if the line is of Tax type then

Line 4634: FROM ar_trx_lines_gt gt

4630: error_message)
4631: SELECT trx_header_id,
4632: trx_line_id,
4633: arp_standard.fnd_message('AR_INAPI_LINK_LINE_ID_NOT_NULL')
4634: FROM ar_trx_lines_gt gt
4635: WHERE gt.line_type = 'TAX'
4636: AND gt.link_to_trx_line_id IS NULL;
4637:
4638: -- Vlaidate if line type is freight then whether

Line 4675: FROM ar_trx_lines_gt

4671: -- now check what type of freight record it has
4672: BEGIN
4673: SELECT count(*)
4674: INTO l_header_freight_count
4675: FROM ar_trx_lines_gt
4676: WHERE trx_header_id = c_freight_rec.trx_header_id
4677: AND link_to_trx_line_id IS NULL;
4678: EXCEPTION
4679: WHEN OTHERS THEN

Line 4685: FROM ar_trx_lines_gt

4681: END;
4682: BEGIN
4683: SELECT count(*)
4684: INTO l_line_freight_count
4685: FROM ar_trx_lines_gt
4686: WHERE trx_header_id = c_freight_rec.trx_header_id
4687: AND link_to_trx_line_id IS NOT NULL;
4688: EXCEPTION
4689: WHEN OTHERS THEN

Line 4735: FROM ar_trx_lines_gt gt

4731: error_message)
4732: SELECT trx_header_id,
4733: trx_line_id,
4734: arp_standard.fnd_message('AR_INAPI_INVALID_SHIP_VIA')
4735: FROM ar_trx_lines_gt gt
4736: WHERE gt.line_type = 'FREIGHT'
4737: AND gt.ship_via IS NOT NULL
4738: AND NOT EXISTS (
4739: SELECT 'X' FROM

Line 4753: FROM ar_trx_lines_gt gt

4749: error_message)
4750: SELECT trx_header_id,
4751: trx_line_id,
4752: arp_standard.fnd_message('AR_INAPI_INVALID_FOB')
4753: FROM ar_trx_lines_gt gt
4754: WHERE gt.line_type = 'FREIGHT'
4755: AND gt.fob_point IS NOT NULL
4756: AND NOT EXISTS (
4757: SELECT 'X' FROM

Line 4771: FROM ar_trx_lines_gt gt

4767: error_message)
4768: SELECT trx_header_id,
4769: trx_line_id,
4770: arp_standard.fnd_message('AR_INAPI_EXT_AMT_NOT_NULL')
4771: FROM ar_trx_lines_gt gt
4772: WHERE gt.line_type = 'FREIGHT'
4773: AND gt.extended_amount IS NULL;
4774:
4775: IF pg_debug = 'Y'

Line 4797: FROM ar_trx_lines_gt gt,

4793: SELECT gt.trx_header_id, gt.trx_line_id,
4794: gt2.creation_sign, gt.extended_amount,
4795: gt.revenue_amount, gt.quantity_invoiced,
4796: gt.unit_selling_price
4797: FROM ar_trx_lines_gt gt,
4798: ar_trx_header_gt gt2
4799: WHERE gt.line_type ='LINE'
4800: AND gt2.trx_header_id = gt.trx_header_id
4801: AND gt2.trx_class = 'CM';

Line 4810: from ar_trx_lines_gt

4806:
4807: Cursor c_ext_amt is
4808: select
4809: trx_line_id,extended_amount,quantity_invoiced,unit_selling_price,currency_code
4810: from ar_trx_lines_gt
4811: where extended_amount IS NULL;
4812:
4813: BEGIN
4814: IF pg_debug = 'Y'

Line 4827: UPDATE ar_trx_lines_gt

4823: For I in c_ext_amt
4824: Loop
4825: ext_amt := arpcurr.currround(I.quantity_invoiced *
4826: I.unit_selling_price,I.CURRENCY_CODE);
4827: UPDATE ar_trx_lines_gt
4828: SET extended_amount =ext_amt
4829: WHERE extended_amount IS NULL
4830: AND trx_line_id= I.trx_line_id;
4831: End Loop;

Line 4833: UPDATE ar_trx_lines_gt

4829: WHERE extended_amount IS NULL
4830: AND trx_line_id= I.trx_line_id;
4831: End Loop;
4832:
4833: UPDATE ar_trx_lines_gt
4834: SET revenue_amount = extended_amount
4835: WHERE revenue_amount IS NULL
4836: AND line_type <> 'TAX';
4837:

Line 5301: FROM ar_trx_lines_gt

5297: l_so_org_id fnd_profile_option_values.profile_option_value%type;
5298:
5299: CURSOR cItemFlex IS
5300: SELECT trx_header_id, trx_line_id,inventory_item_id, org_id
5301: FROM ar_trx_lines_gt
5302: WHERE inventory_item_id IS NOT NULL;
5303:
5304: BEGIN
5305: IF pg_debug = 'Y'

Line 5346: update ar_trx_lines_gt

5342: /*Bug 3844408*/
5343: /*This update should be fired only when the description isn't populated
5344: initially*/
5345: -- get the description
5346: update ar_trx_lines_gt
5347: SET description = (
5348: select description
5349: from mtl_system_items_vl
5350: WHERE inventory_item_id = cItemFlexRec.inventory_item_id

Line 5446: from ar_trx_lines_gt l

5442: select l.trx_line_id,
5443: l.trx_header_id,
5444: arp_standard.fnd_message('AR_RAXTRX_INV_WAREHOUSE'),
5445: l.warehouse_id
5446: from ar_trx_lines_gt l
5447: where l.line_type = 'LINE'
5448: and l.warehouse_id is not null
5449: and not exists (select 'x'
5450: from hr_organization_units hou,

Line 5490: FROM ar_trx_lines_gt line, ar_trx_header_gt hdr,

5486: SELECT line.trx_header_id, line.trx_line_id, hdr.invoicing_rule_id,
5487: line.ACCOUNTING_RULE_ID, line.ACCOUNTING_RULE_DURATION,
5488: line.RULE_START_DATE,line.RULE_END_DATE,line.set_of_books_id,hdr.trx_date,
5489: rr.type, rr.frequency, rr.occurrences
5490: FROM ar_trx_lines_gt line, ar_trx_header_gt hdr,
5491: ra_rules rr
5492: WHERE hdr.invoicing_rule_id IS NOT NULL
5493: AND line.accounting_rule_id IS NOT NULL
5494: AND hdr.trx_header_id = line.trx_header_id

Line 5516: FROM ar_trx_lines_gt gt , ar_trx_header_gt gt2

5512: error_message)
5513: SELECT gt.trx_header_id,
5514: gt.trx_line_id,
5515: arp_standard.fnd_message('AR_INAPI_INVALID_RULE_NAME')
5516: FROM ar_trx_lines_gt gt , ar_trx_header_gt gt2
5517: WHERE gt.accounting_rule_id IS NOT NULL
5518: AND gt2.trx_header_id = gt.trx_header_id
5519: AND gt2.trx_class <> 'CM' -- Added for ER 5869149
5520: AND NOT EXISTS (

Line 5534: FROM ar_trx_lines_gt gt, ar_trx_header_gt gth

5530: error_message)
5531: SELECT gt.trx_header_id,
5532: gt.trx_line_id,
5533: arp_standard.fnd_message('AR_INAPI_RULE_NAME_NOT_NULL')
5534: FROM ar_trx_lines_gt gt, ar_trx_header_gt gth
5535: WHERE gt.accounting_rule_id IS NULL
5536: AND gt.trx_header_id = gth.trx_header_id
5537: AND gth.invoicing_rule_id IS NOT NULL
5538: AND gth.trx_class <> 'CM' -- Added for ER 5869149

Line 5550: FROM ar_trx_lines_gt gt, ar_trx_header_gt gth

5546: error_message)
5547: SELECT gt.trx_header_id,
5548: gt.trx_line_id,
5549: arp_standard.fnd_message('AR_INAPI_RULE_NOT_ALLOWED')
5550: FROM ar_trx_lines_gt gt, ar_trx_header_gt gth
5551: WHERE (gt.accounting_rule_id IS NOT NULL
5552: OR gth.invoicing_rule_id IS NOT NULL)
5553: AND gt.trx_header_id = gth.trx_header_id
5554: AND gth.trx_class = 'CM' -- Added for ER 5257046

Line 5602: UPDATE ar_trx_lines_gt a

5598: ( c_invoicing_rule_rec.trx_header_id,
5599: c_invoicing_rule_rec.trx_line_id,
5600: arp_standard.fnd_message('AR_RAXTRX_RSD_LT_RED'));
5601: ELSE
5602: UPDATE ar_trx_lines_gt a
5603: SET ACCOUNTING_RULE_DURATION =
5604: (SELECT COUNT(*)
5605: FROM ar_periods gps,
5606: ra_rules rr2,

Line 5639: UPDATE ar_trx_lines_gt

5635: ( c_invoicing_rule_rec.trx_header_id,
5636: c_invoicing_rule_rec.trx_line_id,
5637: arp_standard.fnd_message('AR_INAPI_RULE_DUR_NOT_NULL' ));
5638: ELSE
5639: UPDATE ar_trx_lines_gt
5640: SET ACCOUNTING_RULE_DURATION = c_invoicing_rule_rec.occurrences
5641: WHERE trx_line_id = c_invoicing_rule_rec.trx_line_id
5642: AND trx_header_id = c_invoicing_rule_rec.trx_header_id;
5643: END IF;

Line 5651: UPDATE ar_trx_lines_gt

5647: -- validate the user supplied value
5648: IF c_invoicing_rule_rec.ACCOUNTING_RULE_DURATION <>
5649: c_invoicing_rule_rec.occurrences
5650: THEN
5651: UPDATE ar_trx_lines_gt
5652: SET ACCOUNTING_RULE_DURATION = c_invoicing_rule_rec.occurrences
5653: WHERE trx_line_id = c_invoicing_rule_rec.trx_line_id
5654: AND trx_header_id = c_invoicing_rule_rec.trx_header_id;
5655: END IF;

Line 5698: UPDATE ar_trx_lines_gt

5694: THEN
5695: IF c_invoicing_rule_rec.rule_start_date <>
5696: l_rule_start_date
5697: THEN
5698: UPDATE ar_trx_lines_gt
5699: SET rule_start_date = l_rule_start_date
5700: WHERE trx_line_id = c_invoicing_rule_rec.trx_line_id
5701: AND trx_header_id = c_invoicing_rule_rec.trx_header_id;
5702: END IF;

Line 5785: FROM ar_trx_lines_gt gt

5781: SELECT trx_header_id,
5782: trx_line_id,
5783: arp_standard.fnd_message('AR_INAPI_INVALID_USSGL_CODE'),
5784: default_ussgl_transaction_code
5785: FROM ar_trx_lines_gt gt
5786: WHERE gt.default_ussgl_transaction_code IS NOT NULL
5787: AND NOT EXISTS
5788: (SELECT 'X'
5789: FROM gl_ussgl_transaction_codes gutc

Line 5822: UPDATE ar_trx_lines_gt gt

5818: x_return_status := FND_API.G_RET_STS_SUCCESS;
5819:
5820: -- check if memo line is passed and any unit of measue and unit price.
5821: BEGIN
5822: UPDATE ar_trx_lines_gt gt
5823: set gt.unit_selling_price =
5824: ( SELECT m.unit_std_price
5825: FROM ar_memo_lines_vl m
5826: WHERE m.memo_line_id = gt.memo_line_id

Line 5831: UPDATE ar_trx_lines_gt gt

5827: AND gt.memo_line_id IS NOT NULL
5828: AND sysdate between m.start_date and nvl(m.end_date,sysdate))
5829: WHERE gt.unit_selling_price IS NULL;
5830:
5831: UPDATE ar_trx_lines_gt gt
5832: set gt.uom_code =
5833: ( SELECT m.uom_code
5834: FROM ar_memo_lines_vl m
5835: WHERE m.memo_line_id = gt.memo_line_id

Line 6820: ar_trx_lines_GT L

6816: L.trx_line_id,
6817: D.trx_DIST_ID,
6818: arp_standard.fnd_message('AR_INAPI_ONLY_PER_ALLOWED')
6819: FROM ar_trx_DIST_gt D,
6820: ar_trx_lines_GT L
6821: WHERE (L.ACCOUNTING_RULE_ID IS NOT NULL
6822: OR D.ACCOUNT_CLASS = 'REC')
6823: AND d.PERCENT IS NULL
6824: --AND L.trx_line_ID = D.trx_line_ID;

Line 6846: ar_trx_LINES_GT L

6842: L.trx_LINE_ID,
6843: D.trx_DIST_ID,
6844: arp_standard.fnd_message('AR_INAPI_INAVLID_LINE_TYPE')
6845: FROM ar_trx_dist_gt D,
6846: ar_trx_LINES_GT L
6847: WHERE L.trx_LINE_ID = D.trx_LINE_ID
6848: AND DECODE(D.ACCOUNT_CLASS,
6849: 'TAX', 'TAX',
6850: 'FREIGHT','FREIGHT',

Line 6872: ar_trx_LINES_GT L

6868: C.MINIMUM_ACCOUNTABLE_UNIT) *
6869: C.MINIMUM_ACCOUNTABLE_UNIT
6870: )
6871: FROM FND_CURRENCIES C,
6872: ar_trx_LINES_GT L
6873: WHERE L.CURRENCY_CODE = C.CURRENCY_CODE
6874: AND L.trx_LINE_ID = D.trx_LINE_ID
6875: )
6876: WHERE ACCOUNT_CLASS IN ('REV', 'TAX', 'FREIGHT','CHARGES')

Line 6881: FROM ar_trx_LINES_GT L

6877: AND D.PERCENT IS NOT NULL
6878: AND d.amount IS NULL
6879: AND EXISTS
6880: (SELECT 'X'
6881: FROM ar_trx_LINES_GT L
6882: WHERE L.trx_LINE_ID = D.trx_LINE_ID
6883: AND L.ACCOUNTING_RULE_ID IS NULL);
6884:
6885:

Line 6903: ar_trx_LINES_GT L

6899: SELECT DECODE(L.extended_AMOUNT,
6900: 0, 0, /* set percent =0 if line amt = 0 */
6901: ROUND(100 * (D.AMOUNT / L.extended_AMOUNT), 4))
6902: FROM FND_CURRENCIES C,
6903: ar_trx_LINES_GT L
6904: WHERE L.CURRENCY_CODE = C.CURRENCY_CODE
6905: AND L.trx_LINE_ID = D.trx_LINE_ID
6906: )
6907: WHERE ACCOUNT_CLASS in ('REV', 'TAX', 'FREIGHT', 'CHARGES')

Line 6912: FROM ar_trx_LINES_GT L

6908: AND D.AMOUNT IS NOT NULL
6909: AND d.percent IS NULL
6910: AND EXISTS
6911: (SELECT 'X'
6912: FROM ar_trx_LINES_GT L
6913: WHERE L.trx_LINE_ID = D.trx_LINE_ID
6914: AND L.ACCOUNTING_RULE_ID IS NULL);
6915:
6916:

Line 6935: ar_trx_LINES_GT L,

6931: C.MINIMUM_ACCOUNTABLE_UNIT) *
6932: C.MINIMUM_ACCOUNTABLE_UNIT
6933: )
6934: FROM FND_CURRENCIES C,
6935: ar_trx_LINES_GT L,
6936: ar_trx_header_gt h
6937: WHERE C.CURRENCY_CODE = p_trx_system_parameters_rec.base_currency_code
6938: AND L.trx_LINE_ID = D.trx_LINE_ID
6939: AND L.trx_header_id = h.trx_header_id

Line 6946: FROM ar_trx_LINES_GT L

6942: AND d.acctd_amount IS NULL
6943: AND D.PERCENT IS NOT NULL
6944: AND EXISTS
6945: (SELECT 'X'
6946: FROM ar_trx_LINES_GT L
6947: WHERE L.trx_LINE_ID = D.trx_LINE_ID
6948: AND L.ACCOUNTING_RULE_ID IS NULL);
6949:
6950: /* Bug-5340103 End*/

Line 6971: ar_trx_lines_GT L

6967: L.trx_LINE_ID,
6968: arp_standard.fnd_message('AR_INAPI_NVALID_SUM_DIST_AMT'),
6969: d.account_class || ':'||SUM(d.amount)
6970: FROM ar_trx_DIST_gt D,
6971: ar_trx_lines_GT L
6972: WHERE L.ACCOUNTING_RULE_ID IS NULL
6973: AND L.LINE_TYPE = DECODE(D.ACCOUNT_CLASS,
6974: 'REV', 'LINE',
6975: 'TAX', 'TAX',

Line 7000: FROM ar_trx_dist_gt d, ar_trx_lines_gt L, ar_trx_header_gt h

6996: SELECT d.trx_header_id,
6997: d.trx_line_ID,
6998: arp_standard.fnd_message('AR_INAPI_100_PERCENT'),
6999: sum(d.percent)
7000: FROM ar_trx_dist_gt d, ar_trx_lines_gt L, ar_trx_header_gt h
7001: WHERE d.trx_line_id = l.trx_line_id
7002: AND l.trx_header_id = h.trx_header_id
7003: GROUP BY d.trx_header_id,d.trx_line_ID, ACCOUNT_CLASS
7004: HAVING SUM(d.PERCENT) <> 100;

Line 7049: FROM ar_trx_header_gt hgt, ar_trx_lines_gt lgt

7045: -- update accounting set flag
7046: UPDATE ar_trx_dist_gt dgt
7047: SET dgt.account_set_flag =
7048: (SELECT DECODE(hgt.invoicing_rule_id,null,'N','Y')
7049: FROM ar_trx_header_gt hgt, ar_trx_lines_gt lgt
7050: WHERE hgt.trx_header_id = lgt.trx_header_id
7051: AND lgt.trx_line_id = dgt.trx_line_id
7052: AND dgt.account_class <> 'REC'
7053: UNION

Line 7189: ar_trx_LINES_GT L_PARENT,

7185: --RA_CUST_TRX_TYPES TYPE,
7186: FND_CURRENCIES C,
7187: GL_SETS_OF_BOOKS G,
7188: --RA_CUSTOMER_TRX PREV_TRX,
7189: ar_trx_LINES_GT L_PARENT,
7190: ar_trx_LINES_GT L
7191: WHERE --L.REQUEST_ID = :request_id
7192: --L.PREVIOUS_CUSTOMER_TRX_ID = PREV_TRX.CUSTOMER_TRX_ID(+)
7193: --AND L.CUST_TRX_TYPE_ID = TYPE.CUST_TRX_TYPE_ID

Line 7190: ar_trx_LINES_GT L

7186: FND_CURRENCIES C,
7187: GL_SETS_OF_BOOKS G,
7188: --RA_CUSTOMER_TRX PREV_TRX,
7189: ar_trx_LINES_GT L_PARENT,
7190: ar_trx_LINES_GT L
7191: WHERE --L.REQUEST_ID = :request_id
7192: --L.PREVIOUS_CUSTOMER_TRX_ID = PREV_TRX.CUSTOMER_TRX_ID(+)
7193: --AND L.CUST_TRX_TYPE_ID = TYPE.CUST_TRX_TYPE_ID
7194: h.trx_header_id = l_trx_header_id

Line 7280: ar_trx_LINES_GT L

7276: SUM(revenue_amount_split) sales_credit_amount
7277: FROM FND_CURRENCIES C,
7278: ar_trx_SALESCREDITS_gt SC,
7279: SO_SALES_CREDIT_TYPES CR,
7280: ar_trx_LINES_GT L
7281: WHERE L.LINE_TYPE = 'LINE'
7282: AND L.CURRENCY_CODE = C.CURRENCY_CODE
7283: and L.trx_LINE_ID = SC.trx_LINE_ID
7284: and SC.SALES_CREDIT_TYPE_ID = CR.SALES_CREDIT_TYPE_ID

Line 7441: FROM ar_trx_LINES_GT L,

7437: S.trx_LINE_ID,
7438: S.trx_SALESCREDIT_ID,
7439: arp_standard.fnd_message(l_message_name),
7440: L.LINE_TYPE
7441: FROM ar_trx_LINES_GT L,
7442: ar_trx_SALESCREDITS_gt S
7443: WHERE S.trx_LINE_ID = L.trx_LINE_ID
7444: AND L.LINE_TYPE <> 'LINE';
7445:

Line 7479: FROM ar_trx_LINES_GT L,

7475: * C.MINIMUM_ACCOUNTABLE_UNIT
7476: )
7477: ),
7478: pct_precision))
7479: FROM ar_trx_LINES_GT L,
7480: FND_CURRENCIES C,
7481: ar_trx_SALESCREDITS_gt S2
7482: WHERE L.trx_LINE_ID = S2.trx_LINE_ID
7483: AND L.LINE_TYPE = 'LINE'

Line 7529: FROM ar_trx_LINES_GT L,

7525: ) / 100) /
7526: C.MINIMUM_ACCOUNTABLE_UNIT)
7527: * C.MINIMUM_ACCOUNTABLE_UNIT
7528: )
7529: FROM ar_trx_LINES_GT L,
7530: FND_CURRENCIES C
7531: WHERE L.trx_LINE_ID = SC.trx_LINE_ID
7532: AND L.CURRENCY_CODE = C.CURRENCY_CODE)
7533: WHERE SC.revenue_percent_split IS NOT NULL

Line 7570: ar_trx_LINES_GT L,

7566: S.trx_SALESCREDIT_ID,
7567: arp_standard.fnd_message('AR_INAPI_INVALID_PRECISION'),
7568: S.revenue_amount_split
7569: FROM ar_trx_salescredits_gt S,
7570: ar_trx_LINES_GT L,
7571: FND_CURRENCIES C
7572: WHERE S.trx_LINE_ID = L.trx_LINE_ID
7573: AND L.CURRENCY_CODE = C.CURRENCY_CODE
7574: AND s.revenue_amount_split IS NOT NULL

Line 7670: FROM ar_trx_lines_gt l,

7666: c.precision),
7667: ROUND(l.quantity_invoiced * l.unit_selling_price
7668: / c.minimum_accountable_unit) *
7669: c.minimum_accountable_unit))
7670: FROM ar_trx_lines_gt l,
7671: fnd_currencies c
7672: WHERE l.trx_line_id = s.trx_line_id
7673: AND l.line_type = 'LINE'
7674: AND l.currency_code = c.currency_code);

Line 7694: FROM ar_trx_lines_gt lgt

7690: error_message)
7691: SELECT lgt.trx_header_id,
7692: lgt.trx_line_id,
7693: arp_standard.fnd_message(l_message_name)
7694: FROM ar_trx_lines_gt lgt
7695: WHERE lgt.line_type = 'LINE'
7696: AND NOT EXISTS
7697: (SELECT 'X'
7698: FROM ar_trx_salescredits_gt scgt,