Refactor: Refactored the bill inventory in the hope of making it less

error prone and more understandable.
Refactor: Also upgrade path to moving from Price/FullPrice to HasHappyHour/
          IsHappyHour
Must have a few errors.
This commit is contained in:
tanshu
2016-03-29 15:06:46 +05:30
parent 4ac6f66041
commit bb2db24837
9 changed files with 295 additions and 323 deletions

View File

@ -41,6 +41,50 @@ namespace Tanshu.Accounts.Entities
}
set { }
}
public virtual decimal ServiceTaxAmount
{
get
{
if (IsScTaxable)
return Quantity * Price * (1 - Discount) * (1 + ServiceCharge) * ServiceTaxRate;
return Quantity * Price * (1 - Discount) * ServiceTaxRate;
}
}
public virtual decimal VatAmount
{
get
{
if (IsScTaxable)
return Quantity * Price * (1 - Discount) * (1 + ServiceCharge) * VatRate;
return Quantity * Price * (1 - Discount) * VatRate;
}
}
public virtual decimal ServiceChargeAmount
{
get
{
return Quantity * Price * (1 - Discount) * ServiceCharge;
}
}
public virtual decimal DiscountAmount
{
get
{
return Quantity * Price * Discount;
}
}
public virtual decimal Net
{
get
{
return Quantity * Price * (1 - Discount);
}
}
}
public class InventoryMap : ClassMapping<Inventory>
{