This commit is contained in:
EugeneTes
2026-02-02 12:50:00 +01:00
parent 10c0ca20da
commit e90465e286
9 changed files with 109 additions and 33 deletions

View File

@@ -98,7 +98,7 @@ public class BarReceiptConverter
private static void PrintDish(Dish drink, List<PrintCommand> commands)
{
string drinkLine = $"{drink.Number}x {drink.Name}";
commands.Add(new PrintCommand(drinkLine));
commands.Add(new PrintCommand(drinkLine,isBig:true));
// Modifications
if (drink.Modifications != null && (drink.Modifications.Removed.Any() || drink.Modifications.Added.Any()))
{

View File

@@ -35,8 +35,7 @@ public class DiscountInfo
public string Description { get; set; }
public decimal Amount { get; set; }
public string Currency { get; set; }
public decimal? AmountInAlternateCurrency { get; set; }
public string AlternateCurrency { get; set; }
}
public class FinalReceiptItem

View File

@@ -64,6 +64,8 @@ public class ReceiptConverter
commands.Add(new PrintCommand("---------".PadLeft(_lineWidth)));
commands.Add(new PrintCommand("")); //Reini
// Total
string totalLine = $"Summe: {finalReceipt.Total:F2} {finalReceipt.Currency}";
commands.Add(new PrintCommand(Center(totalLine, true), true, true));
@@ -78,12 +80,12 @@ public class ReceiptConverter
}
// Discount
//if (finalReceipt.DiscountInfo != null && finalReceipt.DiscountInfo.Amount > 0)
//{
// commands.Add(new PrintCommand(finalReceipt.DiscountInfo.Description.PadLeft(_lineWidth/2)));
// commands.Add(new PrintCommand(""));
//}
if (finalReceipt.DiscountInfo != null)
{
commands.Add(new PrintCommand(finalReceipt.DiscountInfo.Description.PadRight(_lineWidth / 2) + (finalReceipt.DiscountInfo.Amount.ToString("F2") + " " + finalReceipt.DiscountInfo.Currency).PadLeft(_lineWidth / 2)));
commands.Add(new PrintCommand(""));
}
// Split payments
if (finalReceipt.SplitPayments != null && finalReceipt.SplitPayments.Count > 0)