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

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Tanshu.Accounts.Contracts
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method)]
public class PermissionAttribute : Attribute
{
public PermissionAttribute(RoleConstants role)
{
Role = role;
}
public RoleConstants Role { get; set; }
}
}

View File

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

View File

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

View File

@ -1,31 +0,0 @@
using System;
using System.Runtime.Serialization;
namespace Tanshu.Accounts.Contracts
{
public enum PendingType
{
Today = 0,
Week = 1,
All = 2,
Important = 4,
Alarms = 8
}
public class PendingBills
{
public virtual Guid voucherID { get; set; }
public virtual string BillNo { get; set; }
public virtual string Kot { get; set; }
public virtual string TableID { get; set; }
public virtual decimal Amount { get; set; }
public virtual bool Important { get; set; }
public virtual bool Alarm { get; set; }
public virtual DateTime BookingTime { get; set; }
public virtual DateTime LastEdited { get; set; }
public virtual string Waiter { get; set; }
public virtual string Cashier { get; set; }
public virtual bool Printed { get; set; }
public virtual Nullable<DateTime> AlarmTime { get; set; }
}
}

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 =>
{

View File

@ -1,60 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Tanshu.Accounts.Contracts
{
public sealed class RoleConstants
{
private readonly string role;
private RoleConstants(string role)
{
this.role = role;
}
public override string ToString()
{
return role;
}
public string Role
{
get { return role; }
}
public static RoleConstants ADJUST_ADVANCE = new RoleConstants("Sales/AdjustAdvance");
public static RoleConstants RECEIVE_ADVANCE = new RoleConstants("Sales/ReceiveAdvance");
public static RoleConstants CHANGE_RATE = new RoleConstants("Sales/ChangeRate");
public static RoleConstants CASHIER_CHECKOUT = new RoleConstants("Sales/CashierCheckout");
public static RoleConstants CUSTOMERS = new RoleConstants("Sales/Customers");
public static RoleConstants DISCOUNT = new RoleConstants("Sales/Discount");
public static RoleConstants EDIT_PRINTED_BILL = new RoleConstants("Sales/EditBill");
public static RoleConstants EDIT_PRINTED_PRODUCT = new RoleConstants("Sales/EditPrintedProduct");
public static RoleConstants MERGE_TABLE = new RoleConstants("Sales/MergeTable");
public static RoleConstants MOVE_TABLE = new RoleConstants("Sales/MoveTable");
public static RoleConstants MERGE_KOT = new RoleConstants("Sales/MergeKot");
public static RoleConstants MOVE_KOT = new RoleConstants("Sales/MoveKot");
public static RoleConstants OPEN_BILL = new RoleConstants("Sales/OpenBill");
public static RoleConstants PRINT_BILL = new RoleConstants("Sales/PrintBill");
public static RoleConstants PRINT_KOT = new RoleConstants("Sales/PrintKOT");
public static RoleConstants SALES = new RoleConstants("Sales/SalesBill");
public static RoleConstants DISCOUNT_REPORT = new RoleConstants("Discount Report");
public static RoleConstants VOID_OR_REPRINTED_BILL_REPORT = new RoleConstants("Void or Reprinted Bill Report");
public static RoleConstants BILL_DETAILS = new RoleConstants("Sales/BillDetails");
public static RoleConstants SALE_ANALYSIS = new RoleConstants("Sales/SaleAnalysis");
public static RoleConstants SALE_DETAIL = new RoleConstants("Sales/SaleDetail");
public static RoleConstants ACCOUNTS_AUDIT = new RoleConstants("Accounts Audit");
public static RoleConstants SPLIT_BILL = new RoleConstants("Split Bill");
public static RoleConstants VOID_BILL = new RoleConstants("Sales/VoidPrintedBill");
public static RoleConstants ZERO_RATE = new RoleConstants("Sales/ZeroRate");
public static RoleConstants SETTLE_BILL = new RoleConstants("Sales/SettleBill");
public static RoleConstants PRODUCTS = new RoleConstants("Master/Products");
public static RoleConstants SECURITY_MANAGE_USERS = new RoleConstants("Security/ManageUsers");
public static RoleConstants SECURITY_MANAGE_ROLES = new RoleConstants("Security/ManageRoles");
public static RoleConstants LOG_VIEW = new RoleConstants("Log/View");
public static RoleConstants MASTER_OWNER = new RoleConstants("Master/Owner");
}
}

View File

@ -65,15 +65,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Attributes\CascadeAttribute.cs" />
<Compile Include="Attributes\AllowNullAttribute.cs" />
<Compile Include="Attributes\InverseAttribute.cs" />
<Compile Include="Attributes\DisplayAttribute.cs" />
<Compile Include="Attributes\FormulaAttribute.cs" />
<Compile Include="Attributes\UniqueAttribute.cs" />
<Compile Include="Attributes\PermissionAttribute.cs" />
<Compile Include="Attributes\SecutiryAttribute.cs" />
<Compile Include="Attributes\NotNullAttribute.cs" />
<Compile Include="DisplayAttribute.cs" />
<Compile Include="Constants.cs" />
<Compile Include="Data Contracts Display\BillItemKey.cs">
<SubType>Code</SubType>
@ -100,7 +92,6 @@
<Compile Include="Data Contracts\CustomerBO.cs" />
<Compile Include="Data Contracts\WaiterBO.cs" />
<Compile Include="Data Contracts\InventoryBO.cs" />
<Compile Include="Data Contracts Display\PendingBillsBO.cs" />
<Compile Include="Data Contracts\ProductBO.cs" />
<Compile Include="Data Contracts\ProductGroupBO.cs" />
<Compile Include="Helper Functions\StringHelper.cs" />
@ -110,7 +101,6 @@
<Compile Include="Data Contracts Display\BillInventoryBO.cs" />
<Compile Include="Data Contracts\Auth\UserBO.cs" />
<Compile Include="Data Contracts\VoucherBO.cs" />
<Compile Include="RolesConstants.cs" />
<Compile Include="ValidationException.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />