Check the previous-year comparative source
get_comparative_source_stateCheck whether this statement’s previous-year comparative can be sealed, and get the approval assert_previous_year_no_activity needs. Datavrn refuses to finalise a statement whose previous-year figures come from a trial balance drawn AFTER the year-end closing entries: that derives a previous-year Profit and Loss of all zeroes which foots perfectly and is not last year’s results. When post_closing_detected is true, READ THE WHOLE finding TO YOUR USER — what the state is and all three ways out — and let them choose. Never choose for them. Two of the three remedies are things only they can do (upload the pre-closing trial balance, or enter last year’s signed figures as previous-year values, then generate a fresh version). The third is an assertion that the previous year genuinely had NO ACTIVITY, which is a statement about their client’s accounts, in their words, recorded in their name — a dormant company is the case it exists for. The approval is single-use, expires in 15 minutes, and is tied to this statement, this connection and the member you name; if the previous-year figures change in between, the assertion will be refused and you start again from here. If nothing is wrong there is no approval to hand back, because there is nothing to assert.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client_id | Yes | The entity (client) id — from list_clients. | |
| period_id | Yes | The reporting period id — from list_periods. | |
| template_id | Yes | The statement template id (e.g. 'schedule3_v1' Division I; see list_snapshots/workspace). | |
| on_behalf_of | No | The email address your user signs in to Datavrn with. This records who authorised the change alongside the connection that made it. REQUIRED on an API-key connection — ask your user for it, do not guess. On an OAuth connection leave it out: the change is recorded as authorised by the member who connected; if you do supply it, it must be that member. |