This is a simple, standalone desktop application developed using Python and Tkinter for managing printing shop transactions. It allows users to record printing jobs, view a history of all transactions, and generate basic sales reports for different periods. The system is designed for ease of use and portability, storing all data in a local CSV file.
- Intuitive Transaction Entry:
- Input fields for Paper Type (Short, Long, A4, PhotoPaper), Color (Black, Colored), Pages, Price/Page, and Total.
- Automatic calculation/suggestion of "Total" price based on Pages and Price/Page.
- Add multiple items to a temporary "Items in Transaction" list before confirming.
- Edit and delete individual items from the temporary list via double-click or right-click context menu.
- Transaction Management:
- Confirm transactions to move items from the temporary list to the main "Record" table.
- Auto-generates unique Transaction IDs for each confirmed sale.
- Save all confirmed records to a
records.csv
file for persistence. - Delete past transactions from the "Record" table via right-click context menu.
- Quick Sales Summary (Main Screen):
- Displays real-time summaries for Today's Income, This Month's Income, and This Year's Income.
- Detailed Sales Report:
- Accessible via a dedicated "Report" button.
- Allows filtering transactions by a custom date range.
- Provides aggregate statistics including Total Sales, Total Pages, Total Transactions, and specific page counts by Paper Type (Short, Long, A4, PhotoPaper) and Color (Black, Colored).
- Ability to export the displayed report data as a CSV file.
- Portable Design:
- Can be packaged into a standalone application (using PyInstaller) that runs without needing Python installed on the user's machine.
- Data (
records.csv
) persists directly within the application's folder structure when distributed, making it easy to move.
- Customizable Window Icon & Sidebar Logo:
- Supports custom application icon for the window title bar.
- Displays a custom logo/image in the sidebar.
- Reset Functionality:
- A "Reset Records" button at the bottom-left allows clearing all saved transaction data for a fresh start (with confirmation).
- Python 3.x: The core programming language.
- Tkinter: Python's standard GUI (Graphical User Interface) toolkit.
- Pillow (PIL Fork): For handling and displaying images (logo, window icon).
- CSV Module: For reading and writing transaction data to
records.csv
. - PyInstaller: (Used for packaging) To create standalone executable versions of the application.
- Python 3.x installed on your system.
pip
(Python's package installer), usually comes with Python.
-
Clone the Repository:
git clone [https://github.com/Mejez6603/Printing-POS-Python.git](https://github.com/Mejez6603/Printing-POS-Python.git) cd Printing-POS-Python
(Note: Replace
Printing-POS-Python
if your repository name is different) -
Install Dependencies:
pip install Pillow
-
Prepare Data/Assets:
- Ensure you have a
database
folder in the root directory. - Inside
database
, an emptyrecords.csv
file will be created on first run, or you can paste provided sample data. - Place your
logo.png
andyour_app_icon.png
(or whatever you named them) in the root directory alongsidemain.py
.
- Ensure you have a
python main.py
- Start a Transaction: Fill in the item details (Paper Type, Color, Pages, Price/Page). The "Total" will auto-calculate.
- Add Item: Click "Add Item" to add the current item to the "Items in Transaction" list. You can add multiple items.
- Edit/Delete Item (Before Confirming):
- Double-click an item in the "Items in Transaction" table to populate its details back into the input fields for editing.
- Right-click an item in the "Items in Transaction" table for "Edit Item" or "Delete Item" options.
- Confirm Transaction: Once all items for a sale are added, click "Confirm Transaction". This saves the items to the main "Record" table and
records.csv
. - View Records: The "Record" table on the main screen displays all past transactions.
- Generate Sales Reports: Click the "Report" button in the sidebar to open a detailed sales report window. You can select date ranges and export.
- Reset Records: Click the "Reset Records" button in the sidebar (bottom-left) to clear all saved data (requires confirmation).
Printing-System-Python/
├── main.py # Main application entry point and GUI layout
├── transaction.py # Handles CSV saving/loading and input validation
├── sales_report.py # Logic for generating sales statistics from CSV
├── sales_report_window.py # GUI for the detailed Sales Report window
├── database/ # Directory for data files
│ └── records.csv # Stores all transaction records
├── reports/ # Directory for exported CSV reports
├── logo.png # Sidebar logo image
└── your_app_icon.png # Application window icon (rename as appropriate)
├── .gitignore # Specifies files/folders to ignore in Git
└── README.md # This file!
To create a portable executable (e.g., main.exe
on Windows) that can be run on computers without Python installed:
- Install PyInstaller:
pip install pyinstaller
- Navigate to project root:
cd Printing-System-Python
- Run PyInstaller command:
(Remember to replace
pyinstaller --noconsole --add-data "database;database" --add-data "logo.png;." --add-data "your_app_icon.png;." "main.py"
your_app_icon.png
with your actual icon filename.) - The standalone application will be found in the
dist/main
folder. Copy this entire folder for distribution.
- Embedded Sales Report View: Implement the option to display the sales report directly within the main window instead of a new Toplevel window (already partially prototyped).
- PDF Export for Reports: Add functionality to export sales reports as PDF files.
- Advanced Reporting: More detailed filtering options, graphical charts, or custom report generation tools.
- Product/Service Catalog: Implement a database (e.g., SQLite) to manage predefined paper types, ink types, and pricing rules.
- User Management: Add login functionality for different staff members with roles.
- Basic Inventory Tracking: Monitor stock levels of paper and ink.
- Core Functionality:
- Implemented full transaction input and management.
- Added dynamic "Add Item" to temporary list.
- Enabled confirmation of transactions to main record table.
- Persistent data storage in
database/records.csv
.
- Reporting:
- Quick sales summary on the main transaction screen.
- Detailed Sales Report window with date filtering.
- Aggregated metrics (Total Sales, Total Pages, Total Transactions).
- Breakdown of pages by Paper Type (Short, Long, A4, PhotoPaper) and Color (Black, Colored).
- Export Sales Report to CSV.
- User Interface & Experience:
- Clean and intuitive Tkinter GUI.
- Automatic "Total" calculation in transaction input.
- Item editing and deletion from pending transaction list.
- Application window icon and sidebar logo integration.
- Maintenance & Portability:
- Configured project for PyInstaller packaging (
--onedir
for portable folder distribution). - "Reset Records" functionality to clear all stored data.
- Robust path handling for data files in packaged app.
- Configured project for PyInstaller packaging (
- Operating System: Windows 7 or newer (Windows 10/11 recommended).
- (Note: Linux/macOS executables can be built with appropriate GitHub Actions runners, but are not bundled in the default Windows build.)
- Hardware: A modern computer with sufficient RAM (e.g., 2GB+ RAM, 1GHz+ processor) for general desktop application usage.
- Disk Space: Approximately [e.g., 100MB - 300MB] for the extracted application folder, plus space for your
records.csv
data (which will grow over time).
- Operating System: Windows, macOS, or Linux.
- Python: Python 3.6 or newer (Python 3.9+ recommended).
- Pip: Python's package installer.
- Required Python Libraries:
Pillow
tkinter
(usually built-in with Python)- (Optionally
pyinstaller
if you plan to build executables yourself)
- "ModuleNotFoundError: No module named 'PIL'" (When running from source)
- Reason: The
Pillow
library is not installed. - Solution: Open your terminal/command prompt and run
pip install Pillow
.
- Reason: The
- Data not refreshing or showing zeros in Sales Reports/Quick Summary (in bundled app)
- Reason: The application might be having trouble locating
records.csv
. This specific issue was addressed in recent updates. - Solution: Ensure you are using the latest version of the application code. If you rebuilt with PyInstaller, ensure
sales_report.py
uses the updated pathingbase_dir = os.path.dirname(os.path.abspath(__file__))
.
- Reason: The application might be having trouble locating
- "Add Item" button is disabled.
- Reason: Not all required input fields (Paper Type, Color, Pages, Price/Page, Total) in the transaction input section are filled.
- Solution: Fill in all the fields. The button will enable automatically.
- Application launches, but crashes shortly after (in bundled app).
- Reason: This can be due to various reasons, including missing data files or environmental issues not captured during packaging.
- Solution:
- Ensure you used the
--add-data
flags correctly during PyInstaller packaging fordatabase
,logo.png
, andyour_app_icon.png
. - Try running PyInstaller without
--noconsole
first to see if any errors are printed to the console window that appears.
- Ensure you used the
- My data disappeared after I moved the portable app folder!
- Reason: If you moved the extracted application folder (e.g.,
dist/main/
) to a new location, thedatabase/records.csv
file inside it moved along with it. If you had saved data, it should still be there. - Solution: Ensure you're running the
main.exe
from the correct, complete portable application folder that contains yourdatabase
subfolder with yourrecords.csv
.
- Reason: If you moved the extracted application folder (e.g.,
- Special thanks to the open-source community for developing Python, Tkinter, Pillow, and PyInstaller.
- Nooby
- Doc
- Firelink
- SBBC PC
- To my dog and cat
This project is licensed under the MIT License - see the LICENSE file for details.