project QadFinancials > class BEmployee > method ValGeneral

Description

Validates All common Employee Info


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BEmployee.PostValidateComponent


program code (program1/bemployee.p)

/* Start Date-End Date */
if t_sEmployee.EmployeeStartDate <> ? and
   t_sEmployee.EmployeeEndDate   <> ? and
   t_sEmployee.EmployeeEndDate    < t_sEmployee.EmployeeStartDate
then do:
    assign vcDatetemp  = <M-25 DisplayDate  (input  t_sEmployee.EmployeeEndDate (itDate)) in BEmployee>
           vcDatetemp1 = <M-5 DisplayDate  (input  t_sEmployee.EmployeeStartDate (itDate)) in BEmployee>.
    assign vcMessage = trim(substitute(#T-6'The end date (&3) cannot be before the starting date (&2) (employee: &1).':200(1836)T-6#, trim(t_sEmployee.EmployeeCode), trim(string(vcDatetemp1)), trim(string(vcDatetemp)))).
    <M-1 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  'tEmployee.EmployeeEndDate':U (icFieldName), 
        input  vcDatetemp (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  t_sEmployee.tc_Rowid (icRowid), 
        input  'QADFIN-1596':U (icFcMsgNumber), 
        input  '' (icFcExplanation), 
        input  '' (icFcIdentification), 
        input  '' (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BEmployee>
    assign oiReturnStatus = min(-1, viFcReturnSuper).
end.

/* Employee is a User */
if t_sEmployee.EmployeeIsUser <> false
then do:
    <M-2 run ValEmployeeIsUser (output viFcReturnSuper (oiReturnStatus)) in BEmployee>
    assign oiReturnStatus = if (oiReturnStatus  > 0 and 
                                viFcReturnSuper = 0) or 
                                oiReturnStatus  < 0
                            then oiReturnStatus
                            else viFcReturnSuper.
end.

/* Employee is a Creditor */
if t_sEmployee.Creditor_ID <> 0 and
   t_sEmployee.Creditor_ID <> ?
then do:
    <M-3 run ValRegCurrency (output viFcReturnSuper (oiReturnStatus)) in BEmployee>
    assign oiReturnStatus = if (oiReturnStatus  > 0 and 
                                viFcReturnSuper = 0) or 
                                oiReturnStatus  < 0
                            then oiReturnStatus
                            else viFcReturnSuper.
end.