DBA Data[Home] [Help]

APPS.AR_INVOICE_UTILS dependencies on AR_TRX_LINES_GT

Line 1150: FROM ar_trx_lines_gt lgt,

1146: SELECT lgt.trx_header_id,
1147: lgt.trx_line_id,
1148: arp_standard.fnd_message('AR_INAPI_RULE_INFO_UNNECESSARY'),
1149: NVL(lgt.accounting_rule_id, lgt.accounting_rule_duration)
1150: FROM ar_trx_lines_gt lgt,
1151: ar_trx_header_gt hgt
1152: WHERE (lgt.accounting_rule_id IS NOT NULL
1153: OR lgt.accounting_rule_duration IS NOT NULL)
1154: AND lgt.trx_header_id = hgt.trx_header_id

Line 1167: FROM ar_trx_lines_gt gt

1163: SELECT trx_header_id,
1164: trx_line_id,
1165: arp_standard.fnd_message('AR_INAPI_INV_MASTER_LINE_TYPE'),
1166: link_to_trx_line_id
1167: FROM ar_trx_lines_gt gt
1168: WHERE gt.link_to_trx_line_id IS NOT NULL
1169: AND NOT EXISTS
1170: (SELECT 'X'
1171: FROM ar_trx_lines_gt gt2

Line 1171: FROM ar_trx_lines_gt gt2

1167: FROM ar_trx_lines_gt gt
1168: WHERE gt.link_to_trx_line_id IS NOT NULL
1169: AND NOT EXISTS
1170: (SELECT 'X'
1171: FROM ar_trx_lines_gt gt2
1172: WHERE gt2.trx_line_id = gt.link_to_trx_line_id
1173: AND gt2.line_type = 'LINE');
1174:
1175: -- Sub Lines can not have a line type of 'LINE'

Line 1185: FROM ar_trx_lines_gt gt

1181: SELECT trx_header_id,
1182: trx_line_id,
1183: arp_standard.fnd_message('AR_INAPI_INVALID_SUB_LINE_TYPE'),
1184: link_to_trx_line_id
1185: FROM ar_trx_lines_gt gt
1186: WHERE gt.link_to_trx_line_id IS NOT NULL
1187: AND gt.line_type NOT IN ('TAX', 'FREIGHT');
1188:
1189:

Line 1246: FROM ar_trx_lines_gt lgt

1242: SELECT trx_header_id,
1243: trx_line_id,
1244: arp_standard.fnd_message('AR_TAX_CHOOSE_YES_NO'),
1245: amount_includes_tax_flag
1246: FROM ar_trx_lines_gt lgt
1247: WHERE amount_includes_tax_flag IS NOT NULL
1248: AND amount_includes_tax_flag NOT IN ('Y', 'N');
1249:
1250: -- validate_bfb;

Line 1284: FROM ar_trx_lines_gt lgt

1280: null
1281: FROM ar_trx_header_gt gt
1282: WHERE NOT EXISTS
1283: (SELECT 'X'
1284: FROM ar_trx_lines_gt lgt
1285: WHERE lgt.trx_header_id = gt.trx_header_id);
1286:
1287: -- Every line level row should have a corresponding header level row.
1288: INSERT INTO ar_trx_errors_gt (

Line 1297: FROM ar_trx_lines_gt lgt

1293: SELECT trx_header_id,
1294: trx_line_id,
1295: arp_standard.fnd_message('AR_INAPI_ORPHAN_LINES'),
1296: null
1297: FROM ar_trx_lines_gt lgt
1298: WHERE NOT EXISTS
1299: (SELECT 'X'
1300: FROM ar_trx_header_gt hgt
1301: WHERE hgt.trx_header_id = lgt.trx_header_id);

Line 1313: FROM ar_trx_lines_gt lgt

1309: SELECT trx_header_id,
1310: trx_line_id,
1311: arp_standard.fnd_message('AR_INAPI_LINE_NUMS_NOT_UNIQUE'),
1312: lgt.line_number
1313: FROM ar_trx_lines_gt lgt
1314: WHERE EXISTS
1315: (SELECT 'X'
1316: FROM ar_trx_lines_gt lgt2
1317: WHERE lgt2.trx_header_id = lgt.trx_header_id

Line 1316: FROM ar_trx_lines_gt lgt2

1312: lgt.line_number
1313: FROM ar_trx_lines_gt lgt
1314: WHERE EXISTS
1315: (SELECT 'X'
1316: FROM ar_trx_lines_gt lgt2
1317: WHERE lgt2.trx_header_id = lgt.trx_header_id
1318: AND lgt2.line_number = lgt.line_number
1319: AND lgt2.line_type = lgt.line_type
1320: GROUP BY lgt2.trx_header_id, lgt2.line_number

Line 1333: FROM ar_trx_lines_gt lgt

1329: SELECT trx_header_id,
1330: trx_line_id,
1331: arp_standard.fnd_message('AR_INAPI_LINE_ID_NOT_UNIQUE'),
1332: null
1333: FROM ar_trx_lines_gt lgt
1334: WHERE EXISTS
1335: (SELECT 'X'
1336: FROM ar_trx_lines_gt lgt2
1337: WHERE lgt2.trx_header_id = lgt.trx_header_id

Line 1336: FROM ar_trx_lines_gt lgt2

1332: null
1333: FROM ar_trx_lines_gt lgt
1334: WHERE EXISTS
1335: (SELECT 'X'
1336: FROM ar_trx_lines_gt lgt2
1337: WHERE lgt2.trx_header_id = lgt.trx_header_id
1338: AND lgt2.trx_line_id = lgt.trx_line_id
1339: GROUP BY lgt2.trx_header_id, lgt2.trx_line_id
1340: HAVING count(*) > 1);

Line 4141: FROM ar_trx_lines_gt gt

4137: SELECT trx_header_id,
4138: trx_line_id,
4139: arp_standard.fnd_message('AR_INAPI_UOM_NOT_REQ'),
4140: gt.uom_code
4141: FROM ar_trx_lines_gt gt
4142: WHERE gt.uom_code IS NOT NULL
4143: AND gt.line_type <> 'LINE';
4144:
4145: -- UOM Code not allowed for CM

Line 4156: FROM ar_trx_lines_gt gt, ar_trx_header_gt gt2

4152: SELECT gt.trx_header_id,
4153: gt.trx_line_id,
4154: arp_standard.fnd_message('AR_INAPI_CM_UOM_NOT_ALLOWED'),
4155: gt.uom_code
4156: FROM ar_trx_lines_gt gt, ar_trx_header_gt gt2
4157: WHERE gt.uom_code IS NOT NULL
4158: AND gt.line_type = 'LINE'
4159: AND gt2.trx_header_id = gt.trx_header_id
4160: AND gt2.trx_class = 'CM'; -- added for ER 5869149

Line 4171: FROM ar_trx_lines_gt gt , ar_trx_header_gt gt2

4167: SELECT gt.trx_header_id,
4168: gt.trx_line_id,
4169: arp_standard.fnd_message('AR_INAPI_INVALID_UOM'),
4170: gt.uom_code
4171: FROM ar_trx_lines_gt gt , ar_trx_header_gt gt2
4172: WHERE gt.uom_code IS NOT NULL
4173: AND gt.line_type = 'LINE'
4174: AND gt2.trx_header_id = gt.trx_header_id
4175: AND gt2.trx_class <> 'CM' -- added for ER 5869149

Line 4256: FROM ar_trx_lines_gt gt

4252: SELECT trx_header_id,
4253: trx_line_id,
4254: arp_standard.fnd_message('AR_INAPI_INVALID_TAX_LINE'),
4255: gt.vat_tax_id
4256: FROM ar_trx_lines_gt gt
4257: WHERE extended_amount IS NULL
4258: AND line_type in ('TAX', 'FREIGHT');
4259:
4260: INSERT INTO ar_trx_errors_gt

Line 4269: FROM ar_trx_lines_gt gt

4265: SELECT trx_header_id,
4266: trx_line_id,
4267: arp_standard.fnd_message('AR_INAPI_QTY_NOT_ALLOWED'),
4268: gt.vat_tax_id
4269: FROM ar_trx_lines_gt gt
4270: WHERE line_type in ('TAX', 'FREIGHT')
4271: AND (quantity_invoiced IS NOT NULL
4272: OR unit_selling_price IS NOT NULL );
4273:

Line 4289: FROM ar_trx_lines_gt gt

4285: gt.tax || ', ' ||
4286: gt.tax_status_code || ', ' ||
4287: gt.tax_rate_code || ', ' ||
4288: gt.tax_jurisdiction_code
4289: FROM ar_trx_lines_gt gt
4290: WHERE line_type = 'TAX'
4291: AND gt.tax_regime_code ||
4292: gt.tax ||
4293: gt.tax_status_code ||

Line 4357: FROM ar_trx_lines_gt

4353: SELECT trx_header_id,
4354: trx_line_id,
4355: arp_standard.fnd_message('AR_INAPI_INV_TAX_EXEMPT_FLAG'),
4356: tax_exempt_flag
4357: FROM ar_trx_lines_gt
4358: WHERE tax_exempt_flag IS NOT NULL
4359: AND NOT EXISTS
4360: ( select 'X'
4361: from ar_lookups AL1

Line 4380: FROM ar_trx_lines_gt

4376: error_message)
4377: SELECT trx_header_id,
4378: trx_line_id,
4379: arp_standard.fnd_message('AR_INAPI_REASON_NOT_REQ')
4380: FROM ar_trx_lines_gt
4381: WHERE tax_exempt_flag = 'E'
4382: AND TAX_EXEMPT_REASON_CODE IS NULL;
4383:
4384: -- Also in case of 'R' and 'S' reason code and tax_exempt_number is not required.

Line 4385: UPDATE ar_trx_lines_gt

4381: WHERE tax_exempt_flag = 'E'
4382: AND TAX_EXEMPT_REASON_CODE IS NULL;
4383:
4384: -- Also in case of 'R' and 'S' reason code and tax_exempt_number is not required.
4385: UPDATE ar_trx_lines_gt
4386: SET TAX_EXEMPT_REASON_CODE = null,
4387: tax_exempt_number = null
4388: WHERE tax_exempt_flag in ( 'R', 'S');
4389:

Line 4400: FROM ar_trx_lines_gt

4396: SELECT trx_header_id,
4397: trx_line_id,
4398: arp_standard.fnd_message('AR_INAPI_INVALID_TAX_EXEMPT_CODE'),
4399: TAX_EXEMPT_REASON_CODE
4400: FROM ar_trx_lines_gt
4401: WHERE TAX_EXEMPT_REASON_CODE IS NOT null
4402: AND NOT EXISTS (
4403: SELECT 'X'
4404: FROM ar_lookups

Line 4446: FROM ar_trx_lines_gt gt

4442: SELECT trx_header_id,
4443: trx_line_id,
4444: arp_standard.fnd_message('AR_INAPI_REASON_NOT_REQ'),
4445: gt.reason_code
4446: FROM ar_trx_lines_gt gt
4447: WHERE gt.reason_code IS NOT NULL
4448: AND gt.line_type = 'TAX';
4449:
4450:

Line 4460: FROM ar_trx_lines_gt gt

4456: SELECT trx_header_id,
4457: trx_line_id,
4458: arp_standard.fnd_message('AR_INAPI_INVALID_REASON'),
4459: gt.reason_code
4460: FROM ar_trx_lines_gt gt
4461: WHERE gt.reason_code IS NOT NULL
4462: AND NOT EXISTS (
4463: select 'X'
4464: from ar_lookups

Line 4501: FROM ar_trx_lines_gt gt

4497: ( trx_header_id,
4498: error_message)
4499: SELECT trx_header_id,
4500: arp_standard.fnd_message('AR_INAPI_INV_DESC_NULL')
4501: FROM ar_trx_lines_gt gt
4502: WHERE gt.description IS NULL
4503: AND gt.inventory_item_id IS NULL
4504: AND gt.memo_line_id IS NULL
4505: AND gt.line_type = 'LINE';

Line 4514: FROM ar_trx_lines_gt gt

4510: error_message)
4511: SELECT trx_header_id,
4512: trx_line_id,
4513: arp_standard.fnd_message('AR_DAPI_MEMO_NAME_INVALID')
4514: FROM ar_trx_lines_gt gt
4515: WHERE gt.memo_line_id IS NOT NULL
4516: AND gt.line_type = 'LINE'
4517: AND NOT EXISTS (
4518: SELECT 'X'

Line 4533: UPDATE ar_trx_lines_gt gt

4529: ar_memo_lines_tl. Removed rownum = 1. This was
4530: just masking issues that would arise due to
4531: cartesian join. */
4532:
4533: UPDATE ar_trx_lines_gt gt
4534: SET description = ( SELECT description
4535: FROM ar_memo_lines_tl
4536: WHERE memo_line_id = gt.memo_line_id
4537: AND language = USERENV('LANG')

Line 4573: FROM ar_trx_lines_gt gt ,

4569: ( trx_header_id,
4570: error_message)
4571: SELECT gt.trx_header_id,
4572: arp_standard.fnd_message('AR_INAPI_QTY_NOT_NULL')
4573: FROM ar_trx_lines_gt gt ,
4574: ar_trx_header_gt gt2
4575: WHERE gt.quantity_invoiced IS NULL
4576: AND gt.trx_header_id = gt2.trx_header_id
4577: AND gt2.trx_class <> 'CM' -- added for ER 5869149

Line 4608: FROM ar_trx_lines_gt gt ,

4604: ( trx_header_id,
4605: error_message)
4606: SELECT gt.trx_header_id,
4607: arp_standard.fnd_message('AR_INAPI_UNIT_PRICE_NOT_NULL')
4608: FROM ar_trx_lines_gt gt ,
4609: ar_trx_header_gt gt2
4610: WHERE gt.unit_selling_price IS NULL
4611: AND gt.trx_header_id = gt2.trx_header_id
4612: AND gt2.trx_class <> 'CM' -- Added for ER 5869149

Line 4642: FROM ar_trx_lines_gt gt

4638: invalid_value )
4639: SELECT trx_header_id,
4640: arp_standard.fnd_message('AR_INAPI_INAVLID_LINE_TYPE'),
4641: gt.line_type
4642: FROM ar_trx_lines_gt gt
4643: WHERE gt.line_type not in ('LINE', 'TAX', 'FREIGHT');
4644: IF pg_debug = 'Y'
4645: THEN
4646: debug ('AR_INVOICE_UTILS.validate_line_type (-)' );

Line 4672: FROM ar_trx_lines_gt gt

4668: ( trx_header_id,
4669: error_message)
4670: SELECT trx_header_id,
4671: arp_standard.fnd_message('AR_INAPI_LINE_NUM_NOT_NULL')
4672: FROM ar_trx_lines_gt gt
4673: WHERE gt.line_number IS NULL;
4674:
4675: -- check for duplicate line number
4676: /* INSERT INTO ar_trx_errors_gt

Line 4681: FROM ar_trx_lines_gt gt

4677: ( trx_header_id,
4678: error_message
4679: SELECT trx_header_id,
4680: 'Duplicate Line Number'
4681: FROM ar_trx_lines_gt gt
4682: WHERE gt.line_number IS NOT NULL
4683: AND ; */
4684: IF pg_debug = 'Y'
4685: THEN

Line 4707: FROM ar_trx_lines_gt

4703: l_allow_freight_flag ra_cust_trx_types.allow_freight_flag%type;
4704: l_cust_trx_type_id ra_cust_trx_types.cust_trx_type_id%type;
4705: CURSOR c_freight IS
4706: SELECT trx_header_id, count(*) number_of_freight_lines
4707: FROM ar_trx_lines_gt
4708: WHERE line_type = 'FREIGHT'
4709: group by trx_header_id;
4710:
4711: BEGIN

Line 4727: FROM ar_trx_lines_gt gt

4723: error_message)
4724: SELECT trx_header_id,
4725: trx_line_id,
4726: arp_standard.fnd_message('AR_INAPI_HDR_ID_NOT_NULL')
4727: FROM ar_trx_lines_gt gt
4728: WHERE gt.trx_header_id IS NULL
4729: OR gt.trx_line_id IS NULL;
4730:
4731: -- Now check if the line is of Tax type then

Line 4740: FROM ar_trx_lines_gt gt

4736: error_message)
4737: SELECT trx_header_id,
4738: trx_line_id,
4739: arp_standard.fnd_message('AR_INAPI_LINK_LINE_ID_NOT_NULL')
4740: FROM ar_trx_lines_gt gt
4741: WHERE gt.line_type = 'TAX'
4742: AND gt.link_to_trx_line_id IS NULL;
4743:
4744: -- Vlaidate if line type is freight then whether

Line 4781: FROM ar_trx_lines_gt

4777: -- now check what type of freight record it has
4778: BEGIN
4779: SELECT count(*)
4780: INTO l_header_freight_count
4781: FROM ar_trx_lines_gt
4782: WHERE trx_header_id = c_freight_rec.trx_header_id
4783: AND link_to_trx_line_id IS NULL;
4784: EXCEPTION
4785: WHEN OTHERS THEN

Line 4791: FROM ar_trx_lines_gt

4787: END;
4788: BEGIN
4789: SELECT count(*)
4790: INTO l_line_freight_count
4791: FROM ar_trx_lines_gt
4792: WHERE trx_header_id = c_freight_rec.trx_header_id
4793: AND link_to_trx_line_id IS NOT NULL;
4794: EXCEPTION
4795: WHEN OTHERS THEN

Line 4841: FROM ar_trx_lines_gt gt

4837: error_message)
4838: SELECT trx_header_id,
4839: trx_line_id,
4840: arp_standard.fnd_message('AR_INAPI_INVALID_SHIP_VIA')
4841: FROM ar_trx_lines_gt gt
4842: WHERE gt.line_type = 'FREIGHT'
4843: AND gt.ship_via IS NOT NULL
4844: AND NOT EXISTS (
4845: SELECT 'X' FROM

Line 4859: FROM ar_trx_lines_gt gt

4855: error_message)
4856: SELECT trx_header_id,
4857: trx_line_id,
4858: arp_standard.fnd_message('AR_INAPI_INVALID_FOB')
4859: FROM ar_trx_lines_gt gt
4860: WHERE gt.line_type = 'FREIGHT'
4861: AND gt.fob_point IS NOT NULL
4862: AND NOT EXISTS (
4863: SELECT 'X' FROM

Line 4877: FROM ar_trx_lines_gt gt

4873: error_message)
4874: SELECT trx_header_id,
4875: trx_line_id,
4876: arp_standard.fnd_message('AR_INAPI_EXT_AMT_NOT_NULL')
4877: FROM ar_trx_lines_gt gt
4878: WHERE gt.line_type = 'FREIGHT'
4879: AND gt.extended_amount IS NULL;
4880:
4881: IF pg_debug = 'Y'

Line 4904: FROM ar_trx_lines_gt gt,

4900: gt2.creation_sign, gt.extended_amount,
4901: gt.revenue_amount, gt.quantity_invoiced,
4902: gt.unit_selling_price,
4903: gt.currency_code -- Bug 13635700, FP bug of 9063570
4904: FROM ar_trx_lines_gt gt,
4905: ar_trx_header_gt gt2
4906: WHERE gt.line_type ='LINE'
4907: AND gt2.trx_header_id = gt.trx_header_id;
4908: --AND gt2.trx_class = 'CM'; --Commented Since the below Check has to be performed for both CM and INV

Line 4914: FROM ar_trx_lines_gt gt,

4910: /* CURSOR c_line_amount_sign IS
4911: SELECT gt.trx_header_id, gt2.creation_sign,
4912: sum(gt.extended_amount) extended_amount,
4913: sum(gt.revenue_amount) revenue_amount
4914: FROM ar_trx_lines_gt gt,
4915: ar_trx_header_gt gt2
4916: WHERE gt.line_type ='LINE'
4917: AND gt2.trx_header_id = gt.trx_header_id
4918: group by gt.trx_header_id, gt2.creation_sign ;

Line 4928: from ar_trx_lines_gt

4924:
4925: Cursor c_ext_amt is
4926: select
4927: trx_line_id,extended_amount,quantity_invoiced,unit_selling_price,currency_code
4928: from ar_trx_lines_gt
4929: where extended_amount IS NULL;
4930:
4931: BEGIN
4932: IF pg_debug = 'Y'

Line 5008: UPDATE ar_trx_lines_gt

5004: For I in c_ext_amt
5005: Loop
5006: ext_amt := arpcurr.currround(I.quantity_invoiced *
5007: I.unit_selling_price,I.CURRENCY_CODE);
5008: UPDATE ar_trx_lines_gt
5009: SET extended_amount =ext_amt
5010: WHERE extended_amount IS NULL
5011: AND trx_line_id= I.trx_line_id;
5012: End Loop;

Line 5014: UPDATE ar_trx_lines_gt

5010: WHERE extended_amount IS NULL
5011: AND trx_line_id= I.trx_line_id;
5012: End Loop;
5013:
5014: UPDATE ar_trx_lines_gt
5015: SET revenue_amount = extended_amount
5016: WHERE revenue_amount IS NULL
5017: AND line_type <> 'TAX';
5018:

Line 5429: FROM ar_trx_lines_gt

5425: l_so_org_id fnd_profile_option_values.profile_option_value%type;
5426:
5427: CURSOR cItemFlex IS
5428: SELECT trx_header_id, trx_line_id,inventory_item_id, org_id
5429: FROM ar_trx_lines_gt
5430: WHERE inventory_item_id IS NOT NULL;
5431:
5432: BEGIN
5433: IF pg_debug = 'Y'

Line 5474: update ar_trx_lines_gt

5470: /*Bug 3844408*/
5471: /*This update should be fired only when the description isn't populated
5472: initially*/
5473: -- get the description
5474: update ar_trx_lines_gt
5475: SET description = (
5476: select description
5477: from mtl_system_items_vl
5478: WHERE inventory_item_id = cItemFlexRec.inventory_item_id

Line 5574: from ar_trx_lines_gt l

5570: select l.trx_line_id,
5571: l.trx_header_id,
5572: arp_standard.fnd_message('AR_RAXTRX_INV_WAREHOUSE'),
5573: l.warehouse_id
5574: from ar_trx_lines_gt l
5575: where l.line_type = 'LINE'
5576: and l.warehouse_id is not null
5577: and not exists (select 'x'
5578: from hr_organization_units hou,

Line 5618: FROM ar_trx_lines_gt line, ar_trx_header_gt hdr,

5614: SELECT line.trx_header_id, line.trx_line_id, hdr.invoicing_rule_id,
5615: line.ACCOUNTING_RULE_ID, line.ACCOUNTING_RULE_DURATION,
5616: line.RULE_START_DATE,line.RULE_END_DATE,line.set_of_books_id,hdr.trx_date,
5617: rr.type, rr.frequency, rr.occurrences
5618: FROM ar_trx_lines_gt line, ar_trx_header_gt hdr,
5619: ra_rules rr
5620: WHERE hdr.invoicing_rule_id IS NOT NULL
5621: AND line.accounting_rule_id IS NOT NULL
5622: AND hdr.trx_header_id = line.trx_header_id

Line 5644: FROM ar_trx_lines_gt gt , ar_trx_header_gt gt2

5640: error_message)
5641: SELECT gt.trx_header_id,
5642: gt.trx_line_id,
5643: arp_standard.fnd_message('AR_INAPI_INVALID_RULE_NAME')
5644: FROM ar_trx_lines_gt gt , ar_trx_header_gt gt2
5645: WHERE gt.accounting_rule_id IS NOT NULL
5646: AND gt2.trx_header_id = gt.trx_header_id
5647: AND gt2.trx_class <> 'CM' -- Added for ER 5869149
5648: AND NOT EXISTS (

Line 5662: FROM ar_trx_lines_gt gt, ar_trx_header_gt gth

5658: error_message)
5659: SELECT gt.trx_header_id,
5660: gt.trx_line_id,
5661: arp_standard.fnd_message('AR_INAPI_RULE_NAME_NOT_NULL')
5662: FROM ar_trx_lines_gt gt, ar_trx_header_gt gth
5663: WHERE gt.accounting_rule_id IS NULL
5664: AND gt.trx_header_id = gth.trx_header_id
5665: AND gth.invoicing_rule_id IS NOT NULL
5666: AND gth.trx_class <> 'CM' -- Added for ER 5869149

Line 5678: FROM ar_trx_lines_gt gt, ar_trx_header_gt gth

5674: error_message)
5675: SELECT gt.trx_header_id,
5676: gt.trx_line_id,
5677: arp_standard.fnd_message('AR_INAPI_RULE_NOT_ALLOWED')
5678: FROM ar_trx_lines_gt gt, ar_trx_header_gt gth
5679: WHERE (gt.accounting_rule_id IS NOT NULL
5680: OR gth.invoicing_rule_id IS NOT NULL)
5681: AND gt.trx_header_id = gth.trx_header_id
5682: AND gth.trx_class = 'CM' -- Added for ER 5257046

Line 5730: UPDATE ar_trx_lines_gt a

5726: ( c_invoicing_rule_rec.trx_header_id,
5727: c_invoicing_rule_rec.trx_line_id,
5728: arp_standard.fnd_message('AR_RAXTRX_RSD_LT_RED'));
5729: ELSE
5730: UPDATE ar_trx_lines_gt a
5731: SET ACCOUNTING_RULE_DURATION =
5732: (SELECT COUNT(*)
5733: FROM ar_periods gps,
5734: ra_rules rr2,

Line 5767: UPDATE ar_trx_lines_gt

5763: ( c_invoicing_rule_rec.trx_header_id,
5764: c_invoicing_rule_rec.trx_line_id,
5765: arp_standard.fnd_message('AR_INAPI_RULE_DUR_NOT_NULL' ));
5766: ELSE
5767: UPDATE ar_trx_lines_gt
5768: SET ACCOUNTING_RULE_DURATION = c_invoicing_rule_rec.occurrences
5769: WHERE trx_line_id = c_invoicing_rule_rec.trx_line_id
5770: AND trx_header_id = c_invoicing_rule_rec.trx_header_id;
5771: END IF;

Line 5779: UPDATE ar_trx_lines_gt

5775: -- validate the user supplied value
5776: IF c_invoicing_rule_rec.ACCOUNTING_RULE_DURATION <>
5777: c_invoicing_rule_rec.occurrences
5778: THEN
5779: UPDATE ar_trx_lines_gt
5780: SET ACCOUNTING_RULE_DURATION = c_invoicing_rule_rec.occurrences
5781: WHERE trx_line_id = c_invoicing_rule_rec.trx_line_id
5782: AND trx_header_id = c_invoicing_rule_rec.trx_header_id;
5783: END IF;

Line 5826: UPDATE ar_trx_lines_gt

5822: THEN
5823: IF c_invoicing_rule_rec.rule_start_date <>
5824: l_rule_start_date
5825: THEN
5826: UPDATE ar_trx_lines_gt
5827: SET rule_start_date = l_rule_start_date
5828: WHERE trx_line_id = c_invoicing_rule_rec.trx_line_id
5829: AND trx_header_id = c_invoicing_rule_rec.trx_header_id;
5830: END IF;

Line 5912: FROM ar_trx_lines_gt gt

5908: SELECT trx_header_id,
5909: trx_line_id,
5910: arp_standard.fnd_message('AR_INAPI_INVALID_USSGL_CODE'),
5911: default_ussgl_transaction_code
5912: FROM ar_trx_lines_gt gt
5913: WHERE gt.default_ussgl_transaction_code IS NOT NULL
5914: AND NOT EXISTS
5915: (SELECT 'X'
5916: FROM gl_ussgl_transaction_codes gutc

Line 5949: UPDATE ar_trx_lines_gt gt

5945: x_return_status := FND_API.G_RET_STS_SUCCESS;
5946:
5947: -- check if memo line is passed and any unit of measue and unit price.
5948: BEGIN
5949: UPDATE ar_trx_lines_gt gt
5950: set gt.unit_selling_price =
5951: ( SELECT m.unit_std_price
5952: FROM ar_memo_lines_vl m
5953: WHERE m.memo_line_id = gt.memo_line_id

Line 5958: UPDATE ar_trx_lines_gt gt

5954: AND gt.memo_line_id IS NOT NULL
5955: AND sysdate between m.start_date and nvl(m.end_date,sysdate))
5956: WHERE gt.unit_selling_price IS NULL;
5957:
5958: UPDATE ar_trx_lines_gt gt
5959: set gt.uom_code =
5960: ( SELECT m.uom_code
5961: FROM ar_memo_lines_vl m
5962: WHERE m.memo_line_id = gt.memo_line_id

Line 7148: ar_trx_lines_GT L

7144: L.trx_line_id,
7145: D.trx_DIST_ID,
7146: arp_standard.fnd_message('AR_INAPI_ONLY_PER_ALLOWED')
7147: FROM ar_trx_DIST_gt D,
7148: ar_trx_lines_GT L
7149: WHERE (L.ACCOUNTING_RULE_ID IS NOT NULL
7150: OR D.ACCOUNT_CLASS = 'REC')
7151: AND d.PERCENT IS NULL
7152: --AND L.trx_line_ID = D.trx_line_ID;

Line 7174: ar_trx_LINES_GT L

7170: L.trx_LINE_ID,
7171: D.trx_DIST_ID,
7172: arp_standard.fnd_message('AR_INAPI_INAVLID_LINE_TYPE')
7173: FROM ar_trx_dist_gt D,
7174: ar_trx_LINES_GT L
7175: WHERE L.trx_LINE_ID = D.trx_LINE_ID
7176: AND DECODE(D.ACCOUNT_CLASS,
7177: 'TAX', 'TAX',
7178: 'FREIGHT','FREIGHT',

Line 7200: ar_trx_LINES_GT L

7196: C.MINIMUM_ACCOUNTABLE_UNIT) *
7197: C.MINIMUM_ACCOUNTABLE_UNIT
7198: )
7199: FROM FND_CURRENCIES C,
7200: ar_trx_LINES_GT L
7201: WHERE L.CURRENCY_CODE = C.CURRENCY_CODE
7202: AND L.trx_LINE_ID = D.trx_LINE_ID
7203: )
7204: WHERE ACCOUNT_CLASS IN ('REV', 'TAX', 'FREIGHT','CHARGES')

Line 7209: FROM ar_trx_LINES_GT L

7205: AND D.PERCENT IS NOT NULL
7206: AND d.amount IS NULL
7207: AND EXISTS
7208: (SELECT 'X'
7209: FROM ar_trx_LINES_GT L
7210: WHERE L.trx_LINE_ID = D.trx_LINE_ID
7211: AND L.ACCOUNTING_RULE_ID IS NULL);
7212:
7213: -- bug 6429861

Line 7234: ar_trx_LINES_GT L

7230: SELECT DECODE(L.extended_AMOUNT,
7231: 0, 0, /* set percent =0 if line amt = 0 */
7232: ROUND(100 * (D.AMOUNT / L.extended_AMOUNT), 4))
7233: FROM FND_CURRENCIES C,
7234: ar_trx_LINES_GT L
7235: WHERE L.CURRENCY_CODE = C.CURRENCY_CODE
7236: AND L.trx_LINE_ID = D.trx_LINE_ID
7237: )
7238: WHERE ACCOUNT_CLASS in ('REV', 'TAX', 'FREIGHT', 'CHARGES')

Line 7243: FROM ar_trx_LINES_GT L

7239: AND D.AMOUNT IS NOT NULL
7240: AND d.percent IS NULL
7241: AND EXISTS
7242: (SELECT 'X'
7243: FROM ar_trx_LINES_GT L
7244: WHERE L.trx_LINE_ID = D.trx_LINE_ID
7245: AND L.ACCOUNTING_RULE_ID IS NULL);
7246:
7247: -- bug 6429861

Line 7270: ar_trx_LINES_GT L,

7266: C.MINIMUM_ACCOUNTABLE_UNIT) *
7267: C.MINIMUM_ACCOUNTABLE_UNIT
7268: )
7269: FROM FND_CURRENCIES C,
7270: ar_trx_LINES_GT L,
7271: ar_trx_header_gt h
7272: WHERE C.CURRENCY_CODE = p_trx_system_parameters_rec.base_currency_code
7273: AND L.trx_LINE_ID = D.trx_LINE_ID
7274: AND L.trx_header_id = h.trx_header_id

Line 7281: FROM ar_trx_LINES_GT L

7277: AND d.acctd_amount IS NULL
7278: AND D.PERCENT IS NOT NULL
7279: AND EXISTS
7280: (SELECT 'X'
7281: FROM ar_trx_LINES_GT L
7282: WHERE L.trx_LINE_ID = D.trx_LINE_ID
7283: AND L.ACCOUNTING_RULE_ID IS NULL);
7284:
7285: /* Bug-5340103 End*/

Line 7306: ar_trx_lines_GT L

7302: L.trx_LINE_ID,
7303: arp_standard.fnd_message('AR_INAPI_NVALID_SUM_DIST_AMT'),
7304: d.account_class || ':'||SUM(d.amount)
7305: FROM ar_trx_DIST_gt D,
7306: ar_trx_lines_GT L
7307: WHERE L.ACCOUNTING_RULE_ID IS NULL
7308: AND L.LINE_TYPE = DECODE(D.ACCOUNT_CLASS,
7309: 'REV', 'LINE',
7310: 'TAX', 'TAX',

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

7333: SELECT d.trx_header_id,
7334: d.trx_line_ID,
7335: arp_standard.fnd_message('AR_INAPI_100_PERCENT'),
7336: sum(d.percent)
7337: FROM ar_trx_dist_gt d, ar_trx_lines_gt L, ar_trx_header_gt h
7338: WHERE d.trx_line_id = l.trx_line_id
7339: AND l.trx_header_id = h.trx_header_id
7340: GROUP BY d.trx_header_id,d.trx_line_ID, ACCOUNT_CLASS
7341: HAVING SUM(d.PERCENT) <> 100;

Line 7388: FROM ar_trx_header_gt hgt, ar_trx_lines_gt lgt

7384: -- update accounting set flag
7385: UPDATE ar_trx_dist_gt dgt
7386: SET dgt.account_set_flag =
7387: (SELECT DECODE(hgt.invoicing_rule_id,null,'N','Y')
7388: FROM ar_trx_header_gt hgt, ar_trx_lines_gt lgt
7389: WHERE hgt.trx_header_id = lgt.trx_header_id
7390: AND lgt.trx_line_id = dgt.trx_line_id
7391: AND dgt.account_class <> 'REC'
7392: UNION

Line 7528: ar_trx_LINES_GT L_PARENT,

7524: --RA_CUST_TRX_TYPES TYPE,
7525: FND_CURRENCIES C,
7526: GL_SETS_OF_BOOKS G,
7527: --RA_CUSTOMER_TRX PREV_TRX,
7528: ar_trx_LINES_GT L_PARENT,
7529: ar_trx_LINES_GT L
7530: WHERE --L.REQUEST_ID = :request_id
7531: --L.PREVIOUS_CUSTOMER_TRX_ID = PREV_TRX.CUSTOMER_TRX_ID(+)
7532: --AND L.CUST_TRX_TYPE_ID = TYPE.CUST_TRX_TYPE_ID

Line 7529: ar_trx_LINES_GT L

7525: FND_CURRENCIES C,
7526: GL_SETS_OF_BOOKS G,
7527: --RA_CUSTOMER_TRX PREV_TRX,
7528: ar_trx_LINES_GT L_PARENT,
7529: ar_trx_LINES_GT L
7530: WHERE --L.REQUEST_ID = :request_id
7531: --L.PREVIOUS_CUSTOMER_TRX_ID = PREV_TRX.CUSTOMER_TRX_ID(+)
7532: --AND L.CUST_TRX_TYPE_ID = TYPE.CUST_TRX_TYPE_ID
7533: h.trx_header_id = l_trx_header_id

Line 7619: ar_trx_LINES_GT L

7615: SUM(revenue_amount_split) sales_credit_amount
7616: FROM FND_CURRENCIES C,
7617: ar_trx_SALESCREDITS_gt SC,
7618: SO_SALES_CREDIT_TYPES CR,
7619: ar_trx_LINES_GT L
7620: WHERE L.LINE_TYPE = 'LINE'
7621: AND L.CURRENCY_CODE = C.CURRENCY_CODE
7622: and L.trx_LINE_ID = SC.trx_LINE_ID
7623: and SC.SALES_CREDIT_TYPE_ID = CR.SALES_CREDIT_TYPE_ID

Line 7783: FROM ar_trx_LINES_GT L,

7779: S.trx_LINE_ID,
7780: S.trx_SALESCREDIT_ID,
7781: arp_standard.fnd_message(l_message_name),
7782: L.LINE_TYPE
7783: FROM ar_trx_LINES_GT L,
7784: ar_trx_SALESCREDITS_gt S
7785: WHERE S.trx_LINE_ID = L.trx_LINE_ID
7786: AND L.LINE_TYPE <> 'LINE';
7787:

Line 7821: FROM ar_trx_LINES_GT L,

7817: * C.MINIMUM_ACCOUNTABLE_UNIT
7818: )
7819: ),
7820: pct_precision))
7821: FROM ar_trx_LINES_GT L,
7822: FND_CURRENCIES C,
7823: ar_trx_SALESCREDITS_gt S2
7824: WHERE L.trx_LINE_ID = S2.trx_LINE_ID
7825: AND L.LINE_TYPE = 'LINE'

