diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b9ed230..fa76e1ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-null-dereference") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-dangling-reference") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-system-headers") # Suppress warnings from external libraries +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized") # Suppress uninitialized variable warnings from external date library # Performance optimizations if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") diff --git a/docs/changelog.md b/docs/changelog.md index 5c2042bf..957ef78b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -61,6 +61,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - `zone/order_zone.cc` (modified rendering logic) - **Impact**: Staff can now easily identify unavailable items, managers can quickly toggle item availability, improves operational efficiency during stock shortages +- **Fixed Order Entry Total Off-by-One-Cent Issue with Tax (2026-01-31)** + - Resolved discrepancy between Order Entry zone total display and actual check total when tax is included + - **Changes Made**: + - Modified OrderEntryZone::Render to use pre-calculated tax totals from SubCheck instead of recalculating tax per individual order + - Replaced per-order tax summation with direct use of aggregated tax fields (total_tax_food, total_tax_GST, etc.) + - **Root Cause**: Order Entry zone was calculating tax by summing individual order taxes, while check totals use aggregated tax calculation, causing rounding differences + - **Solution**: Use the same tax calculation method as the main check total for consistency + - **Files modified**: `zone/order_zone.cc` (OrderEntryZone::Render method) + - **Impact**: Order Entry zone now displays the exact same total as the final check, eliminating confusion for staff + ### Fixed - **Fixed GCC 14 Warning in Date Library (2026-01-25)** - Resolved stringop-overflow warning in external/date/include/date/date.h when compiling on Raspberry Pi Compute Module 5 with GCC 14 diff --git a/main/ui/chart.hh b/main/ui/chart.hh index e8238df0..89b66b2b 100644 --- a/main/ui/chart.hh +++ b/main/ui/chart.hh @@ -19,7 +19,7 @@ */ #ifndef _CHART_HH -#define CHART_HH +#define _CHART_HH #include "list_utility.hh" #include "utility.hh" diff --git a/term/term_view.cc b/term/term_view.cc index 636eb50a..ba5e78a3 100644 --- a/term/term_view.cc +++ b/term/term_view.cc @@ -1042,7 +1042,7 @@ class IconifyButton : public LO_PushButton *code accordingly. In that case, you should also make the code *more dynamic, though it should still be quite fast. ****/ - virtual bool IsPointIn(int px, int py) // Overrides RegionInfo::IsPointIn but not marked virtual in intermediate classes + virtual bool IsPointIn(int px, int py) const noexcept override // Overrides RegionInfo::IsPointIn but not marked virtual in intermediate classes { return (px >= (x - EXTRA_ICON_WIDTH)) && (py >= y) && diff --git a/zone/account_zone.hh b/zone/account_zone.hh index 0b2ef6a1..37bf899d 100644 --- a/zone/account_zone.hh +++ b/zone/account_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _ACCOUNT_ZONE_HH -#define ACCOUNT_ZONE_HH +#define _ACCOUNT_ZONE_HH #include "form_zone.hh" diff --git a/zone/button_zone.hh b/zone/button_zone.hh index a9e5e1e0..96925dce 100644 --- a/zone/button_zone.hh +++ b/zone/button_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _BUTTON_ZONE_HH -#define BUTTON_ZONE_HH +#define _BUTTON_ZONE_HH #include "pos_zone.hh" #include "layout_zone.hh" diff --git a/zone/cdu_zone.hh b/zone/cdu_zone.hh index a75004e8..189fe1d3 100644 --- a/zone/cdu_zone.hh +++ b/zone/cdu_zone.hh @@ -20,7 +20,7 @@ */ #ifndef _CDU_ZONE_HH -#define CDU_ZONE_HH +#define _CDU_ZONE_HH #include "cdu.hh" #include "form_zone.hh" diff --git a/zone/chart_zone.hh b/zone/chart_zone.hh index 336b784d..ecd19f67 100644 --- a/zone/chart_zone.hh +++ b/zone/chart_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _CHART_ZONE_HH -#define CHART_ZONE_HH +#define _CHART_ZONE_HH #include "pos_zone.hh" #include "list_utility.hh" diff --git a/zone/check_list_zone.hh b/zone/check_list_zone.hh index 11a00ae1..d655beaf 100644 --- a/zone/check_list_zone.hh +++ b/zone/check_list_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _CHECK_LIST_ZONE_HH -#define CHECK_LIST_ZONE_HH +#define _CHECK_LIST_ZONE_HH #include "form_zone.hh" #include "layout_zone.hh" diff --git a/zone/creditcard_list_zone.hh b/zone/creditcard_list_zone.hh index 41a10658..5da0186e 100644 --- a/zone/creditcard_list_zone.hh +++ b/zone/creditcard_list_zone.hh @@ -18,8 +18,8 @@ * Touch zone for managing credit cards */ -#ifndef CREDITCARD_LIST_ZONE_HH -#define CREDITCARD_LIST_ZONE_HH +#ifndef _CREDITCARD_LIST_ZONE_HH +#define _CREDITCARD_LIST_ZONE_HH #include "form_zone.hh" #include "credit.hh" diff --git a/zone/dialog_zone.hh b/zone/dialog_zone.hh index c231b724..9351cbb6 100644 --- a/zone/dialog_zone.hh +++ b/zone/dialog_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _DIALOG_ZONE_HH -#define DIALOG_ZONE_HH +#define _DIALOG_ZONE_HH #include "check.hh" #include "layout_zone.hh" diff --git a/zone/form_zone.hh b/zone/form_zone.hh index eb4ed578..ae97c314 100644 --- a/zone/form_zone.hh +++ b/zone/form_zone.hh @@ -18,8 +18,8 @@ * base touch zone for data entry and display */ -#ifndef FORM_ZONE_HH -#define FORM_ZONE_HH +#ifndef _FORM_ZONE_HH +#define _FORM_ZONE_HH #include "layout_zone.hh" #include "report.hh" diff --git a/zone/inventory_zone.hh b/zone/inventory_zone.hh index 5d16dcf7..b5935579 100644 --- a/zone/inventory_zone.hh +++ b/zone/inventory_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _INVENTORY_ZONE_HH -#define INVENTORY_ZONE_HH +#define _INVENTORY_ZONE_HH #include "form_zone.hh" diff --git a/zone/labor_zone.hh b/zone/labor_zone.hh index 5bd7a42b..3ae27245 100644 --- a/zone/labor_zone.hh +++ b/zone/labor_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _LABOR_ZONE_HH -#define LABOR_ZONE_HH +#define _LABOR_ZONE_HH #include "form_zone.hh" diff --git a/zone/layout_zone.hh b/zone/layout_zone.hh index 30fe3d2a..a467e160 100644 --- a/zone/layout_zone.hh +++ b/zone/layout_zone.hh @@ -18,8 +18,8 @@ * base class zone object for display layout */ -#ifndef LAYOUT_ZONE_HH -#define LAYOUT_ZONE_HH +#ifndef _LAYOUT_ZONE_HH +#define _LAYOUT_ZONE_HH #include "pos_zone.hh" #include "terminal.hh" diff --git a/zone/login_zone.hh b/zone/login_zone.hh index 740cfa01..df6847bf 100644 --- a/zone/login_zone.hh +++ b/zone/login_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _LOGIN_ZONE_HH -#define LOGIN_ZONE_HH +#define _LOGIN_ZONE_HH #include "layout_zone.hh" diff --git a/zone/merchant_zone.hh b/zone/merchant_zone.hh index 5f6239d1..c064f8b0 100644 --- a/zone/merchant_zone.hh +++ b/zone/merchant_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _MERCHANT_ZONE_HH -#define MERCHANT_ZONE_HH +#define _MERCHANT_ZONE_HH #include "form_zone.hh" diff --git a/zone/order_zone.cc b/zone/order_zone.cc index 744c0d62..9d0c31ba 100644 --- a/zone/order_zone.cc +++ b/zone/order_zone.cc @@ -244,18 +244,9 @@ RenderResult OrderEntryZone::Render(Terminal *t, int update_flag) // Draw Footer // Calculate total with tax int base_total = sc->raw_sales - sc->item_comps; - int total_tax = 0; - - // Calculate tax for all orders in the subcheck - Order *order = sc->OrderList(); - while (order) - { - if (!(order->status & ORDER_COMP)) - { - total_tax += order->CalculateTax(s, t); - } - order = order->next; - } + int total_tax = sc->total_tax_food + sc->total_tax_alcohol + sc->total_tax_GST + + sc->total_tax_PST + sc->total_tax_HST + sc->total_tax_QST + + sc->total_tax_room + sc->total_tax_merchandise + sc->total_tax_VAT; int total_with_tax = base_total + total_tax; diff --git a/zone/order_zone.hh b/zone/order_zone.hh index a3803707..7eee4dec 100644 --- a/zone/order_zone.hh +++ b/zone/order_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _ORDER_ZONE_HH -#define ORDER_ZONE_HH +#define _ORDER_ZONE_HH #include "layout_zone.hh" diff --git a/zone/payment_zone.hh b/zone/payment_zone.hh index c9b6ebc5..206f7334 100644 --- a/zone/payment_zone.hh +++ b/zone/payment_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _PAYMENT_ZONE_HH -#define PAYMENT_ZONE_HH +#define _PAYMENT_ZONE_HH #include "layout_zone.hh" #include "check.hh" diff --git a/zone/payout_zone.hh b/zone/payout_zone.hh index cee5eff3..75eb98d1 100644 --- a/zone/payout_zone.hh +++ b/zone/payout_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _PAYOUT_ZONE_HH -#define PAYOUT_ZONE_HH +#define _PAYOUT_ZONE_HH #include "layout_zone.hh" diff --git a/zone/phrase_zone.hh b/zone/phrase_zone.hh index a5e386d3..a6a1d45e 100644 --- a/zone/phrase_zone.hh +++ b/zone/phrase_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _PHRASE_ZONE_HH -#define PHRASE_ZONE_HH +#define _PHRASE_ZONE_HH #include "form_zone.hh" diff --git a/zone/pos_zone.hh b/zone/pos_zone.hh index 1cf1a3a5..10be35d7 100644 --- a/zone/pos_zone.hh +++ b/zone/pos_zone.hh @@ -18,8 +18,8 @@ * Definition of zone types & other zone data */ -#ifndef POS_ZONE_HH -#define POS_ZONE_HH +#ifndef _POS_ZONE_HH +#define _POS_ZONE_HH #include "zone.hh" diff --git a/zone/printer_zone.hh b/zone/printer_zone.hh index 8f6d3ceb..e4c48811 100644 --- a/zone/printer_zone.hh +++ b/zone/printer_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _PRINTER_ZONE_HH -#define PRINTER_ZONE_HH +#define _PRINTER_ZONE_HH #include "form_zone.hh" #include "zone_object.hh" diff --git a/zone/search_zone.hh b/zone/search_zone.hh index edffdee9..50a86796 100644 --- a/zone/search_zone.hh +++ b/zone/search_zone.hh @@ -18,7 +18,7 @@ */ #ifndef _SEARCH_ZONE_HH -#define SEARCH_ZONE_HH +#define _SEARCH_ZONE_HH #include "layout_zone.hh" diff --git a/zone/settings_zone.hh b/zone/settings_zone.hh index 07ac3942..f86f4a0f 100644 --- a/zone/settings_zone.hh +++ b/zone/settings_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _SETTINGS_ZONE_H -#define SETTINGS_ZONE_H +#define _SETTINGS_ZONE_H #include "form_zone.hh" diff --git a/zone/split_check_zone.hh b/zone/split_check_zone.hh index 7243e5e0..c6c538f6 100644 --- a/zone/split_check_zone.hh +++ b/zone/split_check_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _SPLIT_CHECK_HH -#define SPLIT_CHECK_HH +#define _SPLIT_CHECK_HH #include "pos_zone.hh" #include "zone_object.hh" diff --git a/zone/table_zone.hh b/zone/table_zone.hh index 112bcc23..1dd45a8a 100644 --- a/zone/table_zone.hh +++ b/zone/table_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _TABLE_ZONE_HH -#define TABLE_ZONE_HH +#define _TABLE_ZONE_HH #include "check.hh" #include "customer.hh" diff --git a/zone/user_edit_zone.hh b/zone/user_edit_zone.hh index aa696b99..29d60799 100644 --- a/zone/user_edit_zone.hh +++ b/zone/user_edit_zone.hh @@ -19,7 +19,7 @@ */ #ifndef _USER_EDIT_ZONE_HH -#define USER_EDIT_ZONE_HH +#define _USER_EDIT_ZONE_HH #include "form_zone.hh" diff --git a/zone/video_zone.hh b/zone/video_zone.hh index 4f9adcc5..f6e8958c 100644 --- a/zone/video_zone.hh +++ b/zone/video_zone.hh @@ -19,6 +19,9 @@ * to determine which food types get sent to the Kitchen Video reports. */ +#ifndef _VIDEO_ZONE_HH +#define _VIDEO_ZONE_HH + #define VIDEO_TARGET_NORMAL 0 #define VIDEO_TARGET_KITCHEN 1 @@ -40,3 +43,5 @@ public: int LoadRecord(Terminal *t, int record) override; int SaveRecord(Terminal *t, int record, int write_file) override; }; + +#endif diff --git a/zone/zone.hh b/zone/zone.hh index 40ac00ae..bbd6b280 100644 --- a/zone/zone.hh +++ b/zone/zone.hh @@ -6,8 +6,8 @@ * Functions for managing zones on a view */ -#ifndef ZONE_HH -#define ZONE_HH +#ifndef _ZONE_HH +#define _ZONE_HH #include "utility.hh" #include "list_utility.hh" diff --git a/zone/zone_object.hh b/zone/zone_object.hh index dcd16c84..7c5f239b 100644 --- a/zone/zone_object.hh +++ b/zone/zone_object.hh @@ -18,8 +18,8 @@ * User Interfact componet objects */ -#ifndef ZONE_OBJECT_HH -#define ZONE_OBJECT_HH +#ifndef _ZONE_OBJECT_HH +#define _ZONE_OBJECT_HH #include "utility.hh" #include "list_utility.hh"