Problem
  Customer Orders 1 piece of 101' Lumber
  RBase must remove from inventory then next higher 1/2 foot

SET VAR vTrQty1 REAL = 1 --(the number of pieces)
SET VAR vTrSize1 REAL = 101 --(the size of the piece)

SET VAR vQ1 REAL = (AINT((.vTrQty1 * (.vTrSize1 / 12 ))+.99))
SET VAR vQ1A  REAL = (.vTrQty1 * (.vTrSize1 / 12 ))
SET VAR vQ1B  REAL = (.vQ1 - .vQ1A)
IF .vQ1B <= .5 THEN
  SET VAR vQ1C = .vQ1
ELSE 
  SET VAR vQ1C = (.vQ1 - .5)
ENDIF

The answer is the next highest 1/2 foot. In this case 8.5 feet

Reply via email to