The following lines contain the word 'select', 'insert', 'update' or 'delete':
INSERT ALL
WHEN (ZX_LOCATION_MISSING = 'Y') THEN
INTO ZX_ERRORS_GT(
application_id,
entity_code,
event_class_code,
trx_id,
trx_line_id,
MESSAGE_TEXT,
TRX_LEVEL_TYPE
)
VALUES(
application_id,
entity_code,
event_class_code,
trx_id,
trx_line_id,
l_message_locm,
trx_level_type
)
/* Bug 5516630: Unit price needs to be checked only for distribution lines
WHEN (ZX_UNIT_PRICE_MISSING = 'Y') THEN
INTO ZX_ERRORS_GT(
application_id,
entity_code,
event_class_code,
trx_id,
trx_line_id,
MESSAGE_TEXT,
TRX_LEVEL_TYPE
)
VALUES(
application_id,
entity_code,
event_class_code,
trx_id,
trx_line_id,
l_message_unitp,
trx_level_type
)
*/
SELECT
header.application_id,
header.entity_code,
header.event_class_code,
header.trx_id,
lines_gt.trx_line_id,
lines_gt.trx_level_type,
-- Check for existence of at least one location at line
CASE WHEN (lines_gt.ship_from_location_id is not null OR
lines_gt.ship_to_location_id is not NULL OR
lines_gt.poa_location_id is not NULL OR
lines_gt.poo_location_id is not NULL OR
lines_gt.paying_location_id is not NULL OR
lines_gt.own_hq_location_id is not NULL OR
lines_gt.trading_hq_location_id is not NULL OR
lines_gt.poc_location_id is not NULL OR
lines_gt.poi_location_id is not NULL OR
lines_gt.pod_location_id is not NULL OR
lines_gt.bill_to_location_id is not NULL OR
lines_gt.bill_from_location_id is not NULL OR
lines_gt.title_transfer_location_id is not NULL)
THEN NULL
ELSE 'Y'
END ZX_LOCATION_MISSING
/*,
CASE WHEN (p_event_class_rec.tax_variance_calc_flag = 'Y'
and lines_gt.unit_price is null
and lines_gt.ref_doc_application_id IS NOT NULL
and lines_gt.line_class <> 'AMOUNT_MATCHED')
THEN 'Y'
ELSE NULL
END ZX_UNIT_PRICE_MISSING
*/
FROM ZX_TRX_HEADERS_GT header,
ZX_TRANSACTION_LINES_GT lines_gt
WHERE lines_gt.trx_id = header.trx_id
AND lines_gt.application_id = header.application_id
AND lines_gt.entity_code = header.entity_code
AND lines_gt.event_class_code = header.event_class_code;
IF zx_global_structures_pkg.trx_line_dist_tbl.LINE_LEVEL_ACTION(l_trx_line_index) not in ('CANCEL','DELETE') THEN
IF zx_global_structures_pkg.trx_line_dist_tbl.SHIP_TO_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.SHIP_FROM_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.POA_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.poo_location_id(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.PAYING_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.OWN_HQ_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.TRADING_HQ_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.POC_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.POI_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.POD_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.BILL_TO_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.BILL_FROM_LOCATION_ID(l_trx_line_index) is NULL
AND zx_global_structures_pkg.trx_line_dist_tbl.TITLE_TRANSFER_LOCATION_ID(l_trx_line_index) is NULL THEN
x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
IF zx_global_structures_pkg.trx_line_dist_tbl.LINE_LEVEL_ACTION(l_trx_line_index) not in ('CANCEL','DELETE') THEN
IF zx_global_structures_pkg.trx_line_dist_tbl.TRX_LINE_CURRENCY_CODE(l_trx_line_index) is NULL and
zx_global_structures_pkg.trx_line_dist_tbl.TRX_LINE_PRECISION(l_trx_line_index) is NULL THEN
x_return_status := FND_API.G_RET_STS_ERROR;
IF zx_global_structures_pkg.trx_line_dist_tbl.LINE_LEVEL_ACTION(l_trx_line_index) not in ('CANCEL','DELETE') AND
zx_global_structures_pkg.trx_line_dist_tbl.LINE_CLASS(l_trx_line_index) <> 'AMOUNT_MATCHED' AND
zx_global_structures_pkg.trx_line_dist_tbl.REF_DOC_APPLICATION_ID(l_trx_line_index) is not null THEN
IF zx_global_structures_pkg.trx_line_dist_tbl.UNIT_PRICE(l_trx_line_index) is NULL THEN
x_return_status := FND_API.G_RET_STS_ERROR;
INSERT ALL
WHEN (ZX_ROUND_PARTY_MISSING = 'Y') THEN
INTO ZX_ERRORS_GT(
application_id,
entity_code,
event_class_code,
trx_id,
trx_line_id,
MESSAGE_TEXT,
TRX_LEVEL_TYPE
)
VALUES(
application_id,
entity_code,
event_class_code,
trx_id,
NULL ,--trx_line_id,
l_message_pty,
NULL --interface_line_id
)
WHEN (ZX_CURRENCY_INFO_REQD = 'Y') THEN
INTO ZX_ERRORS_GT(
application_id,
entity_code,
event_class_code,
trx_id,
trx_line_id,
MESSAGE_TEXT,
TRX_LEVEL_TYPE
)
VALUES(
application_id,
entity_code,
event_class_code,
trx_id,
NULL ,--trx_line_id,
l_message_curr,
NULL --interface_line_id
)
SELECT
header.application_id,
header.entity_code,
header.event_class_code,
header.trx_id,
-- Check for existence of at least one rounding party
CASE WHEN (header.rounding_ship_from_party_id is NULL AND
header.rounding_ship_to_party_id is NULL AND
header.rounding_bill_to_party_id is NULL AND
header.rounding_bill_from_party_id is NULL )
THEN 'Y'
ELSE NULL
END ZX_ROUND_PARTY_MISSING,
CASE WHEN (header.TRX_CURRENCY_CODE is NULL
AND header.precision is NULL )
AND EXISTS
( SELECT 1 FROM zx_transaction_lines_gt
WHERE application_id = header.application_id
AND entity_code = header.entity_code
AND event_class_code = header.event_class_code
AND trx_id = header.trx_id
AND ( TRX_LINE_CURRENCY_CODE is NULL
OR trx_line_precision is NULL)
)
THEN 'Y'
ELSE NULL
END ZX_CURRENCY_INFO_REQD
FROM
ZX_TRX_HEADERS_GT header
WHERE VALIDATION_CHECK_FLAG is null;
SELECT /*+ INDEX (ZX_ITM_DISTRIBUTIONS_GT ZX_ITM_DISTRIBUTIONS_GT_U1)*/
/* 1
INTO l_count
FROM ZX_ITM_DISTRIBUTIONS_GT
WHERE application_id = p_event_class_rec.application_id
AND entity_code = p_event_class_rec.entity_code
AND event_class_code = p_event_class_rec.event_class_code
AND trx_id = p_event_class_rec.trx_id
AND trx_line_quantity is null;
SELECT /*+ INDEX (ZX_ITM_DISTRIBUTIONS_GT ZX_ITM_DISTRIBUTIONS_GT_U1)*/
/* 1
INTO l_count
FROM ZX_ITM_DISTRIBUTIONS_GT
WHERE application_id = p_event_class_rec.application_id
AND entity_code = p_event_class_rec.entity_code
AND event_class_code = p_event_class_rec.event_class_code
AND trx_id = p_event_class_rec.trx_id
AND unit_price is null;
| zx_valid_init_params_pkg.global_document_update |
| zx_valid_init_params_pkg.override_recovery |
| zx_valid_init_params_pkg.freeze_distribution_lines |
| zx_valid_init_params_pkg.validate_document_for_tax |
| zx_valid_init_params_pkg.discard_tax_only_lines |
* ===========================================================================*/
PROCEDURE Check_trx_rec
( x_return_status OUT NOCOPY VARCHAR2,
p_trx_rec IN ZX_API_PUB.transaction_rec_type
)
IS
l_api_name CONSTANT VARCHAR2(30):= 'CHECK_TRX_REC';
| zx_valid_init_params_pkg.mark_tax_lines_deleted |
* ============================================================================*/
PROCEDURE Check_trx_line_rec
( x_return_status OUT NOCOPY VARCHAR2,
p_trx_line_rec IN zx_api_pub.transaction_line_rec_type
) IS
l_api_name CONSTANT VARCHAR2(30) := 'CHECK_TRX_LINE_REC';