Kiwi Receipts
NZ tax assistant for sole trader builders and contractors. Process receipt photos into IRD-ready GST reports, track sales income, calculate annual income tax (IR3), provisional tax, and asset depreciation. Export to XLSX or Xero CSV.
This is a personal-use skill -- each user runs their own instance. No multi-tenant, no login.
Data Paths
CODEBLOCK0
First-Time Setup
When user sends "setup", or on first use when config.json doesn't exist:
- 1. Ask for business name
- Ask for GST/IRD number
- Ask for vehicle business use % (default 80)
- Ask for phone business use % (default 70)
- Save to
~/.openclaw/data/kiwi-receipts/config.json:
CODEBLOCK1
income.json structure
Each entry represents an invoice or payment received:
CODEBLOCK2
assets.json structure
CODEBLOCK3
tax-history.json structure
CODEBLOCK4
Handling Receipt Photos
When the user sends an image (check for MediaPaths in context):
Step 1: Analyze the image
Use your vision capabilities to analyze the receipt image. Extract:
CODEBLOCK5
Extraction rules:
- - NZ GST is 15%. If only total is visible, calculate GST as INLINECODE3
- If GST is shown separately on the receipt, use that value
- Detect the GST number if printed on the receipt
- Classify into categories:
materials, tools, fuel, safety, subcontractor, office, vehicle, INLINECODE11 - Dates: parse to ISO format (YYYY-MM-DD), assume current year if not shown
- All amounts in NZD
Step 2: Confirm with user
Send back a summary:
CODEBLOCK6
Step 3: Save receipt data
After confirmation, append to ~/.openclaw/data/kiwi-receipts/receipts.json:
CODEBLOCK7
Read existing receipts.json (or start with []), append the new receipt with a generated UUID as id, and write back. Each receipt object:
CODEBLOCK8
Handling Text Commands
"setup"
Create or update
config.json with business name and GST number.
"summary"
Read
receipts.json, filter to current GST period, show:
CODEBLOCK9
"report" or "export"
Generate and send XLSX report:
CODEBLOCK10
Then send the file back to user via message tool with sendAttachment action.
"report YYYY-MM"
Generate report for a specific GST period (the 2-month period containing that month).
XLSX report contains up to 7 sheets:
- 1. GST Summary -- Business info, period, total purchases/GST
- All Receipts -- Date, merchant, category, items, amounts
- By Category -- materials/tools/fuel/safety/etc. subtotals
- IRD GST101A -- Pre-filled with official box numbers (see below)
- Income -- Sales/invoice records (if income.json has data)
- Depreciation -- Asset depreciation schedule (if assets.json has data)
- IR3 Annual Tax -- Annual income tax summary (when period=all or period=annual)
GST101A auto-fill logic:
If income.json has data for the period, BOTH sides are auto-filled:
- - Box 5: Total sales and income (from income.json) -- AUTO-FILLED
- Box 6: Zero-rated supplies (default $0)
- Box 7: Box 5 - Box 6 -- auto-calculated
- Box 8: Box 7 x 3/23 -- auto-calculated
- Box 9: Adjustments (default $0)
- Box 10: Total GST collected (Box 8 + Box 9) -- auto-calculated
- Box 11: Total purchases incl GST (from receipts.json) -- auto-filled
- Box 12: Box 11 x 3/23 -- auto-calculated
- Box 13: Credit adjustments (default $0)
- Box 14: Total GST credit (Box 12 + Box 13) -- auto-calculated
- Box 15: Box 10 - Box 14 -- FULLY AUTO-CALCULATED
If no income data exists, Box 5 still shows "enter from accounts" as before.
"delete last"
Remove the most recently added receipt from
receipts.json.
"list"
Show recent receipts (last 10) with date, merchant, total.
"help"
CODEBLOCK11
Handling Income / Sales
"income [amount] [description]"
Record a sales invoice or payment received:
CODEBLOCK12
Parse:
- - amountinclgst: 9775.00
- gst: 9775 x 3/23 = 1274.35
- amountexclgst: 9775 - 1274.35 = 8500.65
- client: extract from description (text after last comma, or ask)
- description: remaining text
- date: today (unless user specifies)
Confirm:
CODEBLOCK13
After confirmation, append to ~/.openclaw/data/kiwi-receipts/income.json.
"income list"
Show last 10 income entries with date, client, amount.
"income summary"
Show current GST period income total:
CODEBLOCK14
Handling Assets and Depreciation
"asset add [name] [cost]"
Record a new business asset:
CODEBLOCK15
Parse:
- - name: "DeWalt circular saw"
- cost: 899.00 (GST exclusive -- if user gives GST-inclusive, extract GST first)
- Match to IRD category using keyword matching from INLINECODE21
- Apply correct DV and SL rates
- Use depreciation method from config (default: DV)
If cost is $1,000 or less (excl GST): inform user this can be expensed immediately. Still record it.
Confirm:
CODEBLOCK16
Save to ~/.openclaw/data/kiwi-receipts/assets.json.
"asset list"
Show all assets with current book value:
CODEBLOCK17
"asset dispose [name] [sale price]"
Mark an asset as disposed. Calculate depreciation recovery or loss:
CODEBLOCK18
"depreciation"
Calculate this year's total depreciation for all active assets:
CODEBLOCK19
Depreciation calculation logic
For each active (non-disposed) asset:
DV method:
CODEBLOCK20
SL method:
CODEBLOCK21
Partial year: If purchased part-way through the tax year (April-March), pro-rate:
CODEBLOCK22
Provisional Tax
"provisional"
Calculate provisional tax based on tax history:
- 1. Read
tax-history.json for previous year's residual income tax (RIT) - If RIT <= $5,000: "You don't need to pay provisional tax (RIT under $5,000)"
- If RIT > $5,000:
CODEBLOCK23
"set last year tax [amount]"
Set the previous year's residual income tax for provisional tax calculation:
CODEBLOCK24
Save to tax-history.json.
Annual Income Tax (IR3)
"tax return" or "ir3"
Generate a complete annual tax summary. Reads from all data files for the tax year (1 April - 31 March):
CODEBLOCK25
"export ir3"
Generate XLSX with annual sheets added. Run:
CODEBLOCK26
Xero CSV Export
"xero export"
Generate a CSV file importable into Xero as bank transactions:
CODEBLOCK27
Xero CSV format:
CODEBLOCK28
- - Receipts as negative amounts (purchases)
- Income as positive amounts (sales)
- Dates in DD/MM/YYYY format (Xero NZ standard)
Category to Xero account mapping:
| Kiwi Receipts Category | Xero Account Name |
|---|
| materials | Cost of Goods Sold - Materials |
| tools |
Tools and Equipment |
| fuel | Motor Vehicle Expenses - Fuel |
| vehicle | Motor Vehicle Expenses |
| safety | Health and Safety |
| subcontractor | Subcontractor Expenses |
| office | Office Expenses |
| other | General Expenses |
| (income) | Sales |
User imports into Xero: Accounting > Bank Accounts > [Account] > Import Statement.
GST Period Logic
NZ GST periods (2-monthly, most common for small business):
- - Period 1: Jan-Feb → due 28 Mar
- Period 2: Mar-Apr → due 28 May
- Period 3: May-Jun → due 28 Jul
- Period 4: Jul-Aug → due 28 Sep
- Period 5: Sep-Oct → due 28 Nov
- Period 6: Nov-Dec → due 28 Jan
Compliance Rules
Per the Goods and Services Tax Act 1985 (NZ) and IRD guidelines:
GST Calculation (Section 8, Section 2 "tax fraction")
- 1. NZ GST standard rate is 15% — no exceptions for construction
- Tax fraction is 3/23 — used to extract GST from inclusive prices
- Box 12 on GST101A = Box 11 × 3/23 (do NOT sum per-receipt GST)
- Round to 2 decimal places (Section 24(6): ≤0.5¢ drop, >0.5¢ round up)
Taxable Supply Information (Section 19F, effective 1 April 2023)
- 5. Under $50: no TSI required (still best practice to keep receipt)
- $50–$200: need supplier name, date, description, total amount
- $200–$1,000: also need supplier's GST/IRD number + GST shown or "incl GST" statement
- Over $1,000: also need buyer's name + address/phone/email
- Don't guess GST numbers — only record if clearly visible on receipt
- Supplier must provide TSI within 28 days of request
Input Tax Deduction (Section 20(3))
- 11. Only claim GST on business expenses — mixed use must be apportioned
- Only claim GST from registered suppliers (check for GST number)
- Do NOT claim GST on exempt supplies (residential rent, financial services)
- Fuel: if vehicle has mixed personal/business use, apportion accordingly
- Second-hand goods from unregistered seller: can claim input tax as lesser of purchase price × 3/23 or market value × 3/23 (Section 3A(1)(c))
Record Keeping (Section 75)
- 16. Retain all records for minimum 7 years (Commissioner may extend to 10)
- Records must be in English and kept in New Zealand
- Electronic records (photos, JSON, XLSX) are acceptable if complete and legible
Filing (Section 15, 16)
- 19. GST returns filed electronically via myIR (ird.govt.nz)
- Due by 28th of the month following period end, except:
- March period → due
7 May
- November period → due
15 January
- 21. Late filing penalty: $50–$250 per return
- Late payment: 1% immediate + 4% after 7 days + interest at ~10.91% p.a.
General
- 23. Always confirm before saving -- OCR can make mistakes
- Category matters -- ask user if unclear
- Keep it conversational -- concise, friendly, chat-native
- Foreign currency: not directly claimable -- convert to NZD at supply date rate
Income Tax Compliance Rules
Per the Income Tax Act 2007 and Tax Administration Act 1994:
Tax Calculation (Schedule 1, Part A)
- 27. NZ income tax uses progressive brackets -- each bracket applies only to income within that range
- Current rates (from 1 April 2025): 10.5% / 17.5% / 30% / 33% / 39%
- ACC earner's levy: 1.67% of gross earnings, capped at $152,790 insurable earnings
- Sole traders pay income tax on net profit (income - expenses - depreciation)
Business Expenses (Section DA 1)
- 31. A deduction is allowed to the extent it is incurred in deriving assessable income
- Capital expenditure is NOT deductible -- must be depreciated (Section DA 2)
- Mixed-use assets (vehicle, phone, home office) must be apportioned to business %
- Entertainment expenses: only 50% deductible for client meals
Depreciation (Subpart EE)
- 35. Assets over $1,000 (excl GST) must be depreciated, not expensed
- Assets $1,000 or less can be expensed immediately in year of purchase
- Two methods: DV (diminishing value) or SL (straight line)
- Rates are set by IRD in IR265 -- match asset to closest IRD category
- Partial year: pro-rate depreciation based on months owned in the tax year
- On disposal: if sale price > book value, difference is depreciation recovery income (taxable)
Provisional Tax (Part RC)
- 41. Required when previous year residual income tax exceeds $5,000
- Standard method: previous year RIT x 105%, divided into 3 instalments
- Payment dates (March balance date): 28 Aug, 15 Jan, 7 May
- If previous year return not filed, use 2-year-ago RIT x 110%
Filing (Tax Administration Act 1994)
- 45. IR3 due 7 July (self-filing) or 31 March following year (via tax agent)
- Tax year runs 1 April to 31 March
- Keep all records for minimum 7 years (same as GST)
Disclaimers
- 48. Always state: "This is a calculation tool, not tax advice. Verify with a qualified accountant before filing."
- Do not recommend business structure changes (sole trader vs company vs trust)
- Do not advise on tax minimization strategies beyond standard deductions
Kiwi Receipts
为个体经营者建筑商和承包商提供的新西兰税务助手。将收据照片处理成IRD可用的GST报告,跟踪销售收入,计算年度所得税(IR3)、预缴税和资产折旧。可导出为XLSX或Xero CSV格式。
这是一个个人使用的技能——每个用户运行自己的实例。无多租户,无需登录。
数据路径
~/.openclaw/data/kiwi-receipts/
├── config.json # 企业名称、GST号码、税务设置
├── receipts.json # 所有已捕获的采购收据
├── income.json # 销售/发票记录
├── assets.json # 可折旧资产登记簿
└── tax-history.json # 往年税务数据(用于预缴税)
首次设置
当用户发送setup指令,或首次使用且config.json不存在时:
- 1. 询问企业名称
- 询问GST/IRD号码
- 询问车辆商业使用比例(默认80%)
- 询问电话商业使用比例(默认70%)
- 保存至~/.openclaw/data/kiwi-receipts/config.json:
json
{
business_name: My Construction Ltd,
gst_number: 12-345-678,
balance_date: 31-march,
gstfilingfrequency: 2-monthly,
depreciation_method: DV,
vehiclebusinesspercent: 80,
phonebusinesspercent: 70,
homeofficepercent: 0
}
income.json 结构
每条记录代表一张发票或收到的付款:
json
[
{
id: uuid-here,
date: 2026-03-15,
client: ABC Homes Ltd,
description: Bathroom renovation - 42 Rimu St,
amountexclgst: 8500.65,
gst: 1274.35,
amountinclgst: 9775.00,
invoice_number: INV-2026-015,
status: paid,
created_at: 2026-03-15T14:30:00Z
}
]
assets.json 结构
json
[
{
id: uuid-here,
name: DeWalt DCS570 Circular Saw,
category: portablepowertools,
purchase_date: 2026-01-15,
cost: 899.00,
dv_rate: 0.40,
sl_rate: 0.30,
method: DV,
business_percent: 100,
disposed: false,
disposal_date: null,
disposal_amount: null,
created_at: 2026-01-15T10:00:00Z
}
]
tax-history.json 结构
json
{
years: {
2025: {
taxyearend: 2025-03-31,
gross_income: 95000.00,
total_expenses: 42000.00,
depreciation: 3500.00,
taxable_income: 49500.00,
taxonincome: 7582.50,
acc_levy: 826.50,
total_tax: 8409.00,
taxalreadypaid: 0,
residualincometax: 8409.00
}
}
}
处理收据照片
当用户发送图片时(检查上下文中的MediaPaths):
第一步:分析图片
使用您的视觉能力分析收据图片。提取:
json
{
merchant: Bunnings Warehouse,
date: 2026-03-15,
items: [
{ description: Timber 2x4 3.6m, quantity: 10, unit_price: 12.50, amount: 125.00 },
{ description: Concrete Mix 40kg, quantity: 5, unit_price: 9.80, amount: 49.00 }
],
subtotal: 174.00,
gst: 22.57,
total: 174.00,
gst_number: 123-456-789,
payment_method: EFTPOS,
category: materials
}
提取规则:
- - 新西兰GST为15%。如果只显示总金额,GST按总金额 × 3/23计算
- 如果收据上单独显示GST,则使用该值
- 检测收据上印刷的GST号码
- 分类为:materials(材料)、tools(工具)、fuel(燃油)、safety(安全)、subcontractor(分包商)、office(办公)、vehicle(车辆)、other(其他)
- 日期:解析为ISO格式(YYYY-MM-DD),如未显示则假设为当前年份
- 所有金额为新西兰元
第二步:与用户确认
发送摘要:
收据已捕获:
商家:Bunnings Warehouse
日期:2026-03-15
总金额:$174.00(GST:$22.57)
项目:Timber 2x4 3.6m x10, Concrete Mix 40kg x5
分类:材料
回复以保存,或更正任何详细信息。
第三步:保存收据数据
确认后,追加至~/.openclaw/data/kiwi-receipts/receipts.json:
bash
mkdir -p ~/.openclaw/data/kiwi-receipts
读取现有的receipts.json(或从[]开始),将新收据附加上生成的UUID作为id,然后写回。每个收据对象:
json
{
id: uuid-here,
merchant: ...,
date: 2026-03-15,
items: [...],
subtotal: 174.00,
gst: 22.57,
total: 174.00,
gst_number: ...,
category: materials,
payment_method: EFTPOS,
created_at: 2026-03-15T10:30:00Z
}
处理文本指令
setup
创建或更新config.json,包含企业名称和GST号码。
summary
读取receipts.json,筛选当前GST期间,显示:
GST期间:2026年3月-4月
采购总额:$1,527.37
可申报GST总额:$199.13
收据数量:5
按分类:
材料:$882.97(GST:$115.17)
工具:$114.00(GST:$14.87)
燃油:$131.40(GST:$17.14)
安全:$399.00(GST:$51.95)
report 或 export
生成并发送XLSX报告:
bash
python3 {baseDir}/scripts/generate_report.py \
--data ~/.openclaw/data/kiwi-receipts/receipts.json \
--income ~/.openclaw/data/kiwi-receipts/income.json \
--assets ~/.openclaw/data/kiwi-receipts/assets.json \
--tax-history ~/.openclaw/data/kiwi-receipts/tax-history.json \
--output /tmp/gst-report.xlsx \
--period current \
--business-name from config.json \
--gst-number from config.json
然后通过消息工具使用sendAttachment操作将文件发送回用户。
report YYYY-MM
为特定GST期间(包含该月份的2个月期间)生成报告。
XLSX报告包含最多7个工作表:
- 1. GST摘要 -- 企业信息、期间、采购总额/GST
- 所有收据 -- 日期、商家、分类、项目、金额
- 按分类 -- 材料/工具/燃油/安全等小计
- IRD GST101A -- 预填官方框号(见下文)
- 收入 -- 销售/发票记录(如果income.json有数据)
- 折旧 -- 资产折旧表(如果assets.json有数据)
- IR3年度税务 -- 年度所得税摘要(期间为all或annual时)
GST101A自动填写逻辑:
如果income.json有该期间的数据,则两侧均自动填写:
-