I was asked by a friend of mine if I could do a Point of Sales (POS) system for her sister. I half-said yes. To which my friend confirmed with her sister and then they bought an epson TM-220 printer, a Poseidon Cash Register and a Motorola Bar Code scanner.
Well… since I was a programmer, I thought that I could do it in some archaic RDBMS like dBase III Plus / Clipper ’87 platform or do it in either Visual Basic or Visual FoxPro. The problem was, although I am a programmer by heart, I would have none of the OOP (Object Oriented Programming) Stuff.
I bought a lousy book on Visual Fox Pro, and realized, I could do it, but not at the required time of two weeks. Geeesshh.. Then I remembered one time I was in my bank depositing some money, I chanced upon the system they used, which was browser based.
I thought to myself, “could I?”…
So I tried to design the system mentally on my mind and decided it can be done. The only problem really was interfacing the hardware..
Anyway so I got down to designing and programming the system. I had some prior experience with bar code scanners and thought that that was the easy part. Hmm.. actually the scanner gave me some hard times. The scanner’s documentation did not explain (in lay man’s terms) how I could make the scanner simulate an “Enter” keypress.. Dwindling and staring at the manual I found out how to do it and we were on our way..
The next problem that I encountered was making the system either recognize the receipt printer. Hmm.. this was a tough one, so I researched (googled) on the web regarding this and according to PHP online manuals, I had to install a driver. Some driver it was, it had so much compatibility problems with my WAMP (Windows/Apache/MySQL/PHP/) installation. So I decided to scrap the idea of forcing the issue with the PHP/Printer driver.
Luckily, I am well versed in DOS (Yes, Disc Operating Systems used in the early days, which Windows XP luckily still has in some form.) I researched as to how I could execute DOS commands from within PHP and luckily there was such an animal.
To make the long story short, I was able to scan items with barcodes, printout receipts and open the cash drawer. (After a looooonnggg.. search for the correct ASCII escape codes)
Wheeewww.. So there goes another cute and worthwhile project. As of this writing, the client is currently scanning all the items in their store and placing the corresponding prices into the database. And I guess, though the process may take awhile, the client is happy with it..