# RELEASE NOTES - JUSTSALE POS v3.1.9
**Release Date:** May 05, 2026
**Version:** 3.1.9
**Previous Version:** 3.1.0

## 🚀 Overview
Version 3.1.9 is a significant update focused on modernizing the printing infrastructure, automating product identification, and preparing the system for cloud-based operations. This release also includes a more robust database migration engine.

---

## ✨ New Features & Enhancements

### 🖨️ Enhanced Printing Engine
- **Restructured Print Queue**: The database schema for printing has been overhauled. It now supports raw text/HTML content instead of being limited to sale IDs. This allows for printing of custom documents like barcodes, stock labels, and reports.
- **Printer Targeting**: Added support for specific `printer_name` targeting within the queue, enabling multi-printer setups (e.g., separate Kitchen and Front-Office printers).
- **Status Normalization**: Standardized print status tracking (`pending` vs `printed`) for better service compatibility.

### 🏷️ SKU & Barcode Automation
- **Dynamic SKU Templates**: Introduced a template system for SKU generation (e.g., `PROD-{MMYYYY}-00000`).
- **Auto-Incrementing SKU Numbers**: The system now tracks the next available SKU number globally to prevent collisions.
- **Improved Barcode Management**: Refined the API for batch-generating barcodes for products that lack them.

### ☁️ Cloud Printing Readiness
- **Cloud Config Keys**: Added new system settings for Cloud Printing, including URL, User Authorization, and Polling Intervals.
- **Background Service Support**: Updated configuration file generation (`cloud_printer_config.txt`) to sync with the database settings automatically.

### ⚙️ System Settings Standardization
- **Tax Configuration**: Global `tax_percent` setting added (defaulting to 18% for VAT).
- **Currency Localization**: Added settings for `company_currency_code` and `company_currency_name`.
- **SMTP Security**: Standardized SMTP encryption and authentication fields for reliable email notifications.

---

## 💾 Database Changes

### New/Modified Tables
- **`print_queue`**: 
    - Added `content` (LONGTEXT).
    - Added `printer_name` (VARCHAR).
    - Removed legacy `sale_id`, `user_id`, and `terminal_name` dependencies for more flexibility.
- **`settings`**: Seeded with 11+ new keys for SKU, Cloud, and Local settings.

### Migration Info
- Users upgrading from **3.1.0** should run `finish_update.php` or execute `update_v3.1.9.sql`.
- **Note:** The `print_queue` will be cleared during migration due to the structural overhaul.

---

## 🛠️ Developer & Distribution Notes
- **Clean Distribution**: The `DIST3.1.9` package now includes a "Clean Database" export that resets all transactional data while preserving system logic and default units.
- **Authenticity Verified**: All API and Asset files in the distribution folder have been synchronized with the latest production-ready code.

---
*Developed by Franklin BMC*
