diff --git a/Tanshu.Accounts.PointOfSale/Sales/SalesForm.cs b/Tanshu.Accounts.PointOfSale/Sales/SalesForm.cs index 698100f..64dc419 100644 --- a/Tanshu.Accounts.PointOfSale/Sales/SalesForm.cs +++ b/Tanshu.Accounts.PointOfSale/Sales/SalesForm.cs @@ -405,6 +405,7 @@ namespace Tanshu.Accounts.PointOfSale.Sales } private void btnPrintBill_Click(object sender, EventArgs e) { + btnPrintBill.Enabled = false; bool isPrinted = false, isVoid = false; if (_controller._voucher.VoucherID != Guid.Empty) using (var bi = new VoucherBI()) @@ -414,35 +415,42 @@ namespace Tanshu.Accounts.PointOfSale.Sales isVoid = dbVoucher.Void; } - if (!_controller.CanSaveBill(isPrinted, isVoid)) - return; - var amount = _controller._bill.NetAmount; - _controller.SetDiscount(); - ShowInfo(); - var printed = _controller.SaveAndPrintBill(isPrinted, amount); - if (!printed) - return; - if (_controller._editVoucherID.HasValue) - this.Close(); - else + if (_controller.CanSaveBill(isPrinted, isVoid)) { + var amount = _controller._bill.NetAmount; + _controller.SetDiscount(); ShowInfo(); - FormState = SaleFormState.Waiting; + var printed = _controller.SaveAndPrintBill(isPrinted, amount); + if (printed) + { + if (_controller._editVoucherID.HasValue) + this.Close(); + else + { + ShowInfo(); + FormState = SaleFormState.Waiting; + } + } } + btnPrintBill.Enabled = true; + } private void btnPrintKot_Click(object sender, EventArgs e) { + btnPrintKot.Enabled = false; var printed = _controller.SaveAndPrintKot(); - if (!printed) - return; - if (_controller._editVoucherID.HasValue) - this.Close(); - else + if (printed) { - ShowInfo(); - FormState = SaleFormState.Waiting; + if (_controller._editVoucherID.HasValue) + this.Close(); + else + { + ShowInfo(); + FormState = SaleFormState.Waiting; + } } + btnPrintKot.Enabled = true; } private void btnQuantity_Click(object sender, EventArgs e)