DBA Data[Home] [Help]

APPS.CSTPLENG dependencies on MTL_CST_LAYER_ACT_COST_DETAILS

Line 644: from mtl_cst_layer_act_cost_details

640: end if;
641:
642: select count(*)
643: into l_mclacd_exists
644: from mtl_cst_layer_act_cost_details
645: where transaction_id = i_txn_id
646: and layer_id = i_layer_id
647: and inv_layer_id = i_cur_layer_id;
648:

Line 651: update mtl_cst_layer_act_cost_details

647: and inv_layer_id = i_cur_layer_id;
648:
649: if (l_mclacd_exists > 0) then
650: l_stmt_num := 2;
651: update mtl_cst_layer_act_cost_details
652: set layer_quantity = nvl(layer_quantity,0) + i_qty,
653: variance_amount = nvl(variance_amount,0) + (nvl(actual_cost,0)-nvl(layer_cost,0))*i_qty
654: where transaction_id = i_txn_id
655: and layer_id = i_layer_id

Line 703: insert into mtl_cst_layer_act_cost_details (

699: if (l_debug = 'Y') then
700: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));
701: end if;
702:
703: insert into mtl_cst_layer_act_cost_details (
704: transaction_id,
705: organization_id,
706: layer_id,
707: inv_layer_id,

Line 777: insert into mtl_cst_layer_act_cost_details (

773: if (l_debug = 'Y') then
774: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));
775: end if;
776:
777: insert into mtl_cst_layer_act_cost_details (
778: transaction_id,
779: organization_id,
780: layer_id,
781: inv_layer_id,

Line 827: insert into mtl_cst_layer_act_cost_details (

823:
824: -- case 4 CREATE None None
825: elsif(i_mode = 'CREATE' and i_actual_cost_table = 'NONE' and i_layer_cost_table = 'NONE') then
826:
827: insert into mtl_cst_layer_act_cost_details (
828: transaction_id,
829: organization_id,
830: layer_id,
831: inv_layer_id,

Line 874: insert into mtl_cst_layer_act_cost_details (

870: from dual;
871: -- case 6 REPLENISH CILCD CILCD
872: elsif(i_mode = 'REPLENISH' and i_actual_cost_table = 'CILCD' and i_layer_cost_table = 'CILCD') then
873:
874: insert into mtl_cst_layer_act_cost_details (
875: transaction_id,
876: organization_id,
877: layer_id,
878: inv_layer_id,

Line 958: insert into mtl_cst_layer_act_cost_details (

954:
955: -- case 7 CONSUME MCACD CILCD
956: elsif(i_mode = 'CONSUME' and i_actual_cost_table = 'MCACD' and i_layer_cost_table = 'CILCD') then
957:
958: insert into mtl_cst_layer_act_cost_details (
959: transaction_id,
960: organization_id,
961: layer_id,
962: inv_layer_id,

Line 1044: insert into mtl_cst_layer_act_cost_details (

1040:
1041:
1042: -- case 8 CONSUME MCTCD CILCD
1043: elsif(i_mode = 'CONSUME' and i_actual_cost_table = 'MCTCD' and i_layer_cost_table = 'CILCD') then
1044: insert into mtl_cst_layer_act_cost_details (
1045: transaction_id,
1046: organization_id,
1047: layer_id,
1048: inv_layer_id,

Line 1155: insert into mtl_cst_layer_act_cost_details (

1151:
1152: if (l_debug = 'Y') then
1153: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));
1154: end if;
1155: insert into mtl_cst_layer_act_cost_details (
1156: transaction_id,
1157: organization_id,
1158: layer_id,
1159: inv_layer_id,

Line 1230: insert into mtl_cst_layer_act_cost_details (

1226: end if;
1227:
1228: l_stmt_num := 20;
1229:
1230: insert into mtl_cst_layer_act_cost_details (
1231: transaction_id,
1232: organization_id,
1233: layer_id,
1234: inv_layer_id,

Line 1800: FROM mtl_cst_layer_act_cost_details

1796: /* Check the MOH rates of the two transactions */
1797: l_stmt_num := 80;
1798: SELECT nvl(SUM(actual_cost),0)
1799: INTO l_last_moh
1800: FROM mtl_cst_layer_act_cost_details
1801: WHERE transaction_id = l_last_txn_id
1802: AND organization_id = i_org_id
1803: AND layer_id = i_layer_id
1804: AND inv_layer_id = l_inv_layer_id

Line 1815: FROM mtl_cst_layer_act_cost_details

1811: l_stmt_num := 85;
1812:
1813: SELECT nvl(SUM(actual_cost),0)
1814: INTO l_moh
1815: FROM mtl_cst_layer_act_cost_details
1816: WHERE transaction_id = i_txn_id
1817: AND organization_id = i_org_id
1818: AND layer_id = i_layer_id
1819: AND inv_layer_id = l_inv_layer_id

Line 1858: FROM mtl_cst_layer_act_cost_details

1854:
1855:
1856: SELECT nvl(SUM(layer_cost),0)
1857: INTO l_layer_cost
1858: FROM mtl_cst_layer_act_cost_details
1859: WHERE transaction_id = i_txn_id
1860: AND organization_id = i_org_id
1861: AND layer_id = i_layer_id
1862: AND inv_layer_id = l_inv_layer_id

Line 1943: UPDATE mtl_cst_layer_act_cost_details

1939: END IF;
1940:
1941: /* Update MCLACD entries */
1942: l_stmt_num := 100;
1943: UPDATE mtl_cst_layer_act_cost_details
1944: SET inv_layer_id = l_inv_layer_id
1945: WHERE transaction_id = i_txn_id
1946: AND organization_id = i_org_id
1947: AND layer_id = i_layer_id;

Line 2056: FROM mtl_cst_layer_act_cost_details mclacd

2052: i_req_id,
2053: i_prg_appl_id,
2054: i_prg_id,
2055: sysdate
2056: FROM mtl_cst_layer_act_cost_details mclacd
2057: WHERE transaction_id = i_txn_id
2058: AND inv_layer_id = l_inv_layer_id
2059: AND organization_id = i_org_id
2060: GROUP

Line 3638: from mtl_cst_layer_act_cost_details

3634: l_stmt_num := 11;
3635:
3636: select count(*)
3637: into l_mat_ovhds
3638: from mtl_cst_layer_act_cost_details
3639: where transaction_id = i_txn_id
3640: and organization_id = i_org_id
3641: and layer_id = i_layer_id -- cost group layer
3642: and inv_layer_id = i_inv_layer_id -- inventory layer

Line 3718: from mtl_cst_layer_act_cost_details

3714: -- the material overhead of 'total value' basis (basis_type = 5)
3715:
3716: select nvl(sum(actual_cost),0)
3717: into l_item_cost
3718: from mtl_cst_layer_act_cost_details
3719: where transaction_id = i_txn_id
3720: and organization_id = i_org_id
3721: and layer_id = i_layer_id
3722: and inv_layer_id = i_inv_layer_id;

Line 3940: from mtl_cst_layer_act_cost_details mclacd

3936:
3937: -- check if there is data in MCLACD (material overhead) for this layer.
3938: select count(*)
3939: into l_mclacd_ovhd
3940: from mtl_cst_layer_act_cost_details mclacd
3941: where transaction_id = i_txn_id
3942: and organization_id = i_org_id
3943: and layer_id = i_layer_id
3944: and inv_layer_id = i_inv_layer_id

Line 3995: update mtl_cst_layer_act_cost_details mclacd

3991: if(i_interorg_rec = 1) then
3992:
3993: l_stmt_num := 75;
3994:
3995: update mtl_cst_layer_act_cost_details mclacd
3996: set mclacd.actual_cost = nvl(mclacd.actual_cost, 0) + l_ovhd_cost,
3997: mclacd.layer_cost = nvl(mclacd.layer_cost,0) + l_ovhd_cost,
3998: mclacd.variance_amount = 0,
3999: mclacd.payback_variance_amount = 0

Line 4010: update mtl_cst_layer_act_cost_details mclacd

4006:
4007: else
4008:
4009: l_stmt_num := 76;
4010: update mtl_cst_layer_act_cost_details mclacd
4011: set mclacd.actual_cost = nvl(mclacd.actual_cost, 0) + l_ovhd_cost,
4012: mclacd.variance_amount = decode(l_txn_type_id,68,0,
4013: (nvl(mclacd.actual_cost,0) + l_ovhd_cost
4014: - nvl(mclacd.layer_cost,0)) * layer_quantity ),

Line 4037: insert into mtl_cst_layer_act_cost_details(

4033:
4034:
4035: else /* mclacd does not exist */
4036: l_stmt_num := 80;
4037: insert into mtl_cst_layer_act_cost_details(
4038: transaction_id,
4039: organization_id,
4040: inventory_item_id,
4041: cost_element_id,

Line 4217: from mtl_cst_layer_act_cost_details

4213:
4214: l_stmt_num := 6;
4215: select count(*)
4216: into l_count
4217: from mtl_cst_layer_act_cost_details
4218: where transaction_id = i_txn_id
4219: and organization_id = i_org_id;
4220:
4221: if (l_count = 0) then

Line 4245: from mtl_cst_layer_act_cost_details mclacd

4241: NULL, -- new cost
4242: NVL(sum(mclacd.variance_amount),0),
4243: NVL(sum(mclacd.payback_variance_amount)/abs(i_txn_qty),0), -- bugfix 1393484
4244: NVL(sum(mclacd.onhand_variance_amount),0)
4245: from mtl_cst_layer_act_cost_details mclacd
4246: where mclacd.transaction_id = i_txn_id
4247: and mclacd.organization_id = i_org_id
4248: and mclacd.layer_id = i_layer_id
4249: and mclacd.cost_element_id = mcacd.cost_element_id

Line 4311: from mtl_cst_layer_act_cost_details mclacd

4307: NVL(sum(mclacd.variance_amount),0),
4308: 'N',
4309: NVL(sum(mclacd.payback_variance_amount)/abs(i_txn_qty),0), -- bugfix 1393484
4310: NVL(sum(mclacd.onhand_variance_amount),0)
4311: from mtl_cst_layer_act_cost_details mclacd
4312: where mclacd.transaction_id = i_txn_id
4313: and mclacd.organization_id = i_org_id
4314: and mclacd.layer_id = i_layer_id
4315: and not exists

Line 4686: ** MTL_CST_LAYER_ACT_COST_DETAILS will be populated and the other **

4682: ** This function is called to update inventory layer cost. **
4683: ** It will determine the new elemental costs of the layer based **
4684: ** on user-enter values and compute the adjustment amounts to **
4685: ** inventory valuation. **
4686: ** MTL_CST_LAYER_ACT_COST_DETAILS will be populated and the other **
4687: ** cost tables (CILCD, CIL, CLCD, CQL, CICD, CIC) will be updated **
4688: ** accordingly with the new cost information. **
4689: ** This function is duplicated from CSTPAVCP.average_cost_update. **
4690: ** **

Line 4766: ** Insert records into mtl_cst_layer_act_cost_details. **

4762:
4763: l_stmt_num := 10;
4764:
4765: /*********************************************************
4766: ** Insert records into mtl_cst_layer_act_cost_details. **
4767: *********************************************************/
4768:
4769: insert into mtl_cst_layer_act_cost_details (
4770: transaction_id,

Line 4769: insert into mtl_cst_layer_act_cost_details (

4765: /*********************************************************
4766: ** Insert records into mtl_cst_layer_act_cost_details. **
4767: *********************************************************/
4768:
4769: insert into mtl_cst_layer_act_cost_details (
4770: transaction_id,
4771: organization_id,
4772: layer_id,
4773: inv_layer_id,

Line 4884: from mtl_cst_layer_act_cost_details

4880: l_stmt_num := 20;
4881:
4882: /* select count(*)
4883: into l_neg_cost
4884: from mtl_cst_layer_act_cost_details
4885: where transaction_id = i_txn_id
4886: and organization_id = i_org_id
4887: and layer_id = i_layer_id
4888: and inv_layer_id = l_inv_layer_id

Line 4935: from mtl_cst_layer_act_cost_details mclacd

4931: i_req_id,
4932: i_prg_appl_id,
4933: i_prg_id,
4934: sysdate
4935: from mtl_cst_layer_act_cost_details mclacd
4936: where mclacd.transaction_id = i_txn_id
4937: and mclacd.organization_id = i_org_id
4938: and mclacd.layer_id = i_layer_id
4939: and mclacd.inv_layer_id = l_inv_layer_id;

Line 5946: from mtl_cst_layer_act_cost_details

5942:
5943: select (sum(actual_cost) - sum(layer_cost)),sum(variance_amount),
5944: sum(onhand_variance_amount)
5945: into l_cost,l_var,l_onhand_var
5946: from mtl_cst_layer_act_cost_details
5947: where transaction_id = i_txn_id
5948: and organization_id = i_org_id
5949: and cost_element_id = cost_element;
5950: