narsil/Tanshu.Accounts.Contracts/Data Contracts/InventoryBO.cs
unknown 2d1030abf6 Scripts to transition database to new version.
Changed inventory and product entities to split Vat and Service Tax and IsScTaxable.
Added MessageBox on startup to inform about Debug Mode.
Updated ProductForm for the change.
Work still needs to be done on Thermal Printing where the hack for VAT on Food and VAT on Liqour is still there.
Now No Service Tax on Delivery Works as promised.
2012-04-08 17:58:15 +05:30

47 lines
1.7 KiB
C#

using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
public class Inventory
{
public Inventory()
{
// ReSharper disable DoNotCallOverridableMethodsInConstructor
InventoryModifier = new List<InventoryModifier>();
// ReSharper restore DoNotCallOverridableMethodsInConstructor
}
public virtual int InventoryID { get; set; }
[NotNull]
public virtual Kot Kot { get; set; }
[NotNull]
public virtual Product Product { get; set; }
public virtual decimal Quantity { get; set; }
public virtual decimal Price { get; set; }
public virtual decimal FullPrice { get; set; }
public virtual decimal ServiceCharge { get; set; }
public virtual bool IsScTaxable { get; set; }
public virtual decimal ServiceTax { get; set; }
public virtual decimal Vat { get; set; }
public virtual decimal Discount { get; set; }
[Cascade]
public virtual IList<InventoryModifier> InventoryModifier { get; set; }
[Formula(Formula = "CASE WHEN IsScTaxable = 1 THEN Quantity * Price * (1 - Discount) * (1 + ServiceCharge) * (1 + ServiceTax + Vat) ELSE Quantity * Price * (1 - Discount) * (1 + ServiceCharge + ServiceTax + Vat) END")]
public virtual decimal Amount
{
get
{
if (IsScTaxable)
return Quantity * Price * (1 - Discount) * (1 + ServiceCharge) * (1 + ServiceTax + Vat);
return Quantity * Price * (1 - Discount) * (1 + ServiceCharge + ServiceTax + Vat);
}
private set { }
}
}
}