DBA Data[Home] [Help]

APPS.JAI_RCV_OPM_COSTING_PKG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 20

                                  Issue - Costing update for non-recoverable taxes is wrong when transaction UOM is
				  different from primary UOM.
				  Cause - In MMT table, the cost is to be updated in terms of rate / quantity in primary UOM. But
				  the code updates it with rate / quantity in transaction UOM.
				  Fix - When calculating the amount to update the MMT table, used rcv_transactions.primary_quantity
				  instead of jai_rcv_transactions.quantity.

  4.              01-OCT-2009    Bug 8966461 File version 120.0.12000000.11 / 120.5.12010000.5 / 120.9
                                 Issue - Costing update is wrong for CORRECT transactions with negative
				         quantity.
			         Fix - Divided the costing amount variables by quantity instead of
				       ABS(quantity). As the quantity is negative, costing amount should
				       be positive for the accouting to be correct. For negative quantity,
				       apportion factor will also be negative, and needs to be divided by
				       value with same sign.

  5.              14-Oct-2009    Bug 8894858 File version 120.0.12000000.12 / 120.5.12010000.6 / 120.10
                                 Issue - Costing update is wrong when the uom for RECEIVE transaction is
                                         is different from the source document (PO) uom.
                                 Fix - Used rcv_transactions.source_doc_quantity instead of rcv_transactions.quantity
                                       to calculate the costing amount to be added to po_unit_price.
                                       Also incorporated the changes for bug 8830292 - the program has to pick
                                       the transactions based on the transaction date, not the date of receipt.

  6.                 2-Sep-2010    Bug 9896814     Issue:INDIA LOCAL TAX IMPACT IS INCORRECT ON ACTUAL COST OF THE ITEM IN CASE OF RETURN
		Fix Details:Removed lv_rtr_trx from the IN list of jrt.transaction_type in cursor cur_rcv_costing_records.
    vkaranam for bug#12329209
    issue: TAX ACCOUNTING AT DELIVERY HITTING EXPENSE A/C AS WELL AS INVENTORY VALUATION
    fix : added the below condition in cursor cur_rcv_costing_records
    /*
 AND NOT (jrt.destination_type_code = 'EXPENSE'	or  jrt.INV_ASSET_FLAG='N' OR
 JRT.INV_ITEM_FLAG='N' OR JRT.BASE_aSSET_INVENTORY=2)	       */

------------------------------------------------------------------------------------------------------------*/
  ld_start_date  DATE;
Line: 63

  SELECT *
    FROM rcv_shipment_lines rsl
   WHERE ( p_organization_id IS NULL OR to_organization_id = p_organization_id )
     /*even though to_organization_id is NULL ALLOWED, it is always populated*/
     --AND trunc(creation_date) between cp_start_date AND cp_end_date /*bug 8830292*/
     AND to_organization_id IN ( SELECT jcio.organization_id
                                   FROM jai_cmn_inventory_orgs jcio,
                                        mtl_parameters mtl
                                  WHERE mtl.organization_id = jcio.organization_id
                                    AND mtl.process_enabled_flag = 'Y'
                               )
     AND EXISTS ( SELECT 1
		                FROM jai_rcv_transactions jrt
		               WHERE jrt.shipment_header_id = rsl.shipment_header_id
		                 AND jrt.shipment_line_id = rsl.shipment_line_id
		                 AND jrt.transaction_type = lv_deliver_trx
				 AND trunc(jrt.transaction_date) between cp_start_date and cp_end_date  /*bug 8830292*/
         AND EXISTS ( Select 1 from MTL_SYSTEM_ITEMS_B  msib where msib.inventory_item_id = jrt.inventory_item_id
                      and msib.process_costing_enabled_flag ='Y') --Added by nprashar for bug # 10272657
                 );
Line: 87

  SELECT rt.transaction_id, rt.quantity, rt.primary_quantity, jrt.currency_conversion_rate, jrt.transaction_type, rt.source_doc_quantity  /*bug 8894858*/
    FROM rcv_transactions rt, jai_rcv_transactions jrt
   WHERE rt.transaction_id = jrt.transaction_id
     AND jrt.shipment_line_id          = cp_shipment_line_id
     AND ( (jrt.transaction_type IN (lv_rtr_trx ,lv_deliver_trx)) /*Reverted the chnage performed by bug # 9896814 through bug #12738762*/
          OR (jrt.transaction_type = lv_correct_trx AND
           jrt.parent_transaction_type IN (lv_rtr_trx,lv_deliver_trx)) )
 AND NOT (jrt.destination_type_code = 'EXPENSE'	or  jrt.INV_ASSET_FLAG='N' OR JRT.INV_ITEM_FLAG='N' OR JRT.BASE_aSSET_INVENTORY=2)	 /*added for bug#12329209*/
     AND nvl(jrt.opm_costing_flag,'N') = 'N';
Line: 99

  SELECT receipt_num
    FROM jai_rcv_lines
   WHERE shipment_line_id = cp_shipment_line_id;
Line: 105

  SELECT name
    FROM hr_all_organization_units
   WHERE organization_id = cp_orgn_id;
Line: 111

  SELECT currency_code
    FROM gl_sets_of_books
   WHERE set_of_books_id = cp_cob_id ;
Line: 161

    fnd_file.put_line(fnd_file.output,'Concurrent Program Name: India - Program to Update OPM Cost' );
Line: 173

    fnd_file.put_line(fnd_file.output,'**********************************OPM Cost Update Begins**********************************' );
Line: 263

                                         UPDATE rcv_transactions
						 SET po_unit_price = po_unit_price + ln_costing_amount
					 WHERE transaction_id = rcv_costing_records.transaction_id;
Line: 268

					UPDATE mtl_material_transactions
						 SET transaction_cost = transaction_cost + ln_costing_amt_func_curr /* Modified for bug 7655123 */
					 WHERE rcv_transaction_id = rcv_costing_records.transaction_id;
Line: 272

					UPDATE jai_rcv_transactions
						 SET opm_costing_flag   = 'Y',
								 opm_costing_amount = ln_costing_amount
					 WHERE transaction_id     = rcv_costing_records.transaction_id;
Line: 284

        fnd_file.put_line(fnd_file.output,'Cost Update Successful' );
Line: 290

        fnd_file.put_line(fnd_file.output,'The Receipt was already Cost updated');
Line: 301

    fnd_file.put_line(fnd_file.output,'**********************************OPM Cost Update Ends**********************************' );