929: ELSE
930:
931: SELECT count(*)
932: INTO l_count
933: FROM ra_customer_trx_lines_all rcl
934: WHERE rcl.customer_trx_id = p_parent_trx_id
935: AND rcl.line_type = p_line_type
936: AND exists (select 1 from ra_customer_trx_lines_all rc2
937: where rc2.link_to_cust_trx_line_id = rcl.customer_trx_line_id)
932: INTO l_count
933: FROM ra_customer_trx_lines_all rcl
934: WHERE rcl.customer_trx_id = p_parent_trx_id
935: AND rcl.line_type = p_line_type
936: AND exists (select 1 from ra_customer_trx_lines_all rc2
937: where rc2.link_to_cust_trx_line_id = rcl.customer_trx_line_id)
938: AND rcl.line_type <> 'TAX'
939: AND NVL(rcl.global_attribute9,'N') = NVL(p_below_threshold,'N')
940: AND NVL(rcl.global_attribute10,'N') = NVL(p_report_exclusion,'N')
1105: g_last_update_login,
1106: g_creation_date,
1107: g_created_by
1108: FROM ra_customer_trx_all rct,
1109: ra_customer_trx_lines_all rctl,
1110: ra_cust_trx_line_gl_dist_all rctd,
1111: ra_cust_trx_types_all rctt,
1112: ar_receipt_methods arm,
1113: hz_cust_accounts hca,
1118: hz_locations hl,
1119: je_it_setup_doc_seqs_all ds,
1120: jg_zz_vat_rep_entities repent,
1121: zx_lines_v zx,
1122: ra_customer_trx_lines_all itemgdf
1123: where --rct.customer_trx_id = 665616 AND
1124: zx.trx_id = rct.customer_trx_id
1125: and zx.trx_line_id = rctl.customer_trx_line_id
1126: and zx.tax_regime_code = repent.tax_regime_code
1145: AND hp.party_id = hps.party_id
1146: AND hps.location_id = hl.location_id
1147: AND (NVL(hcsu.tax_reference,hp.tax_reference) IS NULL OR hl.country ='IT' OR hl.country IN (select territory_code from FND_Territories where alternate_territory_code IS NOT NULL))
1148: AND ( rctl.vat_tax_id IS not NULL or exists (select 1 from
1149: ra_customer_trx_lines_all rctla
1150: where rctla.customer_trx_id = rct.customer_trx_id
1151: and rctla.link_to_cust_trx_line_id= rctl.customer_trx_line_id))
1152: AND rct.doc_sequence_id = ds.document_sequence_id
1153: AND ds.vat_reporting_entity_id = g_vat_reporting_entity_id
1239: g_last_update_login,
1240: g_creation_date,
1241: g_created_by
1242: FROM ra_customer_trx_all rct,
1243: ra_customer_trx_lines_all rctl,
1244: ra_cust_trx_line_gl_dist_all rctd,
1245: ra_cust_trx_types_all rctt,
1246: ar_receipt_methods arm,
1247: hz_cust_accounts hca,
1252: hz_locations hl,
1253: je_it_setup_doc_seqs_all ds,
1254: jg_zz_vat_rep_entities repent,
1255: zx_lines_v zx,
1256: ra_customer_trx_lines_all itemgdf
1257: where --rct.customer_trx_id = 665616 AND
1258: zx.trx_id = rct.customer_trx_id
1259: and zx.tax_line_id=rctl.tax_line_id
1260: and zx.tax_regime_code = repent.tax_regime_code
1279: AND hp.party_id = hps.party_id
1280: AND hps.location_id = hl.location_id
1281: AND (NVL(hcsu.tax_reference,hp.tax_reference) IS NULL OR hl.country ='IT' OR hl.country IN (select territory_code from FND_Territories where alternate_territory_code IS NOT NULL))
1282: AND ( rctl.vat_tax_id IS not NULL or exists (select 1 from
1283: ra_customer_trx_lines_all rctla
1284: where rctla.customer_trx_id = rct.customer_trx_id
1285: and rctla.link_to_cust_trx_line_id= rctl.customer_trx_line_id))
1286: AND rct.doc_sequence_id = ds.document_sequence_id
1287: AND ds.vat_reporting_entity_id = g_vat_reporting_entity_id
1371: FROM je_it_trx_lines_all item_lines
1372: WHERE item_lines.trx_id = trx_lines.trx_id
1373: AND item_lines.REQUEST_ID = g_conc_request_id
1374: AND item_lines.trx_line_id = (SELECT rctl.link_to_cust_trx_line_id FROM
1375: ra_customer_trx_lines_all rctl
1376: WHERE rctl.customer_trx_line_id =trx_lines.trx_line_id
1377: AND rctl.customer_trx_id =item_lines.trx_id)
1378: )
1379: WHERE trx_lines.application_id = 222
1398: adj_inv_flag,
1399: orig_trx_id,
1400: inconst_cm_dm_appl_flag
1401: FROM je_it_trx_lines_all item_lines
1402: ,ra_customer_trx_lines_all rctl
1403: WHERE item_lines.trx_id = trx_lines.trx_id
1404: AND item_lines.REQUEST_ID = g_conc_request_id
1405: AND item_lines.trx_line_id = rctl.link_to_cust_trx_line_id
1406: AND rctl.customer_trx_line_id =trx_lines.trx_line_id