Skip to content

Commit 68e6b15

Browse files
authored
Merge pull request #368 from No0ne558/master
Document changelog entries and fix blank kitchen/bar video checks
2 parents 7ac03cd + 7516740 commit 68e6b15

18 files changed

Lines changed: 260 additions & 335 deletions

docs/changelog.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1919
- 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.
2020
- Removed duplicate content and GUI/TUI helper code; made `build.sh` executable.
2121
- Files modified: `build.sh`
22+
- **Reports/UI: Add `Report::TextKV`/`TextKVMid` and refactor report/zone outputs** (2026-04-14)
23+
- Added `Report::TextKV()` and `Report::TextKVMid()` helpers to simplify label/value printing in reports (`main/ui/report.hh`, `main/ui/report.cc`).
24+
- Redesigned the `System::DepositReport()` printed layout for clearer 80-column output and reconciliation sections (`main/ui/system_report.cc`).
25+
- 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.
26+
- Fixed a misleading indentation/guarding bug in `zone/inventory_zone.cc`.
27+
- 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`.
28+
- Follow-up: finish the payment-entry sweep, add unit tests for Deposit/Book Balance output, and update translations.
2229

2330
### Fixed
31+
- **Video Display: Prevent blank checks on Bar/Kitchen video (2026-04-14)**
32+
- 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.
33+
- `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.
34+
- Files modified: `zone/report_zone.cc`
35+
- Impact: Video zones will no longer show blank check headers unless there are actual printable items for that target.
36+
2437
- **Video Display: Keep Bar and Kitchen video checks independent when served/marked done (2026-04-14)**
2538
- Prevented marking orders for the entire check as shown when serving from a single video display.
2639
- Scoped `ORDER_SHOWN` to only orders whose `Order::VideoTarget(settings)` matches the active `video_target` (bar vs kitchen/default).

main/business/check.cc

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,10 +1597,8 @@ int Check::PrintWorkOrder(Terminal *term, Report *report, int printer_id, int re
15971597
}
15981598

15991599
report->Mode(kitchen_mode);
1600-
report->TextL(ordstr, order_color);
1601-
report->TextR(cststr, COLOR_DEFAULT);
1600+
report->TextKV(ordstr, cststr, order_color, COLOR_DEFAULT);
16021601
report->Mode(0);
1603-
report->NewLine();
16041602

16051603
ordstr[0] = '\0';
16061604
str2[0] = '\0';
@@ -1618,10 +1616,8 @@ int Check::PrintWorkOrder(Terminal *term, Report *report, int printer_id, int re
16181616
{
16191617
// write out the line for newline mode
16201618
report->Mode(kitchen_mode);
1621-
report->TextL(str2, COLOR_RED);
1622-
report->TextR("", COLOR_RED);
1619+
report->TextKV(str2, "", COLOR_RED, COLOR_RED);
16231620
report->Mode(0);
1624-
report->NewLine();
16251621
}
16261622
else
16271623
{
@@ -1634,10 +1630,8 @@ int Check::PrintWorkOrder(Terminal *term, Report *report, int printer_id, int re
16341630
{
16351631
vt_safe_string::safe_concat(tmpstr, STRLONG, ",");
16361632
report->Mode(kitchen_mode);
1637-
report->TextL(tmpstr, COLOR_RED);
1638-
report->TextR("", COLOR_RED);
1639-
report->Mode(0);
1640-
report->NewLine();
1633+
report->TextKV(tmpstr, "", COLOR_RED, COLOR_RED);
1634+
report->Mode(0);
16411635
ordstr[0] = '\0';
16421636
vt_safe_string::safe_concat(ordstr, STRLENGTH, " ");
16431637
vt_safe_string::safe_concat(ordstr, STRLENGTH, str2);
@@ -1649,10 +1643,8 @@ int Check::PrintWorkOrder(Terminal *term, Report *report, int printer_id, int re
16491643
if (settings->mod_separator == MOD_SEPARATE_CM && ordstr[0] != '\0')
16501644
{
16511645
report->Mode(kitchen_mode);
1652-
report->TextL(ordstr, COLOR_RED);
1653-
report->TextR("", COLOR_RED);
1646+
report->TextKV(ordstr, "", COLOR_RED, COLOR_RED);
16541647
report->Mode(0);
1655-
report->NewLine();
16561648
}
16571649
}
16581650
}
@@ -2459,8 +2451,7 @@ int Check::MakeReport(Terminal *term, Report *report, int show_what, int video_t
24592451
if (order->status & ORDER_COMP)
24602452
{
24612453
report->NewLine();
2462-
report->TextPosR(-8, GlobalTranslate("COMP"));
2463-
report->TextR(term->FormatPrice(-order->cost, 1), COLOR_RED);
2454+
report->TextKV(GlobalTranslate("COMP"), term->FormatPrice(-order->cost, 1), COLOR_DEFAULT, COLOR_RED);
24642455
}
24652456
}
24662457
}
@@ -2542,14 +2533,10 @@ int Check::MakeReport(Terminal *term, Report *report, int show_what, int video_t
25422533
int tax = sc->TotalTax();
25432534
if (tax)
25442535
{
2545-
report->TextPosR(-8, GlobalTranslate("Tax"));
2546-
report->TextR(term->FormatPrice(tax, 1));
2547-
report->NewLine();
2536+
report->TextKV(GlobalTranslate("Tax"), term->FormatPrice(tax, 1));
25482537
if (sc->IsTaxExempt())
25492538
{
2550-
report->TextPosR(-8, GlobalTranslate("Tax Exempt"));
2551-
report->TextR(term->FormatPrice(-tax, 1));
2552-
report->NewLine();
2539+
report->TextKV(GlobalTranslate("Tax Exempt"), term->FormatPrice(-tax, 1));
25532540
vt_safe_string::safe_format(str, STRLONG, "%s: %s", GlobalTranslate("Tax ID"), sc->tax_exempt.Value());
25542541
report->Mode(PRINT_BOLD);
25552542
report->TextL(str);
@@ -2558,32 +2545,24 @@ int Check::MakeReport(Terminal *term, Report *report, int show_what, int video_t
25582545
tax = 0;
25592546
}
25602547
}
2561-
report->TextPosR(-8, GlobalTranslate("Total"));
2562-
report->TextR(term->FormatPrice(sc->total_sales + tax - sc->item_comps, 1));
2563-
report->NewLine();
2548+
report->TextKV(GlobalTranslate("Total"), term->FormatPrice(sc->total_sales + tax - sc->item_comps, 1));
25642549

25652550
if (sc->PaymentList())
25662551
{
25672552
report->NewLine();
25682553
Payment *payptr = sc->PaymentList();
25692554
while (payptr)
25702555
{
2571-
report->TextL(payptr->Description(settings));
2572-
report->TextR(term->FormatPrice(payptr->value, 1));
2573-
report->NewLine();
2556+
report->TextKV(payptr->Description(settings), term->FormatPrice(payptr->value, 1));
25742557
payptr = payptr->next;
25752558
}
25762559

25772560
report->TextR("------");
25782561
report->NewLine();
2579-
report->TextPosR(-8, term->Translate("Amount Tendered"));
2580-
report->TextR(term->FormatPrice(sc->payment, 1));
2581-
report->NewLine();
2562+
report->TextKV(term->Translate("Amount Tendered"), term->FormatPrice(sc->payment, 1));
25822563
if (sc->balance > 0)
25832564
{
2584-
report->TextPosR(-8, term->Translate("Balance Due"));
2585-
report->TextR(term->FormatPrice(sc->balance, 1));
2586-
report->NewLine();
2565+
report->TextKV(term->Translate("Balance Due"), term->FormatPrice(sc->balance, 1));
25872566
}
25882567
}
25892568
}

main/business/employee.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,7 @@ int UserDB::ListReport(Terminal *t, int active, Report *r)
591591
vt_safe_string::safe_concat(str, 256, str2);
592592
}
593593

594-
r->TextL(str, col);
595-
r->TextR(FormatPhoneNumber(e->phone), col);
596-
r->NewLine();
594+
r->TextKV(str, FormatPhoneNumber(e->phone), col, col);
597595
++count;
598596
}
599597
}

0 commit comments

Comments
 (0)