2010-03-02 17:56:21 +00:00
|
|
|
|
using System;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
using Tanshu.Accounts.Entities;
|
|
|
|
|
using System.Collections.Generic;
|
2010-03-02 17:56:21 +00:00
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.Contracts
|
|
|
|
|
{
|
2011-06-23 12:47:48 +00:00
|
|
|
|
public class BillItemValue
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2016-03-29 09:36:46 +00:00
|
|
|
|
public Inventory inventory { get; set; }
|
|
|
|
|
public Kot kot { get; private set; }
|
2010-03-02 17:56:21 +00:00
|
|
|
|
|
|
|
|
|
public string Display
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2016-03-29 09:36:46 +00:00
|
|
|
|
if (inventory != null)
|
|
|
|
|
{
|
|
|
|
|
var output = string.Format("{0} @ Rs. {1:#.##}", inventory.Product.FullName, inventory.Price);
|
|
|
|
|
if (inventory.Discount != 0)
|
|
|
|
|
output += string.Format(" - {0:#.##%}", inventory.Discount);
|
|
|
|
|
foreach (var item in inventory.InventoryModifier)
|
|
|
|
|
output += string.Format("\n\r -- {0}", item.Modifier.Name);
|
|
|
|
|
return output;
|
|
|
|
|
}
|
|
|
|
|
else if (kot.KotID != Guid.Empty)
|
|
|
|
|
{
|
|
|
|
|
return string.Format("Kot: S-{0} / {1:dd-MMM HH:mm} ({2})", kot.Code, kot.Date, kot.User.Name);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return "== New Kot ==";
|
|
|
|
|
}
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-03-29 09:36:46 +00:00
|
|
|
|
public BillItemValue(Inventory inv)
|
2011-01-31 20:33:22 +00:00
|
|
|
|
{
|
2016-03-29 09:36:46 +00:00
|
|
|
|
inventory = inv;
|
2011-01-31 20:33:22 +00:00
|
|
|
|
}
|
2011-06-23 12:47:48 +00:00
|
|
|
|
public BillItemValue(Product product)
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2016-03-29 09:36:46 +00:00
|
|
|
|
inventory = new Inventory()
|
2011-08-23 07:10:05 +00:00
|
|
|
|
{
|
2016-03-29 09:36:46 +00:00
|
|
|
|
Product = product,
|
|
|
|
|
FullPrice = product.FullPrice,
|
|
|
|
|
Price = product.Price,
|
|
|
|
|
IsScTaxable = product.IsScTaxable,
|
|
|
|
|
Quantity = 1,
|
|
|
|
|
ServiceCharge = product.ServiceCharge,
|
|
|
|
|
ServiceTax = product.ServiceTax,
|
|
|
|
|
Vat = product.Vat,
|
|
|
|
|
Discount = 0,
|
|
|
|
|
ServiceTaxRate = product.ServiceTax.Rate,
|
|
|
|
|
VatRate = product.Vat.Rate
|
|
|
|
|
};
|
2011-08-23 07:10:05 +00:00
|
|
|
|
}
|
|
|
|
|
public BillItemValue()
|
|
|
|
|
{
|
2016-03-29 09:36:46 +00:00
|
|
|
|
this.kot = new Kot();
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
2011-08-23 07:10:05 +00:00
|
|
|
|
|
|
|
|
|
public BillItemValue(Kot kot)
|
|
|
|
|
{
|
2016-03-29 09:36:46 +00:00
|
|
|
|
this.kot = kot;
|
2011-08-23 07:10:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
2011-08-23 07:10:05 +00:00
|
|
|
|
}
|