There are millions of small distributors in India. They work with products like tea, FMCG and textiles, and transport them from state to state daily. Most of them do their accounting using physical books. The introduction of GST (Goods and Services Tax) mandated for businesses was an uphill task for them as they were caught between the expensive Tally software and doing it wrong. This led me to create ChaiBooks which is an open source accounting software exclusively for Indian distributors.
The GST problem
It's not just one tax, it's a complex system with a lot of rules:
- CGST (Central GST) and SGST (State GST) for transactions within the same state
- IGST (Integrated GST) for inter-state transactions
- Reverse charge for certain goods and services
- Composition scheme for businesses having turnover below ₹1.5 crore
Each product has a unique HSN (Harmonized System of Nomenclature) code based on which tax needs to be applied. A 4-digit HSN code for a product might be taxed at 5%, whereas a 6-digit HSN code may be taxed at 12%. If you get the HSN code wrong for the product, you will file wrong returns.
function calculateGST(item: InvoiceItem, sellerState: string, buyerState: string) {
const rate = getHSNRate(item.hsnCode);
if (sellerState === buyerState) {
return {
cgst: item.amount * (rate / 2) / 100,
sgst: item.amount * (rate / 2) / 100,
igst: 0,
};
} else {
return {
cgst: 0,
sgst: 0,
igst: item.amount * rate / 100,
};
}
}
Easy right? But getting it done for each edge case took several weeks.
E-Way Bill
Any movement of goods above ₹50,000 needs to be reported as an e-way bill. E-way bills have a unique format and their validity is determined by the distance. They need to be generated before a truck even leaves.
function needsEwayBill(invoice: Invoice): boolean {
const totalValue = invoice.items.reduce((sum, item) =>
sum + item.amount + item.cgst + item.sgst + item.igst, 0
);
return totalValue > 50000;
}
The Dashboard
The dashboard is a React web app with Node.js, MongoDB and Tailwind CSS. It shows all of the revenue, profit margins, stock and pending invoices on one screen.
- 156 invoices processed
- ₹12 lakh of invoices tracked
- 99.9% accuracy for GST
Exporting as PDF
Indian distributors need to be able to print their invoices in the format that the government mandates. So, I had to use jspdf and a custom template to write GSTIN numbers, HSN codes and tax breakdown in the exact places that are mentioned in the format.
What I learnt
The Indian tax software market is huge, but most of it is trash. The expensive options are Tally and Zoho, and the random apps available on the Play Store are trash. There's room for modern open source alternatives.
Try it yourself: My Billing & Accounting Tool (GST invoicing, client management and GSTR-3B reports). 1 credit per invoice, credits never expire.