{"skills":[{"name":"Reconcile a stocktake to the right cut-off","description":"Adjust physical counts for movements between the count and snapshot times before investigating stock variances.","content":"# Reconcile a stocktake to the right cut-off\n\nAdjust physical counts for movements between the count and snapshot times before investigating stock variances.\n\n## When to use this skill\n\n- A stock count was taken during trading and the books are at close of day.\n- Branches counted at different times from the system snapshot, or stock moved between them.\n- A variance appeared after a count and someone suspects a delivery or posting delay.\n\n## When not to use it\n\n- Valuing stock for the accounts, such as cost or net realisable value. That is for the accountant or auditor.\n- Planning statutory audit procedures for a count.\n- Investigating suspected theft. Follow the business's HR and security procedures.\n\n## What you need\n\n- Dated book snapshot and physical counts per location and SKU, with count times\n- Timed movement log with physical and posting times, quantity signs and ownership or location boundaries\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- When exactly was each line counted, and what time is the book snapshot?\n- Does the movement log show the physical time of each movement as well as its posting time?\n- Is all the counted stock owned by the business and at the same location as the book figure?\n- What were the last goods-received and dispatch documents at the time of the count?\n\n## Method\n\n1. Compare the same thing on both sides: stock owned by the business, at the same location, in the same base unit. Keep consignment stock, customer-owned goods and stock at another branch out of scope.\n2. Fix the cut-off. Note the last goods-received and dispatch documents at the count so each movement can be placed before or after it.\n3. Bring each count to the snapshot time using physical movement times. If counted earlier, add movements strictly after the count time and up to and including the snapshot time. If counted later, reverse movements strictly after the snapshot and up to the count. A later posting timestamp does not move an earlier physical receipt past the cut-off; check whether the book snapshot included it.\n4. Treat a transfer as a departure at the source and an arrival at the destination, each at its own time. Mark movements recorded at the exact counting moment with no stated sequence as ambiguous, unless the input defines inclusive timing.\n5. Compare adjusted physical less book quantity for each line. Explain variances caused by a known posting delay separately from unexplained differences, and keep offsetting differences between locations visible.\n6. Ask for a recount of lines with unexplained variances before any corrective posting.\n\n## Checks before you deliver\n\n- A transfer between two branches should not be applied as a receipt at both.\n- An apparent loss can simply be a delivery accepted after counting. Do not compare two timestamps as if the warehouse stood still.\n- Using the posting time instead of the physical time moves a receipt across the cut-off and creates a false variance.\n- Netting a shortage at one branch against a surplus at another hides both.\n- Counting consignment or customer-owned stock inflates the physical figure.\n\n## How to present the result\n\nLead with the variance for each line after the cut-off adjustment and which lines need a recount. Then give a table: line, physical count and time, movements added or reversed, physical at snapshot, book and variance. Explain variances caused by posting delays separately from unexplained ones, and list ambiguous lines with the question about sequence that resolves each.\n\n## Worked example\n\n**Request:** Reconcile at the 12:00 book snapshot.\n\n**Supplied material:**\n\n```text\nSame location, SKU line A. Physical count 48 at 10:00. Received 10 at 10:30, dispatched 3 at 11:15, received 4 at 12:30. Book A at 12:00 = 56.\n```\n\n**Answer:** The noon count rolls forward to 55 units: 48 counted plus ten received and three dispatched. The book shows 56, so the variance is one unit short. Recount or check movement records before a correction. The 12:30 receipt sits outside this comparison.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nReturn physical_at_snapshot and variance as objects keyed by supplied line ID. For a line with ambiguous same-time movement return null in both maps. Use signed base-unit quantities.\n\n## Sources\n\n- [Odoo \u00b7 Inventory adjustments](https:\/\/www.odoo.com\/documentation\/19.0\/applications\/inventory_and_mrp\/inventory\/warehouses_storage\/inventory_management\/count_products.html): Odoo separates the counted quantity from the on-hand quantity recorded in the database, warns that on-hand stock can change between counting and applying an adjustment, and asks for confirmation before applying it. The skill adjusts for those movements before comparing.\n- [ACCA \u00b7 The audit of assertions](https:\/\/www.accaglobal.com\/gb\/en\/student\/exam-support-resources\/fundamentals-exams-study-resources\/f8\/technical-articles\/assertions.html): ACCA defines cut-off as transactions recorded in the correct period and gives the count procedure of recording the last goods received notes and dispatch notes at the inventory count and tracing them to the records. The skill uses the same cut-off evidence.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/reconcile-stocktake-cutoff\n","scope":"contextual","trigger_keywords":["Reconcile a stocktake to the right cut-off","reconcile-stocktake-cutoff","reconcile stocktake cutoff","We counted stock while still trading. How do I match it to the books?","We counted stock while still trading. How do I match it to the books","stocktake cutoff","stocktake cut-off","stock count cutoff"],"is_private":true,"is_active":true,"scripts":[{"name":"reconcile-stocktake-cutoff-check","description":"Compare a saved JSON answer with a published test. Pass tests\/case-1\/expected.json (or another case) and the path to your answer.","language":"python","filename":"reconcile-stocktake-cutoff-check.py","content":"from pathlib import Path\nimport runpy\n\nrunpy.run_path(str(Path(__file__).parent \/ 'tests' \/ 'check.py'), run_name='__main__')\n","supporting_files":[{"path":"SKILL.md","content":"---\nname: reconcile-stocktake-cutoff\ndescription: \"Roll physical stock counts forward or back to the book snapshot time using timed movements, so stock variances compare like with like before anyone investigates or posts a correction. Use when a stocktake or stock count was done at a different time from the book figures.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/reconcile-stocktake-cutoff\n---\n\n# Reconcile a stocktake to the right cut-off\n\nAdjust physical counts for movements between the count and snapshot times before investigating stock variances.\n\n## When to use this skill\n\n- A stock count was taken during trading and the books are at close of day.\n- Branches counted at different times from the system snapshot, or stock moved between them.\n- A variance appeared after a count and someone suspects a delivery or posting delay.\n\n## When not to use it\n\n- Valuing stock for the accounts, such as cost or net realisable value. That is for the accountant or auditor.\n- Planning statutory audit procedures for a count.\n- Investigating suspected theft. Follow the business's HR and security procedures.\n\n## What you need\n\n- Dated book snapshot and physical counts per location and SKU, with count times\n- Timed movement log with physical and posting times, quantity signs and ownership or location boundaries\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- When exactly was each line counted, and what time is the book snapshot?\n- Does the movement log show the physical time of each movement as well as its posting time?\n- Is all the counted stock owned by the business and at the same location as the book figure?\n- What were the last goods-received and dispatch documents at the time of the count?\n\n## Method\n\n1. Compare the same thing on both sides: stock owned by the business, at the same location, in the same base unit. Keep consignment stock, customer-owned goods and stock at another branch out of scope.\n2. Fix the cut-off. Note the last goods-received and dispatch documents at the count so each movement can be placed before or after it.\n3. Bring each count to the snapshot time using physical movement times. If counted earlier, add movements strictly after the count time and up to and including the snapshot time. If counted later, reverse movements strictly after the snapshot and up to the count. A later posting timestamp does not move an earlier physical receipt past the cut-off; check whether the book snapshot included it.\n4. Treat a transfer as a departure at the source and an arrival at the destination, each at its own time. Mark movements recorded at the exact counting moment with no stated sequence as ambiguous, unless the input defines inclusive timing.\n5. Compare adjusted physical less book quantity for each line. Explain variances caused by a known posting delay separately from unexplained differences, and keep offsetting differences between locations visible.\n6. Ask for a recount of lines with unexplained variances before any corrective posting.\n\n## Checks before you deliver\n\n- A transfer between two branches should not be applied as a receipt at both.\n- An apparent loss can simply be a delivery accepted after counting. Do not compare two timestamps as if the warehouse stood still.\n- Using the posting time instead of the physical time moves a receipt across the cut-off and creates a false variance.\n- Netting a shortage at one branch against a surplus at another hides both.\n- Counting consignment or customer-owned stock inflates the physical figure.\n\n## How to present the result\n\nLead with the variance for each line after the cut-off adjustment and which lines need a recount. Then give a table: line, physical count and time, movements added or reversed, physical at snapshot, book and variance. Explain variances caused by posting delays separately from unexplained ones, and list ambiguous lines with the question about sequence that resolves each.\n\n## Worked example\n\n**Request:** Reconcile at the 12:00 book snapshot.\n\n**Supplied material:**\n\n```text\nSame location, SKU line A. Physical count 48 at 10:00. Received 10 at 10:30, dispatched 3 at 11:15, received 4 at 12:30. Book A at 12:00 = 56.\n```\n\n**Answer:** The noon count rolls forward to 55 units: 48 counted plus ten received and three dispatched. The book shows 56, so the variance is one unit short. Recount or check movement records before a correction. The 12:30 receipt sits outside this comparison.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nReturn physical_at_snapshot and variance as objects keyed by supplied line ID. For a line with ambiguous same-time movement return null in both maps. Use signed base-unit quantities.\n\n## Sources\n\n- [Odoo \u00b7 Inventory adjustments](https:\/\/www.odoo.com\/documentation\/19.0\/applications\/inventory_and_mrp\/inventory\/warehouses_storage\/inventory_management\/count_products.html): Odoo separates the counted quantity from the on-hand quantity recorded in the database, warns that on-hand stock can change between counting and applying an adjustment, and asks for confirmation before applying it. The skill adjusts for those movements before comparing.\n- [ACCA \u00b7 The audit of assertions](https:\/\/www.accaglobal.com\/gb\/en\/student\/exam-support-resources\/fundamentals-exams-study-resources\/f8\/technical-articles\/assertions.html): ACCA defines cut-off as transactions recorded in the correct period and gives the count procedure of recording the last goods received notes and dispatch notes at the inventory count and tracing them to the records. The skill uses the same cut-off evidence.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/reconcile-stocktake-cutoff\n"},{"path":"LICENSE.txt","content":"Original Raq.com instructions and synthetic examples: CC BY 4.0.\nhttps:\/\/creativecommons.org\/licenses\/by\/4.0\/\nAttribution: Raq.com, https:\/\/skills.raq.com\/skills\/reconcile-stocktake-cutoff\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# Delivery during the count\n\nReconcile at the 12:00 book snapshot.\n\n## Supplied material\n\nSame location, SKU line A. Physical count 48 at 10:00. Received 10 at 10:30, dispatched 3 at 11:15, received 4 at 12:30. Book A at 12:00 = 56.\n\n## Worked answer\n\nThe noon count rolls forward to 55 units: 48 counted plus ten received and three dispatched. The book shows 56, so the variance is one unit short. Recount or check movement records before a correction. The 12:30 receipt sits outside this comparison.\n\n## Reasoning\n\nOnly the first receipt and dispatch fall between counting and the snapshot.\n"},{"path":"tests\/check.py","content":"\"\"\"Check a saved agent answer locally with Python 3 (standard library only).\"\"\"\nimport json\nimport math\nimport sys\nfrom pathlib import Path\n\n\ndef compare(expected, actual, path=\"$\", accepted=None):\n    if isinstance(expected, bool) or isinstance(actual, bool):\n        if expected is not actual:\n            yield path\n    elif isinstance(expected, (int, float)) and isinstance(actual, (int, float)):\n        if not math.isclose(expected, actual, rel_tol=0, abs_tol=1e-8):\n            yield path\n    elif isinstance(expected, dict) and isinstance(actual, dict):\n        for key in sorted(set(expected) | set(actual)):\n            if key not in expected or key not in actual:\n                yield f\"{path}.{key}\"\n            elif not any(\n                not list(compare(option, actual[key]))\n                for option in (accepted or {}).get(key, [])\n            ):\n                yield from compare(expected[key], actual[key], f\"{path}.{key}\")\n    elif isinstance(expected, list) and isinstance(actual, list):\n        if len(expected) != len(actual):\n            yield f\"{path} (length)\"\n        for i, (left, right) in enumerate(zip(expected, actual)):\n            yield from compare(left, right, f\"{path}[{i}]\")\n    elif type(expected) != type(actual) or expected != actual:\n        yield path\n\n\ndef main():\n    if len(sys.argv) != 3:\n        raise SystemExit(\"Usage: python3 check.py expected.json answer.json\")\n    try:\n        expected, actual = [json.loads(Path(p).read_text(encoding=\"utf-8\")) for p in sys.argv[1:]]\n        alternatives = Path(sys.argv[1]).with_name(\"accepted.json\")\n        accepted = json.loads(alternatives.read_text(encoding=\"utf-8\")) if alternatives.is_file() else {}\n    except (ValueError, OSError) as error:\n        raise SystemExit(str(error))\n    differences = list(compare(expected, actual, accepted=accepted))\n    if differences:\n        raise SystemExit(\"Different fields: \" + \", \".join(differences))\n    print(\"Pass\")\n\n\nif __name__ == \"__main__\":\n    main()\n"},{"path":"tests\/README.md","content":"Give your agent SKILL.md and one request.txt in a fresh session. Keep the expected answer aside. Save the reply as answer.json, then run this from the tests folder:\n\n    python3 check.py case-1\/expected.json answer.json\n\nEach case also has an explanation. Where accepted.json exists, the checker accepts the alternatives listed there.\n"},{"path":"tests\/case-1\/request.txt","content":"Reconcile at the 12:00 book snapshot.\nReturn only the JSON specified in SKILL.md for this test.\n\nSame location, SKU line A. Physical count 48 at 10:00. Received 10 at 10:30, dispatched 3 at 11:15, received 4 at 12:30. Book A at 12:00 = 56.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"physical_at_snapshot\": {\n        \"A\": 55\n    },\n    \"variance\": {\n        \"A\": -1\n    }\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"Only the first receipt and dispatch fall between counting and the snapshot.\n"},{"path":"tests\/case-2\/request.txt","content":"Reconcile both counts back to the 09:00 snapshot.\nReturn only the JSON specified in SKILL.md for this test.\n\nAt 09:00 books say NORTH 14, SOUTH 6 for the same SKU. At 09:30 transfer 4 from NORTH to SOUTH. Counts at 10:00 NORTH 10, SOUTH 9. No other stock movement.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"physical_at_snapshot\": {\n        \"NORTH\": 14,\n        \"SOUTH\": 5\n    },\n    \"variance\": {\n        \"NORTH\": 0,\n        \"SOUTH\": -1\n    }\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"Reversing the transfer restores the original location basis and exposes the shortage in SOUTH.\n"},{"path":"tests\/case-3\/request.txt","content":"Reconcile line X at the Monday closing snapshot.\nReturn only the JSON specified in SKILL.md for this test.\n\nSame owned stock, warehouse and base unit. Physical 87 at 10am. Shipped 9 at 11am; received 14 at noon; shipped 3 at 1pm. All movements recorded before Monday close. Book X at close is 90.\n"},{"path":"tests\/case-3\/expected.json","content":"{\n    \"physical_at_snapshot\": {\n        \"X\": 89\n    },\n    \"variance\": {\n        \"X\": -1\n    }\n}\n"},{"path":"tests\/case-3\/explanation.txt","content":"87 \u2212 9 + 14 \u2212 3 gives 89, one below the closing book.\n"},{"path":"tests\/case-4\/request.txt","content":"Explain the Monday closing variance on X.\nReturn only the JSON specified in SKILL.md for this test.\n\nPhysical count X at Monday 10:00 was 87. At 11:00 shipped 9, at noon physically received 14 and accepted ownership, and at 13:00 shipped 3. Both shipments posted Monday. The receipt posted Tuesday. Monday closing ledger was 75. Same location and units.\n"},{"path":"tests\/case-4\/expected.json","content":"{\n    \"physical_at_snapshot\": {\n        \"X\": 89\n    },\n    \"variance\": {\n        \"X\": 14\n    }\n}\n"},{"path":"tests\/case-4\/explanation.txt","content":"Monday\u2019s physical stock includes the 14 accepted at noon. The late receipt posting explains all 14 units above Monday\u2019s book count.\n"}],"is_active":true,"is_approved":false}]}]}