<< Click to Display Table of Contents >> Navigation: PaXcel - functions > Customer Functions > SLAgeDoc() |
SLAgeDoc( Company, Account, Period, AgeAsAtDate )
This function will return the period balance based on the document date in relation to the ageing date supplied.
The arguments are as follows:
Company: This is the path to your Pastel data directory. For example:
c:\PastelData\_demo would enable you to retrieve information from the Pastel Partner demo company.
Account: A valid customer account must be supplied. Multiple accounts can be supplied in the format ABC001, ABC002, ABC003.
Period: The period must be a number between 0 and 5 the value returned will depend on this and the date supplied.
0 - The document date is greater than the ageing as date supplied
1 - The document date is in the same calendar period as the age as at date supplied
2 - The document date is in the previous month
3 - The document date is in the month specified less 2 months
4 - The document date is in the month specified less 3 months
5 - The document date is less than the last period stated
e.g We enter an age as date of 31/01/2011
0 - Documents date after 31/01/2011
1 - Documents dated between 01/01/2011 and 31/01/2011
2 - Documents dated between 01/12/2010 and 31/12/2010
3 - Documents dated between 01/11/2010 and 30/11/2010
4 - Documents dated between 01/10/2010 and 31/10/2010
5 - Documents dated prior to 30/09/2010
AgeAsAtDate: Should be a valid date used to calculate the days overdue of the invoice. The format of this date must be the same as your Windows regional settings.
SLAgeDoc( "c:\PastelData\_demo", "ACK001", 0, "31/01/2011" )
The following will display the balance for documents dated after 31/01/2011
SLAgeDoc( "c:\PastelData\_demo", "ACK001", 1, "31/01/2011" )
Balances for documents dated between 01/01/2011 and 31/01/2011
SLAgeDoc( "c:\PastelData\_demo", "ACK001", 2, "31/01/2011" )
Balances for documents dated between 01/12/2010 and 31/12/2010
SLAgeDoc( "c:\PastelData\_demo", "ACK001", 3, "31/01/2011" )
Balances for documents dated between 01/11/2010 and 30/11/2010
SLAgeDoc( "c:\PastelData\_demo", "ACK001", 4, "31/01/2011" )
Balances for documents dated between 01/10/2010 and 31/10/2010
SLAgeDoc( "c:\PastelData\_demo", "ACK001", 5, "31/01/2011" )
Balances for documents dated between before 01/10/2010 Only outstanding balances are calculated |