FUNCTION EnterPurchord()
' If $itemtype = "B", check Purchase Order entered
' message "1573/suppcode is:"&str(suppcode)
' message "1573/suppname is:"&str(suppname)
  vloadif(dpath|"besp_chk.vw")
  order change key "[Order_Nr]"
  data find "[Order_Nr]" equal refcode options ""
  if cerror
    x = EnterNewOrder()
    if x = -1
      return (-1)
    end if
    vunloadif("besp_chk.vw")
    exit function
  else
    currentorder   = precord
    x = EnterNewOrder()
    if x = -1
      return (-1)
    end if
    vunloadif("besp_chk.vw")
    exit function
  end if
END FUNCTION ' EnterPurchord()
