using Tanshu.Accounts.Contracts; using Tanshu.Common; using Tanshu.Accounts.Entities; namespace Tanshu.Accounts.PointOfSale { public class BillDict : OrderedDictionary { public delegate void ItemChangedHandler(); public void Load(Voucher voucher) { foreach (var kot in voucher.Kots) { var kotKey = new BillItemKey(kot.KotID); var kotItem = new BillItemValue(kot); this.Add(kotKey, kotItem); foreach (var inv in kot.Inventories) { var key = new BillItemKey(inv.Product.ProductID, kot.KotID); var item = new BillItemValue(inv.Product) { ProductID = inv.Product.ProductID, Discount = inv.Discount, Name = inv.Product.Units == string.Empty ? inv.Product.Name : inv.Product.Name + " (" + inv.Product.Units + ")", Price = inv.Price, Printed = true, Quantity = inv.Quantity, IsScTaxable = inv.IsScTaxable, ServiceTaxRate = inv.ServiceTaxRate, VatRate = inv.VatRate, ServiceTax = inv.ServiceTax, Vat = inv.Vat, ServiceCharge = inv.ServiceCharge, }; foreach (var mod in inv.InventoryModifier) item.Modifiers.Add(mod.Modifier); this.Add(key, item); } } } } }