Refactor: Instead of a concept of Price/FullPrice, happy hour is now a checkbox in the product.
This needed major refactor in all parts dealing with product or inventory.
This commit is contained in:
@ -11,6 +11,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
public delegate void ItemChangedHandler();
|
||||
public void Load(Voucher voucher)
|
||||
{
|
||||
this.Clear();
|
||||
foreach (var kot in voucher.Kots)
|
||||
{
|
||||
var kotKey = new BillItemKey(kot.KotID);
|
||||
@ -18,12 +19,13 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
this.Add(kotKey, kotItem);
|
||||
foreach (var inv in kot.Inventories)
|
||||
{
|
||||
var key = new BillItemKey(inv.Product.ProductID, kot.KotID);
|
||||
var key = new BillItemKey(inv.Product.ProductID, kot.KotID, inv.IsHappyHour);
|
||||
var item = new BillItemValue(inv);
|
||||
this.Add(key, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public decimal Tax
|
||||
{
|
||||
get
|
||||
@ -35,7 +37,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Where(x => x.Key.BillItemType != BillItemType.Kot).Sum(i => i.Value.inventory.DiscountAmount);
|
||||
return this.Where(x=>x.Key.BillItemType != BillItemType.Kot).Sum(i => i.Value.inventory.DiscountAmount);
|
||||
}
|
||||
}
|
||||
public decimal ServiceCharge
|
||||
|
||||
Reference in New Issue
Block a user