2011-03-11 18:49:48 +00:00
|
|
|
|
using System.Collections.Generic;
|
2011-01-31 20:33:22 +00:00
|
|
|
|
using Tanshu.Accounts.Contracts;
|
2010-03-02 17:56:21 +00:00
|
|
|
|
|
2011-01-30 07:14:05 +00:00
|
|
|
|
namespace Tanshu.Accounts.Entities
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public class Inventory
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2011-03-11 18:49:48 +00:00
|
|
|
|
public Inventory()
|
|
|
|
|
{
|
|
|
|
|
// ReSharper disable DoNotCallOverridableMethodsInConstructor
|
|
|
|
|
InventoryModifier = new List<InventoryModifier>();
|
|
|
|
|
// ReSharper restore DoNotCallOverridableMethodsInConstructor
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public virtual int InventoryID { get; set; }
|
2011-03-11 18:49:48 +00:00
|
|
|
|
|
2011-02-18 16:54:48 +00:00
|
|
|
|
[NotNull]
|
|
|
|
|
public virtual Kot Kot { get; set; }
|
2011-03-11 18:49:48 +00:00
|
|
|
|
|
2011-02-18 16:54:48 +00:00
|
|
|
|
[NotNull]
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public virtual Product Product { get; set; }
|
2011-03-11 18:49:48 +00:00
|
|
|
|
|
2011-02-09 12:03:22 +00:00
|
|
|
|
public virtual decimal Quantity { get; set; }
|
2011-08-28 12:17:15 +00:00
|
|
|
|
public virtual decimal Price { get; set; }
|
|
|
|
|
public virtual decimal FullPrice { get; set; }
|
2011-02-09 12:03:22 +00:00
|
|
|
|
public virtual decimal Tax { get; set; }
|
|
|
|
|
public virtual decimal Discount { get; set; }
|
2011-02-18 16:54:48 +00:00
|
|
|
|
public virtual decimal ServiceCharge { get; set; }
|
2011-01-30 07:14:05 +00:00
|
|
|
|
|
2011-01-31 20:33:22 +00:00
|
|
|
|
[Cascade]
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public virtual IList<InventoryModifier> InventoryModifier { get; set; }
|
2011-03-11 18:49:48 +00:00
|
|
|
|
|
2011-08-28 12:17:15 +00:00
|
|
|
|
[Formula(Formula = "Quantity * Price * (1 - Discount) * (1 + ServiceCharge) * (1 + Tax)")]
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public virtual decimal Amount
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2011-08-28 12:17:15 +00:00
|
|
|
|
get { return Quantity * Price * (1 + Tax) * (1 + ServiceCharge) * (1 - Discount); }
|
2011-02-18 16:54:48 +00:00
|
|
|
|
private set { }
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2011-03-11 18:49:48 +00:00
|
|
|
|
}
|