Line 7871: FROM ar_trx_LINES_GT L,

7867: ) / 100) /
7868: C.MINIMUM_ACCOUNTABLE_UNIT)
7869: * C.MINIMUM_ACCOUNTABLE_UNIT
7870: )
7871: FROM ar_trx_LINES_GT L,
7872: FND_CURRENCIES C
7873: WHERE L.trx_LINE_ID = SC.trx_LINE_ID
7874: AND L.CURRENCY_CODE = C.CURRENCY_CODE)
7875: WHERE SC.revenue_percent_split IS NOT NULL

Line 7916: FROM ar_trx_LINES_GT L,

7912: * C.MINIMUM_ACCOUNTABLE_UNIT
7913: )
7914: ),
7915: pct_precision))
7916: FROM ar_trx_LINES_GT L,
7917: FND_CURRENCIES C,
7918: ar_trx_SALESCREDITS_gt S2
7919: WHERE L.trx_LINE_ID = S2.trx_LINE_ID
7920: AND L.LINE_TYPE = 'LINE'

Line 7966: FROM ar_trx_LINES_GT L,

7962: ) / 100) /
7963: C.MINIMUM_ACCOUNTABLE_UNIT)
7964: * C.MINIMUM_ACCOUNTABLE_UNIT
7965: )
7966: FROM ar_trx_LINES_GT L,
7967: FND_CURRENCIES C
7968: WHERE L.trx_LINE_ID = SC.trx_LINE_ID
7969: AND L.CURRENCY_CODE = C.CURRENCY_CODE)
7970: WHERE SC.non_revenue_percent_split IS NOT NULL

