DBA Data[Home] [Help]

APPS.OPIMPXWI dependencies on STANDARD

Line 73: Description: Gets the cost for an inventory item in a standard costing org

69:
70: /*
71: std_costing_org_item_cost
72:
73: Description: Gets the cost for an inventory item in a standard costing org
74: for a given date.
75:
76: The mcacd (mtl_cst_actual_cost_details) does not store the
77: the new cost in the actual_cost column of a transaction ID

Line 78: corresponding to a standard cost update (SCU). When we look

74: for a given date.
75:
76: The mcacd (mtl_cst_actual_cost_details) does not store the
77: the new cost in the actual_cost column of a transaction ID
78: corresponding to a standard cost update (SCU). When we look
79: up the item cost for an item with a SCU which:
80: 1. Was made prior to the start date of the collection program
81: 2. Was the last transaction on the item before the start
82: date of the collection program,

Line 87: 1. Get the historical item cost from the csc (cst_standard_costs)

83: we get the wrong cost from the actual_cost column of mcacd
84: as the starting cost for the collection program.
85:
86: To correct this, we need to do the following:
87: 1. Get the historical item cost from the csc (cst_standard_costs)
88: table. This table has the historical costs after an SCU is
89: made. We just need the latest cost prior to the start date.
90: If there is more than one SCU on the same day, use the latest
91: cost on that day.

Line 99: Parameters IN: p_org_id - standard costing organization_id

95: because the cic (cst_item_costs) no longer has the
96: historical cost.
97: ----Else use the cost in the CIC
98:
99: Parameters IN: p_org_id - standard costing organization_id
100: p_item_id - inventory item id
101: p_date - date for which we need cost
102:
103: Return values: item_cost (NUMBER) - item cost

Line 119: -- Cursor to get the historical cost from the cst_standard_costs (csc)

115:
116: -- procedure name
117: proc_name VARCHAR2(30) := 'std_costing_org_item_cost';
118:
119: -- Cursor to get the historical cost from the cst_standard_costs (csc)
120: -- table. Need the latest cost in the csc prior to the given date
121: CURSOR latest_csc_cost_to_date_cur (p_org_id NUMBER, p_item_id NUMBER,
122: p_cost_date DATE)
123: IS

Line 124: SELECT csc.standard_cost unit_cost

120: -- table. Need the latest cost in the csc prior to the given date
121: CURSOR latest_csc_cost_to_date_cur (p_org_id NUMBER, p_item_id NUMBER,
122: p_cost_date DATE)
123: IS
124: SELECT csc.standard_cost unit_cost
125: FROM cst_standard_costs csc
126: WHERE csc.organization_id = p_org_id
127: AND csc.inventory_item_id = p_item_id
128: AND csc.standard_cost_revision_date =

Line 125: FROM cst_standard_costs csc

121: CURSOR latest_csc_cost_to_date_cur (p_org_id NUMBER, p_item_id NUMBER,
122: p_cost_date DATE)
123: IS
124: SELECT csc.standard_cost unit_cost
125: FROM cst_standard_costs csc
126: WHERE csc.organization_id = p_org_id
127: AND csc.inventory_item_id = p_item_id
128: AND csc.standard_cost_revision_date =
129: (SELECT max(csc2.standard_cost_revision_date)

Line 128: AND csc.standard_cost_revision_date =

124: SELECT csc.standard_cost unit_cost
125: FROM cst_standard_costs csc
126: WHERE csc.organization_id = p_org_id
127: AND csc.inventory_item_id = p_item_id
128: AND csc.standard_cost_revision_date =
129: (SELECT max(csc2.standard_cost_revision_date)
130: FROM cst_standard_costs csc2
131: WHERE csc2.organization_id = p_org_id
132: AND csc2.inventory_item_id = p_item_id

Line 129: (SELECT max(csc2.standard_cost_revision_date)

125: FROM cst_standard_costs csc
126: WHERE csc.organization_id = p_org_id
127: AND csc.inventory_item_id = p_item_id
128: AND csc.standard_cost_revision_date =
129: (SELECT max(csc2.standard_cost_revision_date)
130: FROM cst_standard_costs csc2
131: WHERE csc2.organization_id = p_org_id
132: AND csc2.inventory_item_id = p_item_id
133: AND csc2.standard_cost_revision_date <

Line 130: FROM cst_standard_costs csc2

126: WHERE csc.organization_id = p_org_id
127: AND csc.inventory_item_id = p_item_id
128: AND csc.standard_cost_revision_date =
129: (SELECT max(csc2.standard_cost_revision_date)
130: FROM cst_standard_costs csc2
131: WHERE csc2.organization_id = p_org_id
132: AND csc2.inventory_item_id = p_item_id
133: AND csc2.standard_cost_revision_date <
134: trunc(p_cost_date) + 1);

Line 133: AND csc2.standard_cost_revision_date <

129: (SELECT max(csc2.standard_cost_revision_date)
130: FROM cst_standard_costs csc2
131: WHERE csc2.organization_id = p_org_id
132: AND csc2.inventory_item_id = p_item_id
133: AND csc2.standard_cost_revision_date <
134: trunc(p_cost_date) + 1);
135:
136: -- Cursor to get all the entries in the cst_standard_cost table for a
137: -- given item/org. If the cost on date cursor returns nothing, then

Line 136: -- Cursor to get all the entries in the cst_standard_cost table for a

132: AND csc2.inventory_item_id = p_item_id
133: AND csc2.standard_cost_revision_date <
134: trunc(p_cost_date) + 1);
135:
136: -- Cursor to get all the entries in the cst_standard_cost table for a
137: -- given item/org. If the cost on date cursor returns nothing, then
138: -- we need to know whether there have been cost updates after the
139: -- the date in question.
140: -- Since we have already checked for cost updates prior to the given

Line 147: SELECT csc.standard_cost unit_cost

143:
144: CURSOR all_csc_costs_post_date_cur (p_org_id NUMBER, p_item_id NUMBER,
145: p_cost_date DATE)
146: IS
147: SELECT csc.standard_cost unit_cost
148: FROM cst_standard_costs csc
149: WHERE csc.organization_id = p_org_id
150: AND csc.inventory_item_id = p_item_id;
151:

Line 148: FROM cst_standard_costs csc

144: CURSOR all_csc_costs_post_date_cur (p_org_id NUMBER, p_item_id NUMBER,
145: p_cost_date DATE)
146: IS
147: SELECT csc.standard_cost unit_cost
148: FROM cst_standard_costs csc
149: WHERE csc.organization_id = p_org_id
150: AND csc.inventory_item_id = p_item_id;
151:
152: -- Cursor to get the historical item cost from the

Line 1670: IF (cost_method = 1) THEN -- is a standard costing org

1666: /* get the item cost if this is not an expense subinventory or an expense
1667: item */
1668: IF ((asset_sub = 1 OR p_subinventory is NULL)
1669: AND (non_expense_item = 'Y')) THEN -- {
1670: IF (cost_method = 1) THEN -- is a standard costing org
1671:
1672: -- get standard costing org cost specially since mcacd does
1673: -- not update the actual cost properly in a standard cost
1674: -- update scenario

Line 1672: -- get standard costing org cost specially since mcacd does

1668: IF ((asset_sub = 1 OR p_subinventory is NULL)
1669: AND (non_expense_item = 'Y')) THEN -- {
1670: IF (cost_method = 1) THEN -- is a standard costing org
1671:
1672: -- get standard costing org cost specially since mcacd does
1673: -- not update the actual cost properly in a standard cost
1674: -- update scenario
1675: item_cost := std_costing_org_item_cost (p_organization_id, p_item_id,
1676: p_trx_date);

Line 1673: -- not update the actual cost properly in a standard cost

1669: AND (non_expense_item = 'Y')) THEN -- {
1670: IF (cost_method = 1) THEN -- is a standard costing org
1671:
1672: -- get standard costing org cost specially since mcacd does
1673: -- not update the actual cost properly in a standard cost
1674: -- update scenario
1675: item_cost := std_costing_org_item_cost (p_organization_id, p_item_id,
1676: p_trx_date);
1677: -- item cost on previous day for starting balances

Line 1708: IF (cost_method = 1) THEN -- standard costing org - we have a previous day

1704: l_start_qty := l_last_end_qty;
1705: l_end_qty := l_start_qty + p_total_qty;
1706: l_avg_qty := (l_start_qty+l_end_qty)/2;
1707:
1708: IF (cost_method = 1) THEN -- standard costing org - we have a previous day
1709: -- cost
1710: -- calculate values from costs
1711: l_start_val := l_start_qty * prev_day_item_cost;
1712: l_end_val := l_end_qty * item_cost;

Line 2201: -- standard costing orgs need be treated differently

2197: -- If this is not an expense sub or and expense item,
2198: -- then get the item cost
2199: IF ((asset_sub = 1 OR l_subinventory is NULL)
2200: AND (non_expense_item = 'Y')) THEN -- {
2201: -- standard costing orgs need be treated differently
2202: IF (cost_method = 1) -- is a standard costing org
2203: THEN -- {
2204: -- get standard costing org cost specially since mcacd does
2205: -- not update the actual cost properly in a standard cost

Line 2202: IF (cost_method = 1) -- is a standard costing org

2198: -- then get the item cost
2199: IF ((asset_sub = 1 OR l_subinventory is NULL)
2200: AND (non_expense_item = 'Y')) THEN -- {
2201: -- standard costing orgs need be treated differently
2202: IF (cost_method = 1) -- is a standard costing org
2203: THEN -- {
2204: -- get standard costing org cost specially since mcacd does
2205: -- not update the actual cost properly in a standard cost
2206: -- update scenario

Line 2204: -- get standard costing org cost specially since mcacd does

2200: AND (non_expense_item = 'Y')) THEN -- {
2201: -- standard costing orgs need be treated differently
2202: IF (cost_method = 1) -- is a standard costing org
2203: THEN -- {
2204: -- get standard costing org cost specially since mcacd does
2205: -- not update the actual cost properly in a standard cost
2206: -- update scenario
2207: item_cost := std_costing_org_item_cost (org_id,
2208: l_item_id,

Line 2205: -- not update the actual cost properly in a standard cost

2201: -- standard costing orgs need be treated differently
2202: IF (cost_method = 1) -- is a standard costing org
2203: THEN -- {
2204: -- get standard costing org cost specially since mcacd does
2205: -- not update the actual cost properly in a standard cost
2206: -- update scenario
2207: item_cost := std_costing_org_item_cost (org_id,
2208: l_item_id,
2209: p_from_date);