Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Replaced the previous interactive/TUI `build.sh` with a simplified terminal-only helper that detects the distribution's package manager, installs missing build dependencies, and runs CMake configure → build → install.
- Removed duplicate content and GUI/TUI helper code; made `build.sh` executable.
- Files modified: `build.sh`
- **Reports/UI: Add `Report::TextKV`/`TextKVMid` and refactor report/zone outputs** (2026-04-14)
- Added `Report::TextKV()` and `Report::TextKVMid()` helpers to simplify label/value printing in reports (`main/ui/report.hh`, `main/ui/report.cc`).
- Redesigned the `System::DepositReport()` printed layout for clearer 80-column output and reconciliation sections (`main/ui/system_report.cc`).
- Converted many simple left/right label/value callsites to use `TextKV`/`TextKVMid` (reports) or `TextLR` (on-screen zones) to unify alignment and reduce duplication across the UI and printed reports.
- Fixed a misleading indentation/guarding bug in `zone/inventory_zone.cc`.
- Files modified (selected): `main/ui/report.hh`, `main/ui/report.cc`, `main/ui/system_report.cc`, `main/business/check.cc`, `zone/payment_zone.cc`, `zone/order_zone.cc`, `zone/inventory_zone.cc`, `zone/drawer_zone.cc`, `zone/table_zone.cc`, `zone/phrase_zone.cc`, `zone/payout_zone.cc`, `zone/settings_zone.cc`, `zone/user_edit_zone.cc`.
- Follow-up: finish the payment-entry sweep, add unit tests for Deposit/Book Balance output, and update translations.

### Fixed
- **Video Display: Prevent blank checks on Bar/Kitchen video (2026-04-14)**
- Fixed bug where an empty check header could be displayed on Bar/Kitchen video when orders had been removed or when new items were added but not sent.
- `ReportZone::ShowCheck()` now uses `Check::PrintCount(..., ORDER_SHOWN)` to ensure the check contains printable (sent and not-yet-shown) items for the specific video target before selecting it for display.
- Files modified: `zone/report_zone.cc`
- Impact: Video zones will no longer show blank check headers unless there are actual printable items for that target.

- **Video Display: Keep Bar and Kitchen video checks independent when served/marked done (2026-04-14)**
- Prevented marking orders for the entire check as shown when serving from a single video display.
- Scoped `ORDER_SHOWN` to only orders whose `Order::VideoTarget(settings)` matches the active `video_target` (bar vs kitchen/default).
Expand Down
45 changes: 12 additions & 33 deletions main/business/check.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1597,10 +1597,8 @@ int Check::PrintWorkOrder(Terminal *term, Report *report, int printer_id, int re
}

report->Mode(kitchen_mode);
report->TextL(ordstr, order_color);
report->TextR(cststr, COLOR_DEFAULT);
report->TextKV(ordstr, cststr, order_color, COLOR_DEFAULT);
report->Mode(0);
report->NewLine();

ordstr[0] = '\0';
str2[0] = '\0';
Expand All @@ -1618,10 +1616,8 @@ int Check::PrintWorkOrder(Terminal *term, Report *report, int printer_id, int re
{
// write out the line for newline mode
report->Mode(kitchen_mode);
report->TextL(str2, COLOR_RED);
report->TextR("", COLOR_RED);
report->TextKV(str2, "", COLOR_RED, COLOR_RED);
report->Mode(0);
report->NewLine();
}
else
{
Expand All @@ -1634,10 +1630,8 @@ int Check::PrintWorkOrder(Terminal *term, Report *report, int printer_id, int re
{
vt_safe_string::safe_concat(tmpstr, STRLONG, ",");
report->Mode(kitchen_mode);
report->TextL(tmpstr, COLOR_RED);
report->TextR("", COLOR_RED);
report->Mode(0);
report->NewLine();
report->TextKV(tmpstr, "", COLOR_RED, COLOR_RED);
report->Mode(0);
ordstr[0] = '\0';
vt_safe_string::safe_concat(ordstr, STRLENGTH, " ");
vt_safe_string::safe_concat(ordstr, STRLENGTH, str2);
Expand All @@ -1649,10 +1643,8 @@ int Check::PrintWorkOrder(Terminal *term, Report *report, int printer_id, int re
if (settings->mod_separator == MOD_SEPARATE_CM && ordstr[0] != '\0')
{
report->Mode(kitchen_mode);
report->TextL(ordstr, COLOR_RED);
report->TextR("", COLOR_RED);
report->TextKV(ordstr, "", COLOR_RED, COLOR_RED);
report->Mode(0);
report->NewLine();
}
}
}
Expand Down Expand Up @@ -2459,8 +2451,7 @@ int Check::MakeReport(Terminal *term, Report *report, int show_what, int video_t
if (order->status & ORDER_COMP)
{
report->NewLine();
report->TextPosR(-8, GlobalTranslate("COMP"));
report->TextR(term->FormatPrice(-order->cost, 1), COLOR_RED);
report->TextKV(GlobalTranslate("COMP"), term->FormatPrice(-order->cost, 1), COLOR_DEFAULT, COLOR_RED);
}
}
}
Expand Down Expand Up @@ -2542,14 +2533,10 @@ int Check::MakeReport(Terminal *term, Report *report, int show_what, int video_t
int tax = sc->TotalTax();
if (tax)
{
report->TextPosR(-8, GlobalTranslate("Tax"));
report->TextR(term->FormatPrice(tax, 1));
report->NewLine();
report->TextKV(GlobalTranslate("Tax"), term->FormatPrice(tax, 1));
if (sc->IsTaxExempt())
{
report->TextPosR(-8, GlobalTranslate("Tax Exempt"));
report->TextR(term->FormatPrice(-tax, 1));
report->NewLine();
report->TextKV(GlobalTranslate("Tax Exempt"), term->FormatPrice(-tax, 1));
vt_safe_string::safe_format(str, STRLONG, "%s: %s", GlobalTranslate("Tax ID"), sc->tax_exempt.Value());
report->Mode(PRINT_BOLD);
report->TextL(str);
Expand All @@ -2558,32 +2545,24 @@ int Check::MakeReport(Terminal *term, Report *report, int show_what, int video_t
tax = 0;
}
}
report->TextPosR(-8, GlobalTranslate("Total"));
report->TextR(term->FormatPrice(sc->total_sales + tax - sc->item_comps, 1));
report->NewLine();
report->TextKV(GlobalTranslate("Total"), term->FormatPrice(sc->total_sales + tax - sc->item_comps, 1));

if (sc->PaymentList())
{
report->NewLine();
Payment *payptr = sc->PaymentList();
while (payptr)
{
report->TextL(payptr->Description(settings));
report->TextR(term->FormatPrice(payptr->value, 1));
report->NewLine();
report->TextKV(payptr->Description(settings), term->FormatPrice(payptr->value, 1));
payptr = payptr->next;
}

report->TextR("------");
report->NewLine();
report->TextPosR(-8, term->Translate("Amount Tendered"));
report->TextR(term->FormatPrice(sc->payment, 1));
report->NewLine();
report->TextKV(term->Translate("Amount Tendered"), term->FormatPrice(sc->payment, 1));
if (sc->balance > 0)
{
report->TextPosR(-8, term->Translate("Balance Due"));
report->TextR(term->FormatPrice(sc->balance, 1));
report->NewLine();
report->TextKV(term->Translate("Balance Due"), term->FormatPrice(sc->balance, 1));
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions main/business/employee.cc
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,7 @@ int UserDB::ListReport(Terminal *t, int active, Report *r)
vt_safe_string::safe_concat(str, 256, str2);
}

r->TextL(str, col);
r->TextR(FormatPhoneNumber(e->phone), col);
r->NewLine();
r->TextKV(str, FormatPhoneNumber(e->phone), col, col);
++count;
}
}
Expand Down
Loading
Loading