{"skills":[{"name":"Schedule invoice instalments","description":"Convert the agreed invoice terms into dated instalments that add up to the exact invoice value.","content":"# Schedule invoice instalments\n\nConvert the agreed invoice terms into dated instalments that add up to the exact invoice value.\n\n## When to use this skill\n\n- A customer has agreed to pay one invoice in several parts and the due dates and amounts need setting out.\n- The terms mix percentages, fixed amounts, a balance, days from the invoice and month ends.\n- A deposit has already been paid and only the remaining instalments need scheduling.\n\n## When not to use it\n\n- Deciding whether to offer a customer credit or instalments. That is a credit risk decision.\n- Interest-bearing payment plans for consumers, which can be regulated credit (in the UK, by the FCA).\n- Chasing missed instalments. Use the overdue invoice chase list skill.\n\n## What you need\n\n- Invoice date, currency and total to allocate\n- Ordered payment terms, percentage basis, deadline rule and any payments already applied\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Do you want the full schedule from the invoice date, or only what is still to be collected? Which payments have already been applied?\n- What exactly do the terms say? Copy the clause, including whether each part is a percentage, a fixed amount or the balance, and what each date is counted from.\n- Calendar days or business days? For business days, which country's or region's holidays apply?\n- What rounding rule and smallest currency unit apply?\n\n## Method\n\n1. Establish whether the request is for the original schedule or only future collections. For outstanding instalments, subtract verified deposits, credits and prior payments once, and keep the bridge to the invoice value.\n2. Read each term for its amount basis (percentage, fixed amount or balance) and its date anchor (invoice date, delivery date or month end).\n3. Calculate in the currency's minor unit. Round percentage instalments half up unless the agreement gives another rule, then give the exact residual to the balance term. For an agreed equal split, put any rounding remainder in the last instalment unless the agreement allocates it differently.\n4. Work out each date. Use calendar days unless business days are specified, and the actual last day of the month for month-end terms, including 29 February in a leap year. For business days use the contract's holiday calendar; UK bank holidays differ between England and Wales, Scotland and Northern Ireland. If the calendar or date anchor is missing, mark the plan incomplete.\n5. Do not move a date that falls on a weekend or holiday unless the agreement says to.\n6. Reconcile the scheduled total to the amount in scope. Explicit amounts that over- or under-allocate it without a balance term are inconsistent; report the difference rather than adjusting a term.\n7. For a UK VAT invoice, note that instalments do not defer the VAT: it is accounted for in the period of the tax point, not as each payment arrives, unless the business uses cash accounting.\n\n## Checks before you deliver\n\n- Issuing multiple invoices is different from allocating one invoice across several due dates.\n- A quoted 30 days from issue and the last day of next month can produce different dates.\n- Rounding each instalment without giving the residual to the balance term leaves the schedule a penny away from the invoice.\n- Assuming February has 28 days. In a leap year, such as 2028, the month ends on the 29th.\n- Counting business days with the wrong holiday calendar. Scotland and Northern Ireland have different bank holidays from England and Wales.\n- Telling a UK customer that VAT is paid as the instalments arrive. VAT follows the tax point unless the business uses cash accounting.\n\n## How to present the result\n\nLead with whether the schedule works (scheduled, missing a rule or inconsistent) and the total scheduled. Then give a table: instalment, due date with weekday, amount, running total and the term it comes from. Show the bridge from invoice value to the amount scheduled when payments were already applied. For a problem, quote the conflicting term and suggest wording that fixes it.\n\n## Worked example\n\n**Request:** Build the receivable schedule for this invoice.\n\n**Supplied material:**\n\n```text\nInvoice \u00a3100.01 issued 2028-01-31. Terms: 20% now, 30% 10 calendar days from issue, balance last day of following month. Two decimal places, half up.\n```\n\n**Answer:** For the \u00a3100.01 invoice, \u00a320.00 is due 31 January 2028, \u00a330.00 on 10 February, and the \u00a350.01 balance on 29 February. The three amounts add up to the invoice total.\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 status as scheduled, missing_rule or inconsistent; instalments as an ordered array with due (YYYY-MM-DD) and amount; total as their sum. For missing_rule or inconsistent return an empty array and total null. For an outstanding-only plan with an applied payment, total is the remaining amount scheduled, and already_applied is the amount excluded from future collection.\n\n## Sources\n\n- [Odoo \u00b7 Payment terms and instalment plans](https:\/\/www.odoo.com\/documentation\/18.0\/applications\/finance\/accounting\/customer_invoices\/payment_terms.html): Odoo builds an instalment plan from several due terms on one invoice, computes each due date from the invoice date, supports end-of-month terms, and says that issuing several invoices is an invoicing policy, not an instalment plan.\n- [GOV.UK \u00b7 UK bank holidays](https:\/\/www.gov.uk\/bank-holidays): GOV.UK publishes separate bank holiday lists for England and Wales, Scotland and Northern Ireland. The skill asks which calendar applies before counting business days.\n- [HMRC \u00b7 VAT guide (VAT Notice 700)](https:\/\/www.gov.uk\/guidance\/vat-guide-notice-700): UK rule: section 14.2 says that when issuing a VAT invoice creates a tax point, the VAT must be accounted for in the return for that period and cannot be delayed until payment is received, unless the business uses cash accounting. The skill warns that instalments do not defer VAT.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/schedule-invoice-instalments\n","scope":"contextual","trigger_keywords":["Schedule invoice instalments","schedule-invoice-instalments","schedule invoice instalments","Can you set out the dates and amounts for paying this invoice in three parts?","Can you set out the dates and amounts for paying this invoice in three parts","invoice instalments","split this invoice into payments","invoice installments"],"is_private":true,"is_active":true,"scripts":[{"name":"schedule-invoice-instalments-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":"schedule-invoice-instalments-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: schedule-invoice-instalments\ndescription: \"Turn an invoice's agreed payment terms into dated instalments that add up to the exact amount, handling percentages, rounding, month ends, leap years and payments already made. Use when splitting an invoice into instalments, a payment plan or staged due dates.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/schedule-invoice-instalments\n---\n\n# Schedule invoice instalments\n\nConvert the agreed invoice terms into dated instalments that add up to the exact invoice value.\n\n## When to use this skill\n\n- A customer has agreed to pay one invoice in several parts and the due dates and amounts need setting out.\n- The terms mix percentages, fixed amounts, a balance, days from the invoice and month ends.\n- A deposit has already been paid and only the remaining instalments need scheduling.\n\n## When not to use it\n\n- Deciding whether to offer a customer credit or instalments. That is a credit risk decision.\n- Interest-bearing payment plans for consumers, which can be regulated credit (in the UK, by the FCA).\n- Chasing missed instalments. Use the overdue invoice chase list skill.\n\n## What you need\n\n- Invoice date, currency and total to allocate\n- Ordered payment terms, percentage basis, deadline rule and any payments already applied\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Do you want the full schedule from the invoice date, or only what is still to be collected? Which payments have already been applied?\n- What exactly do the terms say? Copy the clause, including whether each part is a percentage, a fixed amount or the balance, and what each date is counted from.\n- Calendar days or business days? For business days, which country's or region's holidays apply?\n- What rounding rule and smallest currency unit apply?\n\n## Method\n\n1. Establish whether the request is for the original schedule or only future collections. For outstanding instalments, subtract verified deposits, credits and prior payments once, and keep the bridge to the invoice value.\n2. Read each term for its amount basis (percentage, fixed amount or balance) and its date anchor (invoice date, delivery date or month end).\n3. Calculate in the currency's minor unit. Round percentage instalments half up unless the agreement gives another rule, then give the exact residual to the balance term. For an agreed equal split, put any rounding remainder in the last instalment unless the agreement allocates it differently.\n4. Work out each date. Use calendar days unless business days are specified, and the actual last day of the month for month-end terms, including 29 February in a leap year. For business days use the contract's holiday calendar; UK bank holidays differ between England and Wales, Scotland and Northern Ireland. If the calendar or date anchor is missing, mark the plan incomplete.\n5. Do not move a date that falls on a weekend or holiday unless the agreement says to.\n6. Reconcile the scheduled total to the amount in scope. Explicit amounts that over- or under-allocate it without a balance term are inconsistent; report the difference rather than adjusting a term.\n7. For a UK VAT invoice, note that instalments do not defer the VAT: it is accounted for in the period of the tax point, not as each payment arrives, unless the business uses cash accounting.\n\n## Checks before you deliver\n\n- Issuing multiple invoices is different from allocating one invoice across several due dates.\n- A quoted 30 days from issue and the last day of next month can produce different dates.\n- Rounding each instalment without giving the residual to the balance term leaves the schedule a penny away from the invoice.\n- Assuming February has 28 days. In a leap year, such as 2028, the month ends on the 29th.\n- Counting business days with the wrong holiday calendar. Scotland and Northern Ireland have different bank holidays from England and Wales.\n- Telling a UK customer that VAT is paid as the instalments arrive. VAT follows the tax point unless the business uses cash accounting.\n\n## How to present the result\n\nLead with whether the schedule works (scheduled, missing a rule or inconsistent) and the total scheduled. Then give a table: instalment, due date with weekday, amount, running total and the term it comes from. Show the bridge from invoice value to the amount scheduled when payments were already applied. For a problem, quote the conflicting term and suggest wording that fixes it.\n\n## Worked example\n\n**Request:** Build the receivable schedule for this invoice.\n\n**Supplied material:**\n\n```text\nInvoice \u00a3100.01 issued 2028-01-31. Terms: 20% now, 30% 10 calendar days from issue, balance last day of following month. Two decimal places, half up.\n```\n\n**Answer:** For the \u00a3100.01 invoice, \u00a320.00 is due 31 January 2028, \u00a330.00 on 10 February, and the \u00a350.01 balance on 29 February. The three amounts add up to the invoice total.\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 status as scheduled, missing_rule or inconsistent; instalments as an ordered array with due (YYYY-MM-DD) and amount; total as their sum. For missing_rule or inconsistent return an empty array and total null. For an outstanding-only plan with an applied payment, total is the remaining amount scheduled, and already_applied is the amount excluded from future collection.\n\n## Sources\n\n- [Odoo \u00b7 Payment terms and instalment plans](https:\/\/www.odoo.com\/documentation\/18.0\/applications\/finance\/accounting\/customer_invoices\/payment_terms.html): Odoo builds an instalment plan from several due terms on one invoice, computes each due date from the invoice date, supports end-of-month terms, and says that issuing several invoices is an invoicing policy, not an instalment plan.\n- [GOV.UK \u00b7 UK bank holidays](https:\/\/www.gov.uk\/bank-holidays): GOV.UK publishes separate bank holiday lists for England and Wales, Scotland and Northern Ireland. The skill asks which calendar applies before counting business days.\n- [HMRC \u00b7 VAT guide (VAT Notice 700)](https:\/\/www.gov.uk\/guidance\/vat-guide-notice-700): UK rule: section 14.2 says that when issuing a VAT invoice creates a tax point, the VAT must be accounted for in the return for that period and cannot be delayed until payment is received, unless the business uses cash accounting. The skill warns that instalments do not defer VAT.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/schedule-invoice-instalments\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\/schedule-invoice-instalments\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# Month end and rounding\n\nBuild the receivable schedule for this invoice.\n\n## Supplied material\n\nInvoice \u00a3100.01 issued 2028-01-31. Terms: 20% now, 30% 10 calendar days from issue, balance last day of following month. Two decimal places, half up.\n\n## Worked answer\n\nFor the \u00a3100.01 invoice, \u00a320.00 is due 31 January 2028, \u00a330.00 on 10 February, and the \u00a350.01 balance on 29 February. The three amounts add up to the invoice total.\n\n## Reasoning\n\nThe residual carries the penny and the following February has 29 days.\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":"Build the receivable schedule for this invoice.\nReturn only the JSON specified in SKILL.md for this test.\n\nInvoice \u00a3100.01 issued 2028-01-31. Terms: 20% now, 30% 10 calendar days from issue, balance last day of following month. Two decimal places, half up.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"status\": \"scheduled\",\n    \"instalments\": [\n        {\n            \"due\": \"2028-01-31\",\n            \"amount\": 20\n        },\n        {\n            \"due\": \"2028-02-10\",\n            \"amount\": 30\n        },\n        {\n            \"due\": \"2028-02-29\",\n            \"amount\": 50.01\n        }\n    ],\n    \"total\": 100.01\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"The residual carries the penny and the following February has 29 days.\n"},{"path":"tests\/case-2\/request.txt","content":"Can I enter this payment plan?\nReturn only the JSON specified in SKILL.md for this test.\n\nInvoice \u20ac750 dated 2026-05-01. Fixed terms signed: \u20ac500 now and \u20ac300 after 30 calendar days.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"status\": \"inconsistent\",\n    \"instalments\": [],\n    \"total\": null\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"Two explicit amounts leave \u20ac50 more due than the invoice.\n"},{"path":"tests\/case-3\/request.txt","content":"Schedule only outstanding amounts.\nReturn only the JSON specified in SKILL.md for this test.\n\nInvoice \u00a31,000.01. Receipt \u00a3100.01 applied to the invoice. Remaining balance in three equal instalments on the last calendar days of Jan, Feb and Mar 2028. GBP two decimal places.\n"},{"path":"tests\/case-3\/expected.json","content":"{\n    \"status\": \"scheduled\",\n    \"instalments\": [\n        {\n            \"due\": \"2028-01-31\",\n            \"amount\": 300\n        },\n        {\n            \"due\": \"2028-02-29\",\n            \"amount\": 300\n        },\n        {\n            \"due\": \"2028-03-31\",\n            \"amount\": 300\n        }\n    ],\n    \"total\": 900,\n    \"already_applied\": 100.01\n}\n"},{"path":"tests\/case-3\/explanation.txt","content":"\u00a3900 remains after the deposit. The three month ends include leap day.\n"}],"is_active":true,"is_approved":false}]}]}