Sysytem says that EndDate should be greater than StartDate.Function looks like true.What is wrong?
3.Module 3.Task
Function ProcessIncomeDocs(StartDate = Undefined, EndDate = Undefined) Export
Message = "Error executing ServiceSrv.ProcessIncomeDocs";
EmptyString = "";
If StartDate <> Undefined Then
If TypeOf(StartDate) <> Type("Date") Then
Return Message + Chars.LF + "StartDate parameter has to have the Date type";
else
Return EmptyString;
EndIf;
EndIf;
If EndDate = Undefined Then
EndDate = EndOfDay(CurrentDate());
Else
If TypeOf(EndDate) <> Type("Date") Then
Return Message + Chars.LF + "EndDate parameter has to have the Date type";
else
Return EmptyString;
EndIf;
EndIf;
If StartDate <> Undefined Then
If EndDate < StartDate Then
Return Message + Chars.LF + "EndDate has to be greater than StartDate";
else
Return EmptyString;
EndIf;
EndIf;
EndProcedure
For students who study 1C Junior course.