|
Gets the first free date of the financial year. |
|
|
DATE GetFreeDate ( enum eBookType eBookType, VARIANT_BOOL bHighest ) |
|
|
Parameters | eBookType | [in] A value of the 'eBookType' enumeration. | bHighest | [in] If this parameter is set to true the biggest closing date of the journals, on which entries for all books of the given book type can be made, will be returned. If you set this parameter to false the smallest date is returned, i.e. the date on which entries can be made on at least one of the books of the given book type. | | Return value |
A DATE containing the smallest date on which entries can be made for the given book type. If no entries can be made for the given book type, this method returns the 0-date for COM (i.e. 30/12/1899). | | Remarks |
This method takes the following into account:
| transfers: If a complete transfer is already done for the given book type, no more entries can be made and 0 is returned. |
| VAT closings: The begin date of the first non closed period is returned. This is only the case if the parameter eBookType has the value btPurch or btSales and when the parameter 'Limit entry in closed period to new sundry documents' is checked in your Venice installation (see general accounting parameters) also for the value btFinan. |
| closed journals |
|
|
See Also |
|
|
|
Samples |
|
|
C++ |
|
COleDateTime odtFreeDate;
// Consider the following situations:
// 1.
// - No complete transfer
// - VAT closed until 28/02
// - Journal for book A closed until 31/01
// - Journal for book B closed until 15/02
// - Journal for book C closed until 31/03
odtFreeDate = pYear->GetFreeDate (btSales, VARIANT_TRUE);
// Using the value true for bHighest will return 01/04 because this is the first free date after the VAT closing and allowing entries on all books
odtFreeDate = pYear->GetFreeDate (btSales, VARIANT_FALSE);
// Using the value false for bHighest will return 01/03 because this is the first free date after the VAT closing and allowing entries on at least one book
// 2.
// - Complete transfer
// - ...
odtFreeDate = pYear->GetFreeDate (btSales, VARIANT_TRUE /*VARIANT_FALSE*/);
// Using the value true or false for bHighest will return the 0-date because a complete transfer is already done
// 3.
// - No complete transfer
// - VAT closed until 31/12
// - ...
odtFreeDate = pYear->GetFreeDate (btSales, VARIANT_TRUE /*VARIANT_FALSE*/);
// Using the value true or false for bHighest will return the 0-date because the VAT is closed until the end of the financial year
// 4.
// - No complete transfer
// - VAT closed until 28/02
// - Journal for book A closed until 31/03
// - Journal for book B closed until 31/12
// - Journal for book C closed until 30/06
odtFreeDate = pYear->GetFreeDate (btSales, VARIANT_TRUE);
// Using the value true for bHighest will return the 0-date because there is no more free date allowing entries on all books
odtFreeDate = pYear->GetFreeDate (btSales, VARIANT_FALSE);
// Using the value false for bHighest will return 01/04 because this is the first free date after the VAT closing and allowing entries on at least one book
|
|
|
C# |
|
DateTime dtFreeDate;
// Consider the following situations:
// 1.
// - No complete transfer
// - VAT closed until 28/02
// - Journal for book A closed until 31/01
// - Journal for book B closed until 15/02
// - Journal for book C closed until 31/03
dtFreeDate = oYear.GetFreeDate (eBookType.btSales, true);
// Using the value true for bHighest will return 01/04 because this is the first free date after the VAT closing and allowing entries on all books
dtFreeDate = oYear.GetFreeDate (eBookType.btSales, false);
// Using the value false for bHighest will return 01/03 because this is the first free date after the VAT closing and allowing entries on at least one book
// 2.
// - Complete transfer
// - ...
dtFreeDate = oYear.GetFreeDate (eBookType.btSales, true /*false*/);
// Using the value true or false for bHighest will return the 0-date because a complete transfer is already done
// 3.
// - No complete transfer
// - VAT closed until 31/12
// - ...
dtFreeDate = oYear.GetFreeDate (eBookType.btSales, true /*false*/);
// Using the value true or false for bHighest will return the 0-date because the VAT is closed until the end of the financial year
// 4.
// - No complete transfer
// - VAT closed until 28/02
// - Journal for book A closed until 31/03
// - Journal for book B closed until 31/12
// - Journal for book C closed until 30/06
dtFreeDate = oYear.GetFreeDate (eBookType.btSales, true);
// Using the value true for bHighest will return the 0-date because there is no more free date allowing entries on all books
dtFreeDate = oYear.GetFreeDate (eBookType.btSales, false);
// Using the value false for bHighest will return 01/04 because this is the first free date after the VAT closing and allowing entries on at least one book
|
|
|
VBS |
|
Dim dtFreeDate
' Consider the following situations:
' 1.
' - No complete transfer
' - VAT closed until 28/02
' - Journal for book A closed until 31/01
' - Journal for book B closed until 15/02
' - Journal for book C closed until 31/03
dtFreeDate = oYear.GetFreeDate(btSales, True)
' Using the value true for bHighest will return 01/04 because this is the first free date after the VAT closing and allowing entries on all books
dtFreeDate = oYear.GetFreeDate(btSales, False)
' Using the value false for bHighest will return 01/03 because this is the first free date after the VAT closing and allowing entries on at least one book
' 2.
' - Complete transfer
' - ...
dtFreeDate = oYear.GetFreeDate(btSales, True) ' or False
' Using the value true or false for bHighest will return the 0-date because a complete transfer is already done
' 3.
' - No complete transfer
' - VAT closed until 31/12
' - ...
dtFreeDate = oYear.GetFreeDate(btSales, True) ' or False
' Using the value true or false for bHighest will return the 0-date because the VAT is closed until the end of the financial year
' 4.
' - No complete transfer
' - VAT closed until 28/02
' - Journal for book A closed until 31/03
' - Journal for book B closed until 31/12
' - Journal for book C closed until 30/06
dtFreeDate = oYear.GetFreeDate(btSales, True)
' Using the value true for bHighest will return the 0-date because there is no more free date allowing entries on all books
dtFreeDate = oYear.GetFreeDate(btSales, False)
' Using the value false for bHighest will return 01/04 because this is the first free date after the VAT closing and allowing entries on at least one book
|
|
|
VB.NET |
|
Dim dtFreeDate As Date
' Consider the following situations:
' 1.
' - No complete transfer
' - VAT closed until 28/02
' - Journal for book A closed until 31/01
' - Journal for book B closed until 15/02
' - Journal for book C closed until 31/03
dtFreeDate = oYear.GetFreeDate(eBookType.btSales, True)
' Using the value true for bHighest will return 01/04 because this is the first free date after the VAT closing and allowing entries on all books
dtFreeDate = oYear.GetFreeDate(eBookType.btSales, False)
' Using the value false for bHighest will return 01/03 because this is the first free date after the VAT closing and allowing entries on at least one book
' 2.
' - Complete transfer
' - ...
dtFreeDate = oYear.GetFreeDate(eBookType.btSales, True) ' or False
' Using the value true or false for bHighest will return the 0-date because a complete transfer is already done
' 3.
' - No complete transfer
' - VAT closed until 31/12
' - ...
dtFreeDate = oYear.GetFreeDate(eBookType.btSales, True) ' or False
' Using the value true or false for bHighest will return the 0-date because the VAT is closed until the end of the financial year
' 4.
' - No complete transfer
' - VAT closed until 28/02
' - Journal for book A closed until 31/03
' - Journal for book B closed until 31/12
' - Journal for book C closed until 30/06
dtFreeDate = oYear.GetFreeDate(eBookType.btSales, True)
' Using the value true for bHighest will return the 0-date because there is no more free date allowing entries on all books
dtFreeDate = oYear.GetFreeDate(eBookType.btSales, False)
' Using the value false for bHighest will return 01/04 because this is the first free date after the VAT closing and allowing entries on at least one book
|
|