[Home] [Help]
1227: AND location_id = nvl(p_location_id,0);
1228:
1229: CURSOR rgi_register_id_cur(p_ec_code IN VARCHAR2) IS
1230: SELECT register_id
1231: FROM JAI_CMN_RG_I_TRXS a, JAI_CMN_INVENTORY_ORGS b
1232: WHERE ( a.posted_flag IS NULL OR a.posted_flag = 'N' ) --rchandan for bug#4428980
1233: AND ( a.master_flag IS NULL OR a.master_flag = 'N' ) --rchandan for bug#4428980
1234: AND a.organization_id = b.organization_id
1235: AND a.location_id = b.location_id
1238: ORDER BY a.inventory_item_id, a.Register_Id;
1239:
1240: CURSOR rgi_cur(p_register_id IN NUMBER) IS
1241: SELECT *
1242: FROM JAI_CMN_RG_I_TRXS a
1243: WHERE a.register_id = p_register_id;
1244:
1245: CURSOR balance_cur(p_serial_no IN NUMBER, p_organization_id IN Number, p_location_id IN Number,
1246: p_inventory_item_id IN Number, p_fin_year IN Number) IS
1245: CURSOR balance_cur(p_serial_no IN NUMBER, p_organization_id IN Number, p_location_id IN Number,
1246: p_inventory_item_id IN Number, p_fin_year IN Number) IS
1247: SELECT NVL(balance_packed, 0), NVL(balance_loose, 0)
1248: , nvl(manufactured_qty, 0) -- Vijay Shankar for Bug# 3165687
1249: FROM JAI_CMN_RG_I_TRXS
1250: WHERE slno = p_serial_no
1251: AND organization_id = p_organization_id
1252: AND location_id = nvl(p_location_id,0)
1253: AND fin_year = p_fin_year
1254: AND inventory_item_id = p_inventory_item_id;
1255:
1256: CURSOR c_max_fin_year(p_organization_id IN NUMBER, p_location_id IN NUMBER, p_inventory_item_id NUMBER) IS
1257: SELECT max(fin_year)
1258: FROM JAI_CMN_RG_I_TRXS
1259: WHERE organization_id = p_organization_id
1260: AND location_id = nvl(p_location_id,0)
1261: AND inventory_item_id = p_inventory_item_id;
1262:
1261: AND inventory_item_id = p_inventory_item_id;
1262:
1263: CURSOR serial_no_cur(p_organization_id IN NUMBER, p_location_id IN NUMBER, p_inventory_item_id NUMBER, p_fin_year NUMBER) IS
1264: SELECT nvl(max(slno), 0)
1265: FROM JAI_CMN_RG_I_TRXS
1266: WHERE organization_id = p_organization_id
1267: AND location_id = nvl(p_location_id,0)
1268: AND inventory_item_id = p_inventory_item_id
1269: AND fin_year = p_fin_year;
1424: ||', serial_no->' || v_serial_no);
1425: END IF;
1426:
1427: v_statement_id := '8';
1428: INSERT INTO JAI_CMN_RG_I_TRXS ( register_id,
1429: register_id_part_ii,
1430: fin_year,
1431: slno,
1432: TRANSACTION_SOURCE_NUM,
1537: 'N',
1538: 'Y' );
1539:
1540: v_statement_id := '9';
1541: UPDATE JAI_CMN_RG_I_TRXS
1542: SET posted_flag = 'Y',
1543: master_flag = 'N'
1544: WHERE register_id = rgi_rec.register_id;
1545: