I thought it would be interesting to give a bit of background (both technical and historical) on this very specific application: CS-4U, a billing system for utilities.
Big mess around…
My company got a contract 3 years ago with the East-Timor government to manage the electricity company over there. At that time, gov. accounts were quite empty and money for investment was hard to find (it is not the case anymore). My company was looking for a new billing system, but with no cash…it is a bit hard! Here is a list of some of the key issues we were facing:
- all applications on the market are usually for corporate with an healthy and full wallet. In those low GDP countries, they cannot afford these kind of package.
- most of software companies have no local support
- the existing system was an MS Access solution (!) developed by a very well-known consulting company…Actually, I must said that it could good but with people able to manage it well. After a few months, data in Access were so messy that nobody trust the system anymore.
- there were no local IT team, no IT knowledge to maintain whatever you can bring in.
- we should cover conventional meters (vs. prepaid meters), which means higher consumption in Dili (capital) and later all over the country. We are talking about 500 customers only in Dili (but 60%+ of incomes) and about 50,000 customers all-over the country, with a lot of them without even meters installed!.
- Monthly meter readings are done manually on paper and then input manually in the system by one operator, opening the door for a lot of manual errors.
The only path: FOSS
I suggested that we could develop a simple application based on free/open-source software in order to reduce cost. We will make it as a web application to ease deployment and training as well as remote maintenance when necessary. Moreover I wanted this application as open-source to make sure it can be re-used in the future in a lot of places around the world with similar issues.
This application should meet the following minimum requirements:
- Users access control with different permission levels and action logs
- A maximum of auto-checking should be provided to avoid manual error input (and believe some people are really good to input really impossible data!) as much as possible
- Data should always be consistent everywhere in the system (one of the key problem from the Access system)
- We should introduce the concept of contract and its lifecycle to keep track of all historical actions rather than just customer and meter. Creation of “master-data”: Customer can have one/many Contracts can have one/many Meters but only one meter is active at a time.
- Contract Management should include: new connection (new contract), change of meter (e.g. replace a meter when it breaks), termination of contract + a couple of reports (financial and more technical)
- Reading cycle (usually a monthly cycle to read meters, input in the system and generate invoices)
- Payment collection (with partial payment allowed in this type of country)
- In a first stage we do not include any kind of global process (such as registration for a new connection, then process by technical team up to final validation) due to a lake of organization first), therefore most of the process is done on paper and then input in the system, but it would be easy to integrate all this in the system
- Reports, both financial and technical must be easily accessible at any time
- Administration tasks: tariffs and users management mainly at this stage
Symfony to the rescue!
After agreement, I started working on a first version that we launched in July 2006. I choose to develop it on a xAMP (x for any OS). This version was a very basic MVC and the UI was almost 100% ajax (really bad idea!) and took me 6 months to finalize it (including a long period defining requirements). After facing some limitations, I decided it was time to rewrite the all app with a good PHP/MVC framework. After looking around the open-source market, I decided to go for Symfony mainly because of its good documentation (so good when you start…but never enough!), its development based on years of experience and its trial to speed-up development with good practices.
With Symfony, It took me only 1 and half month to re-write the all apps and add even new features (like multi-utilities and multi-services), including time to learn the framework organization and specificities, this was simply amazing for me. Not only it saves me time during development, but also after production, it is easy to know where to find what. If you follow the framework recommendations everything find its right position easily and you will not get lost to know where to find this class or a specific method.
The new version, Symfony-based, is in place since June 2007 for the electricity company and the government is considering to use it as well for the water department (around 100.000 customers) in a coming future.
Don’t get me wrong, the application has still a lot to be improved ( as well as new features to come) specially when you learn more and more about a framework capabilities. But I will talk about the future in another post…