Back-dating formulas
The system uses the ASSVALBACKDATE table in the database to determine which back-dated
expenditures and revaluations require depreciation calculations. The purpose of the workflow
formulas is to add records for activities that require depreciation to the ASSVALBACKDATE
table.
To add records for back-dated capital expenditures, add a formula to the
BeforeUpdate
event of the WorkOrder
object.
To add records for back-dated revaluations, add a formula to the BeforeAdd
event of the Revaluation
object.
The Formula Editor includes these snippets for this purpose in the
tree:For example, a before BeforeUpdate
formula for work orders might include
these steps:
- Get the close date of the work order.
- If the close date falls in a period that has already been depreciated, check the Prior Periods to Check for Activity field for the asset valuation book.
- If the close date is before the prior periods allowed for the book, do not allow the user to close the work order.
- If the close date is within the prior periods allowed for the book, check if there is a record for the valuation in the ASSVALBACKDATE table.
- If there is no record for the valuation in the ASSVALBACKDATE field, add a record and set the BACKDATETO column to the close date of the work order.
- If there is a record for the valuation in the ASSVALBACKDATE field, and the close date of the work order is before the BACKDATETO date, update the BACKDATETO column with the work order's close date. Otherwise the existing date is kept.
When depreciation is run, the system verifies whether there is a record in the ASSVALBACKDATE table for each valuation that it processes. If a record is found, the system creates depreciation adjustments going back to the BACKDATETO date. The record for that valuation is then deleted from the ASSVALBACKDATE table.