[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FT_ACCTADJ()
 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 := Ctod( "01/31/91" )  // In last 3 days of work week
       ? FT_ACCTADJ( dDate )        // 02/03/91 (next week's start)

       dDate := Ctod( "03/31/91" )  // Not in last 3 days of work week
       ? FT_ACCTADJ( dDate )        // 03/31/91 (this week's start)

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

       dDate := Ctod( "01/31/91" )  // In last 4 days of work week
       ? FT_ACCTADJ( dDate, .T. )   // 02/02/91 (this week's end)

       dDate := Ctod( "03/31/91" )  // Not in last 4 days of work week
       ? FT_ACCTADJ( dDate, .T. )   // 03/30/91 (prior week's end)

 Source: ACCTADJ.PRG

 Author: Jo W. French dba Practical Computing

See Also: FT_DATECNFG() FT_DAYTOBOW()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson