/* $DOC$
   $NAME$
      ft_AcctAdj()
   $CATEGORY$
      Date/Time
   $ONELINER$
      Adjust beginning or ending fiscal pd. dates to acctg. dates
   $SYNTAX$
      ft_AcctAdj( [ <dGivenDate> ], [ <lIsEnd> ] ) -> dDate
   $ARGUMENTS$
      <dGivenDate> is any valid date in any valid format.
      Defaults to Date() if not supplied.

      <lIsEnd> is a logical variable. .F. = adjust for beginning of
      period mode, .T. = adjust for end of period mode.  Defaults to
      beginning of period mode.
   $RETURNS$
      An adjusted date dependent upon mode and work week start day.
   $DESCRIPTION$
      Called by other ft_Acct*() functions. The algorithm is:

      Beginning of period mode:

         IF dGivenDate is in last 3 days of work week
            Return next week's start date
         ELSE
            Return this week's start date
         ENDIF

      End of period mode:

         IF dGivenDate is in last 4 days of work week
            Return this week's end date
         ELSE
            Return prior week's end date
         ENDIF
   $EXAMPLES$
      Beginning of period mode (lIsEnd == .F.)

        dDate := hb_SToD( "19910131" )  // In last 3 days of work week
        ? ft_AcctAdj( dDate )        // 1991-02-03 (next week's start)

        dDate := hb_SToD( "19910331" )  // Not in last 3 days of work week
        ? ft_AcctAdj( dDate )        // 1991-03-31 (this week's start)

      End of period mode (lIsEnd == .T.)

        dDate := hb_SToD( "19910131" )  // In last 4 days of work week
        ? ft_AcctAdj( dDate, .T. )   // 1991-02-02 (this week's end)

        dDate := hb_SToD( "19910331" )  // Not in last 4 days of work week
        ? ft_AcctAdj( dDate, .T. )   // 1991-03-30 (prior week's end)
   $SEEALSO$
      ft_DateCnfg(), ft_DayToBoW()
   $END$
 */
