-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModels.cs
More file actions
49 lines (43 loc) · 1.68 KB
/
Copy pathModels.cs
File metadata and controls
49 lines (43 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System.Text.Json.Serialization;
namespace FMPReceiptPrinter;
public sealed class ReceiptTemplate
{
public string Name { get; set; } = "Default";
public string BusinessName { get; set; } = "";
public string Proprietor { get; set; } = "";
public string Address { get; set; } = "";
public string Contact { get; set; } = "";
public string LogoFile { get; set; } = "";
public string AccentColor { get; set; } = "#087EAF";
public int ItemRows { get; set; } = 7;
}
public sealed class ReceiptItem
{
public decimal Quantity { get; set; }
public string Description { get; set; } = "";
public decimal UnitPrice { get; set; }
[JsonIgnore] public decimal Amount => Quantity * UnitPrice;
}
public sealed class ReceiptData
{
public int ReceiptNumber { get; set; } = 1;
public DateTime Date { get; set; } = DateTime.Today;
public string Customer { get; set; } = "";
public string Address { get; set; } = "";
public string Terms { get; set; } = "7 Days";
public DateTime DueDate { get; set; } = DateTime.Today.AddDays(7);
public List<ReceiptItem> Items { get; set; } = [];
public decimal DeliveryFee { get; set; }
public string PreparedBy { get; set; } = "";
public bool UseESignature { get; set; }
public string SignatureFile { get; set; } = "";
public string Notes { get; set; } = "";
[JsonIgnore] public decimal Subtotal => Items.Sum(x => x.Amount);
[JsonIgnore] public decimal Total => Subtotal + DeliveryFee;
}
public sealed class AppState
{
public int LastReceiptNumber { get; set; }
public string LastTemplate { get; set; } = "";
}
public enum ReceiptSlot { TopLeft, TopRight, BottomLeft, BottomRight }