'UNBANKED - cash/cheque receipts not yet marked as "BANKED"

external   vkeybox() sch scw progress() messbox() vloadif() cpath PrintReport() colpopup()
external   vunloadif() dpath fentrybox() chkdate() remove() areas greeting
external   base findpopup() messboxwait() $drive Background()
external   X_path _SWIP_Crystal() Xreppath

public     ptstr choice sum_date br_name psa dsa #banking

global     x ReturnToMenu() p1 p2 p3 p4 p5 p6 Unbanked() m1 m2 r1 r2 c1 lm	CashUnbanked()


MAIN
single-step off
  screen clear box 1 1 sch scw 0 0 no-border
  repaint off
'   screen shortrestore dsa
'   p1 = "totcash.dfr"
'   p2 = ""   ' p2 = title at top of choice popup ("LABEL")
'   p3 = 1    ' p3 = printer to be used (1=HPIII_QC; 2=GEN_EPSN etc)
'   p4 = 1
'   p5 = 1    ' p5 = choose VIEW/PRINT 1=PRINT; 2=VIEW; 3=CHOOSE
'   p6 = 1    ' p6 = nr of copies

	m1 = "All˙receipts"
	m2 = "˙Cash˙only"
	r1=9					' c1=13
	r2=13
	lm=len(m1)			' message "lm is:"&str(lm)
	c1=abs(50-(lm/2))		' message "c1 is:"&str(c1)
	x = colpopup(r1,c1,r2,m1&m2,"{Esc} to exit",1,0,12,7,0,8)
	if x = 0
		if ptstr = m1                   ' coming back in
			Unbanked()
		elseif ptstr=m2
			CashUnbanked()
		end if
	elseif x=-1
 		ReturnToMenu()
	end if

	Background()

	ReturnToMenu()

END MAIN


FUNCTION Unbanked()     ' show keybox() listing each shop (& ALL)
	vloadif(dpath|"cshrcvd1.vw")
  	order change physical
  	progress(15,10," Please wait ... preparing report ",0)
  	data query execute "unbanked.dfq" index "unbankd1.idx"
' ŚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄæ
' not (deleted)
' and
' [Method_Of_Payment]<>"UNDPMT"
' and
' [Banked]=blank
' ĄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄŁ
  	if cerror
    		messboxwait(" No unbanked Cash/cheques/PDQ's ",0,0,1)
    		return (1)
  	end if
  	order sort now dictionary "unbankd2.idx" fields "[Branch;Method_Of_Payment;Date_Of_Receipt]" ascending

  	vunloadif("X_unbnkd.vws")
  	remove(X_path|"X_unbnkd.*")
'   	ClearHardSpaces()
   	data query execute "not_del.dfq" Smart4 X_path|"X_unbnkd" fields\
   	"[Branch;Method_Of_Payment;Date_Of_Receipt;Job_Nr;CustOrd_Name;Amount_Received]"
  	_SWIP_Crystal(Xreppath|"unbanked","S",0,1,"")

  screen clear box 1 1 sch scw 0 0 no-border

' if shop selection is not included in "areas" on oldpurch.vws refuse access
' if "areas" allow 2 areas, then only one report to be done at any one time (DG excepted)
' print report listing all cash rec'd for selected shop(s)
END FUNCTION ' DailyCash()


FUNCTION CashUnbanked()     '
  vloadif(dpath|"cshrcvd1.vw")
  order change physical
  progress(15,10," Please wait ... preparing report ",0)
  data query execute "unbankd1.dfq" index "unbankd1.idx"
' ŚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄæ
' not (deleted)
' and
' [Method_Of_Payment]="Cash"
' and
' [Banked]=blank
' ĄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄŁ
  if cerror
    messboxwait(" No unbanked Cash ",0,0,1)
    return (1)
  end if
  order sort now dictionary "unbankd2.idx" fields "[Branch;Method_Of_Payment;Date_Of_Receipt]" ascending

  p1 = "unbankd1.dfr"
  p6 = 1    ' p6 = nr of copies 'message " nr of copies"
  PrintReport(p1,p2,p3,p4,p5,p6)   ' draft version
  screen clear box 1 1 sch scw 0 0 no-border
' if shop selection is not included in "areas" on oldpurch.vws refuse access
' if "areas" allow 2 areas, then only one report to be done at any one time (DG excepted)
' print report listing all cash rec'd for selected shop(s)
END FUNCTION ' CashUnbanked()


FUNCTION ReturnToMenu()
  screen clear box 1 1 sch scw 0 0 no-border
  repaint off
  file unload all
  transfer cpath|"pm_menu.psl" in-memory
END FUNCTION ' ReturnToMenu()

