Breaking Change: Changed Kot/Voucher Table Name to Guid Foreign key

Breaking Change: Renamed Discontinued to IsActive and added NA field to products.
Cleanup: Removed not used attributes
Change: RoleConstants changed to simple string
Feature: Table Create/Edit/Reorder and Modifier Create/Edit Form
Feature: Bills now show the Tax name from the database and not a hack
This commit is contained in:
tanshu
2014-10-16 16:41:55 +05:30
parent 69617949bd
commit da929ad036
76 changed files with 3472 additions and 1175 deletions

View File

@ -7,6 +7,7 @@ namespace Tanshu.Accounts.Entities
{
public virtual Guid FoodTableID { get; set; }
public virtual string Name { get; set; }
public virtual bool IsActive { get; set; }
public virtual string Location { get; set; }
public virtual string Status { get; set; }
public virtual int SortOrder { get; set; }
@ -21,6 +22,7 @@ namespace Tanshu.Accounts.Entities
Lazy(true);
Id(x => x.FoodTableID, map => map.Generator(Generators.GuidComb));
Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); });
Property(x => x.IsActive);
Property(x => x.Location);
Property(x => x.Status);
Property(x => x.VoucherID);

View File

@ -18,7 +18,7 @@ namespace Tanshu.Accounts.Entities
public virtual Guid KotID { get; set; }
public virtual Voucher Voucher { get; set; }
public virtual string Code { get; set; }
public virtual string TableID { get; set; }
public virtual FoodTable Table { get; set; }
public virtual bool Printed { get; set; }
public virtual DateTime Date { get; set; }
public virtual User User { get; set; }
@ -34,7 +34,6 @@ namespace Tanshu.Accounts.Entities
Lazy(true);
Id(x => x.KotID, map => map.Generator(Generators.GuidComb));
Property(x => x.Code, map => { map.NotNullable(true); map.Unique(true); });
Property(x => x.TableID, map => map.NotNullable(true));
Property(x => x.Printed, map => map.NotNullable(true));
Property(x => x.Date, map => map.NotNullable(true));
ManyToOne(x => x.Voucher, map =>
@ -44,6 +43,13 @@ namespace Tanshu.Accounts.Entities
map.Cascade(Cascade.None);
});
ManyToOne(x => x.Table, map =>
{
map.Column("TableID");
map.NotNullable(true);
map.Cascade(Cascade.None);
});
ManyToOne(x => x.User, map =>
{
map.Column("UserID");

View File

@ -9,6 +9,11 @@ namespace Tanshu.Accounts.Entities
{
public class Modifier
{
public Modifier()
{
ProductGroupModifiers = new List<ProductGroupModifier>();
InventoryModifiers = new List<InventoryModifier>();
}
public virtual Guid ModifierID { get; set; }
public virtual string Name { get; set; }
public virtual bool ShowInBill { get; set; }

View File

@ -19,11 +19,10 @@ namespace Tanshu.Accounts.Entities
public virtual bool IsScTaxable { get; set; }
public virtual decimal Price { get; set; }
public virtual decimal FullPrice { get; set; }
public virtual bool Discontinued { get; set; }
public virtual bool IsActive { get; set; }
public virtual bool IsNotAvailable { get; set; }
public virtual int SortOrder { get; set; }
[NotNull]
public virtual int BaseCode { get; set; }
[NotNull]
public virtual decimal Quantity { get; set; }
public virtual IList<Inventory> Inventories { get; set; }
@ -44,7 +43,8 @@ namespace Tanshu.Accounts.Entities
Property(x => x.IsScTaxable, map => map.NotNullable(true));
Property(x => x.Price, map => map.NotNullable(true));
Property(x => x.FullPrice, map => map.NotNullable(true));
Property(x => x.Discontinued, map => map.NotNullable(true));
Property(x => x.IsActive, map => map.NotNullable(true));
Property(x => x.IsNotAvailable, map => map.NotNullable(true));
Property(x => x.SortOrder, map => map.NotNullable(true));
Property(x => x.BaseCode, map => map.NotNullable(true));
Property(x => x.Quantity, map => map.NotNullable(true));

View File

@ -15,14 +15,11 @@ namespace Tanshu.Accounts.Entities
public virtual Guid 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 bool Discontinued { get; set; }
public virtual bool IsActive { get; set; }
public virtual int SortOrder { get; set; }
public virtual string GroupType { get; set; }
public virtual IList<Product> Products { get; set; }
public virtual IList<PrintLocation> PrintLocations { get; set; }
@ -38,7 +35,7 @@ namespace Tanshu.Accounts.Entities
Lazy(true);
Id(x => x.ProductGroupID, map => map.Generator(Generators.GuidComb));
Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); });
Property(x => x.Discontinued, map => map.NotNullable(true));
Property(x => x.IsActive, map => map.NotNullable(true));
Property(x => x.SortOrder, map => map.NotNullable(true));
Property(x => x.DiscountLimit, map => map.NotNullable(true));
Property(x => x.IsModifierCompulsory, map => map.NotNullable(true));

View File

@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.Contracts.Attributes;
using Tanshu.Accounts.Entities.Auth;
using NHibernate.Mapping.ByCode.Conformist;
using NHibernate.Mapping.ByCode;
@ -24,11 +23,11 @@ namespace Tanshu.Accounts.Entities
VoucherType = VoucherType.Regular;
}
public Voucher(User user, Customer customer, string table, Waiter waiter, bool printed, bool isVoid, string narration)
public Voucher(User user, Customer customer, FoodTable table, Waiter waiter, bool printed, bool isVoid, string narration)
: this(user)
{
Customer = customer;
TableID = table;
Table = table;
Waiter = waiter;
Printed = printed;
Void = isVoid;
@ -45,7 +44,7 @@ namespace Tanshu.Accounts.Entities
public virtual DateTime CreationDate { get; set; }
public virtual DateTime LastEditDate { get; set; }
public virtual string BillID { get; set; }
public virtual string TableID { get; set; }
public virtual FoodTable Table { get; set; }
public virtual Waiter Waiter { get; set; }
public virtual Customer Customer { get; set; }
public virtual IList<VoucherSettlement> Settlements { get; set; }
@ -75,7 +74,6 @@ namespace Tanshu.Accounts.Entities
Property(x => x.CreationDate, map => map.NotNullable(true));
Property(x => x.LastEditDate, map => map.NotNullable(true));
Property(x => x.BillID, map => map.NotNullable(true));
Property(x => x.TableID, map => map.NotNullable(true));
Property(x => x.Void, map => map.NotNullable(true));
Property(x => x.VoidReason);
Property(x => x.Printed, map => map.NotNullable(true));
@ -86,6 +84,12 @@ namespace Tanshu.Accounts.Entities
map.NotNullable(true);
map.Cascade(Cascade.None);
});
ManyToOne(x => x.Table, map =>
{
map.Column("TableID");
map.NotNullable(true);
map.Cascade(Cascade.None);
});
ManyToOne(x => x.Waiter, map =>
{