Add HMRC tax reporting to accounts

- Add new HMRC Report tab to accounts reports
- Show total turnover (web + manual sales)
- Calculate cost of goods sold from purchases
- Display gross profit and profit margin
- Show operating expenses breakdown
- Calculate net profit before tax
- Estimate tax liability (19% corporation tax)
- Include HMRC checklist of what needs to be reported
- Help admin prepare for Self Assessment submission

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Andymick
2026-07-16 21:17:46 +01:00
co-authored by Claude Haiku 4.5
parent d596cbe836
commit 53dd963090
2 changed files with 104 additions and 2 deletions
+6 -2
View File
@@ -7,7 +7,7 @@ export async function getReportData() {
const isAuthenticated = await isAdminAuthenticated();
if (!isAuthenticated) throw new Error('Unauthorized');
const [orders, manualSales, expenses] = await Promise.all([
const [orders, manualSales, expenses, purchases] = await Promise.all([
prisma.order.findMany({
select: { id: true, total: true, createdAt: true },
orderBy: { createdAt: 'asc' },
@@ -20,7 +20,11 @@ export async function getReportData() {
select: { id: true, amount: true, date: true, category: true },
orderBy: { date: 'desc' },
}),
prisma.purchase.findMany({
select: { id: true, total: true, purchasedAt: true },
orderBy: { purchasedAt: 'desc' },
}),
]);
return { orders, manualSales, expenses };
return { orders, manualSales, expenses, purchases };
}