' show STK_RETN records which have been returned to manufr
repaint on
repaint
single-step on
  vloadif(dpath|"stk_retn.vws")
'   order change key "[Job_Nr]"
  data query execute "drnotes3.dfq" index "stkrtns1.idx"
' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
' [DN_sheet]=blank
' and
' days([MR_sheet])>0
' and not (deleted)
' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  if cerror
    messbox(" No unprocessed returns to Manufacturers ",0,0,1)
    screen clear box 1 1 sch scw 0 0 no-border
    return (1)
  end if
  vunloadif("stk_retn.vws")

' show all unprocessed returns

' select RETURN to be processed use [Reference_Nr] to locate record
  while true
    repaint off
    vloadif(dpath|"drnotes5.vw")
    order change index "stkrtns1.idx"
'   screen save 1 1 sch scw $save_screen
'   $username = userid
'   order change physical
'   order sort now dictionary "x" fields "[author]" ascending
    x = bpopdb("drnotes5",6,"","[ViewDesc]","L70","[Job_Nr]","L0","[ReferenceNr]",5,5,20,78,"",1)
    if x = -1
      messbox(" Must Select! ",0,0,1)
    else
'     orderby = [author]
'     screen shortrestore dsa
message "ptstr is:"&str(ptstr)
'       repaint off
'       vunloadif("userid.vw")
      exit while
    end if
  end while


  vloadif(dpath|"drnotes1.vw")
  progress(15,10," Finding Invoices from"&suppname|" ",0)
  order change key "[Order_Nr]"
message "$refnr) is:"&str($refnr)
  data find "[Order_Nr]" equal $refnr options ""
  if cerror                               '   if none - then return
    x = messbox(" Job Nr not found - confirm as"&jobnr|"? (y/n) - {Esc} to exit ",1,0,0)
    if x = 0
    end if
  end if

