Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/project-doc/users/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ These templates are designed for application users of the Docraft library.
- `hello-world.craft`: minimal working example.
- `basic-report.craft`: multi-section report with header/footer/page number.
- `invoice-foreach.craft`: invoice layout using template variables and `Foreach`.
- `invoice-static.craft`: full invoice layout with literal mock data, no template
variables — runnable as-is.
- `table-json.craft`: table populated from JSON template variables.

## Required variables for `invoice-foreach.craft`
Expand Down
125 changes: 125 additions & 0 deletions doc/project-doc/users/templates/invoice-static.craft
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<Document>
<Settings page_size="A4" page_orientation="portrait"/>

<Metadata>
<Author>Nova Design Studio</Author>
<Subject>Invoice INV-2026-0417</Subject>
<AutoKeywords enabled="true" max_keywords="10" language="en"/>
</Metadata>

<Header margin_left="30" margin_right="30" margin_top="10">
<Layout orientation="horizontal">
<Text weight="0.67" font_size="20" style="bold"
color="#2C3E50">Nova Design Studio</Text>
<Text weight="0.33" font_size="10" alignment="right"
color="#7F8C8D">48 Market Street, San Francisco, CA 94105</Text>
</Layout>
</Header>

<Body margin_left="30" margin_right="30">
<!-- Invoice title -->
<Text font_size="16" style="bold" color="#2C3E50">
INVOICE INV-2026-0417
</Text>
<Blank/>

<!-- Client info -->
<Rectangle background_color="#ECF0F1" padding="10"
border_color="#BDC3C7" border_width="0.5">
<Text font_size="10" style="bold">Bill To:</Text>
<Text font_size="10">Harborline Retail Group</Text>
<Text font_size="10">220 Harbor Blvd, Oakland, CA 94607</Text>
<Text font_size="10">accounts@harborlineretail.com</Text>
</Rectangle>
<Blank/>

<!-- Date and payment terms -->
<Layout orientation="horizontal">
<Text weight="0.33" font_size="10">
Date: July 5, 2026
</Text>
<Text weight="0.33" font_size="10">
Due Date: August 4, 2026
</Text>
<Text weight="0.34" font_size="10" alignment="right">
Payment Terms: Net 30
</Text>
</Layout>
<Blank/>

<!-- Items table -->
<Table>
<THead>
<HTitle style="bold" font_size="10"
background_color="#2C3E50" color="white">
Description
</HTitle>
<HTitle style="bold" font_size="10"
background_color="#2C3E50" color="white">
Qty
</HTitle>
<HTitle style="bold" font_size="10"
background_color="#2C3E50" color="white">
Unit Price
</HTitle>
<HTitle style="bold" font_size="10"
background_color="#2C3E50" color="white">
Amount
</HTitle>
</THead>
<TBody>
<Row>
<Cell><Text>Brand Identity Design</Text></Cell>
<Cell><Text>1</Text></Cell>
<Cell><Text>$3,200.00</Text></Cell>
<Cell><Text>$3,200.00</Text></Cell>
</Row>
<Row>
<Cell><Text>Website Development (hrs)</Text></Cell>
<Cell><Text>40</Text></Cell>
<Cell><Text>$95.00</Text></Cell>
<Cell><Text>$3,800.00</Text></Cell>
</Row>
<Row>
<Cell><Text>Monthly Hosting &amp; Support</Text></Cell>
<Cell><Text>3</Text></Cell>
<Cell><Text>$150.00</Text></Cell>
<Cell><Text>$450.00</Text></Cell>
</Row>
</TBody>
</Table>
<Blank/>

<!-- Totals -->
<Rectangle background_color="#ECF0F1" padding="8">
<Layout orientation="horizontal">
<Text weight="0.5" font_size="11" style="bold">Subtotal:</Text>
<Text weight="0.5" font_size="11"
alignment="right">$7,450.00</Text>
</Layout>
<Layout orientation="horizontal">
<Text weight="0.5" font_size="11" style="bold">Tax (8%):</Text>
<Text weight="0.5" font_size="11"
alignment="right">$596.00</Text>
</Layout>
<Line x1="0" y1="0" x2="200" y2="0"
border_color="#2C3E50" border_width="1"/>
<Layout orientation="horizontal">
<Text weight="0.5" font_size="14" style="bold"
color="#2C3E50">Total:</Text>
<Text weight="0.5" font_size="14" style="bold"
alignment="right" color="#2C3E50">$8,046.00</Text>
</Layout>
</Rectangle>
</Body>

<Footer margin_left="30" margin_right="30">
<Layout orientation="horizontal">
<Text weight="0.5" font_size="8" color="#95A5A6">
Nova Design Studio — VAT US-88-1234567
</Text>
<PageNumber weight="0.5" font_size="8" alignment="right"
color="#95A5A6"/>
</Layout>
</Footer>
</Document>
Loading