CAC Calculate ICP PII Item Costs Multi-Hop

Description

Categories
Enginatics
Repository
GitHub
Calculates the intercompany profit in inventory (PII or ICP) for each item and receiving organization, accumulated over every transfer of the sourcing chain from the origin organization to the receiving organization, for any number of hops.

One row per item and sourcing path. The profit of a hop is the receiving organization's item cost without its this level material overhead, resource, outside processing and overhead costs, less the source organization's converted item cost. Calculated To Org PII is the sum over all hops of the path, each converted into the next organization's currency, plus the origin organization's stored PII cost. Only the origin's stored PII is used, so the PII of intermediate organizations does not have to be loaded first. PII Cost Difference is the calculated less the stored PII of the receiving organization.

Sourcing is read from mrp_item_sourcing_levels_v: for each item and organization the most specific assignment of the assignment set (item-organization, item master source organization, category, item, organization, organization parameter, global), effective on the currency conversion date. Rules disabled before today are not available for a conversion date in the past. A receiving organization with several transfer sources gets one row per path, with rank and allocation percent of the last hop.

Circular Sourcing marks organizations that are only reached through a sourcing loop without an origin; they are calculated for one hop from the source organization's stored PII.

A missing exchange rate leaves the calculated columns blank. Inactive items, master organizations and items without costs in the source or receiving organization are not reported. The hidden parameter Numeric Sign for PII (default 1) states whether PII costs are stored as positive or negative amounts.

SQL 224 lines

Parameters 14