{"skills":[{"name":"Prepare an overdue invoice chase list","description":"Calculate what is collectible at a reporting date after part-payments, credits and open disputes.","content":"# Prepare an overdue invoice chase list\n\nCalculate what is collectible at a reporting date after part-payments, credits and open disputes.\n\n## When to use this skill\n\n- Someone asks which customer invoices are overdue and how much to chase as at month end or today.\n- Part-payments, credit notes and disputes make the aged debtors report hard to trust.\n- Credit control needs a list in order of age, with disputed amounts kept apart.\n\n## When not to use it\n\n- Deciding to start a court claim or pass a debt to a collection agency. Those steps have their own rules, costs and pre-action requirements.\n- Settling a dispute's merits. The method holds the disputed amount and refers it; it does not decide who is right.\n- Calculating late payment interest for a claim. The method notes when it may apply; work out the exact sum from the statutory rules for the relevant country.\n\n## What you need\n\n- Invoice IDs, due dates and amounts in one currency\n- As-of date, dated payment and credit allocations, and dispute status with amounts\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- What date should the list be prepared as at? Payments received after it are left out.\n- Do you have payment and credit allocations with dates, not just today's balances?\n- Which invoices are disputed and for how much, and does your policy hold the whole invoice or the whole account?\n- Where are you and the customer based, and is the customer a business? In the UK, statutory late payment interest and compensation are for business-to-business debts.\n\n## Method\n\n1. Fix the as-of date and currency. Rebuild each invoice's open balance from payments and credits allocated to it and dated on or before that date. Keep unallocated customer credits and payments on account aside and list them; do not use them to clear an invoice without an allocation.\n2. Use the due date from the agreed terms, and ask if an invoice has none rather than assuming. For UK business customers with no agreed payment date, GOV.UK says payment is late 30 days after the customer receives the invoice or the goods or service are delivered, whichever is later.\n3. Count calendar days overdue as the as-of date less the due date. Only invoices at least one day overdue go on the chase list. Zero means due today, and future-due and fully cleared items stay off it.\n4. Separate the disputed part of each overdue balance from the undisputed part. A dispute is not a payment or credit. Apply any documented invoice-wide or account-wide hold; otherwise chase the undisputed portion and refer the disputed amount for resolution. If the disputed amount is unknown, do not guess what can be chased.\n5. Sort the chase list by oldest due date, then by invoice ID, and total the collectible balance.\n6. For each part-paid invoice, note the most recent payment or credit included, so the customer can recognise the balance.\n7. Keep late payment interest and recovery charges out of the chase balance. For UK business-to-business debts, statutory interest of 8% plus the Bank of England base rate may be claimable unless the contract sets a different rate, along with a fixed recovery sum of \u00a340, \u00a370 or \u00a3100 depending on the size of the debt. Note this and ask whether the person wants to claim; elsewhere, check the local rules.\n\n## Checks before you deliver\n\n- A later payment visible in today's ledger changes an historical ageing if applied too early.\n- A disputed balance requires a different follow-up from a routine overdue payment reminder.\n- An invoice due today is not overdue. Including it chases a customer who is still within terms.\n- Using an unallocated payment on account to clear a particular invoice without the customer's instruction can misstate both balances.\n- Chasing the whole balance of a partly disputed invoice, when policy allows chasing the undisputed part, delays the money that is not in dispute.\n- Adding statutory interest or compensation without checking that the customer is a business, what the contract says and that the person wants to claim it.\n\n## How to present the result\n\nLead with the total to chase at the as-of date and the number of invoices. Then give the chase table, oldest first: invoice, due date, days overdue, balance and the last payment or credit included. List disputed invoices separately with the amount held. Note what was left out and why, and offer a short reminder for each customer, ready to send.\n\n## Worked example\n\n**Request:** Make the chase list at 2026-04-30.\n\n**Supplied material:**\n\n```text\nGBP. A due 2026-04-10, \u00a3400, paid \u00a3100 Apr 20 and \u00a3300 May 1. B due Apr 30 \u00a380. C due Apr 2 \u00a390 disputed. D due Apr 15 \u00a3100 credited \u00a3100 Apr 29. All dates 2026.\n```\n\n**Answer:** Chase \u00a3300 on invoice A, 20 days overdue at 30 April. The \u00a3100 received on 20 April reduces the chase amount. Hold B, due that day, and refer C\u2019s \u00a390 dispute to the account owner. D was cleared by its credit on 29 April.\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 chase as an ordered list of objects with id, days_overdue and balance, disputed as sorted overdue open disputed IDs, and collectible_total as a number. Use the currency supplied. For a quantified partial dispute, also provide held_amounts by invoice ID. That ID can appear in both disputed and chase. If the policy requires holding the whole invoice, exclude its entire balance from chase.\n\n## Sources\n\n- [Microsoft \u00b7 Aged accounts receivable](https:\/\/learn.microsoft.com\/en-us\/dynamics365\/business-central\/reports\/report-120): Business Central ages open customer entries as of a chosen date and recommends ageing by due date to separate overdue amounts from amounts not yet due. The skill rebuilds balances at the as-of date in the same way.\n- [Microsoft \u00b7 Send reminders of outstanding balances](https:\/\/learn.microsoft.com\/en-us\/dynamics365\/business-central\/receivables-send-reminders): A customer entry marked On Hold does not prompt a reminder, and interest is not calculated on it. The skill applies the same separation to disputed amounts.\n- [GOV.UK \u00b7 Late commercial payments: charging interest and debt recovery](https:\/\/www.gov.uk\/late-commercial-payments-interest-debt-recovery): UK rules for business-to-business debts: with no agreed date, payment is late 30 days after the invoice is received or the goods or service are delivered; statutory interest is 8% plus the Bank of England base rate unless the contract sets a different rate; fixed recovery sums are \u00a340, \u00a370 or \u00a3100 by size of debt. The skill notes these but keeps them out of the chase balance.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/prepare-overdue-invoice-list\n","scope":"contextual","trigger_keywords":["Prepare an overdue invoice chase list","prepare-overdue-invoice-list","prepare overdue invoice list","Which customer invoices are overdue, and how much should we chase?","Which customer invoices are overdue, and how much should we chase","overdue invoice list","which invoices are overdue","overdue invoices to chase"],"is_private":true,"is_active":true,"scripts":[{"name":"prepare-overdue-invoice-list-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":"prepare-overdue-invoice-list-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: prepare-overdue-invoice-list\ndescription: \"Build an overdue invoice chase list at a set date: rebuild balances from dated payments and credits, count days overdue from the due date and hold disputed amounts. Use when someone asks which invoices are overdue, who owes money or what credit control should chase.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/prepare-overdue-invoice-list\n---\n\n# Prepare an overdue invoice chase list\n\nCalculate what is collectible at a reporting date after part-payments, credits and open disputes.\n\n## When to use this skill\n\n- Someone asks which customer invoices are overdue and how much to chase as at month end or today.\n- Part-payments, credit notes and disputes make the aged debtors report hard to trust.\n- Credit control needs a list in order of age, with disputed amounts kept apart.\n\n## When not to use it\n\n- Deciding to start a court claim or pass a debt to a collection agency. Those steps have their own rules, costs and pre-action requirements.\n- Settling a dispute's merits. The method holds the disputed amount and refers it; it does not decide who is right.\n- Calculating late payment interest for a claim. The method notes when it may apply; work out the exact sum from the statutory rules for the relevant country.\n\n## What you need\n\n- Invoice IDs, due dates and amounts in one currency\n- As-of date, dated payment and credit allocations, and dispute status with amounts\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- What date should the list be prepared as at? Payments received after it are left out.\n- Do you have payment and credit allocations with dates, not just today's balances?\n- Which invoices are disputed and for how much, and does your policy hold the whole invoice or the whole account?\n- Where are you and the customer based, and is the customer a business? In the UK, statutory late payment interest and compensation are for business-to-business debts.\n\n## Method\n\n1. Fix the as-of date and currency. Rebuild each invoice's open balance from payments and credits allocated to it and dated on or before that date. Keep unallocated customer credits and payments on account aside and list them; do not use them to clear an invoice without an allocation.\n2. Use the due date from the agreed terms, and ask if an invoice has none rather than assuming. For UK business customers with no agreed payment date, GOV.UK says payment is late 30 days after the customer receives the invoice or the goods or service are delivered, whichever is later.\n3. Count calendar days overdue as the as-of date less the due date. Only invoices at least one day overdue go on the chase list. Zero means due today, and future-due and fully cleared items stay off it.\n4. Separate the disputed part of each overdue balance from the undisputed part. A dispute is not a payment or credit. Apply any documented invoice-wide or account-wide hold; otherwise chase the undisputed portion and refer the disputed amount for resolution. If the disputed amount is unknown, do not guess what can be chased.\n5. Sort the chase list by oldest due date, then by invoice ID, and total the collectible balance.\n6. For each part-paid invoice, note the most recent payment or credit included, so the customer can recognise the balance.\n7. Keep late payment interest and recovery charges out of the chase balance. For UK business-to-business debts, statutory interest of 8% plus the Bank of England base rate may be claimable unless the contract sets a different rate, along with a fixed recovery sum of \u00a340, \u00a370 or \u00a3100 depending on the size of the debt. Note this and ask whether the person wants to claim; elsewhere, check the local rules.\n\n## Checks before you deliver\n\n- A later payment visible in today's ledger changes an historical ageing if applied too early.\n- A disputed balance requires a different follow-up from a routine overdue payment reminder.\n- An invoice due today is not overdue. Including it chases a customer who is still within terms.\n- Using an unallocated payment on account to clear a particular invoice without the customer's instruction can misstate both balances.\n- Chasing the whole balance of a partly disputed invoice, when policy allows chasing the undisputed part, delays the money that is not in dispute.\n- Adding statutory interest or compensation without checking that the customer is a business, what the contract says and that the person wants to claim it.\n\n## How to present the result\n\nLead with the total to chase at the as-of date and the number of invoices. Then give the chase table, oldest first: invoice, due date, days overdue, balance and the last payment or credit included. List disputed invoices separately with the amount held. Note what was left out and why, and offer a short reminder for each customer, ready to send.\n\n## Worked example\n\n**Request:** Make the chase list at 2026-04-30.\n\n**Supplied material:**\n\n```text\nGBP. A due 2026-04-10, \u00a3400, paid \u00a3100 Apr 20 and \u00a3300 May 1. B due Apr 30 \u00a380. C due Apr 2 \u00a390 disputed. D due Apr 15 \u00a3100 credited \u00a3100 Apr 29. All dates 2026.\n```\n\n**Answer:** Chase \u00a3300 on invoice A, 20 days overdue at 30 April. The \u00a3100 received on 20 April reduces the chase amount. Hold B, due that day, and refer C\u2019s \u00a390 dispute to the account owner. D was cleared by its credit on 29 April.\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 chase as an ordered list of objects with id, days_overdue and balance, disputed as sorted overdue open disputed IDs, and collectible_total as a number. Use the currency supplied. For a quantified partial dispute, also provide held_amounts by invoice ID. That ID can appear in both disputed and chase. If the policy requires holding the whole invoice, exclude its entire balance from chase.\n\n## Sources\n\n- [Microsoft \u00b7 Aged accounts receivable](https:\/\/learn.microsoft.com\/en-us\/dynamics365\/business-central\/reports\/report-120): Business Central ages open customer entries as of a chosen date and recommends ageing by due date to separate overdue amounts from amounts not yet due. The skill rebuilds balances at the as-of date in the same way.\n- [Microsoft \u00b7 Send reminders of outstanding balances](https:\/\/learn.microsoft.com\/en-us\/dynamics365\/business-central\/receivables-send-reminders): A customer entry marked On Hold does not prompt a reminder, and interest is not calculated on it. The skill applies the same separation to disputed amounts.\n- [GOV.UK \u00b7 Late commercial payments: charging interest and debt recovery](https:\/\/www.gov.uk\/late-commercial-payments-interest-debt-recovery): UK rules for business-to-business debts: with no agreed date, payment is late 30 days after the invoice is received or the goods or service are delivered; statutory interest is 8% plus the Bank of England base rate unless the contract sets a different rate; fixed recovery sums are \u00a340, \u00a370 or \u00a3100 by size of debt. The skill notes these but keeps them out of the chase balance.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/prepare-overdue-invoice-list\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\/prepare-overdue-invoice-list\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# Paid after month-end\n\nMake the chase list at 2026-04-30.\n\n## Supplied material\n\nGBP. A due 2026-04-10, \u00a3400, paid \u00a3100 Apr 20 and \u00a3300 May 1. B due Apr 30 \u00a380. C due Apr 2 \u00a390 disputed. D due Apr 15 \u00a3100 credited \u00a3100 Apr 29. All dates 2026.\n\n## Worked answer\n\nChase \u00a3300 on invoice A, 20 days overdue at 30 April. The \u00a3100 received on 20 April reduces the chase amount. Hold B, due that day, and refer C\u2019s \u00a390 dispute to the account owner. D was cleared by its credit on 29 April.\n\n## Reasoning\n\nThe May receipt must stay outside the April balance.\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":"Make the chase list at 2026-04-30.\nReturn only the JSON specified in SKILL.md for this test.\n\nGBP. A due 2026-04-10, \u00a3400, paid \u00a3100 Apr 20 and \u00a3300 May 1. B due Apr 30 \u00a380. C due Apr 2 \u00a390 disputed. D due Apr 15 \u00a3100 credited \u00a3100 Apr 29. All dates 2026.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"chase\": [\n        {\n            \"id\": \"A\",\n            \"days_overdue\": 20,\n            \"balance\": 300\n        }\n    ],\n    \"disputed\": [\n        \"C\"\n    ],\n    \"collectible_total\": 300\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"The May receipt must stay outside the April balance.\n"},{"path":"tests\/case-2\/request.txt","content":"Which invoice balances need chasing on 2026-06-12?\nReturn only the JSON specified in SKILL.md for this test.\n\nEUR, due 2026-06-10: J2 120 less allocated credit 20 on June 11; J1 40. J3 due June 15 for 80. No disputes.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"chase\": [\n        {\n            \"id\": \"J1\",\n            \"days_overdue\": 2,\n            \"balance\": 40\n        },\n        {\n            \"id\": \"J2\",\n            \"days_overdue\": 2,\n            \"balance\": 100\n        }\n    ],\n    \"disputed\": [],\n    \"collectible_total\": 140\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"A partial credit reduces the balance without changing the underlying due date.\n"},{"path":"tests\/case-3\/request.txt","content":"Which amounts can accounts chase as at 2026-11-06?\nReturn only the JSON specified in SKILL.md for this test.\n\nGBP. A due 2026-11-04 for 1,000; by Nov 6, allocated credit 200 and payment 300. Customer disputes 100 of the open A balance. Policy allows chasing undisputed portions. B due 2026-11-06 for 90. No other movements.\n"},{"path":"tests\/case-3\/expected.json","content":"{\n    \"chase\": [\n        {\n            \"id\": \"A\",\n            \"days_overdue\": 2,\n            \"balance\": 400\n        }\n    ],\n    \"disputed\": [\n        \"A\"\n    ],\n    \"collectible_total\": 400,\n    \"held_amounts\": {\n        \"A\": 100\n    }\n}\n"},{"path":"tests\/case-3\/explanation.txt","content":"\u00a3500 remains open on A, of which \u00a3100 is held and \u00a3400 is eligible. B is due today.\n"}],"is_active":true,"is_approved":false}]}]}