Get20thOfNextMonth returns a date that is the 20th of the following month.
This function is particularly useful in accounting situations, where an invoice would be received in one month and paid on the 20th of the following month. So the invoice date is passed to the function to work out the payment due date.
Declaration: Function Get20thOfNextMonth( const aNow : TDateTime) : TDateTime
The use of this function is illustrated below.
procedure ScriptEvent(var Value:Variant);
var
v1stDate : TDateTime;
begin
//If the invoice date is 2024-06-25, then the result is 2024-07-20
v1stDate := Get20thOfNextMonth(Date);
//Displays the "invoice" date and then resulting payment date