new receipt formats

This commit is contained in:
EugeneTes
2026-01-26 14:29:37 +01:00
parent 53cf40c5e3
commit 1125222cbe
13 changed files with 132 additions and 68 deletions

View File

@@ -46,7 +46,7 @@ public class KitchenReceiptConverter
// Gangs
foreach (Gang gang in kitchenReceipt.Gangs)
{
@@ -55,6 +55,13 @@ public class KitchenReceiptConverter
{
PrintDish(dish, commands);
}
if (gang != kitchenReceipt.Gangs.Last())
{
commands.Add(new PrintCommand(""){IsCut = true});
commands.Add(new PrintCommand(""));
commands.Add(new PrintCommand(""));
}
}
if (kitchenReceipt.Gangs.Count > 0)
@@ -96,7 +103,11 @@ public class KitchenReceiptConverter
private static void PrintDish(Dish dish, List<PrintCommand> commands)
{
string dishLine = $"{dish.Number}x {dish.Name}";
commands.Add(new PrintCommand(dishLine){IsTall = true});
string guestInfo = dish.GuestId.HasValue ? $"{dish.GuestId.Value} " : "";
//todo: add word wrap if guest id is present and guestInfo + dish line too long. add spaces in front of continued lines to align with dish name start position
commands.Add(new PrintCommand(guestInfo+dishLine) {IsTall = true});
// Modifications
if (dish.Modifications != null && (dish.Modifications.Removed.Any() || dish.Modifications.Added.Any()))
{