Skip to content

Feature Implementation and Code Quality Improvements#355

Merged
No0ne558 merged 3 commits intoViewTouch:masterfrom
No0ne558:master
Jan 31, 2026
Merged

Feature Implementation and Code Quality Improvements#355
No0ne558 merged 3 commits intoViewTouch:masterfrom
No0ne558:master

Conversation

@No0ne558
Copy link
Contributor

Overview

This PR implements an out-of-stock toggle feature for menu items and resolves several code quality issues including tax calculation bugs and compiler warnings.

Changes Made

1. Tax Calculation Fix (871a0af)

  • Issue: Order Entry totals were off by one cent when tax was included
  • Solution: Changed from per-order tax summation to using pre-calculated SubCheck tax totals
  • Impact: Ensures Order Entry display matches actual check total exactly, eliminating rounding differences

2. External Library Warning Suppression (6a51150)

  • Issue: Compiler warnings from external date library chrono.h headers
  • Solution: Added -Wno-system-headers and -Wno-maybe-uninitialized flags to CMakeLists.txt
  • Impact: Project now builds completely clean with zero compiler warnings

3. Header Guard Standardization (2c02538)

  • Issue: Inconsistent header guard patterns across 25+ header files
  • Solution: Standardized all header guards to use _FILENAME_HH format consistently
  • Files Updated: 29 header files across zone and ui directories
  • Impact: Eliminates compiler warnings and ensures consistent code style

Features Implemented

Out-of-Stock Toggle Feature

  • Added out_of_stock boolean field to SalesItem class
  • Updated data serialization (version 17)
  • Modified UI rendering to display out-of-stock items in red text
  • Added editing controls in inventory zone for toggling item availability
  • Visual feedback clearly indicates unavailable menu items to users

Testing

  • ✅ Project builds cleanly with zero compiler warnings
  • ✅ Out-of-stock toggle feature works correctly in UI
  • ✅ Tax calculation fix verified - Order Entry totals now match check totals exactly
  • ✅ All header guards follow consistent naming convention

Files Changed

  • CMakeLists.txt - Added warning suppression flags
  • main/business/sales.* - Added out-of-stock field and serialization
  • order_zone.cc - Fixed tax calculation and added out-of-stock rendering
  • inventory_zone.cc - Added out-of-stock editing controls
  • 29 header files - Standardized header guard format

Breaking Changes

None. All changes are backward compatible.

Related Issues

  • Resolves tax calculation discrepancy in Order Entry
  • Eliminates all compiler warnings for clean builds
  • Improves code maintainability with consistent header guards

Ready for review and merge! 🚀

This PR enhances the ViewTouch POS system with new functionality while maintaining high code quality standards.

- Fixed off-by-one-cent issue in Order Entry zone total calculation
- Changed from per-order tax summation to using pre-calculated SubCheck tax totals
- Ensures Order Entry display matches actual check total exactly
- Eliminates rounding differences between individual vs aggregated tax calculation

This resolves the discrepancy where Order Entry would show a total
different from the final check total when tax was applied.
- Added -Wno-system-headers and -Wno-maybe-uninitialized flags
- Suppresses warnings from external date library chrono.h headers
- Project now builds completely clean with no compiler warnings
- Standardized all header guards to use _FILENAME_HH format consistently
- Fixed mismatches between #ifndef and #define directives across 25+ header files
- Added missing header guards to video_zone.hh
- Updated zone/ and main/ui/ directories for consistent compilation
- All header guards now follow the pattern: #ifndef _FILENAME_HH / #define _FILENAME_HH
@No0ne558 No0ne558 merged commit 14ff921 into ViewTouch:master Jan 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant