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

@ -15,7 +15,7 @@ namespace Tanshu.Accounts.Contracts
{
if (inventory != null)
{
var output = string.Format("{0} @ Rs. {1:#.##}", inventory.Product.FullName, inventory.Price);
var output = string.Format("{0} @ Rs. {1:#.##}", inventory.EffectiveName, inventory.Price);
if (inventory.Discount != 0)
output += string.Format(" - {0:#.##%}", inventory.Discount);
foreach (var item in inventory.InventoryModifier)
@ -36,12 +36,12 @@ namespace Tanshu.Accounts.Contracts
{
inventory = inv;
}
public BillItemValue(Product product)
public BillItemValue(Product product, bool isHappyHour)
{
inventory = new Inventory()
{
Product = product,
FullPrice = product.FullPrice,
IsHappyHour = isHappyHour,
Price = product.Price,
IsScTaxable = product.IsScTaxable,
Quantity = 1,