COMPILE FUNCTION Comm_Quote_Exp_Dt(Method, Parm1)

/*
	Commuter module for Quote_Exp_Dt Dialog window.
	
	11/16/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/

DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box

EQU CRLF$	TO \0D0A\


ErrTitle = 'Error in Comm_Quote_Exp_Dt'
ErrorMsg = ''

Result = ''

BEGIN CASE
	CASE Method = 'Create'			; GOSUB Create
	CASE Method = 'OK'				; GOSUB OK
	CASE Method = 'Cancel'			; GOSUB Cancel
	CASE Method = 'Refresh'			; GOSUB Refresh
	CASE Method = 'LUDate'			; GOSUB LUDate
	CASE 1
		ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
		
END CASE


RETURN Result


* * * * * * *
Create:
* * * * * * *

obj_AppWindow('Create')

CurrExpDt 	= Parm1[1,@FM]

Set_Property(@WINDOW:'.CURR_EXP_DT','TEXT',CurrExpDt)
Set_Property(@WINDOW:'.CHANGE_DT','INVALUE',Date())

Set_Property(@WINDOW:'.CHANGED_BY','TEXT',OCONV(@USER4,'[XLATE_CONV,LSL_USERS*FIRST_LAST]'))


RETURN


* * * * * * *
Refresh:
* * * * * * *


RETURN


* * * * * * *
LUDate:
* * * * * * *

ReturnCtrl = Parm1[1,@RM]

IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')

DateSelected =  Dialog_Box('POPUP_YEAR',@WINDOW)

RetVal = OCONV(DateSelected, 'D4/')

IF RetVal NE '' THEN
	obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END

RETURN




* * * * * * *
Close:
* * * * * * *


* * * * * * *
Cancel:
* * * * * * *

End_Dialog(@WINDOW,'Cancel')

RETURN



* * * * * * *
OK:
* * * * * * *

Ctrls  = @WINDOW:'.CHANGE_DT':@RM		; Props  = 'DEFPROP':@RM
Ctrls := @WINDOW:'.CURR_EXP_DT':@RM		; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.NEW_EXP_DT':@RM		; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CHANGED_BY':@RM		; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CHANGE_COMMENTS'		; Props := 'DEFPROP'

Vals = Get_Property(Ctrls,Props)

CONVERT @RM TO @VM IN Vals

End_Dialog(@WINDOW,Vals)

RETURN


