POST reverse_adjustment¶
Reverse an Approved Consolidation Adjustment. Creates a reversal document with negated amounts and links both via reversal_journal_id.
Endpoint¶
POST /api/method/konsol.api.reverse_adjustment
Authentication: Required (Frappe session cookie)
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Document name of the adjustment to reverse |
What Happens¶
- Validates the adjustment is in "Approved" status
- Creates a new Consolidation Adjustment with:
- Debit/credit amounts swapped (reversal)
journal_idprefixed withREV-statusset to "Approved"reversal_journal_idpointing to the original
- Submits the reversal document
- Marks the original as "Reversed" with
reversal_journal_idpointing to the reversal - Both synced to ClickHouse
Response¶
{
"message": {
"original": "CADJ-IC001-0001",
"reversal": "CADJ-REV-IC001-0002",
"status": "Reversed"
}
}
Example¶
curl -X POST http://localhost:8069/api/method/konsol.api.reverse_adjustment \
-H "Content-Type: application/json" \
-b "cookies.txt" \
-d '{"name": "CADJ-IC001-0001"}'
Error Responses¶
Wrong status¶
{
"exc_type": "ValidationError",
"_server_messages": "[\"Cannot reverse: current status is 'Pending Approval', expected 'Approved'\"]"
}
dbt Impact¶
The gold_consolidation_adjustments model includes both the original (now "Reversed") and the reversal (status "Approved") entries. The reversal's negated amounts cancel out the original, producing a net-zero effect on consolidated results.
See also: approve_adjustment