using System; using System.Collections.Generic; namespace Tanshu.Accounts.Entities { public class Voucher { public Voucher() { Kots = new List(); Settlements = new List(); } public Voucher(User user, Customer customer) : this() { this.User = user; VoucherType = VoucherType.Regular; Customer = customer; } public Voucher(User user, Customer customer, FoodTable table, bool printed, bool isVoid, string narration) : this(user, customer) { Table = table; Printed = printed; Void = isVoid; Narration = narration; VoucherType = VoucherType.Regular; } public Guid VoucherID { get; set; } public DateTime Date { private set; get; } public int Pax { get; set; } public User User { get; set; } public DateTime CreationDate { private set; get; } public DateTime LastEditDate { private set; get; } public int? BillID { private set; get; } public FoodTable Table { get; set; } public Customer Customer { get; set; } public List Settlements { get; set; } public string Narration { get; set; } public bool Void { get; set; } public string VoidReason { get; set; } public bool Printed { get; set; } public VoucherType VoucherType { get; set; } public int KotID { private set; get; } public List Kots { get; set; } public List Reprints { get; set; } public string FullBillID { get { if (BillID.HasValue) { switch (VoucherType) { case VoucherType.NoCharge: return "NC-" + BillID.Value.ToString(); case VoucherType.Staff: return "ST-" + BillID.Value.ToString(); case VoucherType.TakeAway: case VoucherType.Regular: default: return (BillID.Value / 10000).ToString() + "-" + (BillID.Value % 10000).ToString(); } } else { return "K-" + KotID.ToString(); } } } } }