Initial commit: Voiced invoice desktop app

Offline-first invoicing app for Test Vendor, built by Bongbetic.

- Tauri v2 (Rust) + React/TypeScript + IBM Carbon Design System UI
- SQLite (rusqlite) storage with a persistent invoice-number series
- Guided first-run setup, pre-filled vendor/bank details
- Fixed-amount or rate x quantity line items (per sec/min/hour/session/unit)
- GST as CGST+SGST or IGST, Indian amount-in-words
- Optional signature, with a computer-generated note as fallback
- Print-ready PDF export via @react-pdf/renderer
- Windows cross-compile via cargo-xwin (NSIS installer)

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
This commit is contained in:
2026-10-03 23:07:51 +05:30
co-authored by CommandCodeBot
commit 875a12b2e6
121 changed files with 13660 additions and 0 deletions
+168
View File
@@ -0,0 +1,168 @@
export type TaxType = "none" | "cgst_sgst" | "igst";
export type LineMode = "fixed" | "rate";
export type LineUnit = "second" | "minute" | "hour" | "session" | "unit";
export interface Settings {
vendorName: string;
vendorAddress: string;
vendorEmail: string;
vendorPhone: string;
vendorPan: string;
vendorGstin: string;
vendorStateCode: string;
logoPath: string | null;
signaturePath: string | null;
defaultBankId: number | null;
defaultTaxRate: number;
defaultTaxType: TaxType;
paymentTermsDays: number;
currency: string;
onboarded: boolean;
theme: string;
}
export interface BankAccount {
id: number | null;
label: string;
bankName: string;
accountName: string;
accountNo: string;
branch: string;
ifsc: string;
isDefault: boolean;
}
export interface InvoiceSeries {
id: number;
prefix: string;
padding: number;
nextNumber: number;
isActive: boolean;
createdAt: string;
nextInvoiceNumber: string;
}
export interface Client {
id: number | null;
name: string;
address: string;
gstin: string;
stateCode: string;
poNumber: string;
createdAt: string;
}
export interface InvoiceItem {
id?: number | null;
description: string;
mode: LineMode;
rate: number;
unit: LineUnit;
quantity: number;
amount: number;
sortOrder: number;
}
export interface InvoiceInput {
invoiceDate: string;
dueDate: string;
clientId: number | null;
clientName: string;
clientAddress: string;
clientGstin: string;
poNumber: string;
placeOfSupplyStateCode: string;
subtotal: number;
discount: number;
taxType: TaxType;
taxRate: number;
cgstAmount: number;
sgstAmount: number;
igstAmount: number;
total: number;
amountInWords: string;
bankAccountId: number | null;
bankSnapshot: string;
signaturePath: string | null;
notes: string;
saveClient: boolean;
items: InvoiceItem[];
}
export interface Invoice extends Omit<InvoiceInput, "saveClient"> {
id: number;
number: string;
seriesId: number | null;
status: string;
createdAt: string;
updatedAt: string;
items: InvoiceItem[];
}
export interface InvoiceSummary {
id: number;
number: string;
invoiceDate: string;
dueDate: string;
clientName: string;
total: number;
status: string;
createdAt: string;
}
export const EMPTY_ITEM: InvoiceItem = {
description: "",
mode: "fixed",
rate: 0,
unit: "unit",
quantity: 1,
amount: 0,
sortOrder: 0,
};
export const INDIAN_STATES: { code: string; name: string }[] = [
{ code: "01", name: "Jammu & Kashmir" },
{ code: "02", name: "Himachal Pradesh" },
{ code: "03", name: "Punjab" },
{ code: "04", name: "Chandigarh" },
{ code: "05", name: "Uttarakhand" },
{ code: "06", name: "Haryana" },
{ code: "07", name: "Delhi" },
{ code: "08", name: "Rajasthan" },
{ code: "09", name: "Uttar Pradesh" },
{ code: "10", name: "Bihar" },
{ code: "11", name: "Sikkim" },
{ code: "12", name: "Sampleachal Pradesh" },
{ code: "13", name: "Nagaland" },
{ code: "14", name: "Manipur" },
{ code: "15", name: "Mizoram" },
{ code: "16", name: "Tripura" },
{ code: "17", name: "Meghalaya" },
{ code: "18", name: "Assam" },
{ code: "19", name: "West Bengal" },
{ code: "20", name: "Jharkhand" },
{ code: "21", name: "Odisha" },
{ code: "22", name: "Chhattisgarh" },
{ code: "23", name: "Madhya Pradesh" },
{ code: "24", name: "Gujarat" },
{ code: "26", name: "Dadra & Nagar Haveli and Daman & Diu" },
{ code: "27", name: "Maharashtra" },
{ code: "29", name: "Karnataka" },
{ code: "30", name: "Goa" },
{ code: "31", name: "Lakshadweep" },
{ code: "32", name: "Kerala" },
{ code: "33", name: "Tamil Nadu" },
{ code: "34", name: "Puducherry" },
{ code: "35", name: "Andaman & Nicobar Islands" },
{ code: "36", name: "Telangana" },
{ code: "37", name: "Andhra Pradesh" },
{ code: "38", name: "Ladakh" },
];
export const UNIT_LABELS: Record<LineUnit, string> = {
second: "per second",
minute: "per minute",
hour: "per hour",
session: "per session",
unit: "per unit",
};