new receipt formats
This commit is contained in:
@@ -12,6 +12,8 @@ public class InvoiceReceipt
|
||||
public List<ReceiptItem> Items { get; set; } = new List<ReceiptItem>();
|
||||
public decimal Total { get; set; }
|
||||
public string Currency { get; set; }
|
||||
public string TableNumber { get; set; }
|
||||
public string ThankYouMessage { get; set; }
|
||||
}
|
||||
|
||||
public class ReceiptItem
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Inspectron.Epson.PrintServer.Printers.Utils.FinalRecipe;
|
||||
|
||||
namespace Inspectron.Epson.PrintServer.Printers.Utils.InvoiceReceipt;
|
||||
|
||||
public class ReceiptConverter
|
||||
@@ -24,7 +26,13 @@ public class ReceiptConverter
|
||||
commands.Add(new PrintCommand(""));
|
||||
|
||||
// InvoiceReceipt info
|
||||
string receiptLine = $"Rechnung Nr. {invoiceReceipt.ReceiptNumber}".PadRight(_lineWidth/2)+$"{invoiceReceipt.DateTime:HH:mm dd.MM.yyyy}".PadLeft(_lineWidth/2);
|
||||
string receiptLine = "";
|
||||
if (invoiceReceipt.ReceiptNumber != null)
|
||||
receiptLine += $"Rechnung Nr. {invoiceReceipt.ReceiptNumber}".PadRight(_lineWidth / 2);
|
||||
else
|
||||
receiptLine += $"".PadRight(_lineWidth / 2);
|
||||
receiptLine += $"{invoiceReceipt.DateTime:HH:mm dd.MM.yyyy}".PadLeft(_lineWidth / 2);
|
||||
|
||||
commands.Add(new PrintCommand(receiptLine,isBold:true));
|
||||
commands.Add(new PrintCommand($"Guests: {invoiceReceipt.Guests}"));
|
||||
commands.Add(new PrintCommand(""));
|
||||
@@ -59,6 +67,8 @@ public class ReceiptConverter
|
||||
// Total
|
||||
string totalLine = $"Summe: {invoiceReceipt.Total:F2} {invoiceReceipt.Currency}";
|
||||
commands.Add(new PrintCommand(Center(totalLine, true), true, true));
|
||||
commands.Add(new PrintCommand(Center($"Tisch: {invoiceReceipt.TableNumber}",false), false));
|
||||
commands.Add(new PrintCommand(Center(invoiceReceipt.ThankYouMessage, false)));
|
||||
|
||||
return commands;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user