ERP: Cancel a sale (stock back, invoice cancelled)
erp_sale_cancelCancel a recorded SALE (a sales order, e.g. SO-8): the payments on its invoice are reversed and the invoice cancelled, the goods that left the warehouse are put back in stock (return_stock=false if the goods did not come back), and the order is cancelled. Use for «скасуй продаж», «повернення», «клієнт повернув товар», and to CORRECT a sale: cancel it, then record the right one with erp_record_sale (say so to the person: two cards). Find the number with erp_sales_report / erp_order_list. An invoice-only sale (no order) is cancelled with invoice_cancel. Proposed write: one card listing the stock going back and the invoice. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"order": "<order>"
},
"name": "erp_sale_cancel"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order | Yes | ||
| reason | No | ||
| return_stock | No |