DBA Data[Home] [Help]

APPS.GMF_LOT_COSTING_PUB dependencies on GMF_LOT_COSTS

Line 275: --* rollup_lot_costs(). This is to initialize if there is no record in gmf_lot_costs

271: --* in process_batch()
272: --* - Added NVL clause in process_reversals to avoid "ORA error- Cannot insert NULL into
273: --* into TOTAL_TRANS_COST".
274: --* - Moved the old_cost.onhand_qty into ELSE part of lot_cost_cursor%FOUND in
275: --* rollup_lot_costs(). This is to initialize if there is no record in gmf_lot_costs
276: --* 19-Apr-2005 Dinesh Bug# 4165614
277: --* Passed correct shipped date to book the receive transaction in case of internal orders
278: --* Modified argument passing date for process_movements in process_receipts()
279: --* 28-Apr-2005 WmJohn Harris Bug# 4307381 -- procedure process_batch :

Line 396: old_cost gmf_lot_costs%ROWTYPE;

392: l_debug_level_high PLS_INTEGER;
393:
394: TYPE l_cost_tab_type IS TABLE OF SYSTEM.gmf_cost_type INDEX BY PLS_INTEGER;
395:
396: old_cost gmf_lot_costs%ROWTYPE;
397: old_cost_tab l_cost_tab_type; -- Existing lot costs of lot being rolled up
398:
399: new_cost gmf_lot_costs%ROWTYPE;
400: new_cost_tab l_cost_tab_type; -- New lot costs of lot being rolled up

Line 399: new_cost gmf_lot_costs%ROWTYPE;

395:
396: old_cost gmf_lot_costs%ROWTYPE;
397: old_cost_tab l_cost_tab_type; -- Existing lot costs of lot being rolled up
398:
399: new_cost gmf_lot_costs%ROWTYPE;
400: new_cost_tab l_cost_tab_type; -- New lot costs of lot being rolled up
401:
402: ing_cost gmf_lot_costs%ROWTYPE;
403: ing_cost_tab l_cost_tab_type; -- Batch ingredient cost

Line 402: ing_cost gmf_lot_costs%ROWTYPE;

398:
399: new_cost gmf_lot_costs%ROWTYPE;
400: new_cost_tab l_cost_tab_type; -- New lot costs of lot being rolled up
401:
402: ing_cost gmf_lot_costs%ROWTYPE;
403: ing_cost_tab l_cost_tab_type; -- Batch ingredient cost
404:
405: prd_cost gmf_lot_costs%ROWTYPE;
406: prd_cost_tab l_cost_tab_type; -- Batch product cost

Line 405: prd_cost gmf_lot_costs%ROWTYPE;

401:
402: ing_cost gmf_lot_costs%ROWTYPE;
403: ing_cost_tab l_cost_tab_type; -- Batch ingredient cost
404:
405: prd_cost gmf_lot_costs%ROWTYPE;
406: prd_cost_tab l_cost_tab_type; -- Batch product cost
407:
408: cur_cost_tab l_cost_tab_type; -- Current costs of batch step
409:

Line 1074: FROM gmf_lot_costs glc

1070: , p_cost_type_id NUMBER
1071: )
1072: IS
1073: SELECT *
1074: FROM gmf_lot_costs glc
1075: WHERE glc.lot_number = p_lot_number
1076: AND glc.inventory_item_id = p_item_id
1077: AND glc.organization_id = p_orgn_id
1078: AND glc.cost_type_id = p_cost_type_id

Line 1752: --* Procedure to create a cost header for a new lot in gmf_lot_costs *

1748: END process_burdens;
1749:
1750: --**********************************************************************************************
1751: --* *
1752: --* Procedure to create a cost header for a new lot in gmf_lot_costs *
1753: --* *
1754: --**********************************************************************************************
1755:
1756:

Line 1813: INSERT INTO gmf_lot_costs

