FUNCTION NewIndex()
  progress(fgp,bgp," Creating new Uninvoiced indices on"&ipath|"ÿ",0)
  progtag(fgi,bgi," Creating index for"&$branch)
  data query execute "cofsales.dfq" index "despat_1.idx"
' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
'   [SalesAnalysis]=$branch
' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  if cerror
'     messboxwait(" No uninvoiced orders ",0,0,1)
    return (-1)
  end if
  data query execute "despat_2.dfq" index ipath|$branch|"_uninv.idx"
' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
'   [Inv_Nr]=blank
'   and
'   not (deleted)
'   and
'   [SalesAnalysis]<>"X"
'   and
'   [SalesAnalysis]<>"P"
' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  if cerror
'     messboxwait(" No uninvoiced orders ",0,0,1)
    return (-1)
  end if
  error on
END FUNCTION ' NewIndex()
