Saturday 10 August 2013

The Database Completed

When I first started writing this blog, I mentioned that my target was to write my friend a Database program to manage his shop.

On June 1, 2013, based on a program to draw lines, I fiddled around to produce a far cry from a Word Processor. I posted it here in this blog (Click Here To Check It Out).
That night I pulled an all-nighter and ended up with another program (Click Here To Check Out The Improvement).

Since then I have been working on it from time to time, finally today, I think I finished it and my friend can use it. I still have something to add to it, but it is pretty much done. Here is what the program does:

Password protected with 1 Master Administrator and 99 other addable users, either Admins or Users.

1. It has a help menu that explains where user can do what.

2. Daily sales entry, amount sold is subtracted from Inventory file. As user enters item ID or name, when the matches are 10 or less, the results are displayed dynamically, decreasing as user enters more characters. User can press enter when the result is 1 and the item is added to shopping cart.
User can assign discounts as an amount by entering an amount, or by percentages by adding % at the end of the digits entered. The discount may be for a particular item or a bulk discount on the total.

3. User can search sales for one particular item. The user specifies the "From" and "To" date, results may be saved to a document that is saved on the desktop. Details include the name of the item, item ID, sale Date and Time, username of seller, selling price, (and if user is admin profit made on the sale is also shown).

4. User can enter one particular day and save the sales data to a doc file on the desktop.

5. I'm particularly pleased about this one. User can specify a date. It is taken as the start date for a week sales graph displayed. User can manually enter the amount for this or the Year graph.

6. The inventory menu allows user to input the name of items in stock, amount available, sale price, buying price etc. Sl. number is automatically assigned and a unique item ID is created for that item.
User can delete items by highlighting a particular item and pressing the delete key.
User can also enter a "Warn At" amount which will cause the program to display a warning of low stock when the amount reaches the "Warn At" amount.

7. User accounts allow users to change their passwords. Only Master Admin can change usernames (to prevent someone from messing up inventory or sales by changing name and changing back)

All the data files are encrypted.

What I want to add is an "Orders" option. My friend accepts customized orders for marriages, functions, he will print leaflets (with a traditional twist), make you bookmarks etc.
Although I haven't thought this through yet, I'm thinking it will hold the customers name, phone number and address, order date, delivery date, number of items and a decent length of item information (a discription so to speak...like 500 chars).

I do feel I have come some way since I entered my first programs. I will improve this program since I know there are bound to be some bugs I haven't noticed. Since this was a work in progress as I learnt more and more, I came across many instances of "I wrote this wrong back then" but having to stick with it because changing it would mean a lot more work. But bad code or no, I got it working, and it's not like I'm going to submit it to a professor or anything. I'm not even posting it here, so the legions of critics we meet everyday online, hiding behind texts and texts of keyboard bravado wont get a crack at it. :D

And my friend is getting an application customized to his needs for free, I know he will not complain.

I'm still far from done with C programming, I am very interested in graphics, I'll look into that pretty soon.

I would share the code for AIM (that's what I am calling it....Accounts & Inventory Management) but it is too long, 10382 lines to be precise.

No comments:

Post a Comment