DBA Data[Home] [Help]

APPS.GMF_LOT_COSTING_PUB dependencies on GMF_MATERIAL_LOT_COST_TXNS

Line 287: --* Modified Code to remove the references to trans_id in gmf_material_lot_cost_txns table

283: --* 31-May-2005 Dinesh Vadivel - Bug 4320765(Part B)
284: --* Modified "Explosion_Cursor" to avoid duplicate rows
285: --* 01-Jun-2005 Sukarna Reddy INCONV changes for release 12.
286: --* 07-Jun-2006 Anand Thiyagarajan Bug#5285726
287: --* Modified Code to remove the references to trans_id in gmf_material_lot_cost_txns table
288: --* which caused the lot cost process after a final run to calculate wrong costs
289: --* 07-Jun-2006 Anand Thiyagarajan Bug#5287514
290: --* Modified code to call process_receipts procedure for Purchase Order Return to Vendors
291: --* and for PO Receipt corrections, which are similar to the Purchase Order receipts with a +ve or -ve signs

Line 348: --* Procedure process_reversals2() modified to handle the issue of gmf_material_lot_cost_txns.TOTAL_TRANS_COST

344: --* 09-SEP-2011 Bug 13000758 Saptagirish Pabolu -- Added the condition "IF l_debug_level >= l_debug_level_medium THEN"
345: --* to avoid unnecessary messages in the log file.
346: --* 23-DEC-2011 Bug13386258 / Bug13038249: Modified LACP code to improve LACP Performance.
347: --* 29-DEC-2011 Bug 13528789 Pramod B.H
348: --* Procedure process_reversals2() modified to handle the issue of gmf_material_lot_cost_txns.TOTAL_TRANS_COST
349: --* incorrectly updated with positive amount for WIP Completion Return transaction.
350: --* 06-Jan-2012 Bug 13038249 Parag Kanetkar
351: --* - Modifications to CURSOR unassociated_ings_cursor (specific to batches with routing steps) to group
352: --* transactions for non lot costed ingredients.

Line 2525: --* Procedure to create a new linking transaction in gmf_material_lot_cost_txns *

2521:
2522:
2523: --**********************************************************************************************
2524: --* *
2525: --* Procedure to create a new linking transaction in gmf_material_lot_cost_txns *
2526: --* *
2527: --**********************************************************************************************
2528: PROCEDURE create_material_transaction
2529: ( p_header_id IN NUMBER

Line 2567: INSERT INTO gmf_material_lot_cost_txns

2563: fnd_file.put_line(fnd_file.log,'New Cost Ind :'||p_new_cost_ind);
2564: fnd_file.put_line(fnd_file.log,'Lot Number :'||p_lot_number);
2565: END IF;
2566:
2567: INSERT INTO gmf_material_lot_cost_txns
2568: ( cost_trans_id
2569: , cost_header_id
2570: , cost_type_id
2571: , cost_trans_date

Line 2847: --* from the gmf_material_lot_cost_txns. The issue arises if we have the same item in two different lot cost methods

2843: --* HISTORY
2844: --*
2845: --* 27-Nov-2004 Dinesh Vadivel Bug# 4004338
2846: --* Added cost_type_code in where clause of the select query which returns the header_id
2847: --* from the gmf_material_lot_cost_txns. The issue arises if we have the same item in two different lot cost methods
2848: --* and try to run the Lot Actual Cost Process
2849: --*************************************************************************************
2850:
2851: PROCEDURE process_adjustment

Line 2949: --* NEW_COST_IND in gmf_material_lot_cost_txns is used in the Subledger Posting.

2945: --* X$ - where X$ is the cost of the record that is prior to 100 if any exists.
2946: --* This X$ will be set one and only if we get 100 and -100 adjacent.
2947: --*
2948: --* Dinesh -No Bug# - Earlier new_cost_ind was not set up properly.Now corrected along with 4053149
2949: --* NEW_COST_IND in gmf_material_lot_cost_txns is used in the Subledger Posting.
2950: --* If this indicator is set to 1 then that means whatever cost pointed by
2951: --* header_id in gmf_lot_cost_details is the AVERAGE COST and not the actual
2952: --* TRANSACTION COST. The Actual Transaction cost is under the negative of header_id.
2953: --* So, depending on this NEW_COST_IND, the SL will decide on posting at the cost of

Line 2956: --* Dinesh 4227784 - Issue due to the above changes. Since we have added gmf_material_lot_cost_txns

2952: --* TRANSACTION COST. The Actual Transaction cost is under the negative of header_id.
2953: --* So, depending on this NEW_COST_IND, the SL will decide on posting at the cost of
2954: --* header_id or negative of header_id (i.e., -header_id)
2955: --*
2956: --* Dinesh 4227784 - Issue due to the above changes. Since we have added gmf_material_lot_cost_txns
2957: --* to the get_previous_costs_cur CURSOR, while querying for the prev-prev transaction
2958: --* it will ignore the reversal transactions if any, because the reversal transaction will
2959: --* not have the exact header_id as in gmf_lot_costs. Rather it will have the same header_id
2960: --* as that of its original transaction.

Line 3014: FROM gmf_material_lot_cost_txns gmlct

3010: /* Bug 4227784 - Dinesh Added this as we removed txns table from above query */
3011: CURSOR get_material_lot_cost_txns(p_header_id NUMBER)
3012: IS
3013: SELECT gmlct.new_cost_ind
3014: FROM gmf_material_lot_cost_txns gmlct
3015: WHERE gmlct.cost_header_id = p_header_id
3016: ORDER BY cost_trans_id DESC
3017: ;
3018:

Line 3023: l_cost_header_id gmf_material_lot_cost_txns.cost_header_id%TYPE;

3019: l_prev_cost_cnt NUMBER := 0;
3020: l_prev_header_id gmf_lot_costs.header_id%TYPE;
3021: l_prev_prev_header_id gmf_lot_costs.header_id%TYPE := NULL;
3022: l_prev_unit_cost gmf_lot_costs.unit_cost%TYPE;
3023: l_cost_header_id gmf_material_lot_cost_txns.cost_header_id%TYPE;
3024:
3025: l_onhand_qty gmf_lot_costs.onhand_qty%TYPE;
3026: l_header_id gmf_lot_costs.header_id%TYPE;
3027: l_unit_cost gmf_lot_costs.unit_cost%TYPE;

Line 3030: l_prev_new_cost_ind gmf_material_lot_cost_txns.new_cost_ind%TYPE; /* Dinesh No Bug# */

3026: l_header_id gmf_lot_costs.header_id%TYPE;
3027: l_unit_cost gmf_lot_costs.unit_cost%TYPE;
3028: l_prev_trans_unit_cost gmf_lot_cost_details.component_cost%TYPE;
3029: l_cmpnt_cost gmf_lot_cost_details.component_cost%TYPE;
3030: l_prev_new_cost_ind gmf_material_lot_cost_txns.new_cost_ind%TYPE; /* Dinesh No Bug# */
3031: procedure_name VARCHAR2(100);
3032:
3033: BEGIN
3034:

Line 3234: --* in the average cost of the lot. gmf_material_lot_cost_txns will be pointed to the original

3230: --* Desc: New Procedure for handling batch product reversal transactions
3231: --* In process_reversals procedure we check whether the cost record in gmf_lot_costs
3232: --* just prior to reversal transaction is its Original transaction.
3233: --* If so, we will leap frog that record so as to reverse the effect of original transaction
3234: --* in the average cost of the lot. gmf_material_lot_cost_txns will be pointed to the original
3235: --* transaction record, so that subledger posts the entry accordingly. BUT we are not handling
3236: --* the case if original transactions and reversal transactions don't come next to each other.
3237: --* we process it as adjustment and it is a known issue.
3238: --*

Line 3257: --* Procedure modified to handle the issue of gmf_material_lot_cost_txns.TOTAL_TRANS_COST

3253: --* Find out the latest WIP completion record for same item, lot for the batch
3254: --* Material line. If there is none, then we'll return Error
3255: --* If found then create reversals with this transaction header
3256: --* Bug 13528789 Pramod B.H.
3257: --* Procedure modified to handle the issue of gmf_material_lot_cost_txns.TOTAL_TRANS_COST
3258: --* incorrectly updated with positive amount for WIP Completion Return transaction.
3259: --************************************************************************************************
3260:
3261:

Line 3269: FROM gmf_lot_costs glc, gmf_material_lot_cost_txns gmt,

3265: -- Bug 9239944
3266: CURSOR get_last_wipcompletion
3267: IS
3268: SELECT mmt.transaction_id
3269: FROM gmf_lot_costs glc, gmf_material_lot_cost_txns gmt,
3270: mtl_material_transactions mmt
3271: WHERE glc.lot_number = transaction_row.lot_number
3272: AND glc.inventory_item_id = transaction_row.inventory_item_id
3273: AND glc.organization_id = transaction_row.orgn_id

Line 3287: FROM gmf_material_lot_cost_txns txns

3283:
3284: CURSOR get_orig_trx(p_orig_trans_id NUMBER)
3285: IS
3286: SELECT DECODE(NVL(txns.new_cost_ind,0), 0, txns.cost_header_id, -txns.cost_header_id), txns.new_cost_ind
3287: FROM gmf_material_lot_cost_txns txns
3288: WHERE txns.transaction_id = p_orig_trans_id
3289: AND txns.cost_type_id = l_cost_type_id -- PK 9069363 added cost_type_id and order by
3290: Order by cost_header_id desc;
3291:

Line 8161: DELETE FROM gmf_material_lot_cost_txns

8157: FOR i in 1..l_max_loop_cnt
8158: LOOP
8159: -- Delete all material trx info
8160: FORALL indx IN l_indx_from..l_indx_to
8161: DELETE FROM gmf_material_lot_cost_txns
8162: WHERE cost_header_id in l_header_ids_tab(indx);
8163:
8164: l_matl_rows_deleted := l_matl_rows_deleted + SQL%ROWCOUNT;
8165:

Line 8197: fnd_file.put_line(fnd_File.LOG, ' ' || l_matl_rows_deleted || ' rows deleted from gmf_material_lot_cost_txns.');

8193: FORALL indx IN l_rowids_tab.FIRST..l_rowids_tab.LAST
8194: DELETE FROM gmf_lot_costs
8195: WHERE rowid in l_rowids_tab(indx);
8196:
8197: fnd_file.put_line(fnd_File.LOG, ' ' || l_matl_rows_deleted || ' rows deleted from gmf_material_lot_cost_txns.');
8198: fnd_file.put_line(fnd_File.LOG, ' ' || l_cdtl_rows_deleted || ' rows deleted from gmf_lot_cost_details.');
8199: fnd_file.put_line(fnd_File.LOG, ' ' || SQL%ROWCOUNT || ' rows deleted from gmf_lot_costs.');
8200:
8201: COMMIT;

Line 8214: FROM gmf_material_lot_cost_txns t

8210: -- Delete the residual transactions for which header is final costed
8211: -- but because of reversal, one more transaction got created for the same header.
8212:
8213: DELETE
8214: FROM gmf_material_lot_cost_txns t
8215: WHERE cost_type_id = l_cost_type_id
8216: AND t.final_cost_flag = 0 -- Bug 7173679
8217: AND EXISTS (
8218: SELECT 1

Line 9869: FROM gmf_material_lot_cost_txns gmlc

9865: AND transaction_action_id = 15;
9866:
9867: SELECT cost_header_id
9868: INTO l_header_id
9869: FROM gmf_material_lot_cost_txns gmlc
9870: WHERE transaction_id = l_trans_id
9871: AND lot_number = transaction_row.lot_number
9872: AND cost_type_id = l_cost_type_id;
9873:

Line 10447: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct

10443: AND mmt.organization_id = lcig.organization_id
10444: AND mmt.transaction_source_type_id = 5
10445: -- Perf B14616815 AND mtln.lot_number = nvl(p_lot_no,mtln.lot_number)
10446: AND NOT EXISTS (SELECT 1
10447: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct
10448: WHERE gmlct.transaction_id = mmt.transaction_id /* ANTHIYAG Bug#5285726 07-Jun-2006 */
10449: AND gmlct.cost_type_id = l_cost_type_id
10450: AND gmlct.lot_number = mtln.lot_number
10451: AND gmlct.final_cost_flag = 1)

Line 10503: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct

10499: AND mmt.transaction_source_type_id <> 5
10500: AND mmt.transaction_action_id NOT IN (15,22,6,2,50,51,28,36) /* PK added subinv Xfer Bug 9616762 Ignore container pack unpack Staging Xfers */
10501: -- Perf B14616815 AND mtln.lot_number = nvl(p_lot_no,mtln.lot_number)
10502: AND NOT EXISTS (SELECT 1
10503: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct
10504: WHERE gmlct.transaction_id = mmt.transaction_id /* ANTHIYAG Bug#5285726 07-Jun-2006 */
10505: AND gmlct.cost_type_id = l_cost_type_id
10506: AND gmlct.lot_number = mtln.lot_number
10507: AND gmlct.final_cost_flag = 1)

Line 10556: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct

10552: AND mmt.inventory_item_id = lcig.inventory_item_id
10553: AND mmt.organization_id = lcig.organization_id
10554: -- Perf B14616815 AND mtln.lot_number = nvl(p_lot_no,mtln.lot_number)
10555: AND NOT EXISTS (SELECT 1
10556: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct
10557: WHERE gmlct.transaction_id = mmt.transaction_id /* ANTHIYAG Bug#5285726 07-Jun-2006 */
10558: AND gmlct.cost_type_id = l_cost_type_id
10559: AND gmlct.lot_number = mtln.lot_number
10560: AND gmlct.final_cost_flag = 1)

Line 10608: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct

10604: AND mmt.transaction_source_type_id IN (8,7,13)
10605: AND mmt.transaction_action_id IN (15,22)
10606: -- Perf B14616815 AND mtln.lot_number = nvl(p_lot_no,mtln.lot_number)
10607: AND NOT EXISTS (SELECT 1
10608: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct
10609: WHERE gmlct.transaction_id = mmt.transaction_id /* ANTHIYAG Bug#5285726 07-Jun-2006 */
10610: AND gmlct.cost_type_id = l_cost_type_id
10611: AND gmlct.lot_number = mtln.lot_number
10612: AND gmlct.final_cost_flag = 1)

Line 10823: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct

10819: AND mmt.transaction_source_type_id = 5
10820: -- Perf B14616815 AND mtln.lot_number = nvl(p_lot_no,mtln.lot_number)
10821: AND mtln.lot_number = l_lot_no
10822: AND NOT EXISTS (SELECT 1
10823: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct
10824: WHERE gmlct.transaction_id = mmt.transaction_id /* ANTHIYAG Bug#5285726 07-Jun-2006 */
10825: AND gmlct.cost_type_id = l_cost_type_id
10826: AND gmlct.lot_number = mtln.lot_number
10827: AND gmlct.final_cost_flag = 1)

Line 10880: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct

10876: AND mmt.transaction_action_id NOT IN (15,22,6,2,50,51,28,36) /* PK added subinv Xfer Bug 9616762 Ignore container pack unpack Staging Xfers */
10877: -- Perf B14616815 AND mtln.lot_number = nvl(p_lot_no,mtln.lot_number)
10878: AND mtln.lot_number = l_lot_no
10879: AND NOT EXISTS (SELECT 1
10880: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct
10881: WHERE gmlct.transaction_id = mmt.transaction_id /* ANTHIYAG Bug#5285726 07-Jun-2006 */
10882: AND gmlct.cost_type_id = l_cost_type_id
10883: AND gmlct.lot_number = mtln.lot_number
10884: AND gmlct.final_cost_flag = 1)

Line 10934: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct

10930: AND mmt.organization_id = lcig.organization_id
10931: -- Perf B14616815 AND mtln.lot_number = nvl(p_lot_no,mtln.lot_number)
10932: AND mtln.lot_number = l_lot_no
10933: AND NOT EXISTS (SELECT 1
10934: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct
10935: WHERE gmlct.transaction_id = mmt.transaction_id /* ANTHIYAG Bug#5285726 07-Jun-2006 */
10936: AND gmlct.cost_type_id = l_cost_type_id
10937: AND gmlct.lot_number = mtln.lot_number
10938: AND gmlct.final_cost_flag = 1)

Line 10987: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct

10983: AND mmt.transaction_action_id IN (15,22)
10984: -- Perf B14616815 AND mtln.lot_number = nvl(p_lot_no,mtln.lot_number)
10985: AND mtln.lot_number = l_lot_no
10986: AND NOT EXISTS (SELECT 1
10987: FROM GMF_MATERIAL_LOT_COST_TXNS gmlct
10988: WHERE gmlct.transaction_id = mmt.transaction_id /* ANTHIYAG Bug#5285726 07-Jun-2006 */
10989: AND gmlct.cost_type_id = l_cost_type_id
10990: AND gmlct.lot_number = mtln.lot_number
10991: AND gmlct.final_cost_flag = 1)

Line 11668: UPDATE gmf_material_lot_cost_txns

11664: AND inventory_item_id = transaction_row.inventory_item_id)
11665: RETURNING header_id INTO new_cost.header_id;
11666:
11667: -- B3486228 Also set the transaction qty to the residual
11668: UPDATE gmf_material_lot_cost_txns
11669: SET new_onhand_qty = l_residual_qty
11670: WHERE transaction_id = transaction_row.transaction_id /* ANTHIYAG Bug#5285726 07-Jun-2006 */
11671: AND cost_header_id = new_cost.header_id;
11672: END IF;