Finally Deployed. Don't know the total amount of changes.

This commit is contained in:
tanshu
2014-11-06 16:09:11 +05:30
parent dc3576437f
commit 948cd0bf28
34 changed files with 389 additions and 990 deletions

View File

@ -783,7 +783,6 @@ namespace Tanshu.Accounts.PointOfSale
_billInfo.Printed = finalBill;
_billInfo.Void = false;
_billInfo.Narration = "";
//UpdateKotDiscountAndPrice();
var kot = GetKot(_bill.Where(x => x.Key.BillItemType == BillItemType.Product && x.Key.KotID == Guid.Empty && x.Value.Quantity != 0));
if (kot == null)
return null;
@ -804,6 +803,7 @@ namespace Tanshu.Accounts.PointOfSale
voucher.Customer = _billInfo.Customer;
voucher.Waiter = _billInfo.Waiter;
voucher.Printed = finalBill;
voucher.VoucherType = _billInfo.VoucherType;
foreach (var item in _bill.Where(x => x.Key.BillItemType == BillItemType.Product && x.Key.KotID != Guid.Empty))
{
var i = voucher.Kots.Single(x => x.KotID == item.Key.KotID).Inventories.Single(x => x.Product.ProductID == item.Key.ProductID);

View File

@ -12,6 +12,7 @@ using Tanshu.Common;
using Tanshu.Common.KeyboardControl;
using NHibernate.Tool.hbm2ddl;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Tanshu.Accounts.PointOfSale
{
@ -55,7 +56,7 @@ namespace Tanshu.Accounts.PointOfSale
frmSale.ShowDialog();
Cache.Invalidate();
}
}
private void btnProduct_Click(object sender, EventArgs e)
@ -212,10 +213,32 @@ namespace Tanshu.Accounts.PointOfSale
var result = InputBox.Show("Bill Number", "0", InputBox_Validating);
if (!result.OK)
return;
var billID = int.Parse(result.Text.Replace("-",""));
Expression<Func<Voucher, bool>> query;
int billID;
if (Regex.IsMatch(result.Text, @"^\d{2,}-\d{4}$"))
{
billID = int.Parse(result.Text.Replace("-", ""));
query = x => x.BillID == billID && (x.VoucherType == VoucherType.Regular || x.VoucherType == VoucherType.TakeAway);
}
else if (Regex.IsMatch(result.Text, @"^NC-\d+$"))
{
billID = int.Parse(result.Text.Replace("NC-", ""));
query = x => x.BillID == billID && x.VoucherType == VoucherType.NoCharge;
}
else if (Regex.IsMatch(result.Text, @"^ST-\d+$"))
{
billID = int.Parse(result.Text.Replace("ST-", ""));
query = x => x.BillID == billID && x.VoucherType == VoucherType.Staff;
}
else
return;
Voucher voucher;
using (var bi = new VoucherBI())
voucher = bi.Get(x => x.BillID == billID);
voucher = bi.Get(query);
if (voucher == null)
return;
if (Session.IsAllowed("Sales"))
using (var frmSale = new SalesForm(new BillController(voucher.VoucherID, true)))
frmSale.ShowDialog();

View File

