feat(mcp): books.write_off_invoice (P4b S7)
One tool for the bad debt (rules.md B-41): it writes off an invoice that will not be collected, Dr 6990 Bad Debt Expense / Cr 1200 Accounts Receivable, the receivable line tagged with the invoice so the document reads written_off and its figures stay derived (B-38). The evidence is the point, and the tool takes exactly one of upload_id (an upload, filed with the write-off) and existing_attachment_id (one already filed, linked to the write-off's entry and the invoice); neither or both is refused. amount defaults to what the invoice owes and may be partial. Without confirmed it is a preview: the engine runs on a clone (every refusal the post would give) and the answer is the figures the write-off would leave, entry_id 0, nothing journaled. The tool lives in its own group file, tools/write_offs.rs (plan U0a), so S4.4's document tools and this one land apart; it is destructive, needs books:write to preview and books:post to post (scopes.rs), and is documented under "Tools — A/R and A/P". The destructive-tool count, the tool tables and the journey test's tool count each move by one. Tests over the wire: write_off_then_recovery, write_off_needs_evidence.
This commit is contained in:
1 parent
4e71cf6320
commit
0f1c7786ab
8 files changed
+464
-7
No files matched your search
@@ -579,6 +579,7 @@ impl BooksServer {
|
||||
+ Self::payroll_router()
|
||||
+ Self::payouts_router()
|
||||
+ Self::tax_router()
|
||||
+ Self::write_offs_router()
|
||||
}
|
||||
|
||||
/// The settings in force for this request: the books' own, taken from
|
||||
@@ -1424,6 +1425,8 @@ mod schedules;
|
||||
mod settings_tools;
|
||||
#[path = "tools/tax.rs"]
|
||||
mod tax;
|
||||
#[path = "tools/write_offs.rs"]
|
||||
mod write_offs;
|
||||
|
||||
// The shared helpers are re-exported so every group file reaches them
|
||||
// through `use super::*`, and no group file reaches into another.
|
||||
|
||||
Reference in new issue
Block a user