diff --git a/Sql/Changes 2014.08.08.sql b/Sql/Changes 2014.08.08.sql new file mode 100644 index 0000000..f5cf7a2 --- /dev/null +++ b/Sql/Changes 2014.08.08.sql @@ -0,0 +1,60 @@ +BEGIN TRANSACTION +SET QUOTED_IDENTIFIER ON +SET ARITHABORT ON +SET NUMERIC_ROUNDABORT OFF +SET CONCAT_NULL_YIELDS_NULL ON +SET ANSI_NULLS ON +SET ANSI_PADDING ON +SET ANSI_WARNINGS ON +ALTER TABLE dbo.Vouchers DROP CONSTRAINT FK_BasicTransactions_Users_UserID; +ALTER TABLE dbo.Vouchers DROP CONSTRAINT DF_BasicTransactions_CreationDate; +ALTER TABLE dbo.Vouchers DROP CONSTRAINT DF_BasicTransactions_LastEditDate; +CREATE TABLE dbo.Tmp_Vouchers + ( + VoucherID uniqueidentifier NOT NULL PRIMARY KEY, + Date datetime NOT NULL, + Narration nvarchar(200) NULL, + UserID uniqueidentifier NOT NULL, + CreationDate datetime NOT NULL, + LastEditDate datetime NOT NULL, + Floor int NOT NULL, + BillID nvarchar(10) NOT NULL, + KotID nvarchar(10) NOT NULL, + TableID nvarchar(10) NOT NULL, + WaiterID uniqueidentifier NOT NULL, + CustomerID uniqueidentifier NOT NULL, + AdvanceID uniqueidentifier NULL, + PaidStatus int NOT NULL, + VoidReason nvarchar(50) NULL, + Printed bit NOT NULL, + Alarm datetime NULL + ) ON [PRIMARY] +INSERT INTO dbo.Tmp_Vouchers (VoucherID, Date, Narration, UserID, CreationDate, LastEditDate, Floor, BillID, KotID, TableID, WaiterID, CustomerID, AdvanceId, PaidStatus, VoidReason, Printed, Alarm) + SELECT v.VoucherID, v.Date, v.Narration, v.UserID, v.CreationDate, v.LastEditDate, s.Floor, s.BillID, s.KotID, s.TableID, s.WaiterID, s.CustomerID, s.AdvanceId, s.PaidStatus, s.VoidReason, s.Printed, s.Alarm +FROM dbo.Vouchers v INNER JOIN dbo.SaleVoucher s ON v.VoucherID = s.VoucherID; +ALTER TABLE dbo.SaleVoucher DROP CONSTRAINT FK_SaleVoucher_Vouchers; +ALTER TABLE dbo.Inventory DROP CONSTRAINT FK_Inventory_Vouchers; +DROP TABLE dbo.SaleVoucher; +DROP TABLE dbo.Vouchers; +EXECUTE sp_rename N'dbo.Tmp_Vouchers', N'Vouchers', 'OBJECT'; +ALTER TABLE dbo.Vouchers ADD CONSTRAINT + FK_Vouchers_Users FOREIGN KEY + ( + UserID + ) REFERENCES dbo.Users + ( + UserID + ) ON UPDATE NO ACTION + ON DELETE NO ACTION + +ALTER TABLE dbo.Inventory ADD CONSTRAINT + FK_Inventory_Vouchers FOREIGN KEY + ( + VoucherID + ) REFERENCES dbo.Vouchers + ( + VoucherID + ) ON UPDATE NO ACTION + ON DELETE NO ACTION +ALTER TABLE dbo.ProductGroups DROP COLUMN IsForSale, IsForPurchase; +COMMIT diff --git a/Tanshu.Accounts.BI/AdvanceBI.cs b/Tanshu.Accounts.BI/AdvanceBI.cs deleted file mode 100644 index fde0083..0000000 --- a/Tanshu.Accounts.BI/AdvanceBI.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using Tanshu.Accounts.Contracts; - - -namespace Tanshu.Accounts.BI -{ - public class AdvanceBI - { - public void Insert(AdvanceBO advance) - { - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.AdvanceDAO(connection)) - { - dao.Insert(advance); - } - } - } - public AdvanceBO Get(Guid advanceID) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.AdvanceDAO(connection)) - { - return dao.Get(advanceID); - } - } - } - public List GetAdvances(DateTime fromDate, DateTime toDate, bool all) - { - fromDate = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 00:00:00", fromDate)); - toDate = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 23:59:59", toDate)); - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.AdvanceDAO(connection)) - { - return dao.GetAdvances(fromDate, toDate, all); - } - } - } - public void Adjust(Guid advanceID, Guid userID) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.AdvanceDAO(connection)) - { - - dao.Adjust(advanceID, userID); - } - } - } - } -} diff --git a/Tanshu.Accounts.BI/CheckoutBI.cs b/Tanshu.Accounts.BI/CheckoutBI.cs index 7def91f..24eb339 100644 --- a/Tanshu.Accounts.BI/CheckoutBI.cs +++ b/Tanshu.Accounts.BI/CheckoutBI.cs @@ -22,6 +22,7 @@ namespace Tanshu.Accounts.BI public decimal AdditionalVoids { get; private set; } public decimal VoidsInSystem { get; private set; } public decimal PendingBills { get; private set; } + public decimal NcBills { get; private set; } public decimal NetSales { get; private set; } public decimal ClosingBalance { get; private set; } public decimal RetainedOvernight { get; private set; } @@ -56,6 +57,11 @@ namespace Tanshu.Accounts.BI { get { return _voidsString; } } + private readonly string _ncString; + public string NcString + { + get { return _ncString; } + } private readonly string _discountString; public string DiscountString { @@ -100,6 +106,7 @@ namespace Tanshu.Accounts.BI Cashier = new UserBI().GetUser(CashierID).Name; PendingBills = dao.GetDetail(ref pendingString, PaidStatus.Pending, "\n\r--- Pending Bills ------------------------"); + NcBills = dao.GetDetail(ref _ncString, PaidStatus.Nc, "\n\r--- No Charge Bills ----------------------"); CreditCardReceipts = dao.GetDetail(ref creditCardString, PaidStatus.CreditCard, "\n\r--- Credit Card Bills --------------------"); VoidsInSystem = dao.GetDetail(ref _voidsString, PaidStatus.Void, "\n\r--- Void Bills ---------------------------"); StaffReceipts = dao.GetDetail(ref _staffString, PaidStatus.Staff, "\n\r--- Staff Bills --------------------------"); diff --git a/Tanshu.Accounts.BI/CustomerBI.cs b/Tanshu.Accounts.BI/CustomerBI.cs index e34ba8a..fff418c 100644 --- a/Tanshu.Accounts.BI/CustomerBI.cs +++ b/Tanshu.Accounts.BI/CustomerBI.cs @@ -8,7 +8,6 @@ namespace Tanshu.Accounts.BI { public CustomerBO GetCustomer(Guid customerID) { - using (var connection = new SqlDAO.SqlConnectionDAO()) { using (var dao = new SqlDAO.CustomerDAO(connection)) @@ -16,18 +15,6 @@ namespace Tanshu.Accounts.BI return dao.GetCustomer(customerID); } } - - } - public List GetFilteredCustomers(Dictionary filter) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.CustomerDAO(connection)) - { - return dao.GetFilteredCustomers(filter); - } - } } public List GetCustomers() { diff --git a/Tanshu.Accounts.BI/FiltersBI.cs b/Tanshu.Accounts.BI/FiltersBI.cs new file mode 100644 index 0000000..5bdf9dd --- /dev/null +++ b/Tanshu.Accounts.BI/FiltersBI.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using Tanshu.Accounts.Contracts; + +namespace Tanshu.Accounts.BI +{ + public class FiltersBI + { + public List GetFilteredCustomers(Dictionary filter) + { + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.CustomerDAO(connection)) + { + return dao.GetFilteredCustomers(filter); + } + } + } + public List GetFilteredProducts(Dictionary filter) + { + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.ProductDAO(connection)) + { + return dao.GetFilteredProducts(filter); + } + } + } + } +} diff --git a/Tanshu.Accounts.BI/MembershipBI.cs b/Tanshu.Accounts.BI/MembershipBI.cs index 8534314..7fd678c 100644 --- a/Tanshu.Accounts.BI/MembershipBI.cs +++ b/Tanshu.Accounts.BI/MembershipBI.cs @@ -7,7 +7,6 @@ namespace Tanshu.Accounts.BI { public bool ValidateUser(string name, string password) { - using (var connection = new SqlDAO.SqlConnectionDAO()) { using (var dao = new SqlDAO.MembershipDAO(connection)) diff --git a/Tanshu.Accounts.BI/ProductBI.cs b/Tanshu.Accounts.BI/ProductBI.cs deleted file mode 100644 index ac7cc30..0000000 --- a/Tanshu.Accounts.BI/ProductBI.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System; -using System.Collections.Generic; -using Tanshu.Accounts.Contracts; - -namespace Tanshu.Accounts.BI -{ - public class ProductBI - { - public bool Insert(ProductBO product) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.ProductDAO(connection)) - { - return dao.Insert(product); - } - } - } - public bool Update(ProductBO product) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.ProductDAO(connection)) - { - return dao.Update(product); - } - } - } - public bool Delete(Guid productID) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.ProductDAO(connection)) - { - return dao.Delete(productID); - } - } - } - public ProductBO GetProductFromName(string nameAndUnits) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.ProductDAO(connection)) - { - return dao.GetProduct(nameAndUnits); - } - } - } - public ProductBO GetProduct(Guid productID) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.ProductDAO(connection)) - { - return dao.GetProduct(productID); - } - } - } - public List GetProducts() - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.ProductDAO(connection)) - { - return dao.GetProducts(); - } - } - } - - public List GetFilteredProducts(Dictionary filter) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.ProductDAO(connection)) - { - return dao.GetFilteredProducts(filter); - } - } - } - - public void UpdateShortName() - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.ProductDAO(connection)) - { - dao.UpdateShortName(); - } - } - } - - public List GetUnFilteredProducts() - { - Dictionary filter = new Dictionary(); - filter.Add("Name", ""); - filter.Add("ProductGroup", ""); - return GetFilteredProducts(filter); - } - public List GetProductGroups() - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.ProductDAO(connection)) - { - return dao.GetProductGroups(); - } - } - } - public List GetTaxes() - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.ProductDAO(connection)) - { - return dao.GetTaxes(); - } - } - } - } -} diff --git a/Tanshu.Accounts.BI/SaleVoucherBI.cs b/Tanshu.Accounts.BI/SaleVoucherBI.cs deleted file mode 100644 index 41fed8f..0000000 --- a/Tanshu.Accounts.BI/SaleVoucherBI.cs +++ /dev/null @@ -1,226 +0,0 @@ -using System; -using System.Collections.Generic; -using Tanshu.Accounts.Contracts; - -namespace Tanshu.Accounts.BI -{ - public class SaleVoucherBI - { - public SalesBillItemBO GetDefaultSaleBillItem(Guid productID) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SaleVoucherMixDAO(connection)) - { - return dao.GetDefaultSaleBillItem(productID); - } - } - } - public decimal GetProductDiscountLimit(Guid productID) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SaleVoucherMixDAO(connection)) - { - return dao.GetProductDiscountLimit(productID); - } - } - } - public bool IsBillPrinted(Guid voucherID) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SaleVoucherMixDAO(connection)) - { - return dao.IsBillPrinted(voucherID); - } - } - } - public decimal Amount(Guid voucherID) - { - //throw new NotImplementedException(); - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SaleVoucherMixDAO(connection)) - { - return dao.Amount(voucherID); - } - } - } - public bool Insert(SaleVoucherBO saleVoucher, List inventory) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var vdao = new SqlDAO.VoucherDAO(connection)) - { - using (var svdao = new SqlDAO.SaleVoucherDAO(connection)) - { - using (var idao = new SqlDAO.InventoryDAO(connection)) - { - connection.BeginTransaction(); - #region Voucher - VoucherBO myVoucher = (VoucherBO)saleVoucher; - myVoucher.Date = null; - vdao.Insert(myVoucher); - #endregion - #region Transaction Sale - svdao.Insert(saleVoucher); - #endregion - #region Inventory - foreach (InventoryBO i in inventory) - { - i.VoucherID = saleVoucher.VoucherID; - InventoryBO myInventory = i; - idao.Insert(myInventory); - } - #endregion - connection.CommitTransaction(); - return true; - } - } - } - } - } - public bool Update(SaleVoucherBO saleVoucher, List inventory) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var vdao = new SqlDAO.VoucherDAO(connection)) - { - using (var svdao = new SqlDAO.SaleVoucherDAO(connection)) - { - using (var idao = new SqlDAO.InventoryDAO(connection)) - { - connection.BeginTransaction(); - #region Voucher - VoucherBO myVoucher = (VoucherBO)saleVoucher; - vdao.Update(myVoucher); - #endregion - #region Transaction Sale - svdao.Update(saleVoucher); - #endregion - #region Inventory - idao.Delete(saleVoucher.VoucherID); - foreach (InventoryBO i in inventory) - { - i.VoucherID = saleVoucher.VoucherID; - InventoryBO myInventory = i; - idao.Insert(myInventory); - } - #endregion - connection.CommitTransaction(); - return true; - } - } - } - } - } - public bool GetSaleVoucher(Guid voucherID, ref SaleVoucherBO voucherSale, ref List iList) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var svdao = new SqlDAO.SaleVoucherDAO(connection)) - { - using (var idao = new SqlDAO.InventoryDAO(connection)) - { - voucherSale = svdao.GetVoucherSale(voucherID); - iList = idao.GetInventories(voucherID); - return true; - } - } - } - } - public bool GetSaleVoucher(string billID, ref SaleVoucherBO voucherSale, ref List iList) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var svdao = new SqlDAO.SaleVoucherDAO(connection)) - { - using (var idao = new SqlDAO.InventoryDAO(connection)) - { - voucherSale = svdao.GetVoucherSale(billID); - iList = idao.GetInventories(voucherSale.VoucherID); - return true; - } - } - } - } - - public List GetPendingBills(PendingType list, int floor) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SaleVoucherMixDAO(connection)) - { - return dao.GetPendingBills(list, floor); - } - } - } - - public Guid? GetPendingVoucherID(string tableID, int floor) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SaleVoucherMixDAO(connection)) - { - return dao.GetPendingVoucherID(tableID, floor); - } - } - } - public List SaleInventory(Dictionary.ValueCollection list, Guid? voucherID) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SaleVoucherMixDAO(connection)) - { - return dao.SaleInventory(list, voucherID); - } - } - } - public void SetAlarm(Guid voucherID, DateTime? alarmTime) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SaleVoucherDAO(connection)) - { - dao.SetAlarm(voucherID, alarmTime); - } - } - } - public void VoidBill(Guid voucherID, string reason, Guid userID) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SaleVoucherDAO(connection)) - { - dao.VoidBill(voucherID, reason, userID); - } - } - } - - public void DeclareBillsPaid(Guid userID, List billList, PaidStatus paidStatus) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SaleVoucherMixDAO(connection)) - { - dao.DeclareBillsPaid(userID, billList, paidStatus); - } - } - } - } -} diff --git a/Tanshu.Accounts.BI/SalesAnalysisBI.cs b/Tanshu.Accounts.BI/SalesAnalysisBI.cs index 702ca93..ace2271 100644 --- a/Tanshu.Accounts.BI/SalesAnalysisBI.cs +++ b/Tanshu.Accounts.BI/SalesAnalysisBI.cs @@ -8,7 +8,6 @@ namespace Tanshu.Accounts.BI { public List GetSaleDetail(DateTime startDate, DateTime finishDate, Guid productGroupID) { - using (var connection = new SqlDAO.SqlConnectionDAO()) { using (var dao = new SqlDAO.SalesAnalysisDAO(connection)) @@ -29,25 +28,14 @@ namespace Tanshu.Accounts.BI } } } - public decimal GetFreeSale(DateTime startDate, DateTime finishDate) + public List GetSalesTaxReturn(DateTime startDate, DateTime finishDate, ref decimal voids, ref decimal pending, ref decimal net, ref decimal vat, ref decimal serviceTax, ref decimal nc) { using (var connection = new SqlDAO.SqlConnectionDAO()) { using (var dao = new SqlDAO.SalesAnalysisDAO(connection)) { - return dao.GetFreeSale(startDate, finishDate); - } - } - } - public List GetSalesTaxReturn(DateTime startDate, DateTime finishDate, ref decimal freeSale, ref decimal voids, ref decimal pending, ref decimal net, ref decimal tax) - { - - using (var connection = new SqlDAO.SqlConnectionDAO()) - { - using (var dao = new SqlDAO.SalesAnalysisDAO(connection)) - { - return dao.GetSalesTaxReturn(startDate, finishDate, ref freeSale, ref voids, ref pending, ref net, ref tax); + return dao.GetSalesTaxReturn(startDate, finishDate, ref voids, ref pending, ref net, ref vat, ref serviceTax, ref nc); } } } diff --git a/Tanshu.Accounts.BI/Tanshu.Accounts.BI.csproj b/Tanshu.Accounts.BI/Tanshu.Accounts.BI.csproj index edb25ac..4ec42c5 100644 --- a/Tanshu.Accounts.BI/Tanshu.Accounts.BI.csproj +++ b/Tanshu.Accounts.BI/Tanshu.Accounts.BI.csproj @@ -62,19 +62,18 @@ - + + - - diff --git a/Tanshu.Accounts.BI/VoucherBI.cs b/Tanshu.Accounts.BI/VoucherBI.cs new file mode 100644 index 0000000..20d3997 --- /dev/null +++ b/Tanshu.Accounts.BI/VoucherBI.cs @@ -0,0 +1,202 @@ +using System; +using System.Collections.Generic; +using Tanshu.Accounts.Contracts; +using Tanshu.Accounts.SqlDAO; + +namespace Tanshu.Accounts.BI +{ + public class VoucherBI + { + public VoucherBO Insert(VoucherBO voucher) + { + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var vdao = new SqlDAO.VoucherDAO(connection)) + { + using (var idao = new SqlDAO.InventoryDAO(connection)) + { + using (var advdao = new SqlDAO.AdvanceDAO(connection)) + { + connection.BeginTransaction(); + voucher.Date = null; + vdao.Insert(voucher); + foreach (var i in voucher.Inventories) + { + i.VoucherID = voucher.VoucherID; + idao.Insert(i); + } + if (voucher.AdvanceID.HasValue) + advdao.Adjust(voucher.AdvanceID.Value, CurrentUser.user.UserID); + connection.CommitTransaction(); + return GetVoucher(voucher.VoucherID); + } + } + } + } + } + public VoucherBO Update(VoucherBO voucher) + { + + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var vdao = new SqlDAO.VoucherDAO(connection)) + { + using (var idao = new SqlDAO.InventoryDAO(connection)) + { + using (var advdao = new SqlDAO.AdvanceDAO(connection)) + { + connection.BeginTransaction(); + vdao.Update(voucher); + idao.Delete(voucher.VoucherID); + foreach (InventoryBO i in voucher.Inventories) + { + i.VoucherID = voucher.VoucherID; + idao.Insert(i); + } + if (voucher.AdvanceID.HasValue) + advdao.Adjust(voucher.AdvanceID.Value, CurrentUser.user.UserID); + connection.CommitTransaction(); + return GetVoucher(voucher.VoucherID); + } + } + } + } + } + public VoucherBO GetVoucher(Guid voucherID) + { + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var vdao = new SqlDAO.VoucherDAO(connection)) + { + var voucher = new VoucherBO(); + voucher = vdao.GetVoucher(voucherID); + return FillVoucher(voucher, connection); + } + } + + } + public VoucherBO GetVoucher(string billID) + { + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var vdao = new SqlDAO.VoucherDAO(connection)) + { + var voucher = new VoucherBO(); + voucher = vdao.GetVoucher(billID); + return FillVoucher(voucher, connection); + } + } + } + private VoucherBO FillVoucher(VoucherBO voucher, SqlConnectionDAO connection) + { + using (var idao = new SqlDAO.InventoryDAO(connection)) + { + using (var adao = new SqlDAO.AdvanceDAO(connection)) + { + using (var wdao = new SqlDAO.WaiterDAO(connection)) + { + using (var udao = new SqlDAO.UserDAO(connection)) + { + using (var cdao = new SqlDAO.CustomerDAO(connection)) + { + voucher.Inventories = idao.GetInventories(voucher.VoucherID); + if (voucher.AdvanceID.HasValue) + voucher.Advance = adao.Get(voucher.AdvanceID.Value); + voucher.Waiter = wdao.GetWaiter(voucher.WaiterID); + voucher.User = udao.GetUser(voucher.UserID); + voucher.Customer = cdao.GetCustomer(voucher.CustomerID); + return voucher; + } + } + } + } + } + } + + public List GetPendingBills(PendingType list, int floor) + { + + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.VoucherDAO(connection)) + { + return dao.GetPendingBills(list, floor); + } + } + } + public Guid? GetPendingVoucherID(string tableID, int floor) + { + + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.VoucherDAO(connection)) + { + return dao.GetPendingVoucherID(tableID, floor); + } + } + } + public List SaleInventory(Dictionary.ValueCollection list, Guid? voucherID) + { + var localList = new Dictionary(); + foreach (var item in list) + { + var temp = new InventoryBO(); + if (localList.ContainsKey(item.productID)) + { + temp = localList[item.productID]; + temp.Quantity += item.Quantity; + } + else + { + if (voucherID.HasValue) + temp.VoucherID = voucherID.Value; + temp.InventoryID = Guid.NewGuid(); + temp.Discount = item.Discount; + temp.ProductID = item.productID; + temp.Quantity = item.Quantity; + temp.Rate = item.Price; + temp.Vat = item.Vat; + temp.ServiceTax = item.ServiceTax; + localList.Add(item.productID, temp); + } + } + var outList = new List(); + foreach (var item in localList) + outList.Add(item.Value); + return outList; + } + public void SetAlarm(Guid voucherID, DateTime? alarmTime) + { + + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.VoucherDAO(connection)) + { + dao.SetAlarm(voucherID, alarmTime); + } + } + } + public void VoidBill(Guid voucherID, string reason, Guid userID) + { + + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.VoucherDAO(connection)) + { + dao.VoidBill(voucherID, reason, userID); + } + } + } + public void DeclareBillsPaid(Guid userID, List billList, PaidStatus paidStatus) + { + + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.VoucherDAO(connection)) + { + dao.DeclareBillsPaid(userID, billList, paidStatus); + } + } + } + } +} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/CustomerBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/CustomerBO.cs index 95fdc89..f66ed55 100644 --- a/Tanshu.Accounts.Contracts/Data Contracts/CustomerBO.cs +++ b/Tanshu.Accounts.Contracts/Data Contracts/CustomerBO.cs @@ -6,19 +6,12 @@ namespace Tanshu.Accounts.Contracts public class CustomerBO { - public Guid CustomerID { get; set; } - public int Code { get; set; } - public string Name { get; set; } - public string Address { get; set; } - public bool Important { get; set; } - public string Phone { get; set; } - public string Remarks { get; set; } } } diff --git a/Tanshu.Accounts.Contracts/Data Contracts/InventoryBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/InventoryBO.cs index afb8bb9..db73f87 100644 --- a/Tanshu.Accounts.Contracts/Data Contracts/InventoryBO.cs +++ b/Tanshu.Accounts.Contracts/Data Contracts/InventoryBO.cs @@ -6,73 +6,66 @@ namespace Tanshu.Accounts.Contracts public class InventoryBO { - public Guid InventoryID { get; set; } - public Guid VoucherID { get; set; } - public Guid ProductID { get; set; } + public string ProductName { get; set; } private decimal quantity; - public decimal Quantity { get { return quantity; } set { quantity = value; - if (amount != null) - CalculateAmount(); + amount = null; } } - private decimal rate; + private decimal rate; public decimal Rate { get { return rate; } set { rate = value; - if (amount != null) - CalculateAmount(); + amount = null; } } - decimal vat; + decimal vat; public decimal Vat { get { return vat; } set { - vat = value; if (amount != null) - CalculateAmount(); + vat = value; + amount = null; } } - decimal serviceTax; + decimal serviceTax; public decimal ServiceTax { get { return serviceTax; } set { - serviceTax = value; if (amount != null) - CalculateAmount(); + serviceTax = value; + amount = null; } } + decimal discount; - - public decimal Discount { get { return discount; } set { - discount = value; if (amount != null) - CalculateAmount(); + discount = value; + amount = null; } } - decimal? amount; - + decimal? amount; public decimal Amount { get diff --git a/Tanshu.Accounts.Contracts/Data Contracts/InventoryDisplayBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/InventoryDisplayBO.cs deleted file mode 100644 index e42a2f7..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/InventoryDisplayBO.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Tanshu.Accounts.Contracts -{ - - public class InventoryDisplayBO : InventoryBO - { - - public string ProductName { get; set; } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/PaidStatusBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/PaidStatusBO.cs index d9d8c04..d410020 100644 --- a/Tanshu.Accounts.Contracts/Data Contracts/PaidStatusBO.cs +++ b/Tanshu.Accounts.Contracts/Data Contracts/PaidStatusBO.cs @@ -7,6 +7,7 @@ CreditCard = 3, Credit = 4, Staff = 5, - Void = 6 + Void = 6, + Nc = 7 } } diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs index 460c55d..c186bf1 100644 --- a/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs +++ b/Tanshu.Accounts.Contracts/Data Contracts/ProductBO.cs @@ -11,8 +11,8 @@ namespace Tanshu.Accounts.Contracts public string Units { get; set; } public Guid ProductGroupID { get; set; } public Guid VatID { get; set; } - public decimal SalePrice { get; set; } public Guid ServiceTaxID { get; set; } + public decimal SalePrice { get; set; } public bool Discontinued { get; set; } public int SortOrder { get; set; } } diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductDisplaySmallBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductDisplaySmallBO.cs index 50ccf23..12e3681 100644 --- a/Tanshu.Accounts.Contracts/Data Contracts/ProductDisplaySmallBO.cs +++ b/Tanshu.Accounts.Contracts/Data Contracts/ProductDisplaySmallBO.cs @@ -5,12 +5,12 @@ namespace Tanshu.Accounts.Contracts { public class ProductDisplaySmallBO { + public Guid ProductID { get; set; } public int Code { get; set; } public string Name { get; set; } public decimal Price { get; set; } public string ProuctGroup { get; set; } public string Vat { get; set; } public string ServiceTax { get; set; } - public Guid ProductID { get; set; } } } diff --git a/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs index 4d20356..a250a0a 100644 --- a/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs +++ b/Tanshu.Accounts.Contracts/Data Contracts/ProductGroupBO.cs @@ -8,7 +8,5 @@ namespace Tanshu.Accounts.Contracts public Guid ProductGroupID { get; set; } public string Name { get; set; } public decimal DiscountLimit { get; set; } - public bool IsForSale { get; set; } - public bool IsForPurchae { get; set; } } } diff --git a/Tanshu.Accounts.Contracts/Data Contracts/SaleVoucherBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/SaleVoucherBO.cs deleted file mode 100644 index 3bd5b92..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/SaleVoucherBO.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Tanshu.Accounts.Contracts -{ - public class SaleVoucherBO : VoucherBO - { - public int Floor { get; set; } - public string BillID { get; set; } - public string TableID { get; set; } - public Guid WaiterID { get; set; } - public Guid CustomerID { get; set; } - public Guid? AdvanceID { get; set; } - public PaidStatus PaidStatus { get; set; } - public string VoidReason { get; set; } - public bool Printed { get; set; } - public DateTime? Alarm { get; set; } - public string KotID { get; set; } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/SalesBillItemBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/SalesBillItemBO.cs index 96e879d..20074cf 100644 --- a/Tanshu.Accounts.Contracts/Data Contracts/SalesBillItemBO.cs +++ b/Tanshu.Accounts.Contracts/Data Contracts/SalesBillItemBO.cs @@ -6,13 +6,10 @@ namespace Tanshu.Accounts.Contracts public class SalesBillItemBO { - public Guid productID; - public string Name { get; set; } private decimal price; - public decimal Price { get { return price; } @@ -26,7 +23,6 @@ namespace Tanshu.Accounts.Contracts } private decimal quantity = 1; - public decimal Quantity { get { return quantity; } @@ -40,7 +36,6 @@ namespace Tanshu.Accounts.Contracts } private decimal discount = 0; - public decimal Discount { get { return discount; } @@ -57,22 +52,20 @@ namespace Tanshu.Accounts.Contracts public decimal Vat { get; set; } - public decimal VatAmount { get { - return quantity * price * Vat * (1 - discount); + return quantity * price * (1 - discount) * Vat; } } public decimal ServiceTax { get; set; } - public decimal ServiceTaxAmount { get { - return quantity * price * ServiceTax * (1 - discount); + return quantity * price * (1 - discount) * ServiceTax; } } public decimal TotalTax @@ -100,7 +93,6 @@ namespace Tanshu.Accounts.Contracts } private decimal printed = 0; - public decimal Printed { get { return printed; } @@ -113,13 +105,11 @@ namespace Tanshu.Accounts.Contracts } } - public string location; - public decimal Value { get { - return price * quantity * (1 - discount) * (1 + Vat + ServiceTax ); + return price * quantity * (1 - discount) * (1 + Vat + ServiceTax); } } public decimal Additional diff --git a/Tanshu.Accounts.Contracts/Data Contracts/VerificationBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/VerificationBO.cs deleted file mode 100644 index 706451d..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/VerificationBO.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Tanshu.Accounts.Contracts -{ - public class VerificationBO - { - public Guid VerificationID { get; set; } - public Guid VoucherID { get; set; } - public Guid ProductID { get; set; } - public decimal ActualQuantity { get; set; } - public decimal ComputedQuantity { get; set; } - public decimal LostQuantity - { - get { return ComputedQuantity - ActualQuantity; } - } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/VerificationDisplayBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/VerificationDisplayBO.cs deleted file mode 100644 index 8df296d..0000000 --- a/Tanshu.Accounts.Contracts/Data Contracts/VerificationDisplayBO.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Tanshu.Accounts.Contracts -{ - public class VerificationDisplayBO : VerificationBO - { - public string ProductName { get; set; } - } -} diff --git a/Tanshu.Accounts.Contracts/Data Contracts/VoucherBO.cs b/Tanshu.Accounts.Contracts/Data Contracts/VoucherBO.cs index 725bd73..87726fe 100644 --- a/Tanshu.Accounts.Contracts/Data Contracts/VoucherBO.cs +++ b/Tanshu.Accounts.Contracts/Data Contracts/VoucherBO.cs @@ -1,24 +1,51 @@ using System; using System.Runtime.Serialization; +using System.Collections.Generic; namespace Tanshu.Accounts.Contracts { public class VoucherBO { - public Guid VoucherID { get; set; } - - public int Code { get; set; } - public DateTime? Date { get; set; } - public string Narration { get; set; } - public Guid UserID { get; set; } - public DateTime CreationDate { get; set; } - public DateTime LastEditDate { get; set; } + + public int Floor { get; set; } + public string BillID { get; set; } + public string TableID { get; set; } + public Guid WaiterID { get; set; } + public Guid CustomerID { get; set; } + public Guid? AdvanceID { get; set; } + public PaidStatus PaidStatus { get; set; } + public string VoidReason { get; set; } + public bool Printed { get; set; } + public DateTime? Alarm { get; set; } + public string KotID { get; set; } + + public IList Inventories { get; set; } + public AdvanceBO Advance { get; set; } + public WaiterBO Waiter { get; set; } + public UserBO User { get; set; } + public CustomerBO Customer { get; set; } + public decimal Amount + { + get + { + decimal amount = 0; + foreach (var inv in Inventories) + { + amount += inv.Amount; + } + if (AdvanceID.HasValue) + { + amount -= Advance.Amount; + } + return amount; + } + } } } diff --git a/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj b/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj index 61f4bc7..8bdfb5c 100644 --- a/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj +++ b/Tanshu.Accounts.Contracts/Tanshu.Accounts.Contracts.csproj @@ -59,12 +59,9 @@ - - - @@ -75,7 +72,6 @@ - diff --git a/Tanshu.Accounts.PointOfSale/MainForm.cs b/Tanshu.Accounts.PointOfSale/MainForm.cs index aab7c41..82052f8 100644 --- a/Tanshu.Accounts.PointOfSale/MainForm.cs +++ b/Tanshu.Accounts.PointOfSale/MainForm.cs @@ -48,7 +48,13 @@ namespace Tanshu.Accounts.PointOfSale } else { - new ProductBI().UpdateShortName(); + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.ProductDAO(connection)) + { + dao.UpdateShortName(); + } + } using (var frmSale = new SalesForm()) frmSale.ShowDialog(); } @@ -208,7 +214,7 @@ namespace Tanshu.Accounts.PointOfSale } else { - using (SelectProduct selectProduct = new SelectProduct(new ProductBI().GetFilteredProducts, false)) + using (SelectProduct selectProduct = new SelectProduct(new FiltersBI().GetFilteredProducts, false)) { selectProduct.productEvent += new ProductEventHandler(selectProduct_productEvent); selectProduct.ShowDialog(); diff --git a/Tanshu.Accounts.PointOfSale/ProductsForm.cs b/Tanshu.Accounts.PointOfSale/ProductsForm.cs index 97a40cd..df49c96 100644 --- a/Tanshu.Accounts.PointOfSale/ProductsForm.cs +++ b/Tanshu.Accounts.PointOfSale/ProductsForm.cs @@ -27,7 +27,14 @@ namespace Tanshu.Accounts.PointOfSale FillCombos(); if (_productID.HasValue) { - product = new ProductBI().GetProduct(_productID.Value); + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.ProductDAO(connection)) + { + product = dao.GetProduct(_productID.Value); + } + } + txtUniqueID.Text = product.Code.ToString(); txtName.Text = product.Name; cmbUnits.SelectedItem = product.Units; @@ -50,9 +57,15 @@ namespace Tanshu.Accounts.PointOfSale { string[] units = { "Can", "Gms", "Rs.", "Piece", "Liter", "Plate", "Kg.", "Bottle", "Pack" }; bsUnits.DataSource = units; - bsProductGroups.DataSource = new ProductBI().GetProductGroups(); - bsVat.DataSource = new ProductBI().GetTaxes(); - bsServiceTax.DataSource = new ProductBI().GetTaxes(); + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.ProductDAO(connection)) + { + bsProductGroups.DataSource = dao.GetProductGroups(); + bsVat.DataSource = dao.GetTaxes(); + bsServiceTax.DataSource = dao.GetTaxes(); + } + } } #endregion @@ -62,9 +75,16 @@ namespace Tanshu.Accounts.PointOfSale if (MessageBox.Show("Are you sure?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.Yes) return; - if (new ProductBI().Delete(product.ProductID)) + + using (var connection = new SqlDAO.SqlConnectionDAO()) { - btnCancel_Click(sender, e); + using (var dao = new SqlDAO.ProductDAO(connection)) + { + if (dao.Delete(product.ProductID)) + { + btnCancel_Click(sender, e); + } + } } } @@ -105,10 +125,16 @@ namespace Tanshu.Accounts.PointOfSale product.ServiceTaxID = new Guid(cmbServiceTax.SelectedValue.ToString()); product.Discontinued = chkDiscontinued.Checked; product.VatID = new Guid(cmbVat.SelectedValue.ToString()); - if (product.ProductID == new Guid()) - new ProductBI().Insert(product); - else - new ProductBI().Update(product); + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.ProductDAO(connection)) + { + if (product.ProductID == new Guid()) + dao.Insert(product); + else + dao.Update(product); + } + } } #endregion diff --git a/Tanshu.Accounts.PointOfSale/ProductsForm.resx b/Tanshu.Accounts.PointOfSale/ProductsForm.resx index 2f9ede6..c7837ab 100644 --- a/Tanshu.Accounts.PointOfSale/ProductsForm.resx +++ b/Tanshu.Accounts.PointOfSale/ProductsForm.resx @@ -120,16 +120,25 @@ 251, 17 + + 251, 17 + - 123, 17 + 29, 15 + + + 29, 15 - 145, 54 + 132, 16 - 438, 54 + 434, 13 + + + 434, 13 - 102 + 65 \ No newline at end of file diff --git a/Tanshu.Accounts.PointOfSale/Sales/AdjustAdvanceForm.cs b/Tanshu.Accounts.PointOfSale/Sales/AdjustAdvanceForm.cs index c7e1787..881f3c3 100644 --- a/Tanshu.Accounts.PointOfSale/Sales/AdjustAdvanceForm.cs +++ b/Tanshu.Accounts.PointOfSale/Sales/AdjustAdvanceForm.cs @@ -29,7 +29,15 @@ namespace Tanshu.Accounts.PointOfSale } private void FillDataGrid() { - dgExpenses.DataSource = new AdvanceBI().GetAdvances(dtpFrom.Value, dtpTo.Value, false); + var fromDate = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 00:00:00", dtpFrom.Value)); + var toDate = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 23:59:59", dtpTo.Value)); + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.AdvanceDAO(connection)) + { + dgExpenses.DataSource = dao.GetAdvances(fromDate, toDate, false); + } + } } private void dtpFrom_ValueChanged(object sender, EventArgs e) { @@ -61,7 +69,13 @@ namespace Tanshu.Accounts.PointOfSale } else { - new AdvanceBI().Adjust((Guid)txtNarration.Tag, CurrentUser.user.UserID); + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.AdvanceDAO(connection)) + { + dao.Adjust((Guid)txtNarration.Tag, CurrentUser.user.UserID); + } + } FillDataGrid(); } } diff --git a/Tanshu.Accounts.PointOfSale/Sales/BillHelperFunctions.cs b/Tanshu.Accounts.PointOfSale/Sales/BillHelperFunctions.cs index 37c8608..dda94f6 100644 --- a/Tanshu.Accounts.PointOfSale/Sales/BillHelperFunctions.cs +++ b/Tanshu.Accounts.PointOfSale/Sales/BillHelperFunctions.cs @@ -30,7 +30,20 @@ namespace Tanshu.Accounts.PointOfSale #endregion #region Max Discount - var maxDiscount = new SaleVoucherBI().GetProductDiscountLimit(productID); + decimal maxDiscount; + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.ProductDAO(connection)) + { + maxDiscount = dao.GetProductDiscountLimit(productID); + } + } + + if (discount >= 1) + { + MessageBox.Show(string.Format("Discount cannot be 100% or more", maxDiscount), "100% Discount", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } if (discount > maxDiscount) { if (Thread.CurrentPrincipal.IsInRole("High Discount Allowed")) @@ -107,7 +120,14 @@ namespace Tanshu.Accounts.PointOfSale private static SalesBillItemBO AddNewProduct(Guid productID, BindingSource bindingSource, Dictionary bill) { BillItemKey key = new BillItemKey(productID, true); - SalesBillItemBO product = new SaleVoucherBI().GetDefaultSaleBillItem(productID); + SalesBillItemBO product; + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.ProductDAO(connection)) + { + product = dao.GetDefaultSaleBillItem(productID); + } + } product.Quantity = 1; bill.Add(key, product); bindingSource.DataSource = bill.Values; diff --git a/Tanshu.Accounts.PointOfSale/Sales/RecieveAdvanceForm.cs b/Tanshu.Accounts.PointOfSale/Sales/RecieveAdvanceForm.cs index 496abe4..b0278be 100644 --- a/Tanshu.Accounts.PointOfSale/Sales/RecieveAdvanceForm.cs +++ b/Tanshu.Accounts.PointOfSale/Sales/RecieveAdvanceForm.cs @@ -33,7 +33,13 @@ namespace Tanshu.Accounts.PointOfSale } else { - new AdvanceBI().Insert(adv); + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.AdvanceDAO(connection)) + { + dao.Insert(adv); + } + } GridBind(); PrintAdvances(); } @@ -56,8 +62,15 @@ namespace Tanshu.Accounts.PointOfSale private void GridBind() { - var advance = new AdvanceBI().GetAdvances(dtpFrom.Value, dtpTo.Value, true); - dgExpenses.DataSource = advance; + var fromDate = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 00:00:00", dtpFrom.Value)); + var toDate = Convert.ToDateTime(string.Format("{0:dd-MMM-yyyy} 23:59:59", dtpTo.Value)); + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.AdvanceDAO(connection)) + { + dgExpenses.DataSource = dao.GetAdvances(fromDate, toDate, true); + } + } } private void dtpFrom_ValueChanged(object sender, EventArgs e) diff --git a/Tanshu.Accounts.PointOfSale/Sales/SaleAnalysisForm.cs b/Tanshu.Accounts.PointOfSale/Sales/SaleAnalysisForm.cs index f342e42..b5e93cc 100644 --- a/Tanshu.Accounts.PointOfSale/Sales/SaleAnalysisForm.cs +++ b/Tanshu.Accounts.PointOfSale/Sales/SaleAnalysisForm.cs @@ -48,11 +48,6 @@ namespace Tanshu.Accounts.PointOfSale dgvSale.Columns[2].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0"; dgvSale.Columns[3].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0"; } - - - decimal freeSale = new SalesAnalysisBI().GetFreeSale(startDate, finishDate); - - txtFreeSale.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", freeSale); } private void dtpFinish_ValueChanged(object sender, EventArgs e) diff --git a/Tanshu.Accounts.PointOfSale/Sales/SaleAnalysisForm.designer.cs b/Tanshu.Accounts.PointOfSale/Sales/SaleAnalysisForm.designer.cs index b50abab..3ef4805 100644 --- a/Tanshu.Accounts.PointOfSale/Sales/SaleAnalysisForm.designer.cs +++ b/Tanshu.Accounts.PointOfSale/Sales/SaleAnalysisForm.designer.cs @@ -28,8 +28,6 @@ /// private void InitializeComponent() { - this.txtFreeSale = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); this.dgvSale = new System.Windows.Forms.DataGridView(); this.dtpFinish = new System.Windows.Forms.DateTimePicker(); this.dtpStart = new System.Windows.Forms.DateTimePicker(); @@ -39,23 +37,6 @@ ((System.ComponentModel.ISupportInitialize)(this.dgvSale)).BeginInit(); this.SuspendLayout(); // - // txtFreeSale - // - this.txtFreeSale.Location = new System.Drawing.Point(12, 487); - this.txtFreeSale.Name = "txtFreeSale"; - this.txtFreeSale.ReadOnly = true; - this.txtFreeSale.Size = new System.Drawing.Size(100, 20); - this.txtFreeSale.TabIndex = 15; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(12, 471); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(52, 13); - this.label4.TabIndex = 23; - this.label4.Text = "Free Sale"; - // // dgvSale // this.dgvSale.AllowUserToAddRows = false; @@ -127,11 +108,9 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(548, 519); + this.ClientSize = new System.Drawing.Size(548, 478); this.Controls.Add(this.btnCopy); this.Controls.Add(this.btnPrint); - this.Controls.Add(this.txtFreeSale); - this.Controls.Add(this.label4); this.Controls.Add(this.dgvSale); this.Controls.Add(this.dtpFinish); this.Controls.Add(this.dtpStart); @@ -149,8 +128,6 @@ #endregion - private System.Windows.Forms.TextBox txtFreeSale; - private System.Windows.Forms.Label label4; private System.Windows.Forms.DataGridView dgvSale; private System.Windows.Forms.DateTimePicker dtpFinish; private System.Windows.Forms.DateTimePicker dtpStart; diff --git a/Tanshu.Accounts.PointOfSale/Sales/SalesForm.Designer.cs b/Tanshu.Accounts.PointOfSale/Sales/SalesForm.Designer.cs index 1d824a5..00f0e27 100644 --- a/Tanshu.Accounts.PointOfSale/Sales/SalesForm.Designer.cs +++ b/Tanshu.Accounts.PointOfSale/Sales/SalesForm.Designer.cs @@ -43,6 +43,9 @@ this.txtGrossTax = new System.Windows.Forms.TextBox(); this.dgvProducts = new System.Windows.Forms.DataGridView(); this.Display = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.printedDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.additionalDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.bindingSource = new System.Windows.Forms.BindingSource(this.components); this.pnlBilling = new System.Windows.Forms.Panel(); this.btnAdvance = new System.Windows.Forms.Button(); this.btnResetCustomer = new System.Windows.Forms.Button(); @@ -75,7 +78,19 @@ this.btnPaidCredit = new System.Windows.Forms.Button(); this.dgvPending = new System.Windows.Forms.DataGridView(); this.selectDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.billNoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.kotDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.TableID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.amountDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.importantDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.alarmDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.bookingTimeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.lastEditedDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.waiterDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.cashierDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.printedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.alarmTimeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.bsPending = new System.Windows.Forms.BindingSource(this.components); this.btnAlarm = new System.Windows.Forms.Button(); this.chkRefresh = new System.Windows.Forms.CheckBox(); this.btnRefresh = new System.Windows.Forms.Button(); @@ -90,29 +105,15 @@ this.tpAll = new System.Windows.Forms.TabPage(); this.tpAlarm = new System.Windows.Forms.TabPage(); this.lblUser = new System.Windows.Forms.Label(); - this.billNoDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.kotDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.amountDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.importantDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.alarmDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.bookingTimeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.lastEditedDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.waiterDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.cashierDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.printedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.alarmTimeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.bsPending = new System.Windows.Forms.BindingSource(this.components); - this.printedDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.additionalDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.bindingSource = new System.Windows.Forms.BindingSource(this.components); this.bsWaiter = new System.Windows.Forms.BindingSource(this.components); + this.btnPaidNc = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.dgvProducts)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit(); this.pnlBilling.SuspendLayout(); this.pnlWaiting.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvPending)).BeginInit(); - this.tcPending.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.bsPending)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit(); + this.tcPending.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.bsWaiter)).BeginInit(); this.SuspendLayout(); // @@ -126,10 +127,9 @@ // this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(1060, 636); - this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label7.Location = new System.Drawing.Point(795, 517); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(63, 17); + this.label7.Size = new System.Drawing.Size(49, 13); this.label7.TabIndex = 112; this.label7.Text = "Discount"; this.label7.TextAlign = System.Drawing.ContentAlignment.TopRight; @@ -137,11 +137,10 @@ // txtDiscount // this.txtDiscount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.txtDiscount.Location = new System.Drawing.Point(1133, 633); - this.txtDiscount.Margin = new System.Windows.Forms.Padding(4); + this.txtDiscount.Location = new System.Drawing.Point(850, 514); this.txtDiscount.Name = "txtDiscount"; this.txtDiscount.ReadOnly = true; - this.txtDiscount.Size = new System.Drawing.Size(159, 22); + this.txtDiscount.Size = new System.Drawing.Size(120, 20); this.txtDiscount.TabIndex = 113; this.txtDiscount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // @@ -150,10 +149,9 @@ this.Label12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.Label12.AutoSize = true; this.Label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Label12.Location = new System.Drawing.Point(1077, 700); - this.Label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.Label12.Location = new System.Drawing.Point(808, 569); this.Label12.Name = "Label12"; - this.Label12.Size = new System.Drawing.Size(45, 17); + this.Label12.Size = new System.Drawing.Size(36, 13); this.Label12.TabIndex = 116; this.Label12.Text = "Total"; this.Label12.TextAlign = System.Drawing.ContentAlignment.TopRight; @@ -161,11 +159,10 @@ // txtGrossAmount // this.txtGrossAmount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.txtGrossAmount.Location = new System.Drawing.Point(1133, 665); - this.txtGrossAmount.Margin = new System.Windows.Forms.Padding(4); + this.txtGrossAmount.Location = new System.Drawing.Point(850, 540); this.txtGrossAmount.Name = "txtGrossAmount"; this.txtGrossAmount.ReadOnly = true; - this.txtGrossAmount.Size = new System.Drawing.Size(159, 22); + this.txtGrossAmount.Size = new System.Drawing.Size(120, 20); this.txtGrossAmount.TabIndex = 109; this.txtGrossAmount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // @@ -175,11 +172,10 @@ this.txtAmount.BackColor = System.Drawing.Color.Black; this.txtAmount.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtAmount.ForeColor = System.Drawing.Color.Transparent; - this.txtAmount.Location = new System.Drawing.Point(1133, 697); - this.txtAmount.Margin = new System.Windows.Forms.Padding(4); + this.txtAmount.Location = new System.Drawing.Point(850, 566); this.txtAmount.Name = "txtAmount"; this.txtAmount.ReadOnly = true; - this.txtAmount.Size = new System.Drawing.Size(159, 26); + this.txtAmount.Size = new System.Drawing.Size(120, 22); this.txtAmount.TabIndex = 107; this.txtAmount.Text = "0.00"; this.txtAmount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; @@ -188,10 +184,9 @@ // this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(1067, 668); - this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label6.Location = new System.Drawing.Point(800, 543); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(60, 17); + this.label6.Size = new System.Drawing.Size(46, 13); this.label6.TabIndex = 108; this.label6.Text = "Subtotal"; this.label6.TextAlign = System.Drawing.ContentAlignment.TopRight; @@ -200,31 +195,28 @@ // this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(1077, 601); - this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label5.Location = new System.Drawing.Point(808, 488); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(46, 17); + this.label5.Size = new System.Drawing.Size(36, 13); this.label5.TabIndex = 110; this.label5.Text = "Taxes"; this.label5.TextAlign = System.Drawing.ContentAlignment.TopRight; // // txtNarration // - this.txtNarration.Location = new System.Drawing.Point(16, 593); - this.txtNarration.Margin = new System.Windows.Forms.Padding(4); + this.txtNarration.Location = new System.Drawing.Point(12, 482); this.txtNarration.Multiline = true; this.txtNarration.Name = "txtNarration"; - this.txtNarration.Size = new System.Drawing.Size(287, 130); + this.txtNarration.Size = new System.Drawing.Size(216, 106); this.txtNarration.TabIndex = 4; // // txtGrossTax // this.txtGrossTax.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.txtGrossTax.Location = new System.Drawing.Point(1133, 601); - this.txtGrossTax.Margin = new System.Windows.Forms.Padding(4); + this.txtGrossTax.Location = new System.Drawing.Point(850, 488); this.txtGrossTax.Name = "txtGrossTax"; this.txtGrossTax.ReadOnly = true; - this.txtGrossTax.Size = new System.Drawing.Size(159, 22); + this.txtGrossTax.Size = new System.Drawing.Size(120, 20); this.txtGrossTax.TabIndex = 111; this.txtGrossTax.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // @@ -246,14 +238,13 @@ this.additionalDataGridViewTextBoxColumn}); this.dgvProducts.DataSource = this.bindingSource; this.dgvProducts.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.dgvProducts.Location = new System.Drawing.Point(16, 111); - this.dgvProducts.Margin = new System.Windows.Forms.Padding(4); + this.dgvProducts.Location = new System.Drawing.Point(12, 90); this.dgvProducts.MultiSelect = false; this.dgvProducts.Name = "dgvProducts"; this.dgvProducts.RowHeadersVisible = false; this.dgvProducts.RowTemplate.Height = 19; this.dgvProducts.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgvProducts.Size = new System.Drawing.Size(628, 475); + this.dgvProducts.Size = new System.Drawing.Size(471, 386); this.dgvProducts.TabIndex = 0; this.dgvProducts.VirtualMode = true; this.dgvProducts.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvProducts_CellFormatting); @@ -266,6 +257,31 @@ this.Display.ReadOnly = true; this.Display.Width = 5; // + // printedDataGridViewTextBoxColumn + // + this.printedDataGridViewTextBoxColumn.DataPropertyName = "Printed"; + dataGridViewCellStyle3.Format = "N2"; + this.printedDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle3; + this.printedDataGridViewTextBoxColumn.HeaderText = "Printed"; + this.printedDataGridViewTextBoxColumn.Name = "printedDataGridViewTextBoxColumn"; + this.printedDataGridViewTextBoxColumn.ReadOnly = true; + this.printedDataGridViewTextBoxColumn.Width = 5; + // + // additionalDataGridViewTextBoxColumn + // + this.additionalDataGridViewTextBoxColumn.DataPropertyName = "Additional"; + dataGridViewCellStyle4.Format = "N2"; + dataGridViewCellStyle4.NullValue = null; + this.additionalDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle4; + this.additionalDataGridViewTextBoxColumn.HeaderText = "Additional"; + this.additionalDataGridViewTextBoxColumn.Name = "additionalDataGridViewTextBoxColumn"; + this.additionalDataGridViewTextBoxColumn.ReadOnly = true; + this.additionalDataGridViewTextBoxColumn.Width = 5; + // + // bindingSource + // + this.bindingSource.DataSource = typeof(Tanshu.Accounts.Contracts.SalesBillItemBO); + // // pnlBilling // this.pnlBilling.AutoSize = true; @@ -308,17 +324,15 @@ this.pnlBilling.Controls.Add(this.label7); this.pnlBilling.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlBilling.Location = new System.Drawing.Point(0, 0); - this.pnlBilling.Margin = new System.Windows.Forms.Padding(4); this.pnlBilling.Name = "pnlBilling"; - this.pnlBilling.Size = new System.Drawing.Size(1309, 815); + this.pnlBilling.Size = new System.Drawing.Size(982, 662); this.pnlBilling.TabIndex = 121; // // btnAdvance // - this.btnAdvance.Location = new System.Drawing.Point(455, 668); - this.btnAdvance.Margin = new System.Windows.Forms.Padding(4); + this.btnAdvance.Location = new System.Drawing.Point(341, 543); this.btnAdvance.Name = "btnAdvance"; - this.btnAdvance.Size = new System.Drawing.Size(135, 55); + this.btnAdvance.Size = new System.Drawing.Size(101, 45); this.btnAdvance.TabIndex = 152; this.btnAdvance.Text = "Advance - F10"; this.btnAdvance.UseVisualStyleBackColor = true; @@ -328,20 +342,18 @@ // this.btnResetCustomer.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnResetCustomer.ForeColor = System.Drawing.Color.Red; - this.btnResetCustomer.Location = new System.Drawing.Point(652, 66); - this.btnResetCustomer.Margin = new System.Windows.Forms.Padding(4); + this.btnResetCustomer.Location = new System.Drawing.Point(489, 54); this.btnResetCustomer.Name = "btnResetCustomer"; - this.btnResetCustomer.Size = new System.Drawing.Size(48, 42); + this.btnResetCustomer.Size = new System.Drawing.Size(36, 34); this.btnResetCustomer.TabIndex = 151; this.btnResetCustomer.UseVisualStyleBackColor = true; this.btnResetCustomer.Click += new System.EventHandler(this.btnResetCustomer_Click); // // btnWaiter // - this.btnWaiter.Location = new System.Drawing.Point(455, 593); - this.btnWaiter.Margin = new System.Windows.Forms.Padding(4); + this.btnWaiter.Location = new System.Drawing.Point(341, 482); this.btnWaiter.Name = "btnWaiter"; - this.btnWaiter.Size = new System.Drawing.Size(135, 68); + this.btnWaiter.Size = new System.Drawing.Size(101, 55); this.btnWaiter.TabIndex = 150; this.btnWaiter.Text = "Select Waiter - F5"; this.btnWaiter.UseVisualStyleBackColor = true; @@ -349,18 +361,16 @@ // // txtCode // - this.txtCode.Location = new System.Drawing.Point(708, 66); - this.txtCode.Margin = new System.Windows.Forms.Padding(4); + this.txtCode.Location = new System.Drawing.Point(531, 54); this.txtCode.Name = "txtCode"; - this.txtCode.Size = new System.Drawing.Size(584, 22); + this.txtCode.Size = new System.Drawing.Size(439, 20); this.txtCode.TabIndex = 149; // // btnClear // - this.btnClear.Location = new System.Drawing.Point(312, 593); - this.btnClear.Margin = new System.Windows.Forms.Padding(4); + this.btnClear.Location = new System.Drawing.Point(234, 482); this.btnClear.Name = "btnClear"; - this.btnClear.Size = new System.Drawing.Size(135, 130); + this.btnClear.Size = new System.Drawing.Size(101, 106); this.btnClear.TabIndex = 148; this.btnClear.Text = "Clear - Esc"; this.btnClear.UseVisualStyleBackColor = true; @@ -368,10 +378,9 @@ // // btnRate // - this.btnRate.Location = new System.Drawing.Point(884, 697); - this.btnRate.Margin = new System.Windows.Forms.Padding(4); + this.btnRate.Location = new System.Drawing.Point(663, 566); this.btnRate.Name = "btnRate"; - this.btnRate.Size = new System.Drawing.Size(139, 28); + this.btnRate.Size = new System.Drawing.Size(104, 23); this.btnRate.TabIndex = 146; this.btnRate.Text = "&Rate"; this.btnRate.UseVisualStyleBackColor = true; @@ -379,10 +388,9 @@ // // btnPrintKot // - this.btnPrintKot.Location = new System.Drawing.Point(740, 593); - this.btnPrintKot.Margin = new System.Windows.Forms.Padding(4); + this.btnPrintKot.Location = new System.Drawing.Point(555, 482); this.btnPrintKot.Name = "btnPrintKot"; - this.btnPrintKot.Size = new System.Drawing.Size(136, 130); + this.btnPrintKot.Size = new System.Drawing.Size(102, 106); this.btnPrintKot.TabIndex = 145; this.btnPrintKot.Text = "Print KOT - F12"; this.btnPrintKot.UseVisualStyleBackColor = true; @@ -390,10 +398,9 @@ // // btnPrintBill // - this.btnPrintBill.Location = new System.Drawing.Point(597, 593); - this.btnPrintBill.Margin = new System.Windows.Forms.Padding(4); + this.btnPrintBill.Location = new System.Drawing.Point(448, 482); this.btnPrintBill.Name = "btnPrintBill"; - this.btnPrintBill.Size = new System.Drawing.Size(135, 130); + this.btnPrintBill.Size = new System.Drawing.Size(101, 106); this.btnPrintBill.TabIndex = 144; this.btnPrintBill.Text = "Print Bill - F11"; this.btnPrintBill.UseVisualStyleBackColor = true; @@ -401,10 +408,9 @@ // // btnVoid // - this.btnVoid.Location = new System.Drawing.Point(884, 597); - this.btnVoid.Margin = new System.Windows.Forms.Padding(4); + this.btnVoid.Location = new System.Drawing.Point(663, 485); this.btnVoid.Name = "btnVoid"; - this.btnVoid.Size = new System.Drawing.Size(139, 28); + this.btnVoid.Size = new System.Drawing.Size(104, 23); this.btnVoid.TabIndex = 143; this.btnVoid.Text = "Cancel Current Bill"; this.btnVoid.UseVisualStyleBackColor = true; @@ -412,10 +418,9 @@ // // btnDiscount // - this.btnDiscount.Location = new System.Drawing.Point(884, 633); - this.btnDiscount.Margin = new System.Windows.Forms.Padding(4); + this.btnDiscount.Location = new System.Drawing.Point(663, 514); this.btnDiscount.Name = "btnDiscount"; - this.btnDiscount.Size = new System.Drawing.Size(139, 28); + this.btnDiscount.Size = new System.Drawing.Size(104, 23); this.btnDiscount.TabIndex = 142; this.btnDiscount.Text = "Discount - F3"; this.btnDiscount.UseVisualStyleBackColor = true; @@ -423,10 +428,9 @@ // // btnQuantity // - this.btnQuantity.Location = new System.Drawing.Point(884, 661); - this.btnQuantity.Margin = new System.Windows.Forms.Padding(4); + this.btnQuantity.Location = new System.Drawing.Point(663, 537); this.btnQuantity.Name = "btnQuantity"; - this.btnQuantity.Size = new System.Drawing.Size(139, 28); + this.btnQuantity.Size = new System.Drawing.Size(104, 23); this.btnQuantity.TabIndex = 141; this.btnQuantity.Text = "Quantity - F2"; this.btnQuantity.UseVisualStyleBackColor = true; @@ -434,145 +438,130 @@ // // txtTableID // - this.txtTableID.Location = new System.Drawing.Point(520, 34); - this.txtTableID.Margin = new System.Windows.Forms.Padding(4); + this.txtTableID.Location = new System.Drawing.Point(390, 28); this.txtTableID.Name = "txtTableID"; this.txtTableID.ReadOnly = true; - this.txtTableID.Size = new System.Drawing.Size(123, 22); + this.txtTableID.Size = new System.Drawing.Size(93, 20); this.txtTableID.TabIndex = 140; // // label11 // this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(516, 15); - this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label11.Location = new System.Drawing.Point(387, 12); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(44, 17); + this.label11.Size = new System.Drawing.Size(34, 13); this.label11.TabIndex = 139; this.label11.Text = "Table"; // // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(1072, 15); - this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label10.Location = new System.Drawing.Point(804, 12); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(97, 17); + this.label10.Size = new System.Drawing.Size(73, 13); this.label10.TabIndex = 138; this.label10.Text = "Last Edit User"; // // txtUserID // - this.txtUserID.Location = new System.Drawing.Point(1076, 34); - this.txtUserID.Margin = new System.Windows.Forms.Padding(4); + this.txtUserID.Location = new System.Drawing.Point(807, 28); this.txtUserID.Name = "txtUserID"; this.txtUserID.ReadOnly = true; - this.txtUserID.Size = new System.Drawing.Size(216, 22); + this.txtUserID.Size = new System.Drawing.Size(163, 20); this.txtUserID.TabIndex = 137; // // label9 // this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(345, 15); - this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label9.Location = new System.Drawing.Point(259, 12); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(94, 17); + this.label9.Size = new System.Drawing.Size(72, 13); this.label9.TabIndex = 136; this.label9.Text = "Booking Time"; // // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(648, 15); - this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label8.Location = new System.Drawing.Point(486, 12); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(113, 17); + this.label8.Size = new System.Drawing.Size(84, 13); this.label8.TabIndex = 135; this.label8.Text = "Bill Printing Time"; // // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(860, 15); - this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label4.Location = new System.Drawing.Point(645, 12); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(98, 17); + this.label4.Size = new System.Drawing.Size(74, 13); this.label4.TabIndex = 134; this.label4.Text = "Last Edit Time"; // // txtDate // - this.txtDate.Location = new System.Drawing.Point(652, 34); - this.txtDate.Margin = new System.Windows.Forms.Padding(4); + this.txtDate.Location = new System.Drawing.Point(489, 28); this.txtDate.Name = "txtDate"; this.txtDate.ReadOnly = true; - this.txtDate.Size = new System.Drawing.Size(203, 22); + this.txtDate.Size = new System.Drawing.Size(153, 20); this.txtDate.TabIndex = 133; // // txtLastEditDate // - this.txtLastEditDate.Location = new System.Drawing.Point(864, 34); - this.txtLastEditDate.Margin = new System.Windows.Forms.Padding(4); + this.txtLastEditDate.Location = new System.Drawing.Point(648, 28); this.txtLastEditDate.Name = "txtLastEditDate"; this.txtLastEditDate.ReadOnly = true; - this.txtLastEditDate.Size = new System.Drawing.Size(203, 22); + this.txtLastEditDate.Size = new System.Drawing.Size(153, 20); this.txtLastEditDate.TabIndex = 132; // // txtCreationDate // - this.txtCreationDate.Location = new System.Drawing.Point(349, 34); - this.txtCreationDate.Margin = new System.Windows.Forms.Padding(4); + this.txtCreationDate.Location = new System.Drawing.Point(262, 28); this.txtCreationDate.Name = "txtCreationDate"; this.txtCreationDate.ReadOnly = true; - this.txtCreationDate.Size = new System.Drawing.Size(161, 22); + this.txtCreationDate.Size = new System.Drawing.Size(122, 20); this.txtCreationDate.TabIndex = 131; // // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(165, 15); - this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label3.Location = new System.Drawing.Point(124, 12); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(91, 17); + this.label3.Size = new System.Drawing.Size(69, 13); this.label3.TabIndex = 130; this.label3.Text = "KOT Number"; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 15); - this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label2.Location = new System.Drawing.Point(9, 12); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(80, 17); + this.label2.Size = new System.Drawing.Size(60, 13); this.label2.TabIndex = 129; this.label2.Text = "Bill Number"; // // txtBillID // - this.txtBillID.Location = new System.Drawing.Point(16, 34); - this.txtBillID.Margin = new System.Windows.Forms.Padding(4); + this.txtBillID.Location = new System.Drawing.Point(12, 28); this.txtBillID.Name = "txtBillID"; this.txtBillID.ReadOnly = true; - this.txtBillID.Size = new System.Drawing.Size(144, 22); + this.txtBillID.Size = new System.Drawing.Size(109, 20); this.txtBillID.TabIndex = 128; // // txtKotID // - this.txtKotID.Location = new System.Drawing.Point(169, 34); - this.txtKotID.Margin = new System.Windows.Forms.Padding(4); + this.txtKotID.Location = new System.Drawing.Point(127, 28); this.txtKotID.Name = "txtKotID"; this.txtKotID.ReadOnly = true; - this.txtKotID.Size = new System.Drawing.Size(171, 22); + this.txtKotID.Size = new System.Drawing.Size(129, 20); this.txtKotID.TabIndex = 127; // // btnCustomer // this.btnCustomer.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnCustomer.ForeColor = System.Drawing.Color.Red; - this.btnCustomer.Location = new System.Drawing.Point(16, 66); - this.btnCustomer.Margin = new System.Windows.Forms.Padding(4); + this.btnCustomer.Location = new System.Drawing.Point(12, 54); this.btnCustomer.Name = "btnCustomer"; - this.btnCustomer.Size = new System.Drawing.Size(628, 42); + this.btnCustomer.Size = new System.Drawing.Size(471, 34); this.btnCustomer.TabIndex = 126; this.btnCustomer.UseVisualStyleBackColor = true; this.btnCustomer.Click += new System.EventHandler(this.btnCustomer_Click); @@ -581,6 +570,7 @@ // this.pnlWaiting.AutoSize = true; this.pnlWaiting.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.pnlWaiting.Controls.Add(this.btnPaidNc); this.pnlWaiting.Controls.Add(this.btnPaidStaff); this.pnlWaiting.Controls.Add(this.btnPaidCredit); this.pnlWaiting.Controls.Add(this.dgvPending); @@ -596,17 +586,15 @@ this.pnlWaiting.Controls.Add(this.lblUser); this.pnlWaiting.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlWaiting.Location = new System.Drawing.Point(0, 0); - this.pnlWaiting.Margin = new System.Windows.Forms.Padding(4); this.pnlWaiting.Name = "pnlWaiting"; - this.pnlWaiting.Size = new System.Drawing.Size(1309, 815); + this.pnlWaiting.Size = new System.Drawing.Size(982, 662); this.pnlWaiting.TabIndex = 121; // // btnPaidStaff // - this.btnPaidStaff.Location = new System.Drawing.Point(1133, 649); - this.btnPaidStaff.Margin = new System.Windows.Forms.Padding(4); + this.btnPaidStaff.Location = new System.Drawing.Point(850, 527); this.btnPaidStaff.Name = "btnPaidStaff"; - this.btnPaidStaff.Size = new System.Drawing.Size(160, 71); + this.btnPaidStaff.Size = new System.Drawing.Size(120, 58); this.btnPaidStaff.TabIndex = 138; this.btnPaidStaff.Text = "Paid Staff"; this.btnPaidStaff.UseVisualStyleBackColor = true; @@ -614,10 +602,9 @@ // // btnPaidCredit // - this.btnPaidCredit.Location = new System.Drawing.Point(1133, 727); - this.btnPaidCredit.Margin = new System.Windows.Forms.Padding(4); + this.btnPaidCredit.Location = new System.Drawing.Point(850, 591); this.btnPaidCredit.Name = "btnPaidCredit"; - this.btnPaidCredit.Size = new System.Drawing.Size(160, 65); + this.btnPaidCredit.Size = new System.Drawing.Size(57, 53); this.btnPaidCredit.TabIndex = 137; this.btnPaidCredit.Text = "Paid Credit"; this.btnPaidCredit.UseVisualStyleBackColor = true; @@ -650,14 +637,13 @@ this.printedDataGridViewCheckBoxColumn, this.alarmTimeDataGridViewTextBoxColumn}); this.dgvPending.DataSource = this.bsPending; - this.dgvPending.Location = new System.Drawing.Point(16, 49); - this.dgvPending.Margin = new System.Windows.Forms.Padding(4); + this.dgvPending.Location = new System.Drawing.Point(12, 40); this.dgvPending.MultiSelect = false; this.dgvPending.Name = "dgvPending"; this.dgvPending.RowHeadersVisible = false; this.dgvPending.RowTemplate.Height = 24; this.dgvPending.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgvPending.Size = new System.Drawing.Size(928, 599); + this.dgvPending.Size = new System.Drawing.Size(696, 487); this.dgvPending.TabIndex = 0; this.dgvPending.VirtualMode = true; this.dgvPending.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPending_CellDoubleClick); @@ -669,21 +655,101 @@ // this.selectDataGridViewCheckBoxColumn.HeaderText = "Select"; this.selectDataGridViewCheckBoxColumn.Name = "selectDataGridViewCheckBoxColumn"; - this.selectDataGridViewCheckBoxColumn.Width = 53; + this.selectDataGridViewCheckBoxColumn.Width = 43; + // + // billNoDataGridViewTextBoxColumn + // + this.billNoDataGridViewTextBoxColumn.DataPropertyName = "BillNo"; + this.billNoDataGridViewTextBoxColumn.HeaderText = "BillNo"; + this.billNoDataGridViewTextBoxColumn.Name = "billNoDataGridViewTextBoxColumn"; + this.billNoDataGridViewTextBoxColumn.Width = 59; + // + // kotDataGridViewTextBoxColumn + // + this.kotDataGridViewTextBoxColumn.DataPropertyName = "Kot"; + this.kotDataGridViewTextBoxColumn.HeaderText = "Kot"; + this.kotDataGridViewTextBoxColumn.Name = "kotDataGridViewTextBoxColumn"; + this.kotDataGridViewTextBoxColumn.Width = 48; // // TableID // this.TableID.DataPropertyName = "TableID"; this.TableID.HeaderText = "TableID"; this.TableID.Name = "TableID"; - this.TableID.Width = 82; + this.TableID.Width = 70; + // + // amountDataGridViewTextBoxColumn + // + this.amountDataGridViewTextBoxColumn.DataPropertyName = "Amount"; + this.amountDataGridViewTextBoxColumn.HeaderText = "Amount"; + this.amountDataGridViewTextBoxColumn.Name = "amountDataGridViewTextBoxColumn"; + this.amountDataGridViewTextBoxColumn.Width = 68; + // + // importantDataGridViewCheckBoxColumn + // + this.importantDataGridViewCheckBoxColumn.DataPropertyName = "Important"; + this.importantDataGridViewCheckBoxColumn.HeaderText = "Important"; + this.importantDataGridViewCheckBoxColumn.Name = "importantDataGridViewCheckBoxColumn"; + this.importantDataGridViewCheckBoxColumn.Width = 57; + // + // alarmDataGridViewCheckBoxColumn + // + this.alarmDataGridViewCheckBoxColumn.DataPropertyName = "Alarm"; + this.alarmDataGridViewCheckBoxColumn.HeaderText = "Alarm"; + this.alarmDataGridViewCheckBoxColumn.Name = "alarmDataGridViewCheckBoxColumn"; + this.alarmDataGridViewCheckBoxColumn.Width = 39; + // + // bookingTimeDataGridViewTextBoxColumn + // + this.bookingTimeDataGridViewTextBoxColumn.DataPropertyName = "BookingTime"; + this.bookingTimeDataGridViewTextBoxColumn.HeaderText = "BookingTime"; + this.bookingTimeDataGridViewTextBoxColumn.Name = "bookingTimeDataGridViewTextBoxColumn"; + this.bookingTimeDataGridViewTextBoxColumn.Width = 94; + // + // lastEditedDataGridViewTextBoxColumn + // + this.lastEditedDataGridViewTextBoxColumn.DataPropertyName = "LastEdited"; + this.lastEditedDataGridViewTextBoxColumn.HeaderText = "LastEdited"; + this.lastEditedDataGridViewTextBoxColumn.Name = "lastEditedDataGridViewTextBoxColumn"; + this.lastEditedDataGridViewTextBoxColumn.Width = 82; + // + // waiterDataGridViewTextBoxColumn + // + this.waiterDataGridViewTextBoxColumn.DataPropertyName = "Waiter"; + this.waiterDataGridViewTextBoxColumn.HeaderText = "Waiter"; + this.waiterDataGridViewTextBoxColumn.Name = "waiterDataGridViewTextBoxColumn"; + this.waiterDataGridViewTextBoxColumn.Width = 63; + // + // cashierDataGridViewTextBoxColumn + // + this.cashierDataGridViewTextBoxColumn.DataPropertyName = "Cashier"; + this.cashierDataGridViewTextBoxColumn.HeaderText = "Cashier"; + this.cashierDataGridViewTextBoxColumn.Name = "cashierDataGridViewTextBoxColumn"; + this.cashierDataGridViewTextBoxColumn.Width = 67; + // + // printedDataGridViewCheckBoxColumn + // + this.printedDataGridViewCheckBoxColumn.DataPropertyName = "Printed"; + this.printedDataGridViewCheckBoxColumn.HeaderText = "Printed"; + this.printedDataGridViewCheckBoxColumn.Name = "printedDataGridViewCheckBoxColumn"; + this.printedDataGridViewCheckBoxColumn.Width = 46; + // + // alarmTimeDataGridViewTextBoxColumn + // + this.alarmTimeDataGridViewTextBoxColumn.DataPropertyName = "AlarmTime"; + this.alarmTimeDataGridViewTextBoxColumn.HeaderText = "AlarmTime"; + this.alarmTimeDataGridViewTextBoxColumn.Name = "alarmTimeDataGridViewTextBoxColumn"; + this.alarmTimeDataGridViewTextBoxColumn.Width = 81; + // + // bsPending + // + this.bsPending.DataSource = typeof(Tanshu.Accounts.Contracts.PendingBillsBO); // // btnAlarm // - this.btnAlarm.Location = new System.Drawing.Point(1133, 484); - this.btnAlarm.Margin = new System.Windows.Forms.Padding(4); + this.btnAlarm.Location = new System.Drawing.Point(850, 393); this.btnAlarm.Name = "btnAlarm"; - this.btnAlarm.Size = new System.Drawing.Size(160, 79); + this.btnAlarm.Size = new System.Drawing.Size(120, 64); this.btnAlarm.TabIndex = 136; this.btnAlarm.Text = "Alarm"; this.btnAlarm.UseVisualStyleBackColor = true; @@ -694,20 +760,18 @@ this.chkRefresh.AutoSize = true; this.chkRefresh.Checked = true; this.chkRefresh.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRefresh.Location = new System.Drawing.Point(952, 49); - this.chkRefresh.Margin = new System.Windows.Forms.Padding(4); + this.chkRefresh.Location = new System.Drawing.Point(714, 40); this.chkRefresh.Name = "chkRefresh"; - this.chkRefresh.Size = new System.Drawing.Size(160, 21); + this.chkRefresh.Size = new System.Drawing.Size(121, 17); this.chkRefresh.TabIndex = 134; this.chkRefresh.Text = "Keep refreshing Bills"; this.chkRefresh.UseVisualStyleBackColor = true; // // btnRefresh // - this.btnRefresh.Location = new System.Drawing.Point(12, 649); - this.btnRefresh.Margin = new System.Windows.Forms.Padding(4); + this.btnRefresh.Location = new System.Drawing.Point(9, 527); this.btnRefresh.Name = "btnRefresh"; - this.btnRefresh.Size = new System.Drawing.Size(172, 144); + this.btnRefresh.Size = new System.Drawing.Size(129, 117); this.btnRefresh.TabIndex = 133; this.btnRefresh.Text = "Refresh - F5"; this.btnRefresh.UseVisualStyleBackColor = true; @@ -715,10 +779,9 @@ // // btnPaidCC // - this.btnPaidCC.Location = new System.Drawing.Point(1133, 574); - this.btnPaidCC.Margin = new System.Windows.Forms.Padding(4); + this.btnPaidCC.Location = new System.Drawing.Point(850, 466); this.btnPaidCC.Name = "btnPaidCC"; - this.btnPaidCC.Size = new System.Drawing.Size(160, 68); + this.btnPaidCC.Size = new System.Drawing.Size(120, 55); this.btnPaidCC.TabIndex = 6; this.btnPaidCC.Text = "Paid By CC"; this.btnPaidCC.UseVisualStyleBackColor = true; @@ -726,10 +789,9 @@ // // btnPaidCash // - this.btnPaidCash.Location = new System.Drawing.Point(952, 649); - this.btnPaidCash.Margin = new System.Windows.Forms.Padding(4); + this.btnPaidCash.Location = new System.Drawing.Point(714, 527); this.btnPaidCash.Name = "btnPaidCash"; - this.btnPaidCash.Size = new System.Drawing.Size(173, 144); + this.btnPaidCash.Size = new System.Drawing.Size(130, 117); this.btnPaidCash.TabIndex = 5; this.btnPaidCash.Text = "Paid"; this.btnPaidCash.UseVisualStyleBackColor = true; @@ -737,10 +799,9 @@ // // btnBillList // - this.btnBillList.Location = new System.Drawing.Point(952, 484); - this.btnBillList.Margin = new System.Windows.Forms.Padding(4); + this.btnBillList.Location = new System.Drawing.Point(714, 393); this.btnBillList.Name = "btnBillList"; - this.btnBillList.Size = new System.Drawing.Size(173, 158); + this.btnBillList.Size = new System.Drawing.Size(130, 128); this.btnBillList.TabIndex = 4; this.btnBillList.Text = "List Of Bills to Cancel"; this.btnBillList.UseVisualStyleBackColor = true; @@ -748,10 +809,9 @@ // // btnSelectBill // - this.btnSelectBill.Location = new System.Drawing.Point(952, 294); - this.btnSelectBill.Margin = new System.Windows.Forms.Padding(4); + this.btnSelectBill.Location = new System.Drawing.Point(714, 239); this.btnSelectBill.Name = "btnSelectBill"; - this.btnSelectBill.Size = new System.Drawing.Size(341, 182); + this.btnSelectBill.Size = new System.Drawing.Size(256, 148); this.btnSelectBill.TabIndex = 3; this.btnSelectBill.Text = "Select Bill"; this.btnSelectBill.UseVisualStyleBackColor = true; @@ -759,10 +819,9 @@ // // btnStartBill // - this.btnStartBill.Location = new System.Drawing.Point(952, 78); - this.btnStartBill.Margin = new System.Windows.Forms.Padding(4); + this.btnStartBill.Location = new System.Drawing.Point(714, 63); this.btnStartBill.Name = "btnStartBill"; - this.btnStartBill.Size = new System.Drawing.Size(341, 209); + this.btnStartBill.Size = new System.Drawing.Size(256, 170); this.btnStartBill.TabIndex = 2; this.btnStartBill.Text = "New Bill - F6"; this.btnStartBill.UseVisualStyleBackColor = true; @@ -774,54 +833,49 @@ this.tcPending.Controls.Add(this.tpWeek); this.tcPending.Controls.Add(this.tpAll); this.tcPending.Controls.Add(this.tpAlarm); - this.tcPending.Location = new System.Drawing.Point(256, 15); - this.tcPending.Margin = new System.Windows.Forms.Padding(4); + this.tcPending.Location = new System.Drawing.Point(192, 12); this.tcPending.Name = "tcPending"; this.tcPending.SelectedIndex = 0; - this.tcPending.Size = new System.Drawing.Size(361, 25); + this.tcPending.Size = new System.Drawing.Size(271, 20); this.tcPending.TabIndex = 1; this.tcPending.SelectedIndexChanged += new System.EventHandler(this.tcPending_SelectedIndexChanged); // // tpToday // - this.tpToday.Location = new System.Drawing.Point(4, 25); - this.tpToday.Margin = new System.Windows.Forms.Padding(4); + this.tpToday.Location = new System.Drawing.Point(4, 22); this.tpToday.Name = "tpToday"; - this.tpToday.Padding = new System.Windows.Forms.Padding(4); - this.tpToday.Size = new System.Drawing.Size(353, 0); + this.tpToday.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.tpToday.Size = new System.Drawing.Size(263, 0); this.tpToday.TabIndex = 1; this.tpToday.Text = "Today"; this.tpToday.UseVisualStyleBackColor = true; // // tpWeek // - this.tpWeek.Location = new System.Drawing.Point(4, 25); - this.tpWeek.Margin = new System.Windows.Forms.Padding(4); + this.tpWeek.Location = new System.Drawing.Point(4, 22); this.tpWeek.Name = "tpWeek"; - this.tpWeek.Padding = new System.Windows.Forms.Padding(4); - this.tpWeek.Size = new System.Drawing.Size(353, 0); + this.tpWeek.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.tpWeek.Size = new System.Drawing.Size(263, 0); this.tpWeek.TabIndex = 2; this.tpWeek.Text = "Week"; this.tpWeek.UseVisualStyleBackColor = true; // // tpAll // - this.tpAll.Location = new System.Drawing.Point(4, 25); - this.tpAll.Margin = new System.Windows.Forms.Padding(4); + this.tpAll.Location = new System.Drawing.Point(4, 22); this.tpAll.Name = "tpAll"; - this.tpAll.Padding = new System.Windows.Forms.Padding(4); - this.tpAll.Size = new System.Drawing.Size(353, 0); + this.tpAll.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.tpAll.Size = new System.Drawing.Size(263, 0); this.tpAll.TabIndex = 3; this.tpAll.Text = "All"; this.tpAll.UseVisualStyleBackColor = true; // // tpAlarm // - this.tpAlarm.Location = new System.Drawing.Point(4, 25); - this.tpAlarm.Margin = new System.Windows.Forms.Padding(4); + this.tpAlarm.Location = new System.Drawing.Point(4, 22); this.tpAlarm.Name = "tpAlarm"; - this.tpAlarm.Padding = new System.Windows.Forms.Padding(4); - this.tpAlarm.Size = new System.Drawing.Size(353, 0); + this.tpAlarm.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.tpAlarm.Size = new System.Drawing.Size(263, 0); this.tpAlarm.TabIndex = 5; this.tpAlarm.Text = "Alarms"; this.tpAlarm.UseVisualStyleBackColor = true; @@ -830,130 +884,34 @@ // this.lblUser.Font = new System.Drawing.Font("Microsoft Sans Serif", 48F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblUser.ForeColor = System.Drawing.Color.Red; - this.lblUser.Location = new System.Drawing.Point(192, 652); - this.lblUser.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lblUser.Location = new System.Drawing.Point(144, 530); this.lblUser.Name = "lblUser"; - this.lblUser.Size = new System.Drawing.Size(752, 140); + this.lblUser.Size = new System.Drawing.Size(564, 114); this.lblUser.TabIndex = 135; this.lblUser.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // billNoDataGridViewTextBoxColumn - // - this.billNoDataGridViewTextBoxColumn.DataPropertyName = "BillNo"; - this.billNoDataGridViewTextBoxColumn.HeaderText = "BillNo"; - this.billNoDataGridViewTextBoxColumn.Name = "billNoDataGridViewTextBoxColumn"; - this.billNoDataGridViewTextBoxColumn.Width = 69; - // - // kotDataGridViewTextBoxColumn - // - this.kotDataGridViewTextBoxColumn.DataPropertyName = "Kot"; - this.kotDataGridViewTextBoxColumn.HeaderText = "Kot"; - this.kotDataGridViewTextBoxColumn.Name = "kotDataGridViewTextBoxColumn"; - this.kotDataGridViewTextBoxColumn.Width = 54; - // - // amountDataGridViewTextBoxColumn - // - this.amountDataGridViewTextBoxColumn.DataPropertyName = "Amount"; - this.amountDataGridViewTextBoxColumn.HeaderText = "Amount"; - this.amountDataGridViewTextBoxColumn.Name = "amountDataGridViewTextBoxColumn"; - this.amountDataGridViewTextBoxColumn.Width = 81; - // - // importantDataGridViewCheckBoxColumn - // - this.importantDataGridViewCheckBoxColumn.DataPropertyName = "Important"; - this.importantDataGridViewCheckBoxColumn.HeaderText = "Important"; - this.importantDataGridViewCheckBoxColumn.Name = "importantDataGridViewCheckBoxColumn"; - this.importantDataGridViewCheckBoxColumn.Width = 73; - // - // alarmDataGridViewCheckBoxColumn - // - this.alarmDataGridViewCheckBoxColumn.DataPropertyName = "Alarm"; - this.alarmDataGridViewCheckBoxColumn.HeaderText = "Alarm"; - this.alarmDataGridViewCheckBoxColumn.Name = "alarmDataGridViewCheckBoxColumn"; - this.alarmDataGridViewCheckBoxColumn.Width = 50; - // - // bookingTimeDataGridViewTextBoxColumn - // - this.bookingTimeDataGridViewTextBoxColumn.DataPropertyName = "BookingTime"; - this.bookingTimeDataGridViewTextBoxColumn.HeaderText = "BookingTime"; - this.bookingTimeDataGridViewTextBoxColumn.Name = "bookingTimeDataGridViewTextBoxColumn"; - this.bookingTimeDataGridViewTextBoxColumn.Width = 115; - // - // lastEditedDataGridViewTextBoxColumn - // - this.lastEditedDataGridViewTextBoxColumn.DataPropertyName = "LastEdited"; - this.lastEditedDataGridViewTextBoxColumn.HeaderText = "LastEdited"; - this.lastEditedDataGridViewTextBoxColumn.Name = "lastEditedDataGridViewTextBoxColumn"; - // - // waiterDataGridViewTextBoxColumn - // - this.waiterDataGridViewTextBoxColumn.DataPropertyName = "Waiter"; - this.waiterDataGridViewTextBoxColumn.HeaderText = "Waiter"; - this.waiterDataGridViewTextBoxColumn.Name = "waiterDataGridViewTextBoxColumn"; - this.waiterDataGridViewTextBoxColumn.Width = 74; - // - // cashierDataGridViewTextBoxColumn - // - this.cashierDataGridViewTextBoxColumn.DataPropertyName = "Cashier"; - this.cashierDataGridViewTextBoxColumn.HeaderText = "Cashier"; - this.cashierDataGridViewTextBoxColumn.Name = "cashierDataGridViewTextBoxColumn"; - this.cashierDataGridViewTextBoxColumn.Width = 81; - // - // printedDataGridViewCheckBoxColumn - // - this.printedDataGridViewCheckBoxColumn.DataPropertyName = "Printed"; - this.printedDataGridViewCheckBoxColumn.HeaderText = "Printed"; - this.printedDataGridViewCheckBoxColumn.Name = "printedDataGridViewCheckBoxColumn"; - this.printedDataGridViewCheckBoxColumn.Width = 59; - // - // alarmTimeDataGridViewTextBoxColumn - // - this.alarmTimeDataGridViewTextBoxColumn.DataPropertyName = "AlarmTime"; - this.alarmTimeDataGridViewTextBoxColumn.HeaderText = "AlarmTime"; - this.alarmTimeDataGridViewTextBoxColumn.Name = "alarmTimeDataGridViewTextBoxColumn"; - // - // bsPending - // - this.bsPending.DataSource = typeof(Tanshu.Accounts.Contracts.PendingBillsBO); - // - // printedDataGridViewTextBoxColumn - // - this.printedDataGridViewTextBoxColumn.DataPropertyName = "Printed"; - dataGridViewCellStyle3.Format = "N2"; - this.printedDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle3; - this.printedDataGridViewTextBoxColumn.HeaderText = "Printed"; - this.printedDataGridViewTextBoxColumn.Name = "printedDataGridViewTextBoxColumn"; - this.printedDataGridViewTextBoxColumn.ReadOnly = true; - this.printedDataGridViewTextBoxColumn.Width = 5; - // - // additionalDataGridViewTextBoxColumn - // - this.additionalDataGridViewTextBoxColumn.DataPropertyName = "Additional"; - dataGridViewCellStyle4.Format = "N2"; - dataGridViewCellStyle4.NullValue = null; - this.additionalDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle4; - this.additionalDataGridViewTextBoxColumn.HeaderText = "Additional"; - this.additionalDataGridViewTextBoxColumn.Name = "additionalDataGridViewTextBoxColumn"; - this.additionalDataGridViewTextBoxColumn.ReadOnly = true; - this.additionalDataGridViewTextBoxColumn.Width = 5; - // - // bindingSource - // - this.bindingSource.DataSource = typeof(Tanshu.Accounts.Contracts.SalesBillItemBO); - // // bsWaiter // this.bsWaiter.DataSource = typeof(Tanshu.Accounts.Contracts.WaiterBO); // + // btnPaidNc + // + this.btnPaidNc.Location = new System.Drawing.Point(913, 591); + this.btnPaidNc.Name = "btnPaidNc"; + this.btnPaidNc.Size = new System.Drawing.Size(57, 53); + this.btnPaidNc.TabIndex = 139; + this.btnPaidNc.Text = "Paid Nc"; + this.btnPaidNc.UseVisualStyleBackColor = true; + this.btnPaidNc.Click += new System.EventHandler(this.btnPaidNc_Click); + // // SalesForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1309, 815); + this.ClientSize = new System.Drawing.Size(982, 662); this.Controls.Add(this.pnlWaiting); this.Controls.Add(this.pnlBilling); this.KeyPreview = true; - this.Margin = new System.Windows.Forms.Padding(4); this.MaximizeBox = false; this.Name = "SalesForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; @@ -962,14 +920,14 @@ this.Load += new System.EventHandler(this.SalesForm_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SalesForm_KeyDown); ((System.ComponentModel.ISupportInitialize)(this.dgvProducts)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).EndInit(); this.pnlBilling.ResumeLayout(false); this.pnlBilling.PerformLayout(); this.pnlWaiting.ResumeLayout(false); this.pnlWaiting.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvPending)).EndInit(); - this.tcPending.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.bsPending)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).EndInit(); + this.tcPending.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.bsWaiter)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -1053,6 +1011,7 @@ private System.Windows.Forms.Button btnPaidStaff; private System.Windows.Forms.Button btnPaidCredit; private System.Windows.Forms.Button btnAdvance; + private System.Windows.Forms.Button btnPaidNc; } } diff --git a/Tanshu.Accounts.PointOfSale/Sales/SalesForm.cs b/Tanshu.Accounts.PointOfSale/Sales/SalesForm.cs index d26b943..8e737c2 100644 --- a/Tanshu.Accounts.PointOfSale/Sales/SalesForm.cs +++ b/Tanshu.Accounts.PointOfSale/Sales/SalesForm.cs @@ -29,7 +29,7 @@ namespace Tanshu.Accounts.PointOfSale private CustomerBO customer = new CustomerBI().GetCustomer(new Guid("F016CBAD-206C-42C0-BB1D-6006CE57BAB5")); private Guid? _advanceID; #endregion - private SaleVoucherBO _billInfo; + private VoucherBO _billInfo; object lockObject = new object(); Guid? _newBillID; @@ -80,7 +80,7 @@ namespace Tanshu.Accounts.PointOfSale } case Keys.F7: { - using (SelectProduct selectProduct = new SelectProduct(new ProductBI().GetFilteredProducts, true)) + using (SelectProduct selectProduct = new SelectProduct(new FiltersBI().GetFilteredProducts, true)) { selectProduct.ShowDialog(); if (selectProduct.SelectedItem != null) @@ -273,18 +273,18 @@ namespace Tanshu.Accounts.PointOfSale private void btnPrintBill_Click(object sender, EventArgs e) { var val = Save(true); - if (!val.HasValue) + if (val == null) return; - PrintBill(val.Value); - ClearBill(); + PrintBill(val.VoucherID); + ClearBill(); } private void btnPrintKot_Click(object sender, EventArgs e) { var val = Save(false); - if (!val.HasValue) + if (val == null) return; - PrintKOT(val.Value); - ClearBill(); + PrintKOT(val.VoucherID); + ClearBill(); } private void btnCancel_Click(object sender, EventArgs e) { @@ -324,7 +324,17 @@ namespace Tanshu.Accounts.PointOfSale LoadBill(_newBillID.Value); ChangeFormState(SaleFormState.Billing); } - ControlFactory.GenerateButtons(ref pnlBilling, new Rectangle(489, 94, 481, 385), 6, 6, 2, new ProductBI().GetUnFilteredProducts(), new ButtonClickDelegate(button_Click)); + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.ProductDAO(connection)) + { + Dictionary filter = new Dictionary(); + filter.Add("Name", ""); + filter.Add("ProductGroup", ""); + var buttons = dao.GetFilteredProducts(filter); + ControlFactory.GenerateButtons(ref pnlBilling, new Rectangle(489, 94, 481, 385), 6, 6, 2, buttons, new ButtonClickDelegate(button_Click)); + } + } } private void ChangeFormState(SaleFormState state) @@ -345,17 +355,21 @@ namespace Tanshu.Accounts.PointOfSale #region Save Bill - private Guid? Save(bool finalBill) + private VoucherBO Save(bool finalBill) { decimal? amount = null; - if (_billInfo != null && new SaleVoucherBI().IsBillPrinted(_billInfo.VoucherID)) + VoucherBO oldVoucher = null; + if (_billInfo != null) + oldVoucher = new VoucherBI().GetVoucher(_billInfo.VoucherID); + + if (oldVoucher != null && oldVoucher.Printed) { if (!Thread.CurrentPrincipal.IsInRole("Sales/EditBill")) { MessageBox.Show("You are not authorized to access"); return null; } - amount = new SaleVoucherBI().Amount(_billInfo.VoucherID); + amount = oldVoucher.Amount; } if (bill.Count == 0) return null; @@ -364,7 +378,15 @@ namespace Tanshu.Accounts.PointOfSale if (_advanceID.HasValue) { var billAmount = Math.Round(bill.Values.Sum(b => b.Value)); - var advanceAmount = new AdvanceBI().Get(_advanceID.Value).Amount; + decimal advanceAmount = 0; + using (var connection = new SqlDAO.SqlConnectionDAO()) + { + using (var dao = new SqlDAO.AdvanceDAO(connection)) + { + advanceAmount = dao.Get(_advanceID.Value).Amount; + } + } + if (advanceAmount > billAmount) { if (MessageBox.Show("Advance adjusted amount more than bill amount, advance will not be adjusted.\n\rContinue will bill print?", "Advace adjustment error", @@ -375,10 +397,8 @@ namespace Tanshu.Accounts.PointOfSale } } var saved = _billInfo == null ? AddNewSale(finalBill) : UpdateSale(finalBill); - if (saved.HasValue && _advanceID.HasValue) - new AdvanceBI().Adjust(_advanceID.Value, CurrentUser.user.UserID); if (amount != null) - Log.Warn(string.Format("{4} modified bill no {0}/{1} from (Rs. {2:#,00}) to (Rs. {3:#,00})", _billInfo.BillID, _billInfo.TableID, amount.Value, new SaleVoucherBI().Amount(saved.Value), Thread.CurrentPrincipal.Identity.Name)); + Log.Warn(string.Format("{4} modified bill no {0}/{1} from (Rs. {2:#,00}) to (Rs. {3:#,00})", _billInfo.BillID, _billInfo.TableID, amount.Value, saved.Amount, Thread.CurrentPrincipal.Identity.Name)); if (_newBillID.HasValue) this.Close(); return saved; @@ -400,8 +420,7 @@ namespace Tanshu.Accounts.PointOfSale else Print.Thermal.PrintWaiterKot("KOT", voucherID, bill.Values.ToList()); } - #region Save / Update - private Guid? AddNewSale(bool finalBill) + private VoucherBO AddNewSale(bool finalBill) { if (_billInfo != null) { @@ -412,13 +431,11 @@ namespace Tanshu.Accounts.PointOfSale if (btnWaiter.Tag == null) btnWaiter.Tag = new WaiterBI().GetWaiters()[0].WaiterID; - #region SaleVoucher var user = CurrentUser.user; - var saleVoucher = new SaleVoucherBO + var voucher = new VoucherBO { CustomerID = customer.CustomerID, PaidStatus = PaidStatus.Pending, - //Paid = finalBill, TableID = txtTableID.Text, WaiterID = (Guid)btnWaiter.Tag, Printed = finalBill, @@ -428,33 +445,23 @@ namespace Tanshu.Accounts.PointOfSale Floor = _floor, AdvanceID = _advanceID }; - #endregion - #region Inventories - List iList = new SaleVoucherBI().SaleInventory(bill.Values, null); - #endregion - new SaleVoucherBI().Insert(saleVoucher, iList); - return saleVoucher.VoucherID; - + voucher.Inventories = new VoucherBI().SaleInventory(bill.Values, null); + return new VoucherBI().Insert(voucher); } - private Guid? UpdateSale(bool finalBill) + private VoucherBO UpdateSale(bool finalBill) { if (btnWaiter.Tag == null) btnWaiter.Tag = new WaiterBI().GetWaiters()[0].WaiterID; var user = CurrentUser.user; - #region Voucher and SaleVoucher - var saleVoucher = new SaleVoucherBO + var voucher = new VoucherBO { VoucherID = _billInfo.VoucherID, UserID = _billInfo.UserID, Date = _billInfo.Date, - CreationDate = DateTime.Now, - LastEditDate = DateTime.Now, Narration = _billInfo.Narration, Alarm = _billInfo.Alarm, - BillID = _billInfo.BillID, CustomerID = customer.CustomerID, - KotID = _billInfo.KotID, PaidStatus = _billInfo.PaidStatus, Printed = _billInfo.Printed || finalBill, TableID = txtTableID.Text, @@ -464,16 +471,11 @@ namespace Tanshu.Accounts.PointOfSale AdvanceID = _advanceID }; if ((!_billInfo.Printed) && finalBill) - saleVoucher.Date = null; - #endregion - #region Inventory - List iList = new SaleVoucherBI().SaleInventory(bill.Values, _billInfo.VoucherID); - #endregion - new SaleVoucherBI().Update(saleVoucher, iList); - return saleVoucher.VoucherID; + voucher.Date = null; + voucher.Inventories = new VoucherBI().SaleInventory(bill.Values, _billInfo.VoucherID); + return new VoucherBI().Update(voucher); } #endregion - #endregion private void LoadBillFromTable() @@ -484,7 +486,7 @@ namespace Tanshu.Accounts.PointOfSale txtTableID.Text = result.Text.Trim(); if ((txtTableID.Text != "C") && (txtTableID.Text != "") && (!txtTableID.Text.Contains("."))) { - Guid? tID = new SaleVoucherBI().GetPendingVoucherID(txtTableID.Text, _floor); + Guid? tID = new VoucherBI().GetPendingVoucherID(txtTableID.Text, _floor); if (tID.HasValue) { LoadBill(tID.Value); @@ -499,8 +501,7 @@ namespace Tanshu.Accounts.PointOfSale private void LoadBill(Guid voucherID) { ClearBill(); - var iList = new List(); - new SaleVoucherBI().GetSaleVoucher(voucherID, ref _billInfo, ref iList); + _billInfo = new VoucherBI().GetVoucher(voucherID); this.txtBillID.Text = _billInfo.BillID; this.txtKotID.Text = _billInfo.KotID; @@ -508,15 +509,15 @@ namespace Tanshu.Accounts.PointOfSale this.txtDate.Text = _billInfo.Date.Value.ToString("HH:mm dd-MMM-yyyy"); this.txtLastEditDate.Text = _billInfo.LastEditDate.ToString("HH:mm dd-MMM-yyyy"); this.txtNarration.Text = _billInfo.Narration; - this.txtUserID.Text = new UserBI().GetUser(_billInfo.UserID).Name; - this.customer = new CustomerBI().GetCustomer(_billInfo.CustomerID); + this.txtUserID.Text = _billInfo.User.Name; + this.customer = _billInfo.Customer; this.btnCustomer.Text = this.customer.Name; this.txtTableID.Text = _billInfo.TableID; this.btnWaiter.Tag = _billInfo.WaiterID; this._advanceID = _billInfo.AdvanceID; - this.btnWaiter.Text = string.Format("{0} - F5", new WaiterBI().GetWaiter(_billInfo.WaiterID).Name); + this.btnWaiter.Text = string.Format("{0} - F5", _billInfo.Waiter.Name); - foreach (var inventory in iList) + foreach (var inventory in _billInfo.Inventories) { var key = new BillItemKey(inventory.ProductID, inventory.Quantity == 0); bill.Add(key, new SalesBillItemBO @@ -561,9 +562,9 @@ namespace Tanshu.Accounts.PointOfSale { lock (lockObject) { - pendingBills = new SaleVoucherBI().GetPendingBills(pendingList, _floor); + pendingBills = new VoucherBI().GetPendingBills(pendingList, _floor); bsPending.DataSource = pendingBills; - var alarmBills = new SaleVoucherBI().GetPendingBills(PendingType.Alarms, _floor).OrderBy(b => b.AlarmTime).ToList(); + var alarmBills = new VoucherBI().GetPendingBills(PendingType.Alarms, _floor).OrderBy(b => b.AlarmTime).ToList(); if (alarmBills.Count > 0) { var al = alarmBills.First(); @@ -639,7 +640,7 @@ namespace Tanshu.Accounts.PointOfSale { if ((customer.CustomerID == new Guid("F016CBAD-206C-42C0-BB1D-6006CE57BAB5")) && (!reset)) { - using (SelectCustomer selectCustomer = new SelectCustomer(new CustomerBI().GetFilteredCustomers, true)) + using (SelectCustomer selectCustomer = new SelectCustomer(new FiltersBI().GetFilteredCustomers, true)) { selectCustomer.customerEvent += new CustomerEventHandler(selectCustomer_customerEvent); selectCustomer.ShowDialog(); @@ -707,7 +708,7 @@ namespace Tanshu.Accounts.PointOfSale voidReason.ShowDialog(); if (voidReason.SelectedItem != null) { - new SaleVoucherBI().VoidBill(_billInfo.VoucherID, voidReason.SelectedItem.Description, CurrentUser.user.UserID); + new VoucherBI().VoidBill(_billInfo.VoucherID, voidReason.SelectedItem.Description, CurrentUser.user.UserID); ClearBill(); } else @@ -761,14 +762,14 @@ namespace Tanshu.Accounts.PointOfSale private void btnPaidCash_Click(object sender, EventArgs e) { var user = CurrentUser.user; - new SaleVoucherBI().DeclareBillsPaid(user.UserID, selectedBills, PaidStatus.Cash); + new VoucherBI().DeclareBillsPaid(user.UserID, selectedBills, PaidStatus.Cash); ListUnpaidBills(); } private void btnPaidCC_Click(object sender, EventArgs e) { var user = CurrentUser.user; - new SaleVoucherBI().DeclareBillsPaid(user.UserID, selectedBills, PaidStatus.CreditCard); + new VoucherBI().DeclareBillsPaid(user.UserID, selectedBills, PaidStatus.CreditCard); ListUnpaidBills(); } @@ -787,12 +788,12 @@ namespace Tanshu.Accounts.PointOfSale DateTime alarmTime; if (result.Text == string.Empty) { - new SaleVoucherBI().SetAlarm(billAlarm.voucherID, null); + new VoucherBI().SetAlarm(billAlarm.voucherID, null); MessageBox.Show("Alarm Cleared", "Alarm Cleared", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (DateTime.TryParseExact(result.Text, "dd-MMM-yyyy HH:mm", new CultureInfo("en-US"), DateTimeStyles.None, out alarmTime)) { - new SaleVoucherBI().SetAlarm(billAlarm.voucherID, alarmTime); + new VoucherBI().SetAlarm(billAlarm.voucherID, alarmTime); MessageBox.Show("Alarm set", "Alarm Set", MessageBoxButtons.OK, MessageBoxIcon.Information); } else @@ -811,16 +812,14 @@ namespace Tanshu.Accounts.PointOfSale var result = InputBox.Show("Bill No", "Bill No", "", InputBox_Validating); if (result.OK) { - var saleVoucher = new SaleVoucherBO(); - var list = new List(); - new SaleVoucherBI().GetSaleVoucher(result.Text,ref saleVoucher, ref list); - if (saleVoucher == null) + var voucher = new VoucherBI().GetVoucher(result.Text); + if (voucher == null) return; - LoadBill(saleVoucher.VoucherID); + LoadBill(voucher.VoucherID); ChangeFormState(SaleFormState.Billing); } - - + + //#region Filters //decimal? minValue = 0, maxValue = 0; @@ -937,14 +936,14 @@ namespace Tanshu.Accounts.PointOfSale private void btnPaidStaff_Click(object sender, EventArgs e) { var user = CurrentUser.user; - new SaleVoucherBI().DeclareBillsPaid(user.UserID, selectedBills, PaidStatus.Staff); + new VoucherBI().DeclareBillsPaid(user.UserID, selectedBills, PaidStatus.Staff); ListUnpaidBills(); } private void btnPaidCredit_Click(object sender, EventArgs e) { var user = CurrentUser.user; - new SaleVoucherBI().DeclareBillsPaid(user.UserID, selectedBills, PaidStatus.Credit); + new VoucherBI().DeclareBillsPaid(user.UserID, selectedBills, PaidStatus.Credit); ListUnpaidBills(); } @@ -959,6 +958,13 @@ namespace Tanshu.Accounts.PointOfSale } } + + private void btnPaidNc_Click(object sender, EventArgs e) + { + var user = CurrentUser.user; + new VoucherBI().DeclareBillsPaid(user.UserID, selectedBills, PaidStatus.Nc); + ListUnpaidBills(); + } } } diff --git a/Tanshu.Accounts.PointOfSale/Sales/SalesForm.resx b/Tanshu.Accounts.PointOfSale/Sales/SalesForm.resx index aeade32..0e23543 100644 --- a/Tanshu.Accounts.PointOfSale/Sales/SalesForm.resx +++ b/Tanshu.Accounts.PointOfSale/Sales/SalesForm.resx @@ -129,27 +129,27 @@ True - - True - - - True - - - 248, 17 - - - True - - - True - - - 248, 17 - 17, 17 + + True + + + True + + + 248, 17 + + + True + + + True + + + 248, 17 + 148, 17 diff --git a/Tanshu.Accounts.PointOfSale/Tanshu.Accounts.PointOfSale.csproj b/Tanshu.Accounts.PointOfSale/Tanshu.Accounts.PointOfSale.csproj index 905e199..ace0a11 100644 --- a/Tanshu.Accounts.PointOfSale/Tanshu.Accounts.PointOfSale.csproj +++ b/Tanshu.Accounts.PointOfSale/Tanshu.Accounts.PointOfSale.csproj @@ -332,6 +332,10 @@ {90C9D02C-91AF-4529-86BE-28320332DDB5} Tanshu.Accounts.Print + + {B755D152-37C3-47D6-A721-3AD17A8EF316} + Tanshu.Accounts.SqlDAO +