312: WHERE master_organization_id = p_master_org))
313: AND ROWNUM = 1;
314:
315: SELECT count(1) INTO material_org_count
316: FROM mtl_material_transactions_temp
317: WHERE inventory_item_id = p_item_id
318: AND organization_id = p_org_id
319: AND rownum = 1;
320:
318: AND organization_id = p_org_id
319: AND rownum = 1;
320:
321: --bug 7355994(7356679,7356680): setting lot-serial flag to be 1 in case
322: --rows exist in mtl_material_transactions_temp
323: IF (material_org_count = 1) THEN
324: material_org_count_ls := 1;
325: END IF;
326:
358: END IF;
359:
360: IF (material_org_count <> 1) THEN
361: SELECT COUNT(1) INTO material_master_count
362: FROM mtl_material_transactions_temp
363: WHERE inventory_item_id = p_item_id
364: AND (organization_id IN (SELECT organization_id
365: FROM mtl_parameters
366: WHERE master_organization_id = p_master_org))
366: WHERE master_organization_id = p_master_org))
367: AND rownum = 1;
368:
369: --bug 7355994(7356679,7356680): setting lot-serial flag to be 1 in
370: --case rows exist in mtl_material_transactions_temp
371: IF(material_master_count = 1) THEN
372: material_master_count_ls := 1;
373: END IF;
374:
1154: if (cost_moq <> 1 and cost_moq2 <> 1) then
1155:
1156: select count(1)
1157: into cost_tmp
1158: from mtl_material_transactions_temp
1159: where inventory_item_id = p_item_id
1160: and organization_id in
1161: (select organization_id
1162: from mtl_parameters