Fix: Updated PrintBill where discount is showed on screen before printing bill.

Fix: Updated Product Page so that HappyHour is updated properly
This commit is contained in:
tanshu
2016-05-12 14:41:02 +05:30
parent 5124347d1b
commit 5f0f80ed1e
4 changed files with 54 additions and 49 deletions

View File

@ -381,19 +381,10 @@ namespace Tanshu.Accounts.PointOfSale
ClearBill();
return true;
}
public bool SaveAndPrintBill()
public bool CanSaveBill(bool isPrinted, bool isVoid)
{
#region Check if Allowed
if (!Session.IsAllowed("Print Bill") || _bill.Count(x => x.Key.BillItemType != BillItemType.Kot) == 0)
return false;
bool isPrinted = false, isVoid = false;
if (_voucher.VoucherID != Guid.Empty)
using (var bi = new VoucherBI())
{
var dbVoucher = bi.Get(x => x.VoucherID == _voucher.VoucherID);
isPrinted = dbVoucher.Printed;
isVoid = dbVoucher.Void;
}
if (isVoid)
{
MessageBox.Show(string.Format("This Bill is already void.\nReason: {0}", _voucher.VoidReason), "Bill already Voided", MessageBoxButtons.OK, MessageBoxIcon.Error);
@ -401,11 +392,10 @@ namespace Tanshu.Accounts.PointOfSale
}
if (isPrinted && !Session.IsAllowed("Edit Printed Bill"))
return false;
#endregion
var amount = _bill.NetAmount;
SetDiscount();
return true;
}
public bool SaveAndPrintBill(bool isPrinted, decimal amount)
{
if (isPrinted)
{
SaveReprintOrDiscountBill(amount);