sync_vouchers_to_sql
Pull voucher headers for a date range into the session's in-memory SQL cache, enabling aggregate reporting without repeatedly fetching from Tally.
Instructions
Pull voucher HEADERS (date, type, number, party ledger, amount, narration — not line items) for one date range into this session's SQL cache (in-memory, gone when the session ends), so query_sql can aggregate/report on them (e.g. sales by customer by month) without re-fetching from Tally. Call this once per chunk to build up full multi-year history for the CURRENTLY OPEN company within this session — re-running for the SAME range just refreshes it (safe to re-run), and each call only touches vouchers within its own date range, so calling it for 2024 then 2025 gives you both, not just the latest. If you switch companies (set_company), sync again — the cache doesn't track which company a row came from, so don't query across a company switch without re-syncing first. IMPORTANT: pick a chunk size that won't time out — a full year (~7,500 vouchers here) took ~6s against the 10s request timeout; prefer quarterly or monthly chunks for a busy company, and back off further if a call times out. Does not include stock item / ledger line detail (see get_ledger_vouchers/get_vouchers for that).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | End date in DD-MM-YYYY format | |
| from | Yes | Start date in DD-MM-YYYY format |