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:
tanshu
2016-04-11 12:31:52 +05:30
parent 69cb7d8bce
commit 20eac3c216
35 changed files with 861 additions and 435 deletions

View File

@ -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