tally_cancel_voucher
Cancel an existing TallyPrime voucher to void posted amounts while keeping its number and avoiding gaps; preview the write, then confirm after user approval.
Instructions
CANCEL an existing voucher in TallyPrime. It keeps its voucher number, marked cancelled, and its amounts stop counting — so the number series has no gap. Prefer this to deleting when a posted entry has to be voided.
Give the guid and current date from tally_get_vouchers, and a reason, which becomes the narration.
WRITES TO TALLYPRIME, in two steps. This call only PREVIEWS: it checks the change against the live books and returns exactly what would be written plus a confirmToken — nothing is changed. Show the preview to the user, and only after they approve it call tally_confirm_write with the token. Never confirm on your own initiative, and never confirm a preview the user has not seen.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guid | Yes | The voucher's guid, as returned by tally_get_vouchers. | |
| reason | Yes | Why it is cancelled. Becomes the narration. | |
| company | No | Company name. Omit to use whichever company TallyPrime has loaded. If given and it is not the loaded one, the call fails with TALLY_COMPANY_NOT_LOADED rather than returning another company's data. | |
| currentDate | Yes | The voucher's date as it is NOW in TallyPrime (from the same read). |