Multiple settlement options. Upgrade SQL Script included.

This commit is contained in:
unknown
2011-03-12 00:19:48 +05:30
parent 9ed5843dbd
commit aea41a9d24
42 changed files with 1917 additions and 1550 deletions

View File

@ -1,18 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Tanshu.Accounts.Contracts
namespace Tanshu.Accounts.Contracts.Attributes
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public class AllowNullAttribute : Attribute
{
private string message = string.Empty;
private string _message = string.Empty;
public string Message
{
get { return message; }
set { message = value; }
get { return _message; }
set { _message = value; }
}
}
}
}

View File

@ -0,0 +1,19 @@
using System;
namespace Tanshu.Accounts.Contracts
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public class DisplayAttribute : Attribute
{
public DisplayAttribute(string name, bool showInChoices, int group)
{
Name = name;
ShowInChoices = showInChoices;
Group = group;
}
public string Name { get; set; }
public int Group { get; set; }
public bool ShowInChoices { get; set; }
}
}

View File

@ -1,6 +1,4 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Entities.Auth;
using Tanshu.Accounts.Contracts;

View File

@ -1,8 +1,4 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
namespace Tanshu.Accounts.Entities
namespace Tanshu.Accounts.Entities
{
public class Customer
{

View File

@ -1,18 +1,25 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using System.Collections.Generic;
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 Rate { get; set; }
public virtual decimal Tax { get; set; }
@ -21,18 +28,12 @@ namespace Tanshu.Accounts.Entities
[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);
}
get { return Quantity * Rate * (1 + Tax) * (1 + ServiceCharge) * (1 - Discount); }
private set { }
}
public Inventory()
{
InventoryModifier = new List<InventoryModifier>();
}
}
}
}

View File

@ -1,23 +1,23 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using System.Collections.Generic;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
public class ProductGroup
{
public virtual int ProductGroupID { get; set; }
[NotNull, Unique]
public virtual string Name { get; set; }
public virtual decimal DiscountLimit { get; set; }
public virtual bool IsModifierCompulsory { get; set; }
public virtual string GroupType { get; set; }
public virtual IList<Product> Products { get; set; }
public ProductGroup()
{
Products = new List<Product>();
}
public virtual int ProductGroupID { get; set; }
[NotNull, Unique]
public virtual string Name { get; set; }
public virtual decimal DiscountLimit { get; set; }
public virtual bool IsModifierCompulsory { get; set; }
public virtual string GroupType { get; set; }
public virtual IList<Product> Products { get; set; }
}
}
}

View File

@ -1,17 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.Entities
{
public enum SettleOption
{
[Display("Unsettled", false, 1)]
Unsettled = 1,
[Display("Cash", true, 2)]
Cash = 2,
[Display("Credit Card", true, 2)]
CreditCard = 3,
[Display("No Charge", true, 3)]
NoCharge = 4,
[Display("Bill To Company", true, 4)]
BillToCompany = 5,
Staff = 6
[Display("Tip", true, 2)]
Tip = 6,
[Display("Round Off", false, 1)]
RoundOff = 7,
[Display("Amount", false, 1)]
Amount = 8
}
}
}

View File

@ -1,46 +1,60 @@
using System;
using System.Runtime.Serialization;
using FluentNHibernate.Mapping;
using Tanshu.Accounts.Entities.Auth;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.Contracts.Attributes;
using Tanshu.Accounts.Entities.Auth;
namespace Tanshu.Accounts.Entities
{
public class Voucher
{
public Voucher()
{
Kots = new List<Kot>();
Settlements = new List<VoucherSettlement>();
}
public virtual int VoucherID { get; set; }
public virtual DateTime? Date { get; set; }
public virtual string Narration { get; set; }
[NotNull]
public virtual User User { get; set; }
[NotNull]
public virtual DateTime CreationDate { get; set; }
[NotNull]
public virtual DateTime LastEditDate { get; set; }
[NotNull]
public virtual string BillID { get; set; }
[NotNull]
public virtual string TableID { get; set; }
[NotNull]
public virtual Waiter Waiter { get; set; }
[NotNull]
public virtual Customer Customer { get; set; }
[NotNull]
public virtual SettleOption Settled { get; set; }
[Cascade]
public virtual IList<VoucherSettlement> Settlements { get; set; }
[NotNull]
public virtual bool Void { get; set; }
[AllowNull]
public virtual string VoidReason { get; set; }
[NotNull]
public virtual bool Printed { get; set; }
[NotNull]
public virtual string KotID { get; set; }
[Cascade]
public virtual IList<Kot> Kots { get; set; }
public Voucher()
{
this.Kots = new List<Kot>();
}
}
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.Contracts.Attributes;
using Tanshu.Accounts.Entities.Auth;
namespace Tanshu.Accounts.Entities
{
public class VoucherSettlement
{
public virtual int VoucherSettlementID { get; set; }
[NotNull]
public virtual Voucher Voucher { get; set; }
[NotNull]
public virtual SettleOption Settled { get; set; }
[NotNull]
public virtual decimal Amount { get; set; }
}
}

View File

@ -79,6 +79,7 @@
<ItemGroup>
<Compile Include="Attributes\CascadeAttribute.cs" />
<Compile Include="Attributes\AllowNullAttribute.cs" />
<Compile Include="Attributes\DisplayAttribute.cs" />
<Compile Include="Attributes\FormulaAttribute.cs" />
<Compile Include="Attributes\UniqueAttribute.cs" />
<Compile Include="Attributes\PermissionAttribute.cs" />
@ -91,6 +92,7 @@
<Compile Include="Data Contracts\Auth\RoleGroup.cs" />
<Compile Include="Data Contracts\Auth\Group.cs" />
<Compile Include="Data Contracts\Auth\Role.cs" />
<Compile Include="Data Contracts\VoucherSettlementBO.cs" />
<Compile Include="Data Contracts\KotBO.cs" />
<Compile Include="Data Contracts\PaymentGroupBO.cs" />
<Compile Include="Data Contracts\InventoryModifierBO.cs" />