ATC: DUE option(s) INTO $variable
This command sets the document due date (or optionally, sets it to a specific day of the month) or creates a variable with the date information.
- option(s) is required and can be any combination of the following. Options are applied in the order they are specified:
- n indicates the number of days to add or subtract to the current due date for the document. Use – (minus sign) to indicate number of days to subtract and use 0 (zero) to leave the due date as is.
- NOW n sets the Due date based on the current date plus or minus n. Positive numbers add; negative numbers subcontract, for example, NOW 1.5 means 1 and half days from now.
- DAY nth indicates that the due date should be changed to the nth day of the month, advancing to the next month if needed. sfPMS figures out which month by first calculating the DUE n date and then the DAY nth day.
- WEEKDAY indicates that if the resolved date (after all prior options are processed) lands on a Saturday or Sunday, the next Monday should be used.
- AT h sets the time portion of the Due date and, if used, must be specified as the last option. h is expressed in the 24-hour clock and can include decimals; for example, AT 15.5 menas 3:30 PM.
- [V2020+] FROM $variable sets the working date based on the value of a date variable.
- INTO $variable is optional, but must be specified after the option(s) if used. It creates a variable with the resolved date instead of setting the document Due date. The variable can then be used in subsequent ATC: SET commands.
ATC: DUE -2
The above example means “change the Due date to be two days earlier.”
ATC: DUE 6 DAY 4
The above example means “change the Due date to be 6 days later, then change the due date to the 4th of the month, moving to the next month if necessary.” For example, if the Due date is originally Oct 1, then this command will first change it to Oct. 7 then, using that as a starting point, change the due date to the 4th of the next month: Nov 4.
ATC: DUE 0 DAY 16 WEEKDAY
The above example means “change the Due date to the next 16th of the month, unless that day falls on a weekend, in which case change the Due date to the next Monday after the 16th.”
ATC: DUE 0 DAY 16 WEEKDAY INTO $NextDueDate ATC: SET SourceDate = $NextDueDate
The above example means “resolve the Due date as explained in the example above and then place that date in the $NextDueDate variable. Then set the Source Date to equal the date in the $NextDueDate variable.”
ATC: DUE 365 DAY 1 -1 INTO $EndOn
The above example means “change the due date to the last day of the month a year from the current date and store it into $EndOn.
ATC: SET $DocDate = DocMasterDetail.DocDate ATC: DUE FROM $DocDate 1 WEEKDAY
The above example means “Set the variable $DocDate to the document’s Doc date then set the Due date to one day past the Doc Date, advancing to Monday if that date falls on a Saturday or Sunday.”
Last updated: April 2, 2020 at 12:48 pm; green text = new