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; }
|
|
|
|
|
public virtual Voucher Voucher { get; set; }
|
|
|
|
|
public virtual Product Product { get; set; }
|
|
|
|
|
|
2011-02-09 12:03:22 +00:00
|
|
|
|
public virtual decimal Quantity { get; set; }
|
2011-01-30 07:14:05 +00:00
|
|
|
|
|
2011-02-09 12:03:22 +00:00
|
|
|
|
public virtual decimal Rate { get; set; }
|
2010-03-02 17:56:21 +00:00
|
|
|
|
|
2011-02-09 12:03:22 +00:00
|
|
|
|
public virtual decimal Tax { get; set; }
|
2011-01-30 07:14:05 +00:00
|
|
|
|
|
2011-02-09 12:03:22 +00:00
|
|
|
|
public virtual decimal Discount { get; set; }
|
2011-01-30 07:14:05 +00:00
|
|
|
|
|
2011-02-09 12:03:22 +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; }
|
|
|
|
|
|
|
|
|
|
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-01-30 07:14:05 +00:00
|
|
|
|
set
|
|
|
|
|
{ }
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
2011-01-30 07:14:05 +00:00
|
|
|
|
|
2011-02-04 19:30:55 +00:00
|
|
|
|
//public decimal DiscountAmount
|
|
|
|
|
//{
|
|
|
|
|
// get
|
|
|
|
|
// {
|
|
|
|
|
// return quantity * rate * (1 + tax) * (1 + serviceCharge) * discount;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|