Welcome to the J&K Bannu Pulao Billing System, a Python-based desktop application built with Tkinter for managing restaurant billing operations. Designed for a fictional restaurant, this tool streamlines order processing, bill generation, and customer management with an intuitive GUI. It includes features like a built-in calculator, email bill sending, dark mode, and bill saving/searching capabilities, making it a versatile solution for small-scale restaurant management.
- Interactive GUI: User-friendly Tkinter interface with organized sections for customer details, product selection, and bill display.
- Product Categories:
- Pulao: Aik Pao, Aadha Kilo, Aik Kilo.
- Kabab: Chapli Kabab.
- Raita & Salad: Raita, Salad.
- Cold Drinks: Regular, Half Litre, Litre, 1.5 Litre.
- Mineral Water: 500ml, 1000ml.
- Billing Operations:
- Calculate total prices based on selected items and quantities.
- Generate detailed bills with customer details, itemized list, and total amount.
- Save bills to a local
bills/directory with unique bill numbers. - Search and display saved bills by bill number.
- Print bills using the system's default printer.
- Send bills via email using Gmail SMTP.
- Built-in Calculator: A fully functional calculator for quick arithmetic operations, accessible via a button.
- Dark Mode: Toggle between light and dark themes for better usability.
- Clear Function: Reset all input fields and bill area with one click.
- Input Validation: Ensures valid numeric inputs for quantities and checks for required customer details.
- Real-Time Date: Displays the current date on generated bills.
- Python 3.x: Ensure Python is installed on your system.
- Tkinter: Usually included with Python. If not, install it:
pip install tk
- SMTP Access: For the email feature, you need a Gmail account with "Less Secure App Access" enabled or an App Password (recommended for security).
- Operating System: Tested on Windows. For printing, ensure a default printer is configured.
-
Clone the Repository:
git clone https://github.com/theusmandev/Bannu-Billing-app.git cd jk-bannu-pulao-billing-system -
Ensure Dependencies: Verify Python and Tkinter are installed. No additional libraries are required for core functionality.
-
Run the Application:
Bannu-Billing-app
Ensure the
billing_system.pyfile (rename your script accordingly) is in the project directory. Place theImages/folder with icon files (main.ico,cal.ico,mail.ico) in the same directory.
-
Launch the Application: Run the script to open the GUI window titled "J&K Bannu Pulao".
-
Enter Customer Details:
- Input the customer's name, phone number, and (optionally) bill number in the "Customer Details" section.
- Use the "SEARCH" button to retrieve a saved bill by bill number.
-
Select Products:
- Enter quantities for desired items (e.g., Aik Pao Pulao, Chapli Kabab, Regular Cold Drink) in the respective entry fields.
- Default quantities are set to 0.
-
Calculate Total:
- Click the "Total" button to compute prices for Pulao, Kabab, Raita & Salad, and Drinks/Mineral Water.
- Prices are displayed in the "Total Prices" section (e.g., Pulao: 360 RS).
-
Generate Bill:
- Click the "Bill" button to create a detailed bill in the text area, including:
- Restaurant name and date.
- Customer details and bill number.
- Itemized list with quantities and prices.
- Total amount.
- The bill is automatically saved to the
bills/directory with a unique bill number.
- Click the "Bill" button to create a detailed bill in the text area, including:
-
Additional Actions:
- Print: Click "Print" to send the bill to the default printer.
- Send: Click "Send" to email the bill. Enter your Gmail address, password (or App Password), and recipient's email in the popup window.
- Clear: Click "Clear" to reset all fields and the bill area.
- Dark Mode: Toggle between light and dark themes using the "Dark Mode" button.
- Calculator: Open a calculator window by clicking "Calculator" for quick calculations.
-
Email Setup:
- For the "Send" feature, configure your Gmail account:
- Enable 2-Step Verification and generate an App Password (recommended).
- Or enable "Less Secure App Access" in Gmail settings (less secure).
- Input the App Password in the password field when prompted.
- For the "Send" feature, configure your Gmail account:
billing_system.py: Main script containing the GUI, billing logic, calculator, and email functionality.Images/:main.ico: Icon for the main window.cal.ico: Icon for the calculator window.mail.ico: Icon for the email window.
bills/: Directory for saving generated bills as.txtfiles.demo.gif(optional): Add a demo GIF or screenshot to showcase the application.
- GUI: Built with Tkinter, featuring frames for customer details, product selection, bill display, and total prices.
- Billing Logic:
- Prices are hardcoded (e.g., Aik Pao Pulao: 180 RS, Chapli Kabab: 130 RS).
- The
totalfunction calculates subtotals for each category and updates entry fields. - The
bill_areafunction generates a formatted bill with customer details and itemized pricing.
- File Handling:
- Bills are saved as
.txtfiles in thebills/directory with unique bill numbers (randomly generated between 500–1000). - The
search_billfunction retrieves saved bills by bill number.
- Bills are saved as
- Email Sending: Uses
smtplibto send bills via Gmail SMTP, with a popup for sender/receiver details. - Calculator: A separate Tkinter window with buttons for digits, operators, square, square root, and clear functions.
- Dark Mode: Toggles between light (
white) and dark (#212121) themes, updating widget colors dynamically. - Printing: Uses
tempfileandos.startfileto print bills via the system's default printer.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Make your changes (e.g., add new menu items, improve UI, or enhance email security).
- Commit your changes (
git commit -m "Add your feature"). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
Please ensure your code follows PEP 8 style guidelines and includes comments for clarity.
- Add support for multiple restaurants or customizable menu items.
- Implement a database (e.g., SQLite) for bill storage and customer history.
- Enhance email security with OAuth2 for Gmail authentication.
- Add a PDF export option for bills.
- Include a settings panel for custom prices and themes.
- Support multi-language interfaces for broader accessibility.
- Email Sending: May fail if Gmail's security settings are not configured correctly. Use an App Password for reliable operation.
- Printing: Limited to Windows due to
os.startfile. Cross-platform printing may require additional libraries. - Bill Number Collisions: Random bill numbers (500–1000) may occasionally overlap. Consider using sequential or timestamp-based numbering.
- Inspired by the need for efficient restaurant billing solutions.
- Thanks to the Python, Tkinter, and open-source communities for their resources.
- Special thanks to Muhammad Usman for the original design and vision.
Feel free to star ⭐ this repository if you find it useful, and share your feedback or ideas in the issues section!
Created by [Muhammad Usman]
