39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using System;
|
|
using System.Runtime.Serialization;
|
|
using FluentNHibernate.Mapping;
|
|
using System.Collections.Generic;
|
|
using Tanshu.Accounts.Contracts;
|
|
|
|
namespace Tanshu.Accounts.Entities
|
|
{
|
|
public class Inventory
|
|
{
|
|
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 Rate { get; set; }
|
|
public virtual decimal Tax { get; set; }
|
|
public virtual decimal Discount { get; set; }
|
|
public virtual decimal ServiceCharge { get; set; }
|
|
|
|
[Cascade]
|
|
public virtual IList<InventoryModifier> InventoryModifier { get; set; }
|
|
[Formula(Formula = "Quantity * Rate * (1 - Discount) * (1 + ServiceCharge) * (1 + Tax)")]
|
|
public virtual decimal Amount
|
|
{
|
|
get
|
|
{
|
|
return Quantity * Rate * (1 + Tax) * (1 + ServiceCharge) * (1 - Discount);
|
|
}
|
|
private set { }
|
|
}
|
|
public Inventory()
|
|
{
|
|
InventoryModifier = new List<InventoryModifier>();
|
|
}
|
|
}
|
|
}
|