using System; using System.Runtime.Serialization; using System.Collections.Generic; namespace Tanshu.Accounts.Contracts { public class VoucherBO { public Guid VoucherID { get; set; } public DateTime? Date { get; set; } public string Narration { get; set; } public Guid UserID { get; set; } public DateTime CreationDate { get; set; } public DateTime LastEditDate { get; set; } public int Floor { get; set; } public string BillID { get; set; } public string TableID { get; set; } public Guid WaiterID { get; set; } public Guid CustomerID { get; set; } public Guid? AdvanceID { get; set; } public PaidStatus PaidStatus { get; set; } public string VoidReason { get; set; } public bool Printed { get; set; } public DateTime? Alarm { get; set; } public string KotID { get; set; } public IList Inventories { get; set; } public AdvanceBO Advance { get; set; } public WaiterBO Waiter { get; set; } public UserBO User { get; set; } public CustomerBO Customer { get; set; } public decimal Amount { get { decimal amount = 0; foreach (var inv in Inventories) { amount += inv.Amount; } if (AdvanceID.HasValue) { amount -= Advance.Amount; } return amount; } } } }