@ -75,7 +75,7 @@
// Label7
//
this.Label7.AutoSize = true;
this.Label7.Location = new System.Drawing.Point(70, 141);
this.Label7.Location = new System.Drawing.Point(70, 169);
this.Label7.Name = "Label7";
this.Label7.Size = new System.Drawing.Size(36, 13);
this.Label7.TabIndex = 17;
@ -88,7 +88,7 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(26, 115);
this.label5.Location = new System.Drawing.Point(26, 143);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(80, 13);
this.label5.TabIndex = 16;
@ -150,7 +150,7 @@
this.txtPrice.AccessibleName = "";
this.txtPrice.Location = new System.Drawing.Point(112, 64);
this.txtPrice.Name = "txtPrice";
this.txtPrice.Size = new System.Drawing.Size(84, 20);
this.txtPrice.Size = new System.Drawing.Size(104, 20);
this.txtPrice.TabIndex = 3;
this.txtPrice.Text = "0";
//
@ -159,9 +159,9 @@
this.cmbVat.DataSource = this.bsVat;
this.cmbVat.DisplayMember = "Name";
this.cmbVat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbVat.Location = new System.Drawing.Point(213, 87);
this.cmbVat.Location = new System.Drawing.Point(112, 114);
this.cmbVat.Name = "cmbVat";
this.cmbVat.Size = new System.Drawing.Size(88, 21);
this.cmbVat.Size = new System.Drawing.Size(189, 21);
this.cmbVat.TabIndex = 4;
this.cmbVat.ValueMember = "TaxID";
//
@ -172,7 +172,7 @@
// chkIsActive
//
this.chkIsActive.AutoSize = true;
this.chkIsActive.Location = new System.Drawing.Point(191, 115);
this.chkIsActive.Location = new System.Drawing.Point(307, 89);
this.chkIsActive.Name = "chkIsActive";
this.chkIsActive.Size = new System.Drawing.Size(67, 17);
this.chkIsActive.TabIndex = 7;
@ -182,15 +182,15 @@
// txtServiceCharge
//
this.txtServiceCharge.AccessibleName = "Phone 1";
this.txtServiceCharge.Location = new System.Drawing.Point(112, 113);
this.txtServiceCharge.Location = new System.Drawing.Point(112, 141);
this.txtServiceCharge.Name = "txtServiceCharge";
this.txtServiceCharge.Size = new System.Drawing.Size(73, 20);
this.txtServiceCharge.Size = new System.Drawing.Size(189, 20);
this.txtServiceCharge.TabIndex = 5;
this.txtServiceCharge.Text = "0";
//
// btnAddProductGroup
//
this.btnAddProductGroup.Location = new System.Drawing.Point(307, 139);
this.btnAddProductGroup.Location = new System.Drawing.Point(307, 167);
this.btnAddProductGroup.Name = "btnAddProductGroup";
this.btnAddProductGroup.Size = new System.Drawing.Size(96, 21);
this.btnAddProductGroup.TabIndex = 9;
@ -203,7 +203,7 @@
this.cmbProductGroup.DataSource = this.bsProductGroups;
this.cmbProductGroup.DisplayMember = "Name";
this.cmbProductGroup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbProductGroup.Location = new System.Drawing.Point(112, 139);
this.cmbProductGroup.Location = new System.Drawing.Point(112, 167);
this.cmbProductGroup.Name = "cmbProductGroup";
this.cmbProductGroup.Size = new System.Drawing.Size(189, 21);
this.cmbProductGroup.TabIndex = 8;
@ -211,7 +211,7 @@
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(328, 166);
this.btnCancel.Location = new System.Drawing.Point(328, 195);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 75);
this.btnCancel.TabIndex = 11;
@ -221,7 +221,7 @@
//
// btnOk
//
this.btnOk.Location = new System.Drawing.Point(247, 166);
this.btnOk.Location = new System.Drawing.Point(247, 195);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 75);
this.btnOk.TabIndex = 10;
@ -232,7 +232,7 @@
// txtFullPrice
//
this.txtFullPrice.AccessibleName = "";
this.txtFullPrice.Location = new System.Drawing.Point(201, 64);
this.txtFullPrice.Location = new System.Drawing.Point(222, 64);
this.txtFullPrice.Name = "txtFullPrice";
this.txtFullPrice.Size = new System.Drawing.Size(79, 20);
this.txtFullPrice.TabIndex = 19;
@ -245,7 +245,7 @@
this.cmbServiceTax.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbServiceTax.Location = new System.Drawing.Point(112, 87);
this.cmbServiceTax.Name = "cmbServiceTax";
this.cmbServiceTax.Size = new System.Drawing.Size(96, 21);
this.cmbServiceTax.Size = new System.Drawing.Size(189, 21);
this.cmbServiceTax.TabIndex = 20;
this.cmbServiceTax.ValueMember = "TaxID";
//
@ -261,7 +261,7 @@
// chkIsScTaxable
//
this.chkIsScTaxable.AutoSize = true;
this.chkIsScTaxable.Location = new System.Drawing.Point(307, 89);
this.chkIsScTaxable.Location = new System.Drawing.Point(307, 144);
this.chkIsScTaxable.Name = "chkIsScTaxable";
this.chkIsScTaxable.Size = new System.Drawing.Size(91, 17);
this.chkIsScTaxable.TabIndex = 22;
@ -271,7 +271,7 @@
// chkIsNotAvailable
//
this.chkIsNotAvailable.AutoSize = true;
this.chkIsNotAvailable.Location = new System.Drawing.Point(255, 114);
this.chkIsNotAvailable.Location = new System.Drawing.Point(307, 116);
this.chkIsNotAvailable.Name = "chkIsNotAvailable";
this.chkIsNotAvailable.Size = new System.Drawing.Size(57, 17);
this.chkIsNotAvailable.TabIndex = 23;
@ -282,7 +282,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(415, 276);
this.ClientSize = new System.Drawing.Size(415, 282);
this.Controls.Add(this.chkIsNotAvailable);
this.Controls.Add(this.chkIsScTaxable);
this.Controls.Add(this.label6);

