2010-03-02 17:56:21 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.Serialization;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
using FluentNHibernate.Mapping;
|
|
|
|
|
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-01-30 07:14:05 +00:00
|
|
|
|
public virtual int InventoryID { get; set; }
|
2011-02-18 16:54:48 +00:00
|
|
|
|
[NotNull]
|
|
|
|
|
public virtual Kot Kot { get; set; }
|
|
|
|
|
[NotNull]
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public virtual Product Product { get; set; }
|
2011-02-09 12:03:22 +00:00
|
|
|
|
public virtual decimal Quantity { get; set; }
|
|
|
|
|
public virtual decimal Rate { get; set; }
|
|
|
|
|
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-02-18 16:54:48 +00:00
|
|
|
|
[Formula(Formula = "Quantity * Rate * (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
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2011-02-09 12:03:22 +00:00
|
|
|
|
return Quantity * Rate * (1 + Tax) * (1 + ServiceCharge) * (1 - Discount);
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
2011-02-18 16:54:48 +00:00
|
|
|
|
private set { }
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public Inventory()
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2011-01-30 07:14:05 +00:00
|
|
|
|
InventoryModifier = new List<InventoryModifier>();
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|