narsil/Tanshu.Accounts.Contracts/Data Contracts/VoucherBO.cs
unknown 831ec37cda Reprint and Printed bill editing logged.
Printed bill can no longer be changed, any changes voids the bill and prints a new one.
Added option to Split Bill.
Kot printed with right time.
Numerous bug fixes.
2011-08-23 12:40:05 +05:30

111 lines
2.4 KiB
C#

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 Voucher
{
protected Voucher()
{
Kots = new List<Kot>();
Settlements = new List<VoucherSettlement>();
}
public Voucher(User user)
: this()
{
this._date = null;
this.User = user;
}
protected int _voucherID;
public virtual int VoucherID
{
get { return _voucherID; }
}
protected DateTime? _date;
public virtual DateTime? Date
{
get { return _date; }
}
public virtual string Narration { get; set; }
[NotNull]
public virtual User User { get; set; }
protected DateTime _creationDate;
[NotNull]
public virtual DateTime CreationDate
{
get { return _creationDate; }
}
protected DateTime _lastEditDate;
[NotNull]
public virtual DateTime LastEditDate
{
get { return _lastEditDate; }
}
protected string _billID;
[NotNull]
public virtual string BillID
{
get { return _billID; }
}
[NotNull]
public virtual string TableID { get; set; }
[NotNull]
public virtual Waiter Waiter { get; set; }
[NotNull]
public virtual Customer Customer { get; set; }
[Cascade]
public virtual IList<VoucherSettlement> Settlements { get; set; }
[NotNull]
public virtual bool Void { get; set; }
[AllowNull]
public virtual string VoidReason { get; set; }
protected bool _printed;
[NotNull]
public virtual bool Printed
{
get
{ return _printed; }
set
{
if (_printed)
return;
if (value == false)
return;
_date = null;
_printed = value;
}
}
#pragma warning disable 649
private string _kotID;
#pragma warning restore 649
[NotNull]
public virtual string KotID
{
get { return _kotID; }
}
[Cascade]
public virtual IList<Kot> Kots { get; set; }
}
}