1809: fnd_file.put_line(fnd_file.log,'Doc Type = '||p_trx_src_type_id||','||p_txn_act_id);
1810: fnd_file.put_line(fnd_file.log,'Doc ID = '||p_doc_id);
1811: END IF;
1812:
1813: INSERT INTO gmf_lot_costs
1814: ( header_id
1815: , inventory_item_id
1816: , lot_number
1817: , organization_id

Line 2374: l_header_id gmf_lot_costs.header_id%type;

2370:
2371: PROCEDURE process_adjustment
2372: IS
2373: loop_count NUMBER;
2374: l_header_id gmf_lot_costs.header_id%type;
2375: procedure_name VARCHAR2(100);
2376: BEGIN
2377:
2378: procedure_name := 'Process Adjustment';

Line 2408: UPDATE gmf_lot_costs

2404: END IF;
2405:
2406:
2407:
2408: UPDATE gmf_lot_costs
2409: SET onhand_qty = onhand_qty + transaction_row.trans_qty
2410: , last_update_date = sysdate
2411: WHERE header_id = old_cost.header_id;
2412:

Line 2489: --* not have the exact header_id as in gmf_lot_costs. Rather it will have the same header_id

2485: --*
2486: --* Dinesh 4227784 - Issue due to the above changes. Since we have added gmf_material_lot_cost_txns
2487: --* to the get_previous_costs_cur CURSOR, while querying for the prev-prev transaction
2488: --* it will ignore the reversal transactions if any, because the reversal transaction will
2489: --* not have the exact header_id as in gmf_lot_costs. Rather it will have the same header_id
2490: --* as that of its original transaction.
2491: --* So removed this table and added seperately to get new_cost_ind
2492: --*
2493: --**********************************************************************************************

Line 2516: FROM gmf_lot_costs glc

2512: header_id prev_header_id,
2513: unit_cost prev_unit_cost,
2514: RANK () OVER (PARTITION BY glc.inventory_item_id, glc.organization_id, glc.cost_type_id, glc.lot_number
2515: ORDER BY glc.cost_date DESC, glc.header_id DESC) lot_cost_rank
2516: FROM gmf_lot_costs glc
2517: WHERE glc.inventory_item_id = p_item_id
2518: AND glc.lot_number = p_lot_number
2519: AND glc.organization_id = p_orgn_id
2520: AND glc.cost_type_id = p_cost_type_id

Line 2550: l_prev_header_id gmf_lot_costs.header_id%TYPE;

2546: ORDER BY cost_trans_id DESC
2547: ;
2548:
2549: l_prev_cost_cnt NUMBER := 0;
2550: l_prev_header_id gmf_lot_costs.header_id%TYPE;
2551: l_prev_prev_header_id gmf_lot_costs.header_id%TYPE := NULL;
2552: l_prev_unit_cost gmf_lot_costs.unit_cost%TYPE;
2553: l_cost_header_id gmf_material_lot_cost_txns.cost_header_id%TYPE;
2554:

Line 2551: l_prev_prev_header_id gmf_lot_costs.header_id%TYPE := NULL;

2547: ;
2548:
2549: l_prev_cost_cnt NUMBER := 0;
2550: l_prev_header_id gmf_lot_costs.header_id%TYPE;
2551: l_prev_prev_header_id gmf_lot_costs.header_id%TYPE := NULL;
2552: l_prev_unit_cost gmf_lot_costs.unit_cost%TYPE;
2553: l_cost_header_id gmf_material_lot_cost_txns.cost_header_id%TYPE;
2554:
2555: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;

Line 2552: l_prev_unit_cost gmf_lot_costs.unit_cost%TYPE;

2548:
2549: l_prev_cost_cnt NUMBER := 0;
2550: l_prev_header_id gmf_lot_costs.header_id%TYPE;
2551: l_prev_prev_header_id gmf_lot_costs.header_id%TYPE := NULL;
2552: l_prev_unit_cost gmf_lot_costs.unit_cost%TYPE;
2553: l_cost_header_id gmf_material_lot_cost_txns.cost_header_id%TYPE;
2554:
2555: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;
2556: l_header_id gmf_lot_costs.header_id%TYPE;

Line 2555: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;

2551: l_prev_prev_header_id gmf_lot_costs.header_id%TYPE := NULL;
2552: l_prev_unit_cost gmf_lot_costs.unit_cost%TYPE;
2553: l_cost_header_id gmf_material_lot_cost_txns.cost_header_id%TYPE;
2554:
2555: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;
2556: l_header_id gmf_lot_costs.header_id%TYPE;
2557: l_unit_cost gmf_lot_costs.unit_cost%TYPE;
2558: l_prev_trans_unit_cost gmf_lot_cost_details.component_cost%TYPE;
2559: l_cmpnt_cost gmf_lot_cost_details.component_cost%TYPE;

Line 2556: l_header_id gmf_lot_costs.header_id%TYPE;

2552: l_prev_unit_cost gmf_lot_costs.unit_cost%TYPE;
2553: l_cost_header_id gmf_material_lot_cost_txns.cost_header_id%TYPE;
2554:
2555: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;
2556: l_header_id gmf_lot_costs.header_id%TYPE;
2557: l_unit_cost gmf_lot_costs.unit_cost%TYPE;
2558: l_prev_trans_unit_cost gmf_lot_cost_details.component_cost%TYPE;
2559: l_cmpnt_cost gmf_lot_cost_details.component_cost%TYPE;
2560: l_prev_new_cost_ind gmf_material_lot_cost_txns.new_cost_ind%TYPE; /* Dinesh No Bug# */

Line 2557: l_unit_cost gmf_lot_costs.unit_cost%TYPE;

2553: l_cost_header_id gmf_material_lot_cost_txns.cost_header_id%TYPE;
2554:
2555: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;
2556: l_header_id gmf_lot_costs.header_id%TYPE;
2557: l_unit_cost gmf_lot_costs.unit_cost%TYPE;
2558: l_prev_trans_unit_cost gmf_lot_cost_details.component_cost%TYPE;
2559: l_cmpnt_cost gmf_lot_cost_details.component_cost%TYPE;
2560: l_prev_new_cost_ind gmf_material_lot_cost_txns.new_cost_ind%TYPE; /* Dinesh No Bug# */
2561: procedure_name VARCHAR2(100);

Line 2783: --* In process_reversals procedure we check whether the cost record in gmf_lot_costs

2779: --************************************************************************************************
2780: --* Procedure Name : PROCESS_REVERSALS2
2781: --*
2782: --* Desc: New Procedure for handling batch product reversal transactions
2783: --* In process_reversals procedure we check whether the cost record in gmf_lot_costs
2784: --* just prior to reversal transaction is its Original transaction.
2785: --* If so, we will leap frog that record so as to reverse the effect of original transaction
2786: --* in the average cost of the lot. gmf_material_lot_cost_txns will be pointed to the original
2787: --* transaction record, so that subledger posts the entry accordingly. BUT we are not handling

Line 2810: l_orig_trx_header_id gmf_lot_costs.header_id%TYPE;

2806: SELECT DECODE(NVL(txns.new_cost_ind,0), 0, txns.cost_header_id, -txns.cost_header_id), txns.new_cost_ind
2807: FROM gmf_material_lot_cost_txns txns
2808: WHERE txns.transaction_id = p_orig_trans_id;
2809:
2810: l_orig_trx_header_id gmf_lot_costs.header_id%TYPE;
2811: l_orig_trx_new_cost_ind NUMBER;
2812: l_orig_trx_trans_cost NUMBER;
2813: orig_trx_cost_tab l_cost_tab_type;
2814:

Line 2815: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;

2811: l_orig_trx_new_cost_ind NUMBER;
2812: l_orig_trx_trans_cost NUMBER;
2813: orig_trx_cost_tab l_cost_tab_type;
2814:
2815: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;
2816: l_header_id gmf_lot_costs.header_id%TYPE;
2817: l_unit_cost gmf_lot_costs.unit_cost%TYPE;
2818: l_cmpnt_cost gmf_lot_cost_details.component_cost%TYPE;
2819: i NUMBER;

Line 2816: l_header_id gmf_lot_costs.header_id%TYPE;

2812: l_orig_trx_trans_cost NUMBER;
2813: orig_trx_cost_tab l_cost_tab_type;
2814:
2815: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;
2816: l_header_id gmf_lot_costs.header_id%TYPE;
2817: l_unit_cost gmf_lot_costs.unit_cost%TYPE;
2818: l_cmpnt_cost gmf_lot_cost_details.component_cost%TYPE;
2819: i NUMBER;
2820: procedure_name VARCHAR2(100);

Line 2817: l_unit_cost gmf_lot_costs.unit_cost%TYPE;

2813: orig_trx_cost_tab l_cost_tab_type;
2814:
2815: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;
2816: l_header_id gmf_lot_costs.header_id%TYPE;
2817: l_unit_cost gmf_lot_costs.unit_cost%TYPE;
2818: l_cmpnt_cost gmf_lot_cost_details.component_cost%TYPE;
2819: i NUMBER;
2820: procedure_name VARCHAR2(100);
2821:

Line 2865: UPDATE gmf_lot_costs

2861: THEN
2862: clone_costs;
2863: END IF;
2864:
2865: UPDATE gmf_lot_costs
2866: SET onhand_qty = onhand_qty + transaction_row.trans_qty,
2867: last_update_date = sysdate
2868: WHERE header_id = old_cost.header_id;
2869:

Line 2873: fnd_file.put_line(fnd_file.log,'Reversals2: Error in updating gmf_lot_costs for transaction_id: '||to_char(transaction_row.transaction_id));

2869:
2870: IF(SQL%ROWCOUNT = 1) THEN
2871: l_return_status := 'S';
2872: ELSE
2873: fnd_file.put_line(fnd_file.log,'Reversals2: Error in updating gmf_lot_costs for transaction_id: '||to_char(transaction_row.transaction_id));
2874: l_return_status := 'E';
2875: RETURN;
2876: END IF;
2877:

Line 3081: -- we can simply query the gmf_lot_costs table. If not we have to do dig around for costs.

3077: END IF;
3078: END IF;
3079: -- As there is a chance that the two organizations could be in separate companies we need to do something
3080: -- to ensure we can locate a cost for the sending transaction. If the two companies involved are the same
3081: -- we can simply query the gmf_lot_costs table. If not we have to do dig around for costs.
3082:
3083:
3084:
3085: IF (p_source_le <> p_target_le)

Line 6425: TYPE header_ids_tab IS TABLE OF gmf_lot_costs.header_id%TYPE

6421:
6422: TYPE lot_cost_cursor_type IS REF CURSOR;
6423: Cur_lc_header lot_cost_cursor_type;
6424:
6425: TYPE header_ids_tab IS TABLE OF gmf_lot_costs.header_id%TYPE
6426: INDEX BY BINARY_INTEGER;
6427: l_header_ids_tab header_ids_tab;
6428: l_empty_header_ids_tab header_ids_tab;
6429:

Line 6466: FROM gmf_lot_costs glc,

6462:
6463: -- Open a cursor that retrieves only the item/lot/sublot specified
6464: OPEN Cur_lc_header FOR
6465: SELECT glc.header_id, glc.rowid
6466: FROM gmf_lot_costs glc,
6467: gmf_lot_costed_items_gt gpo
6468: WHERE glc.organization_id = gpo.organization_id
6469: AND glc.inventory_item_id = gpo.inventory_item_id
6470: AND glc.cost_type_id = l_cost_type_id

Line 6554: DELETE FROM gmf_lot_costs

6550: --
6551: -- Now delete all rows from main lot costs table
6552: --
6553: FORALL indx IN l_rowids_tab.FIRST..l_rowids_tab.LAST
6554: DELETE FROM gmf_lot_costs
6555: WHERE rowid in l_rowids_tab(indx);
6556:
6557:
6558: fnd_file.put_line(fnd_File.LOG, ' ' || l_matl_rows_deleted || ' rows deleted from gmf_material_lot_cost_txns.');

Line 6560: fnd_file.put_line(fnd_File.LOG, ' ' || SQL%ROWCOUNT || ' rows deleted from gmf_lot_costs.');

6556:
6557:
6558: fnd_file.put_line(fnd_File.LOG, ' ' || l_matl_rows_deleted || ' rows deleted from gmf_material_lot_cost_txns.');
6559: fnd_file.put_line(fnd_File.LOG, ' ' || l_cdtl_rows_deleted || ' rows deleted from gmf_lot_cost_details.');
6560: fnd_file.put_line(fnd_File.LOG, ' ' || SQL%ROWCOUNT || ' rows deleted from gmf_lot_costs.');
6561:
6562:
6563: COMMIT;
6564:

Line 6583: FROM gmf_lot_costs glc,

6579: FROM gmf_material_lot_cost_txns t
6580: WHERE cost_type_id = l_cost_type_id
6581: AND EXISTS (
6582: SELECT 1
6583: FROM gmf_lot_costs glc,
6584: gmf_process_organizations_gt gpo
6585: WHERE glc.organization_id = gpo.organization_id
6586: AND glc.header_id = t.cost_header_id
6587: AND glc.cost_type_id = t.cost_type_id

Line 7410: l_old_cost gmf_lot_costs%ROWTYPE;

7406: AUTHOR : Sukarna Reddy INVCONV
7407: ==========================================================*/
7408:
7409: PROCEDURE process_lot_split IS
7410: l_old_cost gmf_lot_costs%ROWTYPE;
7411: l_old_cost_tab l_cost_tab_type;
7412: l_parent_lot_number VARCHAR2(80);
7413: i NUMBER;
7414: l_new_cost NUMBER;

Line 7586: l_old_cost gmf_lot_costs%rowtype;

7582:
7583: l_unit_cost NUMBER;
7584: l_total_cost NUMBER;
7585: l_cost_tab l_cost_tab_type;
7586: l_old_cost gmf_lot_costs%rowtype;
7587: l_new_cost_tab l_cost_tab_type;
7588: procedure_name VARCHAR2(100);
7589:
7590:

Line 7743: l_old_cost gmf_lot_costs%rowtype;

7739: ==========================================================*/
7740:
7741:
7742: PROCEDURE process_lot_translate IS
7743: l_old_cost gmf_lot_costs%rowtype;
7744: l_cost_tab l_cost_tab_type;
7745: l_lot_number VARCHAR2(80);
7746: l_trans_date DATE;
7747: i PLS_INTEGER;

Line 8248: FROM gmf_lot_costs

8244: AND lot_number = transaction_row.lot_number
8245: AND cost_type_id = l_cost_type_id;
8246:
8247: SELECT * INTO new_cost
8248: FROM gmf_lot_costs
8249: WHERE header_id = l_header_id;
8250:
8251: create_material_transaction
8252: ( p_header_id => l_header_id

Line 8543: -- row in) GMF_LOT_COSTS, add new rows to (or update the existing rows in)

8539: -- if transactions have been back-dated the algorithm will work, but might produce
8540: -- a wrong answer.
8541:
8542: -- For each replenishment we must add a new row to (or update the existing
8543: -- row in) GMF_LOT_COSTS, add new rows to (or update the existing rows in)
8544: -- GMF_LOT_COST_DETAILS and finally create a row in GMF_LOT_COST_TRANSACTIONS
8545: -- that links the inventory transaction to the row in GMF_LOT_COSTS.
8546:
8547: -- For each consumption we leave the GMF_LOT_COSTS and GMF_LOT_COST_DETAILS

Line 8545: -- that links the inventory transaction to the row in GMF_LOT_COSTS.

8541:
8542: -- For each replenishment we must add a new row to (or update the existing
8543: -- row in) GMF_LOT_COSTS, add new rows to (or update the existing rows in)
8544: -- GMF_LOT_COST_DETAILS and finally create a row in GMF_LOT_COST_TRANSACTIONS
8545: -- that links the inventory transaction to the row in GMF_LOT_COSTS.
8546:
8547: -- For each consumption we leave the GMF_LOT_COSTS and GMF_LOT_COST_DETAILS
8548: -- rows alone and just create the GMF_LOT_COST_TRANSACTIONS row.
8549:

Line 8547: -- For each consumption we leave the GMF_LOT_COSTS and GMF_LOT_COST_DETAILS

8543: -- row in) GMF_LOT_COSTS, add new rows to (or update the existing rows in)
8544: -- GMF_LOT_COST_DETAILS and finally create a row in GMF_LOT_COST_TRANSACTIONS
8545: -- that links the inventory transaction to the row in GMF_LOT_COSTS.
8546:
8547: -- For each consumption we leave the GMF_LOT_COSTS and GMF_LOT_COST_DETAILS
8548: -- rows alone and just create the GMF_LOT_COST_TRANSACTIONS row.
8549:
8550: --
8551: -- umoogala 21-Nov-2003

Line 9247: UPDATE gmf_lot_costs

9243: fnd_file.put_line
9244: (fnd_file.log,'Onhand balance has flipped from -ve to +ve. Setting onhand qty to residual qty');
9245: END IF;
9246:
9247: UPDATE gmf_lot_costs
9248: SET onhand_qty = l_residual_qty
9249: WHERE header_id = (SELECT max(header_id)
9250: FROM gmf_lot_costs
9251: WHERE organization_id = transaction_row.orgn_id

Line 9250: FROM gmf_lot_costs

9246:
9247: UPDATE gmf_lot_costs
9248: SET onhand_qty = l_residual_qty
9249: WHERE header_id = (SELECT max(header_id)
9250: FROM gmf_lot_costs
9251: WHERE organization_id = transaction_row.orgn_id
9252: AND lot_number = transaction_row.lot_number)
9253: RETURNING header_id INTO new_cost.header_id;
9254:

Line 9312: UPDATE gmf_lot_costs

9308: onhand_qty = new_cost.onhand_qty
9309: WHERE adjustment_id = transaction_row.doc_id;
9310: END IF;
9311:
9312: UPDATE gmf_lot_costs
9313: SET final_cost_flag = 1
9314: WHERE header_id = new_cost.header_id;
9315: ELSE
9316: IF transaction_row.source = 3 THEN