-- Shipping Network Checking SQL:
SELECT a.from_organization_code, a.from_organization_name,
a.to_organization_code, a.to_organization_name, DECODE (a.intransit_type,
2, 'Intransit',
1, 'Direct'
) "Transfer Type",
(SELECT meaning
FROM apps.mfg_lookups
WHERE lookup_type = 'MTL_FOB_POINT'
AND lookup_code = a.fob_point) fob_point,
a.elemental_visibility_enabled, DECODE (a.routing_header_id,
1, 'Standard',
2, 'Inspection',
3, 'Direct',
NULL, NULL
) receipt_routing,
manual_receipt_expense,DECODE (a.internal_order_required_flag,
1, 'Y',
2, 'N'
) intenal_order_required,
DECODE (a.matl_interorg_transfer_code,
1, 'None',
'2', 'Requested Value',
'3', 'Requested %',
'4', 'Predefined'
) transfer_Charge,INTERORG_TRNSFR_CHARGE_PERCENT, NAME,
distance_uom_code, to_organization_distance Value,
apps.xxr12_get_val
(interorg_transfer_cr_account,
'GLCODE'
) interorg_transfer_cr_account,
apps.xxr12_get_val
(interorg_price_var_account,
'GLCODE'
) interorg_price_var_account,
apps.xxr12_get_val
(interorg_receivables_account,
'GLCODE'
) interorg_receivables_account,
apps.xxr12_get_val
(interorg_payables_account,
'GLCODE'
) interorg_payables_account,
apps.xxr12_get_val (intransit_inv_account,
'GLCODE'
) intransit_inv_account
FROM mtl_shipping_network_view a, gl_code_combinations_kfv b, qp_list_headers_vl pl
WHERE a.interorg_transfer_cr_account = b.code_combination_id and PRICELIST_ID=LIST_HEADER_ID
order by FROM_ORGANIZATION_CODE
a.to_organization_code, a.to_organization_name, DECODE (a.intransit_type,
2, 'Intransit',
1, 'Direct'
) "Transfer Type",
(SELECT meaning
FROM apps.mfg_lookups
WHERE lookup_type = 'MTL_FOB_POINT'
AND lookup_code = a.fob_point) fob_point,
a.elemental_visibility_enabled, DECODE (a.routing_header_id,
1, 'Standard',
2, 'Inspection',
3, 'Direct',
NULL, NULL
) receipt_routing,
manual_receipt_expense,DECODE (a.internal_order_required_flag,
1, 'Y',
2, 'N'
) intenal_order_required,
DECODE (a.matl_interorg_transfer_code,
1, 'None',
'2', 'Requested Value',
'3', 'Requested %',
'4', 'Predefined'
) transfer_Charge,INTERORG_TRNSFR_CHARGE_PERCENT, NAME,
distance_uom_code, to_organization_distance Value,
apps.xxr12_get_val
(interorg_transfer_cr_account,
'GLCODE'
) interorg_transfer_cr_account,
apps.xxr12_get_val
(interorg_price_var_account,
'GLCODE'
) interorg_price_var_account,
apps.xxr12_get_val
(interorg_receivables_account,
'GLCODE'
) interorg_receivables_account,
apps.xxr12_get_val
(interorg_payables_account,
'GLCODE'
) interorg_payables_account,
apps.xxr12_get_val (intransit_inv_account,
'GLCODE'
) intransit_inv_account
FROM mtl_shipping_network_view a, gl_code_combinations_kfv b, qp_list_headers_vl pl
WHERE a.interorg_transfer_cr_account = b.code_combination_id and PRICELIST_ID=LIST_HEADER_ID
order by FROM_ORGANIZATION_CODE
No comments:
Post a Comment