PRIVATE lcgodown,lcgodno,lnSummary
STORE ' ' TO lcgodown,lcgodno
STORE 0 TO lnSummary

DO SET_MENU
= GET_PDT('GODOWN WISE MODEL WISE VEHICLE TRANSFERED')

PRIVATE lctmpwind
lctmpwind = sys(2015)
defi wind (lctmpwind) from 0,0 to 12,70 pane colo rgb(,,,174,215,255)
acti wind (lctmpwind)
move wind (lctmpwind) cent
@ 1,2 say 'Godown name : ' &gcrepo_clr
@ 1,20 get lcgodown size 1,20 pict '@!' valid getno(lcgodown,lcgodno,'GODOWN','GODOWN','GODOWN','GODOWN_NO','GODOWN_NO','*** GODOWN INFO. ***',.F.) &gcrepo_clr
READ with lctmpwind
rele wind (lctmpwind)

IF EMPTY(lcgodno)
	DO err_msg WITH 'NO GODOWN WAS SELECTED' + CHR(13) + 'REPORT WILL NOT BE GENERATED..'
	DO cls_menu
	RETURN
ENDIF

SELECT frmGodown.godown as FrmGodown,toGodown.GODOWN as toGodown,toGODOWN.GODOWN_NO,MODEL.MODEL,COUNT(*) AS QTY, ;
	IIF(frm_godown = lcgodno,'O','I') as inOutFlg,VEHICLETRNMAST.TRUCK_NO,VEHICLETRNMAST.TRANSPORT, ;
	VEHICLE.CHASIS_NO,VEHICLE.ENGINE_NO,VEHICLE.MODELCOLNO,VEHICLETRNMAST.TRANSFERNO,VEHICLETRNMAST.TRANSFERDT ;
	FROM GODOWN as toGodown,VEHICLETRNMAST,VEHICLETRNBODY,MODEL,VEHICLE,godown as frmGodown ;
	WHERE VEHICLETRNMAST.FRM_GODOWN = frmGodown.godown_no ;
		and VEHICLETRNMAST.TO_GODOWN = toGodown.godown_no ;
		AND VEHICLETRNMAST.TRANSFERNO = VEHICLETRNBODY.TRANSFERNO ;
		AND VEHICLETRNBODY.REF_NO = VEHICLE.REF_NO ;
		AND VEHICLE.MODEL_NO = MODEL.MODEL_NO ;
		AND BETWEEN(VEHICLETRNMAST.TRANSFERDT,DATE1,DATE2) ;
		AND INLIST(lcgodno,vehicleTrnMast.frm_godown,vehicleTrnMast.to_godown) ;
GROUP BY frmGodown,toGodown,toGODOWN.GODOWN_NO,MODEL.MODEL,inOutFlg,VEHICLETRNMAST.TRUCK_NO,VEHICLETRNMAST.TRANSPORT, ;
	VEHICLE.CHASIS_NO,VEHICLE.ENGINE_NO,VEHICLE.MODELCOLNO,VEHICLETRNMAST.TRANSFERNO,VEHICLETRNMAST.TRANSFERDT  ;
INTO CURSOR QUERY

SELECT QUERY
brow
IF RECCOUNT() > 0
	DO PRINREPO WITH '','GINTTRAN',''
ELSE
	DO ALERT WITH "NO RECORD FOUND FOR GIVEN PERIOD..."
ENDIF 
DO CLS_MENU