The following lines contain the word 'select', 'insert', 'update' or 'delete':
* field after scaling when integer is selected as scale_type.
* S.Sriram 15Jun2004 Bug# 3680537
* In the ceil_up and floor_down procedures, the qty. should first be rounded off
* to 9 digits before integer scaling is done.
* S.Sriram 26-Nov2004 NPD Convergence.
* Added orgn_id in scale and theoretical_yield procedures and modified references
* to sy_uoms table to mtl_units_of measure and used the INV_CONVERT.inv_um_convert
* procedure for Qty. conversion.
* TDaniel 21-NOV-2006 Bug 5667857 - Changed unit_of_measure reference to UOM_CODE.
* Raju 31-DEC-2011 Bug 13603986 - Changed mtl_unit_of_measure reference to mtl_unit_of_measure_vl.
*****************************************************************************************************************/
/**********************************************************************
* OVERVIEW:
* ========
*
The Scale Batch procedure accepts as input the local scale table,
which includes a subset of the detail lines of the batch as
they exist in gme_material_details.
This subset is defined by scale_rec record and contains the fields
necessary for scaling of the batch.
Initially, determine the uom of the FM_YIELD_TYPE.
Then Accumulate counter
values of batch output and input, which will determine the scale
type of the items and whether they contribute to yield.
From these counters, determine whether certain conditions
exist: does a simple scaling scenario exist that
will enable early exit or do we have to scale at all.
If these conditions are not met, continue on to PHASE I and
then PHASE II of the full scaling process.
**********************************************************************/
/* Procedure to get the standard uom for the 'fm_yield_type'
This will be used to convert all the quantities into single
unit of measure
*/
PROCEDURE get_fm_yield_type
(
p_orgn_id IN NUMBER,
x_conv_uom OUT NOCOPY VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2)
IS
CURSOR sy_uoms_typ_cursor(v_yield_type VARCHAR2) IS
SELECT uom_code
FROM mtl_units_of_measure_vl
WHERE uom_class = v_yield_type
AND base_uom_flag = 'Y';
SELECT uom_code
FROM mtl_units_of_measure_vl
WHERE uom_class = v_yield_type
AND base_uom_flag = 'Y';