I'm planning to implement closing and reopening the business years, based on French accounting rules, but I suppose these might be shared for many countries.
ExerciceOpen transactional object contains:
exercise start date
account for the opening balance
optional reference to last ExerciceBalance
possibly empty list of ExerciceOpenItem objects that each have:
account to credit if the result is positive - 120 in France
account to debit if the result is negative (loss) - 129 in France
ExerciceBalance transactional printable object that contains:
reference to ExerciseResult object
account for the closing balance
When creating the first exercise:
No Exercise* object must already exists
The ExerciceOpen object is created, date is preconfigured from the global preferences
The use fills in ExerciceOpenItem objects for opening balances
When the ExerciceOpen is submitted, it will create ledger entries based on the ExerciceOpenItem objects
When closing an exercise:
first the ExerciseResult is created referencing the last ExerciseOpen object
then the ExerciseResult object is submitted, when submitted it will create ledger entries so that all income and expense accounts have a zero balance on the exercise period.
then the ExerciceBalance is created referencing the ExerciseResult object
then the ExerciceBalance is submitted. When submitted it will ensure that ExerciseResult is submitted and all accounts (except the closing balance account) are zeroed on the exercise period by creating ledger entries to the closing balance account
When opening the next exercise:
An ExerciseOpen object is created referencing the last ExerciceBalance and the date must not be past or same as the ExerciceBalance close date
When submitted, it checks that the the ExerciceBalance is submitted and the opening balances are created based on the ExerciceBalance closing balances. it also checks that there is no unbalanced ledger entries past the opening date
When any transactional object is submitted, any ledger entry created is checked:
if it touches an income or expense account, the ledger date must not be before any submited ExerciseResult date
in any case the ledger entry date must not be before any submitted ExerciseBalance date
I'm planning to implement closing and reopening the business years, based on French accounting rules, but I suppose these might be shared for many countries.
When creating the first exercise:
When the ExerciceOpen is submitted, it will create ledger entries based on the ExerciceOpenItem objects
When closing an exercise:
When opening the next exercise:
When any transactional object is submitted, any ledger entry created is checked: