Refactor: Instead of a concept of Price/FullPrice, happy hour is now a checkbox in the product.

This needed major refactor in all parts dealing with product or inventory.
This commit is contained in:
tanshu
2016-04-11 12:31:52 +05:30
parent 69cb7d8bce
commit 20eac3c216
35 changed files with 861 additions and 435 deletions

View File

@ -17,7 +17,7 @@ namespace Tanshu.Accounts.Entities
public virtual decimal ServiceCharge { get; set; }
public virtual bool IsScTaxable { get; set; }
public virtual decimal Price { get; set; }
public virtual decimal FullPrice { get; set; }
public virtual bool HasHappyHour { get; set; }
public virtual bool IsActive { get; set; }
public virtual bool IsNotAvailable { get; set; }
public virtual int SortOrder { get; set; }
@ -30,6 +30,7 @@ namespace Tanshu.Accounts.Entities
{
return Units == string.Empty ? Name : string.Format("{0} ({1})", Name, Units);
}
set { }
}
}
public class ProductMap : ClassMapping<Product>
@ -46,12 +47,16 @@ namespace Tanshu.Accounts.Entities
Property(x => x.ServiceCharge, map => map.NotNullable(true));
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.HasHappyHour, 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.Quantity, map => map.NotNullable(true));
Property(x => x.FullName, map =>
{
map.Formula("CASE WHEN Units = '' THEN Name ELSE Name + ' (' + Units + ')' END");
});
ManyToOne(x => x.ProductGroup, map => { map.Column("ProductGroupID"); map.Cascade(Cascade.None); });
ManyToOne(x => x.ServiceTax, map => { map.Column("ServiceTaxID"); map.Cascade(Cascade.None); });
ManyToOne(x => x.Vat, map => { map.Column("VatID"); map.Cascade(Cascade.None); });