File receipt draft
create_receipt_draftFiles a pending customer-payment draft ("customer paid X"). On approval in Taokeh it writes a bank receipt, settles the invoices and issues the official receipt (the next OR number, dated as the payment), as Sales → Receive payment does; nothing posts before that. It settles an existing customer's open invoices: customerId comes from resolve_customer and the open invoices from open_invoices. It takes either a lump total (allocated oldest first) or per-invoice allocations, which the server re-derives against live outstanding amounts. MYR only; a foreign-currency invoice is refused (it is settled in Banking → Payments). Approval books a bank account, so a cash payment is recorded in Taokeh under Sales → Official receipts → Receive payment with Received into = Cash. A receipt dated on or before the accounting start date never settles an opening invoice (that money is already counted in it): allocations naming one are refused and a lump total skips it. The payment proof (bank-in slip, remittance advice) can ride the draft and lands on the settlement entry on approval: inline (attachmentBase64 + attachmentMediaType + attachmentBytes) for small files or a client that cannot reach taokeh.my, or attachmentToken from request_attachment_upload; one lane per call.
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": {
"receiptDate": "<receiptDate>"
},
"name": "create_receipt_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | A short reviewer note in the reviewer's language naming what to double-check before approving (a smudged total, an uncertain party, a judgment call). Shown on a small approval card; empty when nothing needs flagging. | |
| total | No | ||
| customer | No | ||
| customerId | No | ||
| allocations | No | ||
| needsReview | No | ||
| receiptDate | Yes | ||
| printedTotal | No | ||
| bankAccountId | No | ||
| attachmentBytes | No | Decoded byte size of the original file. Sent with attachmentBase64, it lets the server refuse a truncated paste instead of filing a corrupt file. | |
| attachmentToken | No | The token from request_attachment_upload, once the file bytes have been PUT to its uploadUrl; it carries a photo or PDF of any size without base64. Not combined with attachmentBase64. The file lands on the settlement entry on approval. | |
| attachmentBase64 | No | The original payment proof (bank-in slip, remittance advice) as base64, for small files (a few KB); a photo or multi-page PDF goes through request_attachment_upload and `attachmentToken`. A bad type or oversize file is refused and nothing is filed. | |
| attachmentSha256 | No | SHA-256 of the original file as 64 hex characters: an optional second integrity check on attachmentBase64. | |
| attachmentFilename | No | Optional original filename for the attachment, e.g. bank-in-slip.jpg. | |
| attachmentMediaType | No | The attachment's media type, e.g. 'image/jpeg' or 'application/pdf'. Required with attachmentBase64; a type that does not match the file's bytes is refused and nothing is filed. |