word wrap for final receipt
discount for final receipt
This commit is contained in:
@@ -10,19 +10,19 @@ using System.Text.Json;
|
||||
// ============================================================================
|
||||
// FINAL RECEIPT - HTML PRINTER
|
||||
// ============================================================================
|
||||
var receipt = TestHelpers.BuildSampleFinalReceipt(true);
|
||||
var serializedReceipt = JsonSerializer.Serialize(receipt, new JsonSerializerOptions { WriteIndented = true });
|
||||
//var receipt = TestHelpers.BuildSampleFinalReceipt(true);
|
||||
//var serializedReceipt = JsonSerializer.Serialize(receipt, new JsonSerializerOptions { WriteIndented = true });
|
||||
|
||||
var converter = new FinalReceiptConverter(lineWidth: 48, bigFontLineWidth: 24);
|
||||
var printCommands = converter.Convert(serializedReceipt);
|
||||
//var converter = new FinalReceiptConverter(lineWidth: 48, bigFontLineWidth: 24);
|
||||
//var printCommands = converter.Convert(serializedReceipt);
|
||||
|
||||
TestHelpers.PrintCommandsToConsole(printCommands);
|
||||
//TestHelpers.PrintCommandsToConsole(printCommands);
|
||||
|
||||
var printer = await TestHelpers.CreateHtmlPrinterAsync();
|
||||
await TestHelpers.PrintCommandsToHtmlPrinterAsync(
|
||||
printer,
|
||||
printCommands,
|
||||
logoPath: "ristorante-klinglers.ch-logo_white_bg.png");
|
||||
//var printer = await TestHelpers.CreateHtmlPrinterAsync();
|
||||
//await TestHelpers.PrintCommandsToHtmlPrinterAsync(
|
||||
// printer,
|
||||
// printCommands,
|
||||
// logoPath: "ristorante-klinglers.ch-logo_white_bg.png");
|
||||
|
||||
|
||||
// ============================================================================
|
||||
@@ -77,19 +77,19 @@ await TestHelpers.PrintCommandsToHtmlPrinterAsync(
|
||||
// ============================================================================
|
||||
// KITCHEN RECEIPT - HTML PRINTER
|
||||
// ============================================================================
|
||||
//var receipt = TestHelpers.BuildSampleKitchenReceipt();
|
||||
//var serializedReceipt = JsonSerializer.Serialize(receipt, new JsonSerializerOptions { WriteIndented = true });
|
||||
//var deserializedReceipt = JsonSerializer.Deserialize<KitchenReceipt>(serializedReceipt);
|
||||
var receipt = TestHelpers.BuildSampleKitchenReceipt();
|
||||
var serializedReceipt = JsonSerializer.Serialize(receipt, new JsonSerializerOptions { WriteIndented = true });
|
||||
var deserializedReceipt = JsonSerializer.Deserialize<KitchenReceipt>(serializedReceipt);
|
||||
|
||||
//var converter = new KitchenReceiptConverter(bigLineWidth: 20, lineWidth: 33);
|
||||
//var printCommands = converter.ConvertToPrintCommands(deserializedReceipt);
|
||||
var converter = new KitchenReceiptConverter(bigLineWidth: 20, lineWidth: 33);
|
||||
var printCommands = converter.ConvertToPrintCommands(deserializedReceipt);
|
||||
|
||||
//TestHelpers.PrintCommandsToConsole(printCommands);
|
||||
TestHelpers.PrintCommandsToConsole(printCommands);
|
||||
|
||||
//var printer = await TestHelpers.CreateHtmlPrinterAsync(
|
||||
// path: @".\kitchen_test.html",
|
||||
// paperWidth: TestHelpers.KitchenPaperWidth);
|
||||
//await TestHelpers.PrintKitchenCommandsToHtmlPrinterAsync(printer, printCommands);
|
||||
var printer = await TestHelpers.CreateHtmlPrinterAsync(
|
||||
path: @".\kitchen_test.html",
|
||||
paperWidth: TestHelpers.KitchenPaperWidth);
|
||||
await TestHelpers.PrintKitchenCommandsToHtmlPrinterAsync(printer, printCommands);
|
||||
|
||||
|
||||
// ============================================================================
|
||||
|
||||
@@ -141,7 +141,7 @@ public static class TestHelpers
|
||||
receipt.Items.Add(new FinalReceiptItem
|
||||
{
|
||||
Quantity = 1,
|
||||
Description = "Granini Tomatensaft",
|
||||
Description = "An item with really long description that should wrap",
|
||||
UnitPrice = 5.50m,
|
||||
TotalPrice = 5.50m,
|
||||
TaxCategory = "A"
|
||||
@@ -323,29 +323,29 @@ public static class TestHelpers
|
||||
GuestId = 1
|
||||
});
|
||||
receipt.Gangs[0].Dishes.Add(new Dish(1, "Baby Spinach Salad with Truffl"){GuestId = 2});
|
||||
receipt.Gangs[0].Dishes.Add(new Dish(1, "Beef Tataki")
|
||||
{
|
||||
Modifications = new DishModifications
|
||||
{
|
||||
Removed = new List<string> { "Onion" },
|
||||
Added = new List<string> { "Extra Sauce" }
|
||||
},
|
||||
Comment = "Medium rare",
|
||||
GuestId = 3
|
||||
});
|
||||
receipt.Gangs[0].Dishes.Add(new Dish(1, "Salmon Taco")
|
||||
{
|
||||
Modifications = new DishModifications
|
||||
{
|
||||
Added = new List<string> { "Extra Lime" }
|
||||
},
|
||||
GuestId = 4
|
||||
});
|
||||
//receipt.Gangs[0].Dishes.Add(new Dish(1, "Beef Tataki")
|
||||
//{
|
||||
// Modifications = new DishModifications
|
||||
// {
|
||||
// Removed = new List<string> { "Onion" },
|
||||
// Added = new List<string> { "Extra Sauce" }
|
||||
// },
|
||||
// Comment = "Medium rare",
|
||||
// GuestId = 3
|
||||
//});
|
||||
//receipt.Gangs[0].Dishes.Add(new Dish(1, "Salmon Taco")
|
||||
//{
|
||||
// Modifications = new DishModifications
|
||||
// {
|
||||
// Added = new List<string> { "Extra Lime" }
|
||||
// },
|
||||
// GuestId = 4
|
||||
//});
|
||||
|
||||
receipt.Gangs[1].Dishes.Add(new Dish(1, "Avocado Sashimi") { GuestId = 2 });
|
||||
receipt.Gangs[1].Dishes.Add(new Dish(1, "Avocado Sashimi") { GuestId = 1 });
|
||||
receipt.Gangs[1].Dishes.Add(new Dish(1, "Baby Spinach Salad with Truffl") { GuestId = 2 });
|
||||
receipt.Gangs[1].Dishes.Add(new Dish(1, "Beef Tataki") { GuestId = 3 });
|
||||
receipt.Gangs[1].Dishes.Add(new Dish(1, "Salmon Taco") { GuestId = 4 });
|
||||
//receipt.Gangs[1].Dishes.Add(new Dish(1, "Beef Tataki") { GuestId = 3 });
|
||||
//receipt.Gangs[1].Dishes.Add(new Dish(1, "Salmon Taco") { GuestId = 4 });
|
||||
|
||||
return receipt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user