create_physical_stock
Record a physical stock count in TallyPrime and update the item's book quantity to match the counted quantity, reconciling actual stock levels.
Instructions
Create a Physical Stock voucher in TallyPrime — records a physical count and updates the stock item's book quantity to match it (that's the point of the voucher). Confirmed live against a real Tally-exported XML template (uses DIFFACTUALQTY=Yes at voucher level, not a per-line flag) after an earlier version of this tool was found to corrupt the closing balance to a nonsensical negative number — fixed and re-verified: counting 95 of an item that had 100 correctly closed the item at 95. It does not post any monetary/ledger write-off for the resulting shortage or excess value — do that separately with create_voucher if needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Physical count date in DD-MM-YYYY format | |
| items | Yes | One entry per counted stock item. | |
| narration | No | Narration / description | |
| voucherNumber | No | Explicit voucher number. Normally omit and let Tally auto-number — but some Tally configurations stop auto-numbering certain voucher types via the XML gateway (confirmed live for item-invoice types). If creation fails with a blank EXCEPTIONS:1, check get_vouchers for the highest existing number of this voucher type and retry with voucherNumber set to the next one. |