Multiple settlement options. Upgrade SQL Script included.
This commit is contained in:
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using FluentNHibernate.Mapping;
|
||||
using Tanshu.Accounts.Entities.Auth;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using FluentNHibernate.Mapping;
|
||||
|
||||
namespace Tanshu.Accounts.Entities
|
||||
namespace Tanshu.Accounts.Entities
|
||||
{
|
||||
public class Customer
|
||||
{
|
||||
|
||||
@ -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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user