{"skills":[{"name":"Check an invoice against a quote","description":"Find changed prices, unapproved additions and missing credits against the version the customer accepted.","content":"# Check an invoice against a quote\n\nFind changed prices, unapproved additions and missing credits against the version the customer accepted.\n\n## When to use this skill\n\n- An invoice has arrived and someone wants to know whether it matches the quote they accepted.\n- The total looks right or close, but lines have changed, an extra has appeared or an agreed credit is missing.\n- A final invoice shows deposits or stage payments and the balance due needs checking.\n\n## When not to use it\n\n- Choosing between quotes before work starts. Use the builders' quotes comparison skill.\n- Deciding whether the supplier is entitled to an extra charge under the contract. The method shows what was approved in writing; entitlement is a contract question.\n- Ruling on the correct VAT rate for a supply. Check HMRC guidance in the UK, or the tax authority where the supply is made.\n\n## What you need\n\n- Accepted quote with line amounts, units and tax basis\n- Approved variations, agreed credits, invoices to date and payments made\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Which quote version did you accept, and how: signature, purchase order or email? Only that version is the baseline.\n- Do you have every approved change in writing, with its reference and price?\n- Are the quoted prices before or after VAT or sales tax, and is the supplier VAT-registered?\n- Is this a stage invoice or the final one, and what deposits or payments have you already made?\n\n## Method\n\n1. Identify the accepted revision and the evidence of acceptance. Use its currency, tax basis, units and billing period throughout. If the invoice is for a stage or milestone, compare only that stage.\n2. Build the approved schedule by line ID with quantity, unit price and amount from the accepted quote. Add each signed variation once, with its reference. Keep declined options and changes requested without written approval outside the schedule, in a separate list.\n3. Include each agreed credit or discount once at its agreed value. Match invoice lines to the schedule by line ID and record the signed invoiced-minus-approved amount, including lines missing from either side at zero. On measured lines compare quantity and unit price as well as the amount.\n4. Compare on one tax basis. Where the invoice charges VAT, check the rate and VAT amount on each line and the supplier's VAT number: a UK VAT invoice must show them (HMRC VAT Notice 700, section 16.3). Never compare a net quote with a gross invoice.\n5. Prove the totals: the sum of the line variances must equal the difference between the approved and invoiced totals on the chosen basis.\n6. For a final invoice with deposits, gross up the approved charges with the documented tax, deduct only payments actually received and credited, once each, and show the agreed charge, tax, gross total, payments applied and balance due separately. In the UK a deposit usually creates its own VAT tax point, so check that the VAT across the deposit and final invoices adds up to the VAT on the full agreed price.\n7. Draft the query: each variance with its line ID, the approved amount and its source, the invoiced amount, and the action needed (credit note, corrected invoice or written approval).\n\n## Checks before you deliver\n\n- Equal grand totals can hide an unauthorised extra offset by a missing service.\n- Keep a deposit paid separate from the underlying contract value unless the document explicitly bills the remaining balance.\n- Comparing a net quote with a VAT-inclusive invoice creates a false variance the size of the VAT.\n- An emailed request or a phone call is not an approved variation unless the contract allows it. List it as unapproved rather than adding it to the schedule.\n- A correct line total can hide a higher unit rate on fewer units, or the reverse. Check quantity and rate on measured lines.\n- An agreed credit taken twice, once as its own line and again as a reduced price, understates the bill. Apply each credit once.\n\n## How to present the result\n\nLead with the amount to query, or confirm the invoice matches, in one sentence. Then give a table by line ID: approved amount and its source (quote or variation reference), invoiced amount and difference. Show the totals bridge on one tax basis and, for a final invoice, the gross total, payments credited and balance due. Finish with the query to the supplier, ready to send.\n\n## Worked example\n\n**Request:** Check this final invoice before I query it.\n\n**Supplied material:**\n\n```text\nGBP net, final invoice.\nAccepted Q7: DESIGN 600; PRINT 300; optional STORE 75 declined.\nSigned V2: add 50 to PRINT. Agreed CREDIT -40.\nInvoice: DESIGN 600; PRINT 350; STORE 75; CREDIT -20.\n```\n\n**Answer:** The approved net price is \u00a3910 and the invoice is \u00a31,005. Query \u00a395: storage was declined but billed at \u00a375, and the invoice allows only \u00a320 of the agreed \u00a340 credit. Design and the revised print charge agree.\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 approved_total, invoiced_total and difference as numbers in the supplied currency and tax basis, and variances as an object keyed by every differing line ID with its signed invoiced-minus-approved amount. Use an empty object for a complete match. For a requested settlement bridge also include gross_total, payments_applied and balance_due. For a settlement bridge also return comparison_basis as net or gross, or null if it cannot be established.\n\n## Sources\n\n- [Government Commercial Function \u00b7 Contract management foundation guide](https:\/\/www.gov.uk\/government\/publications\/civil-service-helping-you-with-managing-suppliers-and-contracts\/contract-management-training-accreditation-foundation-level-takeaway-guide-html): The guide says nothing should be agreed except through a contract change notice, that changes and their costs are authorised by all parties before implementation, and lists invoicing without the required evidence as a warning sign. The skill therefore counts only written, approved variations.\n- [Microsoft \u00b7 Prepayment invoices](https:\/\/learn.microsoft.com\/en-gb\/dynamics365\/business-central\/finance-how-to-create-prepayment-invoices): Business Central deducts the prepayment amount from the amount due when the final invoice is posted, and lets the prepayment be entered including VAT when prices include VAT. This is the deposit bridge the skill uses.\n- [HMRC \u00b7 VAT guide (VAT Notice 700)](https:\/\/www.gov.uk\/guidance\/vat-guide-notice-700): UK rules. Section 16.3 lists what a VAT invoice must show, including the quantity, VAT rate and net amount for each line and the total VAT, and section 14.2.3 says most deposits are advance payments that create a tax point when received. The skill uses these for its VAT and deposit checks on UK invoices.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/check-invoice-against-quote\n","scope":"contextual","trigger_keywords":["Check an invoice against a quote","check-invoice-against-quote","check invoice against quote","Does this invoice match the quote we accepted?","Does this invoice match the quote we accepted","invoice against the quote","invoice matches the quote","quoted versus invoiced"],"is_private":true,"is_active":true,"scripts":[{"name":"check-invoice-against-quote-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":"check-invoice-against-quote-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: check-invoice-against-quote\ndescription: \"Check a supplier's invoice line by line against the accepted quote and signed variations, and find changed prices, unapproved extras, missing credits and deposit errors. Use when an invoice differs from the quote, or before approving a final invoice for payment.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/check-invoice-against-quote\n---\n\n# Check an invoice against a quote\n\nFind changed prices, unapproved additions and missing credits against the version the customer accepted.\n\n## When to use this skill\n\n- An invoice has arrived and someone wants to know whether it matches the quote they accepted.\n- The total looks right or close, but lines have changed, an extra has appeared or an agreed credit is missing.\n- A final invoice shows deposits or stage payments and the balance due needs checking.\n\n## When not to use it\n\n- Choosing between quotes before work starts. Use the builders' quotes comparison skill.\n- Deciding whether the supplier is entitled to an extra charge under the contract. The method shows what was approved in writing; entitlement is a contract question.\n- Ruling on the correct VAT rate for a supply. Check HMRC guidance in the UK, or the tax authority where the supply is made.\n\n## What you need\n\n- Accepted quote with line amounts, units and tax basis\n- Approved variations, agreed credits, invoices to date and payments made\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Which quote version did you accept, and how: signature, purchase order or email? Only that version is the baseline.\n- Do you have every approved change in writing, with its reference and price?\n- Are the quoted prices before or after VAT or sales tax, and is the supplier VAT-registered?\n- Is this a stage invoice or the final one, and what deposits or payments have you already made?\n\n## Method\n\n1. Identify the accepted revision and the evidence of acceptance. Use its currency, tax basis, units and billing period throughout. If the invoice is for a stage or milestone, compare only that stage.\n2. Build the approved schedule by line ID with quantity, unit price and amount from the accepted quote. Add each signed variation once, with its reference. Keep declined options and changes requested without written approval outside the schedule, in a separate list.\n3. Include each agreed credit or discount once at its agreed value. Match invoice lines to the schedule by line ID and record the signed invoiced-minus-approved amount, including lines missing from either side at zero. On measured lines compare quantity and unit price as well as the amount.\n4. Compare on one tax basis. Where the invoice charges VAT, check the rate and VAT amount on each line and the supplier's VAT number: a UK VAT invoice must show them (HMRC VAT Notice 700, section 16.3). Never compare a net quote with a gross invoice.\n5. Prove the totals: the sum of the line variances must equal the difference between the approved and invoiced totals on the chosen basis.\n6. For a final invoice with deposits, gross up the approved charges with the documented tax, deduct only payments actually received and credited, once each, and show the agreed charge, tax, gross total, payments applied and balance due separately. In the UK a deposit usually creates its own VAT tax point, so check that the VAT across the deposit and final invoices adds up to the VAT on the full agreed price.\n7. Draft the query: each variance with its line ID, the approved amount and its source, the invoiced amount, and the action needed (credit note, corrected invoice or written approval).\n\n## Checks before you deliver\n\n- Equal grand totals can hide an unauthorised extra offset by a missing service.\n- Keep a deposit paid separate from the underlying contract value unless the document explicitly bills the remaining balance.\n- Comparing a net quote with a VAT-inclusive invoice creates a false variance the size of the VAT.\n- An emailed request or a phone call is not an approved variation unless the contract allows it. List it as unapproved rather than adding it to the schedule.\n- A correct line total can hide a higher unit rate on fewer units, or the reverse. Check quantity and rate on measured lines.\n- An agreed credit taken twice, once as its own line and again as a reduced price, understates the bill. Apply each credit once.\n\n## How to present the result\n\nLead with the amount to query, or confirm the invoice matches, in one sentence. Then give a table by line ID: approved amount and its source (quote or variation reference), invoiced amount and difference. Show the totals bridge on one tax basis and, for a final invoice, the gross total, payments credited and balance due. Finish with the query to the supplier, ready to send.\n\n## Worked example\n\n**Request:** Check this final invoice before I query it.\n\n**Supplied material:**\n\n```text\nGBP net, final invoice.\nAccepted Q7: DESIGN 600; PRINT 300; optional STORE 75 declined.\nSigned V2: add 50 to PRINT. Agreed CREDIT -40.\nInvoice: DESIGN 600; PRINT 350; STORE 75; CREDIT -20.\n```\n\n**Answer:** The approved net price is \u00a3910 and the invoice is \u00a31,005. Query \u00a395: storage was declined but billed at \u00a375, and the invoice allows only \u00a320 of the agreed \u00a340 credit. Design and the revised print charge agree.\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 approved_total, invoiced_total and difference as numbers in the supplied currency and tax basis, and variances as an object keyed by every differing line ID with its signed invoiced-minus-approved amount. Use an empty object for a complete match. For a requested settlement bridge also include gross_total, payments_applied and balance_due. For a settlement bridge also return comparison_basis as net or gross, or null if it cannot be established.\n\n## Sources\n\n- [Government Commercial Function \u00b7 Contract management foundation guide](https:\/\/www.gov.uk\/government\/publications\/civil-service-helping-you-with-managing-suppliers-and-contracts\/contract-management-training-accreditation-foundation-level-takeaway-guide-html): The guide says nothing should be agreed except through a contract change notice, that changes and their costs are authorised by all parties before implementation, and lists invoicing without the required evidence as a warning sign. The skill therefore counts only written, approved variations.\n- [Microsoft \u00b7 Prepayment invoices](https:\/\/learn.microsoft.com\/en-gb\/dynamics365\/business-central\/finance-how-to-create-prepayment-invoices): Business Central deducts the prepayment amount from the amount due when the final invoice is posted, and lets the prepayment be entered including VAT when prices include VAT. This is the deposit bridge the skill uses.\n- [HMRC \u00b7 VAT guide (VAT Notice 700)](https:\/\/www.gov.uk\/guidance\/vat-guide-notice-700): UK rules. Section 16.3 lists what a VAT invoice must show, including the quantity, VAT rate and net amount for each line and the total VAT, and section 14.2.3 says most deposits are advance payments that create a tax point when received. The skill uses these for its VAT and deposit checks on UK invoices.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/check-invoice-against-quote\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\/check-invoice-against-quote\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# Optional storage billed\n\nCheck this final invoice before I query it.\n\n## Supplied material\n\nGBP net, final invoice.\nAccepted Q7: DESIGN 600; PRINT 300; optional STORE 75 declined.\nSigned V2: add 50 to PRINT. Agreed CREDIT -40.\nInvoice: DESIGN 600; PRINT 350; STORE 75; CREDIT -20.\n\n## Worked answer\n\nThe approved net price is \u00a3910 and the invoice is \u00a31,005. Query \u00a395: storage was declined but billed at \u00a375, and the invoice allows only \u00a320 of the agreed \u00a340 credit. Design and the revised print charge agree.\n\n## Reasoning\n\nThe extra storage and the \u00a320 shortfall in the credit both increase the bill.\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":"Check this final invoice before I query it.\nReturn only the JSON specified in SKILL.md for this test.\n\nGBP net, final invoice.\nAccepted Q7: DESIGN 600; PRINT 300; optional STORE 75 declined.\nSigned V2: add 50 to PRINT. Agreed CREDIT -40.\nInvoice: DESIGN 600; PRINT 350; STORE 75; CREDIT -20.\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"approved_total\": 910,\n    \"invoiced_total\": 1005,\n    \"difference\": 95,\n    \"variances\": {\n        \"STORE\": 75,\n        \"CREDIT\": 20\n    }\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"The extra storage and the \u00a320 shortfall in the credit both increase the bill.\n"},{"path":"tests\/case-2\/request.txt","content":"Do these lines match the signed quote?\nReturn only the JSON specified in SKILL.md for this test.\n\nFinal invoice, EUR net.\nQ4 accepted: TRAIN 400; MANUAL 100.\nInvoice: TRAIN 400; SETUP 100. No variations.\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"approved_total\": 500,\n    \"invoiced_total\": 500,\n    \"difference\": 0,\n    \"variances\": {\n        \"MANUAL\": -100,\n        \"SETUP\": 100\n    }\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"A substituted charge balances the total while changing what the buyer bought.\n"},{"path":"tests\/case-3\/request.txt","content":"Compare net charges and show the gross amount still due.\nReturn only the JSON specified in SKILL.md for this test.\n\nGBP. Accepted Q1 WORK 8,000 net. Signed change V2 adds 500 to WORK. Invoice WORK 8,500 net, VAT 1,700, gross 10,200. Deposit receipt 2,400 gross shown as credited and bank receipt agrees; supplier claims balance 7,800.\n"},{"path":"tests\/case-3\/expected.json","content":"{\n    \"approved_total\": 8500,\n    \"invoiced_total\": 8500,\n    \"difference\": 0,\n    \"variances\": {},\n    \"gross_total\": 10200,\n    \"payments_applied\": 2400,\n    \"balance_due\": 7800,\n    \"comparison_basis\": \"net\"\n}\n"},{"path":"tests\/case-3\/explanation.txt","content":"The agreed change explains the \u00a3500. The deposit reduces the gross outstanding balance, leaving the underlying price unchanged.\n"}],"is_active":true,"is_approved":false}]}]}