View File

@ -10,6 +10,7 @@ namespace Tanshu.Accounts.PointOfSale
public partial class BillDetailsForm : Form
{
IList<BillDetail> _list;
bool _loading = true;
public BillDetailsForm()
{
InitializeComponent();
@ -22,6 +23,7 @@ namespace Tanshu.Accounts.PointOfSale
private void ShowStatement()
{
if (_loading) return;
if (DateTime.Today.Subtract(dtpStart.Value.Date).Days > 5 && !Session.IsAllowed("Accounts Audit"))
return;
_list = new SalesAnalysisBI().GetBillDetails(dtpStart.Value, dtpFinish.Value);
@ -41,6 +43,7 @@ namespace Tanshu.Accounts.PointOfSale
{
dtpStart.Value = DateTime.Today;
dtpFinish.Value = DateTime.Today;
_loading = false;
ShowStatement();
}
}

View File

@ -28,67 +28,16 @@
/// </summary>
private void InitializeComponent()
{
this.label18 = new System.Windows.Forms.Label();
this.txtClosingCash = new System.Windows.Forms.TextBox();
this.dtpFinish = new System.Windows.Forms.DateTimePicker();
this.dtpStart = new System.Windows.Forms.DateTimePicker();
this.label17 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.btnCalculate = new System.Windows.Forms.Button();
this.btnPrint = new System.Windows.Forms.Button();
this.txtStatus = new System.Windows.Forms.TextBox();
this.txtSales = new System.Windows.Forms.TextBox();
this.txtDeposited = new System.Windows.Forms.TextBox();
this.txtPending = new System.Windows.Forms.TextBox();
this.cmbCashier = new System.Windows.Forms.ComboBox();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtPayments = new System.Windows.Forms.TextBox();
this.txtCashReceipts = new System.Windows.Forms.TextBox();
this.txtCCReceipts = new System.Windows.Forms.TextBox();
this.txtAdditionalVoids = new System.Windows.Forms.TextBox();
this.txtVoidsInSystem = new System.Windows.Forms.TextBox();
this.txtDiscounts = new System.Windows.Forms.TextBox();
this.txtRates = new System.Windows.Forms.TextBox();
this.txtAdvanceReceived = new System.Windows.Forms.TextBox();
this.txtReceipts = new System.Windows.Forms.TextBox();
this.txtOpening = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.NC = new System.Windows.Forms.Label();
this.txtBillToCompany = new System.Windows.Forms.TextBox();
this.txtNC = new System.Windows.Forms.TextBox();
this.dgvSale = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).BeginInit();
this.SuspendLayout();
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(12, 432);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(68, 13);
this.label18.TabIndex = 71;
this.label18.Text = "Closing Cash";
//
// txtClosingCash
//
this.txtClosingCash.Location = new System.Drawing.Point(99, 429);
this.txtClosingCash.Name = "txtClosingCash";
this.txtClosingCash.ReadOnly = true;
this.txtClosingCash.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtClosingCash.Size = new System.Drawing.Size(200, 20);
this.txtClosingCash.TabIndex = 55;
//
// dtpFinish
//
this.dtpFinish.Location = new System.Drawing.Point(189, 12);
@ -105,73 +54,11 @@
this.dtpStart.TabIndex = 41;
this.dtpStart.ValueChanged += new System.EventHandler(this.DtpStartValueChanged);
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(12, 328);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(85, 13);
this.label17.TabIndex = 67;
this.label17.Text = "Discounts Given";
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(12, 354);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(81, 13);
this.label16.TabIndex = 68;
this.label16.Text = "Rates Changed";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(12, 406);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(53, 13);
this.label15.TabIndex = 70;
this.label15.Text = "Net Sales";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(12, 458);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(82, 13);
this.label14.TabIndex = 72;
this.label14.Text = "Cash Deposited";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(12, 484);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(37, 13);
this.label13.TabIndex = 73;
this.label13.Text = "Status";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(12, 380);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(62, 13);
this.label12.TabIndex = 69;
this.label12.Text = "Bill Pending";
//
// btnCalculate
//
this.btnCalculate.Location = new System.Drawing.Point(12, 507);
this.btnCalculate.Name = "btnCalculate";
this.btnCalculate.Size = new System.Drawing.Size(287, 23);
this.btnCalculate.TabIndex = 39;
this.btnCalculate.Text = "&Calculate";
this.btnCalculate.UseVisualStyleBackColor = true;
this.btnCalculate.Click += new System.EventHandler(this.BtnCalculateClick);
//
// btnPrint
//
this.btnPrint.Location = new System.Drawing.Point(12, 536);
this.btnPrint.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btnPrint.Location = new System.Drawing.Point(15, 262);
this.btnPrint.Name = "btnPrint";
this.btnPrint.Size = new System.Drawing.Size(287, 23);
this.btnPrint.TabIndex = 40;
@ -179,40 +66,6 @@
this.btnPrint.UseVisualStyleBackColor = true;
this.btnPrint.Click += new System.EventHandler(this.BtnPrintClick);
//
// txtStatus
//
this.txtStatus.Location = new System.Drawing.Point(99, 481);
this.txtStatus.Name = "txtStatus";
this.txtStatus.ReadOnly = true;
this.txtStatus.Size = new System.Drawing.Size(200, 20);
this.txtStatus.TabIndex = 56;
//
// txtSales
//
this.txtSales.Location = new System.Drawing.Point(99, 403);
this.txtSales.Name = "txtSales";
this.txtSales.ReadOnly = true;
this.txtSales.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtSales.Size = new System.Drawing.Size(200, 20);
this.txtSales.TabIndex = 54;
//
// txtDeposited
//
this.txtDeposited.Location = new System.Drawing.Point(99, 455);
this.txtDeposited.Name = "txtDeposited";
this.txtDeposited.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtDeposited.Size = new System.Drawing.Size(200, 20);
this.txtDeposited.TabIndex = 38;
//
// txtPending
//
this.txtPending.Location = new System.Drawing.Point(99, 377);
this.txtPending.Name = "txtPending";
this.txtPending.ReadOnly = true;
this.txtPending.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtPending.Size = new System.Drawing.Size(200, 20);
this.txtPending.TabIndex = 53;
//
// cmbCashier
//
this.cmbCashier.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@ -241,255 +94,44 @@
this.label9.TabIndex = 58;
this.label9.Text = "Cashier";
//
// label8
// dgvSale
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(12, 302);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(81, 13);
this.label8.TabIndex = 66;
this.label8.Text = "Voids in System";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(12, 276);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(82, 13);
this.label7.TabIndex = 65;
this.label7.Text = "Additional Voids";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(12, 250);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(53, 13);
this.label6.TabIndex = 64;
this.label6.Text = "Payments";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(12, 224);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(76, 13);
this.label5.TabIndex = 63;
this.label5.Text = "Cash Receipts";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 146);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(66, 13);
this.label4.TabIndex = 62;
this.label4.Text = "CC Receipts";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 120);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(78, 13);
this.label3.TabIndex = 61;
this.label3.Text = "Adv. Received";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 94);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(49, 13);
this.label2.TabIndex = 60;
this.label2.Text = "Receipts";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 68);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 13);
this.label1.TabIndex = 59;
this.label1.Text = "Opening";
//
// txtPayments
//
this.txtPayments.Location = new System.Drawing.Point(99, 247);
this.txtPayments.Name = "txtPayments";
this.txtPayments.ReadOnly = true;
this.txtPayments.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtPayments.Size = new System.Drawing.Size(200, 20);
this.txtPayments.TabIndex = 48;
//
// txtCashReceipts
//
this.txtCashReceipts.Location = new System.Drawing.Point(99, 221);
this.txtCashReceipts.Name = "txtCashReceipts";
this.txtCashReceipts.ReadOnly = true;
this.txtCashReceipts.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtCashReceipts.Size = new System.Drawing.Size(200, 20);
this.txtCashReceipts.TabIndex = 47;
//
// txtCCReceipts
//
this.txtCCReceipts.Location = new System.Drawing.Point(99, 143);
this.txtCCReceipts.Name = "txtCCReceipts";
this.txtCCReceipts.ReadOnly = true;
this.txtCCReceipts.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtCCReceipts.Size = new System.Drawing.Size(200, 20);
this.txtCCReceipts.TabIndex = 46;
//
// txtAdditionalVoids
//
this.txtAdditionalVoids.Location = new System.Drawing.Point(99, 273);
this.txtAdditionalVoids.Name = "txtAdditionalVoids";
this.txtAdditionalVoids.ReadOnly = true;
this.txtAdditionalVoids.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtAdditionalVoids.Size = new System.Drawing.Size(200, 20);
this.txtAdditionalVoids.TabIndex = 49;
//
// txtVoidsInSystem
//
this.txtVoidsInSystem.Location = new System.Drawing.Point(99, 299);
this.txtVoidsInSystem.Name = "txtVoidsInSystem";
this.txtVoidsInSystem.ReadOnly = true;
this.txtVoidsInSystem.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtVoidsInSystem.Size = new System.Drawing.Size(200, 20);
this.txtVoidsInSystem.TabIndex = 50;
//
// txtDiscounts
//
this.txtDiscounts.Location = new System.Drawing.Point(99, 325);
this.txtDiscounts.Name = "txtDiscounts";
this.txtDiscounts.ReadOnly = true;
this.txtDiscounts.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtDiscounts.Size = new System.Drawing.Size(200, 20);
this.txtDiscounts.TabIndex = 51;
//
// txtRates
//
this.txtRates.Location = new System.Drawing.Point(99, 351);
this.txtRates.Name = "txtRates";
this.txtRates.ReadOnly = true;
this.txtRates.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtRates.Size = new System.Drawing.Size(200, 20);
this.txtRates.TabIndex = 52;
//
// txtAdvanceReceived
//
this.txtAdvanceReceived.Location = new System.Drawing.Point(99, 117);
this.txtAdvanceReceived.Name = "txtAdvanceReceived";
this.txtAdvanceReceived.ReadOnly = true;
this.txtAdvanceReceived.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtAdvanceReceived.Size = new System.Drawing.Size(200, 20);
this.txtAdvanceReceived.TabIndex = 45;
//
// txtReceipts
//
this.txtReceipts.Location = new System.Drawing.Point(99, 91);
this.txtReceipts.Name = "txtReceipts";
this.txtReceipts.ReadOnly = true;
this.txtReceipts.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtReceipts.Size = new System.Drawing.Size(200, 20);
this.txtReceipts.TabIndex = 44;
//
// txtOpening
//
this.txtOpening.Location = new System.Drawing.Point(99, 65);
this.txtOpening.Name = "txtOpening";
this.txtOpening.ReadOnly = true;
this.txtOpening.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtOpening.Size = new System.Drawing.Size(200, 20);
this.txtOpening.TabIndex = 43;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(12, 198);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(79, 13);
this.label11.TabIndex = 77;
this.label11.Text = "Bill to Company";
//
// NC
//
this.NC.AutoSize = true;
this.NC.Location = new System.Drawing.Point(12, 172);
this.NC.Name = "NC";
this.NC.Size = new System.Drawing.Size(58, 13);
this.NC.TabIndex = 76;
this.NC.Text = "No Charge";
//
// txtBillToCompany
//
this.txtBillToCompany.Location = new System.Drawing.Point(99, 195);
this.txtBillToCompany.Name = "txtBillToCompany";
this.txtBillToCompany.ReadOnly = true;
this.txtBillToCompany.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtBillToCompany.Size = new System.Drawing.Size(200, 20);
this.txtBillToCompany.TabIndex = 75;
//
// txtNC
//
this.txtNC.Location = new System.Drawing.Point(99, 169);
this.txtNC.Name = "txtNC";
this.txtNC.ReadOnly = true;
this.txtNC.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.txtNC.Size = new System.Drawing.Size(200, 20);
this.txtNC.TabIndex = 74;
this.dgvSale.AllowUserToAddRows = false;
this.dgvSale.AllowUserToDeleteRows = false;
this.dgvSale.AllowUserToResizeRows = false;
this.dgvSale.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvSale.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvSale.Location = new System.Drawing.Point(15, 65);
this.dgvSale.MultiSelect = false;
this.dgvSale.Name = "dgvSale";
this.dgvSale.ReadOnly = true;
this.dgvSale.RowHeadersVisible = false;
this.dgvSale.RowTemplate.Height = 19;
this.dgvSale.RowTemplate.ReadOnly = true;
this.dgvSale.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvSale.Size = new System.Drawing.Size(287, 187);
this.dgvSale.TabIndex = 59;
//
// CashierCheckoutForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(311, 571);
this.Controls.Add(this.label11);
this.Controls.Add(this.NC);
this.Controls.Add(this.txtBillToCompany);
this.Controls.Add(this.txtNC);
this.Controls.Add(this.label18);
this.Controls.Add(this.txtClosingCash);
this.ClientSize = new System.Drawing.Size(311, 297);
this.Controls.Add(this.dgvSale);
this.Controls.Add(this.dtpFinish);
this.Controls.Add(this.dtpStart);
this.Controls.Add(this.label17);
this.Controls.Add(this.label16);
this.Controls.Add(this.label15);
this.Controls.Add(this.label14);
this.Controls.Add(this.label13);
this.Controls.Add(this.label12);
this.Controls.Add(this.btnCalculate);
this.Controls.Add(this.btnPrint);
this.Controls.Add(this.txtStatus);
this.Controls.Add(this.txtSales);
this.Controls.Add(this.txtDeposited);
this.Controls.Add(this.txtPending);
this.Controls.Add(this.cmbCashier);
this.Controls.Add(this.label10);
this.Controls.Add(this.label9);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtPayments);
this.Controls.Add(this.txtCashReceipts);
this.Controls.Add(this.txtCCReceipts);
this.Controls.Add(this.txtAdditionalVoids);
this.Controls.Add(this.txtVoidsInSystem);
this.Controls.Add(this.txtDiscounts);
this.Controls.Add(this.txtRates);
this.Controls.Add(this.txtAdvanceReceived);
this.Controls.Add(this.txtReceipts);
this.Controls.Add(this.txtOpening);
this.MaximizeBox = false;
this.Name = "CashierCheckoutForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Cashier Checkout Form";
this.Load += new System.EventHandler(this.CashierCheckoutFormLoad);
this.Load += new System.EventHandler(this.CashierCheckoutForm_Load);
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -497,46 +139,12 @@
#endregion
private System.Windows.Forms.Label label18;
private System.Windows.Forms.TextBox txtClosingCash;
private System.Windows.Forms.DateTimePicker dtpFinish;
private System.Windows.Forms.DateTimePicker dtpStart;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Button btnCalculate;
private System.Windows.Forms.Button btnPrint;
private System.Windows.Forms.TextBox txtStatus;
private System.Windows.Forms.TextBox txtSales;
private System.Windows.Forms.TextBox txtDeposited;
private System.Windows.Forms.TextBox txtPending;
private System.Windows.Forms.ComboBox cmbCashier;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtPayments;
private System.Windows.Forms.TextBox txtCashReceipts;
private System.Windows.Forms.TextBox txtCCReceipts;
private System.Windows.Forms.TextBox txtAdditionalVoids;
private System.Windows.Forms.TextBox txtVoidsInSystem;
private System.Windows.Forms.TextBox txtDiscounts;
private System.Windows.Forms.TextBox txtRates;
private System.Windows.Forms.TextBox txtAdvanceReceived;
private System.Windows.Forms.TextBox txtReceipts;
private System.Windows.Forms.TextBox txtOpening;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label NC;
private System.Windows.Forms.TextBox txtBillToCompany;
private System.Windows.Forms.TextBox txtNC;
private System.Windows.Forms.DataGridView dgvSale;
}
}