Line 8010: ar_trx_LINES_GT L,

8006: S.trx_SALESCREDIT_ID,
8007: arp_standard.fnd_message('AR_INAPI_INVALID_PRECISION'),
8008: S.revenue_amount_split
8009: FROM ar_trx_salescredits_gt S,
8010: ar_trx_LINES_GT L,
8011: FND_CURRENCIES C
8012: WHERE S.trx_LINE_ID = L.trx_LINE_ID
8013: AND L.CURRENCY_CODE = C.CURRENCY_CODE
8014: AND s.revenue_amount_split IS NOT NULL

Line 8112: FROM ar_trx_lines_gt l,

8108: c.precision),
8109: ROUND(l.quantity_invoiced * l.unit_selling_price
8110: / c.minimum_accountable_unit) *
8111: c.minimum_accountable_unit))
8112: FROM ar_trx_lines_gt l,
8113: fnd_currencies c
8114: WHERE l.trx_line_id = s.trx_line_id
8115: AND l.line_type = 'LINE'
8116: AND l.currency_code = c.currency_code);

Line 8136: FROM ar_trx_lines_gt lgt

8132: error_message)
8133: SELECT lgt.trx_header_id,
8134: lgt.trx_line_id,
8135: arp_standard.fnd_message(l_message_name)
8136: FROM ar_trx_lines_gt lgt
8137: WHERE lgt.line_type = 'LINE'
8138: AND NOT EXISTS
8139: (SELECT 'X'
8140: FROM ar_trx_salescredits_gt scgt,