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:
@ -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>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user