This commit is contained in:
EugeneTes
2026-04-03 08:38:32 +02:00
parent 763cd1071b
commit 5ee95c8109
7 changed files with 39 additions and 19 deletions

View File

@@ -41,7 +41,7 @@ public class BarReceiptConverter
commands.Add(new PrintCommand(Center(kitchenReceipt.SpecialInstruction, true), true, true));
commands.Add(new PrintCommand(""));
}
commands.Add(new PrintCommand(""));
commands.Add(new PrintCommand(CreateDashedLine()));
@@ -52,11 +52,19 @@ public class BarReceiptConverter
foreach (Gang gang in kitchenReceipt.Gangs)
{
commands.Add(new PrintCommand(Center($"{gang.Id}. {gang.Name}", false)) { IsRed = true });
commands.Add(new PrintCommand(Center($"{gang.Id}. {gang.Name}", true)) { IsBig = true });
commands.Add(new PrintCommand(""));
commands.Add(new PrintCommand(""));
foreach (var dish in gang.Dishes)
{
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)
@@ -98,25 +106,25 @@ public class BarReceiptConverter
private static void PrintDish(Dish drink, List<PrintCommand> commands)
{
string drinkLine = $"{drink.Number}x {drink.Name}";
commands.Add(new PrintCommand(drinkLine,isBig:true));
commands.Add(new PrintCommand(drinkLine){IsTall = true});
// Modifications
if (drink.Modifications != null && (drink.Modifications.Removed.Any() || drink.Modifications.Added.Any()))
{
foreach (var removed in drink.Modifications.Removed)
{
commands.Add(new PrintCommand($" - {removed}", isBold:true));
commands.Add(new PrintCommand($" - {removed}", isBold:true){IsTall = true});
}
foreach (var added in drink.Modifications.Added)
{
commands.Add(new PrintCommand($" + {added}", isBold: true));
commands.Add(new PrintCommand($" + {added}", isBold: true){IsTall = true});
}
}
// SpecialInstruction
if (!string.IsNullOrEmpty(drink.Comment))
{
commands.Add(new PrintCommand($" Comment: {drink.Comment}", isBold: true));
commands.Add(new PrintCommand($" Comment: {drink.Comment}", isBold: true){IsTall = true});
}
commands.Add(new PrintCommand("")); // Extra line between drinks for bar