{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"invoice-generator","type":"registry:block","title":"Invoice Generator","description":"Line items that total themselves, and a button that clones the next invoice.","author":"Notion Arena","categories":["business"],"tags":["native","pro","invoice","finance","freelance","formula","rollup"],"meta":{"kind":"native","tier":"pro","version":"1.1.0","updatedAt":"2026-09-05","notionPlan":"Plus","emoji":"🧾","delivery":["api","duplicate","guide"],"capabilities":{"interactive":false,"offlineSafe":true,"persistsLocally":false,"writesToNotion":true,"needsNetwork":false},"recipe":"invoice-generator","installUrl":"https://notionarena.vercel.app/api/install"},"files":[{"path":"recipes/invoice-generator.json","type":"registry:file","target":"notion/recipes/invoice-generator.json","content":"{\n  \"$schema\": \"https://notionarena.vercel.app/r/schema.json\",\n  \"notionVersion\": \"2026-03-11\",\n  \"id\": \"invoice-generator\",\n  \"summary\": \"Clients, Invoices and Line Items with tax computed per client, a printable page-body layout, and revenue-by-month chart.\",\n  \"databases\": [\n    {\n      \"ref\": \"clients\",\n      \"title\": \"Clients\",\n      \"icon\": \"🏢\",\n      \"properties\": {\n        \"Name\": {\n          \"title\": {}\n        },\n        \"Contact\": {\n          \"people\": {}\n        },\n        \"Email\": {\n          \"email\": {}\n        },\n        \"Billing address\": {\n          \"rich_text\": {}\n        },\n        \"Tax ID\": {\n          \"rich_text\": {}\n        },\n        \"Tax rate\": {\n          \"number\": {\n            \"format\": \"percent\"\n          },\n          \"description\": \"Applied to every invoice for this client.\"\n        },\n        \"Currency\": {\n          \"select\": {\n            \"options\": [\n              {\n                \"name\": \"USD\",\n                \"color\": \"green\"\n              },\n              {\n                \"name\": \"EUR\",\n                \"color\": \"blue\"\n              },\n              {\n                \"name\": \"GBP\",\n                \"color\": \"purple\"\n              },\n              {\n                \"name\": \"PKR\",\n                \"color\": \"yellow\"\n              }\n            ]\n          }\n        },\n        \"Payment terms (days)\": {\n          \"number\": {\n            \"format\": \"number\"\n          }\n        },\n        \"Invoices\": {\n          \"relation\": {\n            \"type\": \"dual_property\",\n            \"dual_property\": {\n              \"synced_property_name\": \"Client\"\n            }\n          },\n          \"__relationRef\": \"invoices\"\n        },\n        \"Total invoiced\": {\n          \"rollup\": {\n            \"relation_property_name\": \"Invoices\",\n            \"rollup_property_name\": \"Grand total\",\n            \"function\": \"sum\"\n          }\n        },\n        \"Total paid\": {\n          \"rollup\": {\n            \"relation_property_name\": \"Paid invoices\",\n            \"rollup_property_name\": \"Grand total\",\n            \"function\": \"sum\"\n          }\n        },\n        \"Outstanding\": {\n          \"formula\": {\n            \"expression\": \"prop(\\\"Total invoiced\\\") - prop(\\\"Total paid\\\")\"\n          }\n        }\n      },\n      \"seed\": [\n        {\n          \"name\": \"Northwind Logistics\",\n          \"props\": {\n            \"Tax rate\": 0.2,\n            \"Currency\": \"USD\",\n            \"Payment terms (days)\": 30\n          }\n        },\n        {\n          \"name\": \"Kestrel Labs\",\n          \"props\": {\n            \"Tax rate\": 0,\n            \"Currency\": \"USD\",\n            \"Payment terms (days)\": 14\n          }\n        }\n      ]\n    },\n    {\n      \"ref\": \"invoices\",\n      \"title\": \"Invoices\",\n      \"icon\": \"🧾\",\n      \"properties\": {\n        \"Name\": {\n          \"title\": {}\n        },\n        \"Invoice number\": {\n          \"unique_id\": {\n            \"prefix\": \"INV\"\n          }\n        },\n        \"Status\": {\n          \"status\": {\n            \"options\": [\n              {\n                \"name\": \"Draft\",\n                \"color\": \"gray\",\n                \"group\": \"To-do\"\n              },\n              {\n                \"name\": \"Sent\",\n                \"color\": \"blue\",\n                \"group\": \"In progress\"\n              },\n              {\n                \"name\": \"Overdue\",\n                \"color\": \"red\",\n                \"group\": \"In progress\"\n              },\n              {\n                \"name\": \"Paid\",\n                \"color\": \"green\",\n                \"group\": \"Complete\"\n              },\n              {\n                \"name\": \"Void\",\n                \"color\": \"gray\",\n                \"group\": \"Complete\"\n              }\n            ]\n          }\n        },\n        \"Client\": {\n          \"relation\": {\n            \"type\": \"single_property\",\n            \"single_property\": {}\n          },\n          \"__relationRef\": \"clients\"\n        },\n        \"Issue date\": {\n          \"date\": {}\n        },\n        \"Due date\": {\n          \"date\": {}\n        },\n        \"Paid date\": {\n          \"date\": {}\n        },\n        \"LineItems\": {\n          \"relation\": {\n            \"type\": \"dual_property\",\n            \"dual_property\": {\n              \"synced_property_name\": \"Invoice\"\n            }\n          },\n          \"__relationRef\": \"lineItems\"\n        },\n        \"Subtotal\": {\n          \"rollup\": {\n            \"relation_property_name\": \"LineItems\",\n            \"rollup_property_name\": \"Line total\",\n            \"function\": \"sum\"\n          }\n        },\n        \"Tax rate\": {\n          \"rollup\": {\n            \"relation_property_name\": \"Client\",\n            \"rollup_property_name\": \"Tax rate\",\n            \"function\": \"show_original\"\n          }\n        },\n        \"Tax\": {\n          \"formula\": {\n            \"expression\": \"prop(\\\"Subtotal\\\") * prop(\\\"Tax rate\\\")\"\n          }\n        },\n        \"Grand total\": {\n          \"formula\": {\n            \"expression\": \"prop(\\\"Subtotal\\\") + prop(\\\"Tax\\\")\"\n          }\n        },\n        \"Days overdue\": {\n          \"formula\": {\n            \"expression\": \"if(prop(\\\"Status\\\") == \\\"Paid\\\", 0, max(0, dateBetween(now(), prop(\\\"Due date\\\"), \\\"days\\\")))\"\n          }\n        },\n        \"Overdue flag\": {\n          \"formula\": {\n            \"expression\": \"ifs(prop(\\\"Status\\\") == \\\"Paid\\\", \\\"\\\", prop(\\\"Days overdue\\\") > 14, \\\"🔴 \\\" + format(prop(\\\"Days overdue\\\")) + \\\"d overdue\\\", prop(\\\"Days overdue\\\") > 0, \\\"🟡 \\\" + format(prop(\\\"Days overdue\\\")) + \\\"d overdue\\\", true, \\\"🟢 Current\\\")\"\n          }\n        },\n        \"Reference\": {\n          \"rich_text\": {}\n        },\n        \"Attachments\": {\n          \"files\": {}\n        }\n      },\n      \"seed\": [\n        {\n          \"name\": \"October retainer · Northwind\",\n          \"props\": {\n            \"Status\": \"Sent\"\n          }\n        },\n        {\n          \"name\": \"Component audit · Kestrel\",\n          \"props\": {\n            \"Status\": \"Draft\"\n          }\n        }\n      ]\n    },\n    {\n      \"ref\": \"lineItems\",\n      \"title\": \"Line Items\",\n      \"icon\": \"➕\",\n      \"isInline\": true,\n      \"properties\": {\n        \"Name\": {\n          \"title\": {}\n        },\n        \"Description\": {\n          \"rich_text\": {}\n        },\n        \"Quantity\": {\n          \"number\": {\n            \"format\": \"number\"\n          }\n        },\n        \"Unit price\": {\n          \"number\": {\n            \"format\": \"dollar\"\n          }\n        },\n        \"Invoice\": {\n          \"relation\": {\n            \"type\": \"single_property\",\n            \"single_property\": {}\n          },\n          \"__relationRef\": \"invoices\"\n        },\n        \"Line total\": {\n          \"formula\": {\n            \"expression\": \"prop(\\\"Quantity\\\") * prop(\\\"Unit price\\\")\"\n          }\n        },\n        \"Order\": {\n          \"number\": {\n            \"format\": \"number\"\n          }\n        }\n      },\n      \"seed\": [\n        {\n          \"name\": \"Component library build\",\n          \"props\": {\n            \"Quantity\": 1,\n            \"Unit price\": 6400\n          }\n        },\n        {\n          \"name\": \"Design review hours\",\n          \"props\": {\n            \"Quantity\": 8,\n            \"Unit price\": 145\n          }\n        }\n      ]\n    }\n  ],\n  \"views\": [\n    {\n      \"on\": \"invoices\",\n      \"name\": \"By status\",\n      \"type\": \"board\",\n      \"configuration\": {\n        \"type\": \"board\",\n        \"card_layout\": \"comfortable\"\n      }\n    },\n    {\n      \"on\": \"invoices\",\n      \"name\": \"Overdue\",\n      \"type\": \"table\",\n      \"filter\": {\n        \"property\": \"Overdue flag\",\n        \"string\": {\n          \"contains\": \"overdue\"\n        }\n      },\n      \"sorts\": [\n        {\n          \"property\": \"Days overdue\",\n          \"direction\": \"descending\"\n        }\n      ]\n    },\n    {\n      \"on\": \"invoices\",\n      \"name\": \"Revenue by month\",\n      \"type\": \"chart\",\n      \"configuration\": {\n        \"type\": \"chart\",\n        \"chart_type\": \"column\",\n        \"x_axis\": {\n          \"type\": \"date\",\n          \"property_name\": \"Issue date\",\n          \"date_grouping\": \"month\"\n        },\n        \"y_axis\": {\n          \"aggregator\": \"sum\",\n          \"property_name\": \"Grand total\"\n        },\n        \"color_theme\": \"green\",\n        \"show_data_labels\": true,\n        \"height\": \"medium\"\n      }\n    },\n    {\n      \"on\": \"invoices\",\n      \"name\": \"Issue calendar\",\n      \"type\": \"calendar\",\n      \"configuration\": {\n        \"type\": \"calendar\",\n        \"calendar_by\": \"Issue date\"\n      }\n    },\n    {\n      \"on\": \"clients\",\n      \"name\": \"Clients\",\n      \"type\": \"table\"\n    },\n    {\n      \"on\": \"lineItems\",\n      \"name\": \"All line items\",\n      \"type\": \"table\"\n    }\n  ],\n  \"pages\": [\n    {\n      \"title\": \"Invoice page layout\",\n      \"icon\": \"🖨️\",\n      \"blocks\": [\n        {\n          \"object\": \"block\",\n          \"type\": \"paragraph\",\n          \"paragraph\": {\n            \"rich_text\": [\n              {\n                \"type\": \"text\",\n                \"text\": {\n                  \"content\": \"Put this in the \",\n                  \"link\": null\n                }\n              },\n              {\n                \"type\": \"text\",\n                \"text\": {\n                  \"content\": \"Invoices\",\n                  \"link\": null\n                },\n                \"annotations\": {\n                  \"code\": true\n                }\n              },\n              {\n                \"type\": \"text\",\n                \"text\": {\n                  \"content\": \" page body template. Column layouts survive export to PDF, which a table alone does not.\",\n                  \"link\": null\n                }\n              }\n            ],\n            \"color\": \"default\"\n          }\n        },\n        {\n          \"object\": \"block\",\n          \"type\": \"column_list\",\n          \"column_list\": {},\n          \"children\": [\n            {\n              \"object\": \"block\",\n              \"type\": \"column\",\n              \"column\": {},\n              \"children\": [\n                {\n                  \"object\": \"block\",\n                  \"type\": \"heading_3\",\n                  \"heading_3\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"From\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\",\n                    \"is_toggleable\": false\n                  }\n                },\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Your business name\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                },\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Address line\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                },\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Tax ID\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                }\n              ]\n            },\n            {\n              \"object\": \"block\",\n              \"type\": \"column\",\n              \"column\": {},\n              \"children\": [\n                {\n                  \"object\": \"block\",\n                  \"type\": \"heading_3\",\n                  \"heading_3\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Bill to\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\",\n                    \"is_toggleable\": false\n                  }\n                },\n                {\n                  \"object\": \"block\",\n                  \"type\": \"callout\",\n                  \"callout\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Use a linked mention of the Client property so the address is never typed twice.\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"icon\": {\n                      \"type\": \"emoji\",\n                      \"emoji\": \"🔗\"\n                    },\n                    \"color\": \"gray_background\"\n                  }\n                }\n              ]\n            },\n            {\n              \"object\": \"block\",\n              \"type\": \"column\",\n              \"column\": {},\n              \"children\": [\n                {\n                  \"object\": \"block\",\n                  \"type\": \"heading_3\",\n                  \"heading_3\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Details\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\",\n                    \"is_toggleable\": false\n                  }\n                },\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Invoice no.\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                },\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Issued\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                },\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Due\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                },\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Terms\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"object\": \"block\",\n          \"type\": \"divider\",\n          \"divider\": {}\n        },\n        {\n          \"object\": \"block\",\n          \"type\": \"heading_3\",\n          \"heading_3\": {\n            \"rich_text\": [\n              {\n                \"type\": \"text\",\n                \"text\": {\n                  \"content\": \"Line items\",\n                  \"link\": null\n                }\n              }\n            ],\n            \"color\": \"default\",\n            \"is_toggleable\": false\n          }\n        },\n        {\n          \"object\": \"block\",\n          \"type\": \"paragraph\",\n          \"paragraph\": {\n            \"rich_text\": [\n              {\n                \"type\": \"text\",\n                \"text\": {\n                  \"content\": \"Embed the Line Items database here as a linked view, filtered to this invoice, showing Name, Quantity, Unit price and Line total.\",\n                  \"link\": null\n                }\n              }\n            ],\n            \"color\": \"default\"\n          }\n        },\n        {\n          \"object\": \"block\",\n          \"type\": \"divider\",\n          \"divider\": {}\n        },\n        {\n          \"object\": \"block\",\n          \"type\": \"column_list\",\n          \"column_list\": {},\n          \"children\": [\n            {\n              \"object\": \"block\",\n              \"type\": \"column\",\n              \"column\": {},\n              \"children\": [\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Payment instructions, bank details, and a thank-you line.\",\n                          \"link\": null\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                }\n              ]\n            },\n            {\n              \"object\": \"block\",\n              \"type\": \"column\",\n              \"column\": {},\n              \"children\": [\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Subtotal\",\n                          \"link\": null\n                        },\n                        \"annotations\": {\n                          \"bold\": true\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                },\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Tax\",\n                          \"link\": null\n                        },\n                        \"annotations\": {\n                          \"bold\": true\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                },\n                {\n                  \"object\": \"block\",\n                  \"type\": \"paragraph\",\n                  \"paragraph\": {\n                    \"rich_text\": [\n                      {\n                        \"type\": \"text\",\n                        \"text\": {\n                          \"content\": \"Total due\",\n                          \"link\": null\n                        },\n                        \"annotations\": {\n                          \"bold\": true\n                        }\n                      }\n                    ],\n                    \"color\": \"default\"\n                  }\n                }\n              ]\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}"},{"path":"recipes/invoice-generator.manual.md","type":"registry:file","target":"notion/recipes/invoice-generator.manual.md","content":"## Button: “Duplicate for next month”\n\n**Why this cannot be scripted:** Button properties are response-only in the Notion API: the schema is returned on read, but the API ignores button settings on write and cannot create a button or configure its actions.\n\n1. Invoices → ••• → Property → Button, name it “Duplicate for next month”.\n2. Action 1: Add page to → Invoices. Set Client to this page's Client, Status to Draft, Issue date to Today.\n3. Action 2: Open the new page, so you can paste last month's line items.\n4. Notion buttons cannot copy related rows, so line items are the one manual step.\n\n## Automation: mark Sent invoices Overdue\n\n**Why this cannot be scripted:** Database automations have no public API surface. They are configured per-database in the Notion app under ••• → Automations.\n\n1. Invoices → Automations → New automation.\n2. Trigger: Due date is before Today (Notion evaluates date triggers daily).\n3. Condition: Status is Sent.\n4. Action: set Status to Overdue.\n5. Second automation: when Status becomes Paid, set Paid date to Today.\n"}]}