project QadFinancials > class BBillSchedule > method ValidateComponentDueDayForDayInMth

validation procedure


Parameters


iiDueDateinputintegerValue of the business field to validate.
icDueDateFieldNameinputcharacterName of the business field to validate.
iiBillingDateinputinteger
iiDelayMthinputinteger
icOccuranceNbrinputcharacter
icMonthsDelayFieldNameinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBillSchedule.ValidateComponentPost


program code (program3/bbillschedule.p)

/* ================================================================= */
/* Validate Due Date for Day In Month                                */
/* ================================================================= */
assign vcMessageOccurance = #T-1'Occurrence':255(101094581)T-1# + " ":U + icOccuranceNbr.

/* the due date is mandatory if billing date is existing*/
if iiBillingDate <> 0 and
    iiDueDate = 0
then do:
    <M-65 run SetMessage
       (input  trim(substitute(#T-71'If you specify a value in the Billing Day (&1) field, you must also specify a value in the Due Day (&2) field.':255(147041606)T-71#, vcMessageOccurance, iiDueDate)) (icMessage), 
        input  '':U (icArguments), 
        input  icDueDateFieldName (icFieldName), 
        input  string(iiDueDate) (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  ? (icRowid), 
        input  'qadfin-933093':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BBillSchedule>
    assign oiReturnStatus = -1.
end.

/* the due date should be blank if billing date is not existing*/
if iiBillingDate = 0 and 
    iiDueDate <> 0
then do:
    <M-55 run SetMessage
       (input  trim(substitute(#T-25'If the Billing Day (&1) field is 0, the Due Day (&2) field must also be 0.':255(517941445)T-25#, vcMessageOccurance, iiDueDate)) (icMessage), 
        input  '':U (icArguments), 
        input  icDueDateFieldName (icFieldName), 
        input  string(iiDueDate) (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  ? (icRowid), 
        input  'qadfin-841898':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BBillSchedule>
    assign oiReturnStatus = -1.
end.

/* the months delay should be blank if billing date is not existing*/
if iiBillingDate = 0 and 
    iiDelayMth <> 0
then do:
     <M-91 run SetMessage
        (input  trim(substitute(#T-73'If the Billing Day (&1) field is 0, the Months Delay (&2) field must also be 0.':255(257801167)T-73#, vcMessageOccurance, iiDelayMth)) (icMessage), 
         input  '':U (icArguments), 
         input  icMonthsDelayFieldName (icFieldName), 
         input  string(iiDelayMth) (icFieldValue), 
         input  'E':U (icType), 
         input  3 (iiSeverity), 
         input  ? (icRowid), 
         input  'qadfin-107099':U (icFcMsgNumber), 
         input  '':U (icFcExplanation), 
         input  '':U (icFcIdentification), 
         input  '':U (icFcContext), 
         output viFcReturnSuper (oiReturnStatus)) in BBillSchedule>
    assign oiReturnStatus = -1.
end.

/* the due date should bigger than billing date if delay month is not 0 */
if iiDelayMth = 0 and
    iiBillingDate > iiDueDate
then do:
    <M-94 run SetMessage
       (input  trim(substitute(#T-76'If the Months Delay (&1) field is 0, the Due Day (&2) field cannot be earlier than the Billing Day (&3) field.':255(139559139)T-76#, vcMessageOccurance, iiDueDate, vcMessageOccurance)) (icMessage), 
        input  '':U (icArguments), 
        input  icDueDateFieldName (icFieldName), 
        input  string(iiDueDate) (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  ? (icRowid), 
        input  'qadfin-381339':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BBillSchedule>
    assign oiReturnStatus = -1.
end.