A comprehensive Point of Sale (POS) system developed in PHP for Romanian retail and restaurant businesses.
phpos is a production-ready, business-critical application that handles the complete retail workflow from product reception to fiscal compliance. It features fiscal printer integration, multi-register support, extensive inventory management, and a touch-optimized interface.
- Order management system
- Consumption receipts (bonuri consum)
- Sales records and tracking
- Product reception with touch keyboard
- Batch/lot tracking
- Stock valuation
- Inventory records
- Product transformations
- Cash register management
- Day-end closing procedures
- Price modifications
- Management reports
- Sales reports
- Customer database
- Supplier management
- Supplier product catalog
- NIR documents (receipt documents)
- Receipt records
- Returns processing
- Invoice generation
- Integration with fiscal printers (Datecs, Zeka, Elka, Sapel)
- Electronic Cash Register (ECR) support
- VAT (TVA) handling
- Fiscal receipt generation
- Custom on-screen QWERTY keyboard
- Numeric keypad for quantity/price entry
- Optimized for POS terminal operation
- PHP 7.2
- MySQL Database (database name:
retail) - Active Record Pattern via AbstractDB base class
- HTML 4.01 Transitional
- jQuery 1.2.6
- jQuery UI (full suite)
- xajax - PHP AJAX framework
- ISO-8859-1 encoding (Romanian characters)
- PHPExcel - Excel file generation and export
- libchart - Chart and graph generation
- Barcode generation library
- Google App Engine (PHP flexible environment)
phpos/
├── config/ # Configuration files
│ ├── config.db.sample.php
│ ├── config.fiscal.php
│ ├── config.imprimante.php
│ └── date_firma.php
├── css/ # Stylesheets
├── db/ # Database schemas and migrations
│ ├── retail_empty.sql
│ ├── retail.sql
│ └── views.sql
├── include/ # Core application code
│ ├── db/ # Database abstraction layer
│ ├── helpers/ # Helper classes (forms, GUI, keyboards)
│ ├── models/ # Business logic models (33+ classes)
│ ├── libchart/ # Chart generation library
│ ├── rapoarte/ # Reports
│ └── xajax_global/ # Global AJAX functions
├── js/ # JavaScript libraries
├── thirdparty/ # Third-party libraries
│ ├── PHPExcel/
│ ├── barcode/
│ └── xajax/
├── views/ # View templates
│ ├── comanda/
│ ├── config.produse/
│ ├── intrari/
│ ├── login/
│ └── receptie/
└── *.php # Module entry points (80+ files)
The project follows a custom MVC-like architecture:
- Models: Active Record pattern with 33+ business entity classes
- Views: Separate PHP templates in
/views/directory - Controllers: Server-side AJAX handlers in
*.server.phpfiles
Each module follows a three-file pattern:
module.php- Main view/UI file (HTML + JavaScript)module.common.php- Shared includes, AJAX function registrationmodule.server.php- Server-side AJAX handlers and business logic
The AbstractDB base class provides:
- Automatic CRUD operations (insert, update, delete)
- Dynamic object building from database schema
- Form generation from model definitions
- Query builder with options arrays
- Support for relationships
index.php- Redirects to loginlogin.php- Authentication systemcomanda.php- Main order/sales interfacereceptie.tastatura.php- Reception/intake with keyboard
- Product configuration (
config.produse) - Inventory management (
inventar) - Cash register (
registru.casa) - Day closing (
inchidere.zi) - Reports (
rapoarte,raportgestiune) - Customer management (
clienti) - Supplier management (
furnizori) - And many more...
- Primary Database:
retail - Schema File:
db/retail_empty.sql - Full Data:
db/retail.sql - Views:
db/views.sql
bonuri- Receipts/ticketsbonuri_continut- Receipt line itemsbonuri_plata- Payment methodscomenzi- Ordersproduse- Productsclienti- Customersfurnizori- Suppliersinventar- Inventoryniruri- NIR documentsusers- System userscase_fiscale- Fiscal cash registerszile_economice- Economic/business days
- Copy
config/config.db.sample.phptoconfig/config.db.php - Update database credentials:
- Server: 127.0.0.1
- Database:
retail - Username: your_username
- Password: your_password
- Import database schema:
db/retail_empty.sql
Edit config/config.fiscal.php to configure:
- Fiscal printer brand (Datecs, Zeka, Elka, Sapel)
- File path for fiscal receipts (default:
C:\xampp\bonuri\)
Update config/date_firma.php with your company details.
- User authentication and permissions system
- Multiple cash register support
- Economic day tracking and business day closure
- User role management (
drepturi.users.php)
- Management reports
- Sales reports
- Inventory reports
- Excel export capabilities (via PHPExcel)
- Print functionality for all documents
- Total PHP Files: 430+
- Model Classes: 33+
- Functional Modules: 27+
- Lines in Largest File: 924 (comanda.server.php)
- Database Tables: 20+ main tables
- Third-Party Libraries: 3 major (xajax, PHPExcel, libchart)
- PHP 7.2 or higher
- MySQL 5.x or higher
- Web server (Apache/Nginx)
- Modern web browser with JavaScript enabled
- (Optional) Fiscal printer for Romanian compliance
- Touch-screen optimized interface
- On-screen keyboards for easy data entry
- Real-time AJAX updates (no page reloads)
- Fiscal printer integration for Romanian market
- Comprehensive reporting system
- Batch/lot tracking for inventory
- Product transformation capabilities
- Multi-payment method support
The application is designed for Romanian businesses:
- Interface in Romanian language
- ISO-8859-1 encoding for Romanian characters (ă, â, î, ș, ț)
- Romanian fiscal compliance
- Romanian business document formats (NIR, factură, etc.)
Proprietary software developed for Romanian retail businesses.
phpos - Sistemul complet de gestiune pentru magazine și restaurante