View File

@ -1,7 +1,10 @@
using System;
using System.Linq;
using System.Windows.Forms;
using Tanshu.Accounts.Repository;
using Tanshu.Accounts.Print;
using Tanshu.Accounts.Entities;
using System.Collections.Generic;
namespace Tanshu.Accounts.PointOfSale
{
@ -15,7 +18,7 @@ namespace Tanshu.Accounts.PointOfSale
InitializeComponent();
}
private void CashierCheckoutFormLoad(object sender, EventArgs e)
private void CashierCheckoutForm_Load(object sender, EventArgs e)
{
dtpStart.Format = DateTimePickerFormat.Custom;
dtpStart.CustomFormat = "dd-MMM-yyyy";
@ -23,42 +26,38 @@ namespace Tanshu.Accounts.PointOfSale
dtpFinish.Format = DateTimePickerFormat.Custom;
dtpFinish.CustomFormat = "dd-MMM-yyyy";
dtpFinish.Value = DateTime.Now.Date;
FillUsers();
_loading = false;
FillUsers();
}
private void FillUsers()
{
var loading = _loading;
_loading = true;
cmbCashier.DisplayMember = "Name";
cmbCashier.ValueMember = "UserID";
using (var bi = new UserBI())
cmbCashier.DataSource = bi.ListActive(dtpStart.Value.Date.AddHours(7), dtpFinish.Value.Date.AddDays(1).AddHours(7));
_loading = loading;
_loading = false;
}
private void CmbCashierSelectedIndexChanged(object sender, EventArgs e)
{
EmployeeStatus();
//log.Warn(string.Format("User Checkout: {0} by {1}", coProxy.Cashier, Session.User.Name));
ShowStatement();
}
private void EmployeeStatus()
private void ShowStatement()
{
if (_loading || cmbCashier.SelectedValue == null)
return;
_coProxy = new CheckoutBI((Guid)cmbCashier.SelectedValue, dtpStart.Value, dtpFinish.Value);
txtCCReceipts.Text = string.Format("{0:#,##0.00}", _coProxy.CcReceipts);
txtNC.Text = string.Format("{0:#,##0.00}", _coProxy.NcReceipts);
txtBillToCompany.Text = string.Format("{0:#,##0.00}", _coProxy.BtcReceipts);
txtCashReceipts.Text = string.Format("{0:#,##0.00}", _coProxy.CashReceipts);
txtVoidsInSystem.Text = string.Format("{0:#,##0.00}", _coProxy.VoidsInSystem);
txtDiscounts.Text = string.Format("{0:#,##0.00}", _coProxy.Discount);
txtPending.Text = string.Format("{0:#,##0.00}", _coProxy.PendingBills);
txtSales.Text = string.Format("{0:#,##0.00}", _coProxy.CashReceipts);
txtClosingCash.Text = string.Format("{0:#,##0.00}", _coProxy.ClosingBalance);
txtStatus.Text = _coProxy.Status;
var list = _coProxy.amounts.ToList() ;
dgvSale.DataSource = list;
dgvSale.AutoGenerateColumns = true;
dgvSale.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
dgvSale.Columns[0].HeaderText = "Item";
dgvSale.Columns[1].HeaderText = "Amount";
dgvSale.Columns[1].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
dgvSale.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
}
private void DtpStartValueChanged(object sender, EventArgs e)
@ -71,16 +70,6 @@ namespace Tanshu.Accounts.PointOfSale
FillUsers();
}
private void BtnCalculateClick(object sender, EventArgs e)
{
decimal deposited = 0;
if (!decimal.TryParse(txtDeposited.Text, out deposited))
deposited = 0;
_coProxy.Calculate();
txtStatus.Text = _coProxy.Status;
}
private void BtnPrintClick(object sender, EventArgs e)
{
Thermal.PrintClosing(_coProxy);

View File

@ -9,11 +9,25 @@ namespace Tanshu.Accounts.PointOfSale
public partial class frmSaleAnalysisForm : Form
{
IList<SalesAnalysis> _list;
bool _loading;
public frmSaleAnalysisForm()
{
_loading = true;
InitializeComponent();
}
private void SaleAnalysisForm_Load(object sender, EventArgs e)
{
dtpStart.Format = DateTimePickerFormat.Custom;
dtpStart.CustomFormat = "dd-MMM-yyyy";
dtpStart.Value = DateTime.Now.Date;
dtpFinish.Format = DateTimePickerFormat.Custom;
dtpFinish.CustomFormat = "dd-MMM-yyyy";
dtpFinish.Value = DateTime.Now.Date;
_loading = false;
ShowStatement();
}
private void dtpStart_ValueChanged(object sender, EventArgs e)
{
ShowStatement();
@ -21,6 +35,8 @@ namespace Tanshu.Accounts.PointOfSale
private void ShowStatement()
{
if (_loading)
return;
if (DateTime.Today.Subtract(dtpStart.Value.Date).Days > 5 &&
!Session.IsAllowed("Accounts Audit"))
return;
@ -39,13 +55,6 @@ namespace Tanshu.Accounts.PointOfSale
ShowStatement();
}
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
{
dtpStart.Value = DateTime.Today;
dtpFinish.Value = DateTime.Today;
ShowStatement();
}
private void btnPrint_Click(object sender, EventArgs e)
{
if (_list != null)

View File

@ -110,7 +110,7 @@
this.Name = "frmSaleAnalysisForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Sale Analysis Form";
this.Load += new System.EventHandler(this.Sale_Analysis_Form_Load);
this.Load += new System.EventHandler(this.SaleAnalysisForm_Load);
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -45,13 +45,10 @@ namespace Tanshu.Accounts.PointOfSale.Sales
}
else
{
if (voucher.BillID.HasValue)
{
txtBillID.Text = voucher.BillID.Value.ToString();
}
txtBillID.Text = voucher.FullBillID;
txtKotID.Text = "K-" + voucher.KotID.ToString();
txtCreationDate.Text = voucher.CreationDate.ToString("HH:mm dd-MMM-yyyy");
txtDate.Text = voucher.Date.Value.ToString("HH:mm dd-MMM-yyyy");
txtDate.Text = voucher.Date.ToString("HH:mm dd-MMM-yyyy");
txtLastEditDate.Text = voucher.LastEditDate.ToString("HH:mm dd-MMM-yyyy");
btnCustomer.Text = voucher.Customer.Name;
txtTableID.Text = voucher.Table.Name;

View File

@ -51,10 +51,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Include\NHibernate\Iesi.Collections.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Include\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NHibernate, Version=3.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Include\NHibernate\NHibernate.dll</HintPath>