The following lines contain the word 'select', 'insert', 'update' or 'delete':
Cursor C_Reg_Sel IS SELECT register_selected, po_id
FROM JAI_OPM_OSP_HDRS
WHERE osp_header_id = pr_new.batch_id ;
Cursor C_Vend_Id(p_po_id number) IS SELECT a. Vendor_id, a.ship_to_location_id, b.location_code FROM po_headers_all a, hr_locations_all b
WHERE po_header_id = p_po_id
AND a.SHIP_TO_LOCATION_ID = b.LOCATION_ID; /*Added ship_to_location_id for bug # 9088563*/
SELECT organization_id, INVENTORY_ITEM_ID,act_quantity,uom_code
FROM JAI_OPM_OSP_DTLS
WHERE osp_header_id = pr_new.batch_id
and issue_recpt_flag = 'R';
Cursor C_Tot_Excise IS SELECT SUM(excise_payable) tot_excise_payable
FROM JAI_OPM_OSP_DTLS
WHERE osp_header_id = pr_new.batch_id and
issue_recpt_flag = 'I';
Cursor C_Act_Out_Qty IS SELECT SUM(act_quantity) tot_qty
FROM JAI_OPM_OSP_DTLS
WHERE osp_header_id = pr_new.batch_id and
issue_recpt_flag = 'R';
Cursor C_Plan_Out_Qty IS SELECT plan_quantity plan_qty
FROM JAI_OPM_OSP_DTLS
WHERE osp_header_id = pr_new.batch_id and
issue_recpt_flag = 'R';
SELECT MAX(NVL(OSP_RETURN_DAYS,0))
from JAI_CMN_INVENTORY_ORGS --JAI_OPM_ORGANIZATIONS
WHERE organization_id = cpn_organization_id;
l_updated_by NUMBER;
lv_register JAI_OPM_OSP_HDRS.REGISTER_SELECTED%type ;
should also be inserted.
Presently , this was done at completion state , when the batch status = 3
08-Jun-2005 This Object is Modified to refer to New DB Entity names in place of Old DB Entity Names,
as required for CASE COMPLAINCE. Version 116.1
13-Jun-2005 File Version: 116.2
Ramananda for bug#4428980. Removal of SQL LITERALs is done
08-Jul-2005 Brathod
Issue: Inventory Convergence Uptake
Solution:
- Code related to batch_status = 2 (Release) is commented because this functionality
is now handled by the form JAINGOSP.fmb and the code is included in the form.
- Code is modified to remove reference to OPM Tables which are obsoleted in R12 Datamodel
and replace with the related Discrete Objects
--------------------------------------------------------------------------------------------*/
IF pr_new.BATCH_STATUS = 3 AND pr_old.BATCH_STATUS=1 THEN
/* Raise_application_error(-20010,'Cannot Certify the Batch Without Releasing it');
l_updated_by := pr_new.last_updated_by;
INSERT INTO JAI_OPM_TXN_EXTN_HDRS
( TRANSACTION_NAME,
TRANSACTION_HEADER_ID,
VENDOR_CUSTOMER_ID,
TRANSACTION_DATE,
ORIGINAL_DUE_DATE,
EXTENDED_DUE_DATE,
USER_REFERENCE,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN)
VALUES
( lv_tran_name, --'OSP_ISSUE',
pr_new.batch_id,
l_vend_id,
sysdate,
sysdate + return_days,
sysdate + return_days,
pr_new.batch_no,
sysdate,
l_updated_by,
sysdate,
l_updated_by,
null
);
l_updated_by,
rec.organization_id,
rec.inventory_item_id
);
UPDATE JAI_OPM_OSP_HDRS
SET final_receipt = 'Y',
receivable_excise = l_recv_qty
WHERE osp_header_id = pr_new.batch_id;