CAC Intercompany SO Price List vs. Item Cost Comparison

Description

Categories
Enginatics
Repository
GitHub
Report to show the internal SO price lists, source org item costs and compare against the "To Org" item costs and PII (profit in inventory) amounts. This report is used to ensure the profit in inventory (PII) cost model is working correctly.

Parameters:
===========
Price Effective Date: the date the sales order list prices are effective (mandatory).
Currency Conversion Date: the exchange rate conversion date to use to convert the sales price to the same currency as the item cost (mandatory).
Currency Conversion Type: the desired currency conversion type to use to convert the sales price to the same currency as the item cost (mandatory).
PII Cost Type: the profit in inventory cost type you wish to report (mandatory).
PII Sub-Element: the sub-element or resource for profit in inventory, such as PII or ICP (mandatory).
Assignment Set: the set of sourcing rules to use with calculating the PII item costs (mandatory).
Cost Type: the cost type to use for the item costs, such as Frozen or Pending (mandatory).
Category Set: any item category you wish, typically the Cost or Product Line category set (optional).
Item Number: enter the specific item numbers(s) you wish to report (optional).
Operating Unit: enter the specific operating unit(s) you wish to report (optional).
To Org Code: enter the specific To Org you wish to report (optional).
To Operating Unit: enter the specific operating unit(s) you wish to report (optional).
To Org Ledger: enter the specific "To Org" ledger(s) you wish to report (optional).

/* +=============================================================================+
-- | Copyright 2010 - 2024 Douglas Volz Consulting, Inc.
-- | All rights reserved.
-- | Permission to use this code is granted provided the original author is
-- | acknowledged. No warranties, express or otherwise is included in this permission.
-- +=============================================================================+
-- |
-- | Original Author: Douglas Volz ([email protected])
-- |
-- | Program Name: xxx_so_price_cost_pii_rept.sql
-- |
-- | Version Modified on Modified by Description
-- | ======= =========== =========================================
-- | 1.0 26 Nov 2010 Douglas Volz Created initial Report
-- | 1.18 13 Dec 2018 Douglas Volz Add Source Org OU to the InterCo_OUs inline table, to ensure
-- | uniqueness. Add Source Org joins for Src_Org item costs.
-- | Removed Release 11i edits. Replaced gl.name with gl.short_name.
-- | 1.19 17 Jun 2019 Douglas Volz Replace Oracle function apps.qp_price_list_pvt.get_product_uom_code
-- | with "and ucr.uom_code = qpa.product_uom_code". Comment out Source
-- | and To Org Added Costs columns.
-- | 1.20 21 Aug 2019 Douglas Volz Removed client-specific SQL logic.
-- | 1.21 25 Oct 2019 Douglas Volz Correction to p_price_effective_date parameter
-- | 1.22 17 Jul 2022 Douglas Volz Changes for multi-language lookup values. Changed
-- | back to Oracle QP price packages, to get price list
-- | information based on both category or item-specific price lists.
-- | 1.23 28 Nov 2023 Andy Haack Added G/L security for the "To Org" G/L and removed tabs.
-- | 1.24 06 Feb 2024 Douglas Volz Fix for G/L Daily Rates and add "To Org" inventory security.
-- | 1.25 25 Jun 2024 Douglas Volz Reinstall missing parameters, Item Number and To Operating Unit.
-- | 1.26 23 Oct 2026 Andy Haack Rebuilt to the Blitz Report SQL standards.
-- +=============================================================================+*/

SQL 247 lines

Parameters 12

ParameterTypeList of values SQL
Price Effective DateDate
(qll.start_date_active is null or qll.start_date_active<=:p_price_effective_date) and (qll.end_date_active is null or qll.end_date_active>=:p_price_effective_date)
Currency Conversion DateDate
Currency Conversion TypeLOV
PII Cost TypeLOV
cct.cost_type=:p_pii_cost_type
PII Sub-ElementLOV
br.resource_code=:p_pii_sub_element
Assignment SetLOV
mas.assignment_set_name=:p_assignment_set
Cost TypeLOV
Category SetLOV
Item NumberLOV
msiv_src.concatenated_segments=:p_item_number
To Org CodeLOV
mp_to.organization_code=:p_to_org_code
To Operating UnitLOV
haouv_to.name=:p_to_org_operating_unit
To Org LedgerLOV
gl_to.name=:p_to_org_ledger