﻿
// Reset variables if new transaction or new customer
if not V[VD03_transactionid=&V[_transactionid]] _
    or not V[VD03_kunnr=&F[RF02D-KUNNR]]
  
  Set V[VD03_*] ""
  Set V[VD03_transactionid] "&V[_transactionid]"
  Set V[VD03_kunnr] "&F[RF02D-KUNNR]"
  
endif

if Q[transaction=VD03]  and Q[Page=SCREEN_1100_TAB_01]
  Set V[chartfilename] "&%[TEMP]\saleschart.&V[VD03_kunnr].png"
  
  // display chart?
  if V[VD03_display_chart=X]
    Box (7,86) (22,135) "Orders &V[year4] - &V[year0] in thousands"
    Pushbutton (7,137) "x" size=(1,1) process="chart_close.txt"
    Image (8,87) "&V[chartfilename]" -noBuffer
    
  else
    Pushbutton (7,86) "@NF\QDisplay chart@Chart orders" process="chart_open.txt"
  endif
endif
