Moved numpad control to Tanshu.Common. Billing feature complete. Delete not working as expected
Signed-off-by: unknown <tanshu@.(none)>
This commit is contained in:
60
Tanshu.Accounts.PointOfSale/Advances/AdjustAdvanceForm.cs
Normal file
60
Tanshu.Accounts.PointOfSale/Advances/AdjustAdvanceForm.cs
Normal file
@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Helpers;
|
||||
using System.Data.SqlClient;
|
||||
using System.Configuration;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
using Tanshu.Accounts.Entities;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class AdjustAdvanceForm : Form
|
||||
{
|
||||
bool loading = true;
|
||||
public AdjustAdvanceForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void AdjustAdvancesForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpFrom.Format = DateTimePickerFormat.Custom;
|
||||
dtpFrom.CustomFormat = "dd-MMM-yyyy";
|
||||
dtpFrom.Value = DateTime.Now;
|
||||
dtpTo.Format = DateTimePickerFormat.Custom;
|
||||
dtpTo.CustomFormat = "dd-MMM-yyyy";
|
||||
dtpTo.Value = DateTime.Now;
|
||||
loading = false;
|
||||
FillDataGrid();
|
||||
}
|
||||
private void FillDataGrid()
|
||||
{
|
||||
dgExpenses.DataSource = new AdvanceBI().GetAdvances(dtpFrom.Value, dtpTo.Value, false);
|
||||
}
|
||||
private void dtpFrom_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!loading)
|
||||
FillDataGrid();
|
||||
}
|
||||
|
||||
private void btnSelect_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var item = (Advance)dgExpenses.SelectedRows[0].DataBoundItem;
|
||||
txtCashier.Text = item.CashierIn.Name;
|
||||
txtNarration.Tag = item.AdvanceID;
|
||||
txtNarration.Text = item.Narration;
|
||||
txtAmount.Text = item.Amount.ToString();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void btnAdjust_Click(object sender, EventArgs e)
|
||||
{
|
||||
new AdvanceBI().Adjust((int)txtNarration.Tag, Session.User.UserID);
|
||||
FillDataGrid();
|
||||
}
|
||||
}
|
||||
}
|
||||
270
Tanshu.Accounts.PointOfSale/Advances/AdjustAdvanceForm.designer.cs
generated
Normal file
270
Tanshu.Accounts.PointOfSale/Advances/AdjustAdvanceForm.designer.cs
generated
Normal file
@ -0,0 +1,270 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class AdjustAdvanceForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.btnAdjust = new System.Windows.Forms.Button();
|
||||
this.btnSelect = new System.Windows.Forms.Button();
|
||||
this.Label7 = new System.Windows.Forms.Label();
|
||||
this.txtNarration = new System.Windows.Forms.TextBox();
|
||||
this.txtAmount = new System.Windows.Forms.TextBox();
|
||||
this.lblAmount = new System.Windows.Forms.Label();
|
||||
this.txtCashier = new System.Windows.Forms.TextBox();
|
||||
this.Label5 = new System.Windows.Forms.Label();
|
||||
this.txtVoid = new System.Windows.Forms.TextBox();
|
||||
this.txtAmt = new System.Windows.Forms.TextBox();
|
||||
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.dtpTo = new System.Windows.Forms.DateTimePicker();
|
||||
this.dtpFrom = new System.Windows.Forms.DateTimePicker();
|
||||
this.dgExpenses = new System.Windows.Forms.DataGridView();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgExpenses)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnAdjust
|
||||
//
|
||||
this.btnAdjust.Location = new System.Drawing.Point(142, 113);
|
||||
this.btnAdjust.Name = "btnAdjust";
|
||||
this.btnAdjust.Size = new System.Drawing.Size(75, 21);
|
||||
this.btnAdjust.TabIndex = 111;
|
||||
this.btnAdjust.Text = "&Adjust";
|
||||
this.btnAdjust.Click += new System.EventHandler(this.btnAdjust_Click);
|
||||
//
|
||||
// btnSelect
|
||||
//
|
||||
this.btnSelect.Location = new System.Drawing.Point(61, 113);
|
||||
this.btnSelect.Name = "btnSelect";
|
||||
this.btnSelect.Size = new System.Drawing.Size(75, 21);
|
||||
this.btnSelect.TabIndex = 110;
|
||||
this.btnSelect.Text = "&Select";
|
||||
this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
|
||||
//
|
||||
// Label7
|
||||
//
|
||||
this.Label7.AutoSize = true;
|
||||
this.Label7.Location = new System.Drawing.Point(6, 92);
|
||||
this.Label7.Name = "Label7";
|
||||
this.Label7.Size = new System.Drawing.Size(50, 13);
|
||||
this.Label7.TabIndex = 109;
|
||||
this.Label7.Text = "Narration";
|
||||
//
|
||||
// txtNarration
|
||||
//
|
||||
this.txtNarration.Location = new System.Drawing.Point(61, 90);
|
||||
this.txtNarration.Name = "txtNarration";
|
||||
this.txtNarration.ReadOnly = true;
|
||||
this.txtNarration.Size = new System.Drawing.Size(330, 20);
|
||||
this.txtNarration.TabIndex = 108;
|
||||
//
|
||||
// txtAmount
|
||||
//
|
||||
this.txtAmount.Location = new System.Drawing.Point(61, 68);
|
||||
this.txtAmount.Name = "txtAmount";
|
||||
this.txtAmount.ReadOnly = true;
|
||||
this.txtAmount.Size = new System.Drawing.Size(100, 20);
|
||||
this.txtAmount.TabIndex = 107;
|
||||
//
|
||||
// lblAmount
|
||||
//
|
||||
this.lblAmount.AutoSize = true;
|
||||
this.lblAmount.Location = new System.Drawing.Point(11, 71);
|
||||
this.lblAmount.Name = "lblAmount";
|
||||
this.lblAmount.Size = new System.Drawing.Size(43, 13);
|
||||
this.lblAmount.TabIndex = 106;
|
||||
this.lblAmount.Text = "Amount";
|
||||
//
|
||||
// txtCashier
|
||||
//
|
||||
this.txtCashier.Location = new System.Drawing.Point(61, 47);
|
||||
this.txtCashier.Name = "txtCashier";
|
||||
this.txtCashier.ReadOnly = true;
|
||||
this.txtCashier.Size = new System.Drawing.Size(330, 20);
|
||||
this.txtCashier.TabIndex = 105;
|
||||
//
|
||||
// Label5
|
||||
//
|
||||
this.Label5.AutoSize = true;
|
||||
this.Label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Label5.Location = new System.Drawing.Point(56, 501);
|
||||
this.Label5.Name = "Label5";
|
||||
this.Label5.Size = new System.Drawing.Size(40, 16);
|
||||
this.Label5.TabIndex = 104;
|
||||
this.Label5.Text = "Void";
|
||||
//
|
||||
// txtVoid
|
||||
//
|
||||
this.txtVoid.BackColor = System.Drawing.Color.Black;
|
||||
this.txtVoid.ForeColor = System.Drawing.Color.Lime;
|
||||
this.txtVoid.Location = new System.Drawing.Point(112, 499);
|
||||
this.txtVoid.Name = "txtVoid";
|
||||
this.txtVoid.ReadOnly = true;
|
||||
this.txtVoid.Size = new System.Drawing.Size(100, 20);
|
||||
this.txtVoid.TabIndex = 103;
|
||||
this.txtVoid.Text = "0.00";
|
||||
this.txtVoid.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// txtAmt
|
||||
//
|
||||
this.txtAmt.BackColor = System.Drawing.Color.Black;
|
||||
this.txtAmt.ForeColor = System.Drawing.Color.Lime;
|
||||
this.txtAmt.Location = new System.Drawing.Point(281, 500);
|
||||
this.txtAmt.Name = "txtAmt";
|
||||
this.txtAmt.ReadOnly = true;
|
||||
this.txtAmt.Size = new System.Drawing.Size(110, 20);
|
||||
this.txtAmt.TabIndex = 102;
|
||||
this.txtAmt.Text = "0.00";
|
||||
this.txtAmt.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// Label4
|
||||
//
|
||||
this.Label4.AutoSize = true;
|
||||
this.Label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Label4.Location = new System.Drawing.Point(232, 502);
|
||||
this.Label4.Name = "Label4";
|
||||
this.Label4.Size = new System.Drawing.Size(44, 16);
|
||||
this.Label4.TabIndex = 101;
|
||||
this.Label4.Text = "Total";
|
||||
//
|
||||
// Label3
|
||||
//
|
||||
this.Label3.AutoSize = true;
|
||||
this.Label3.Location = new System.Drawing.Point(13, 52);
|
||||
this.Label3.Name = "Label3";
|
||||
this.Label3.Size = new System.Drawing.Size(42, 13);
|
||||
this.Label3.TabIndex = 100;
|
||||
this.Label3.Text = "Cashier";
|
||||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.AutoSize = true;
|
||||
this.Label2.Location = new System.Drawing.Point(171, 18);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(20, 13);
|
||||
this.Label2.TabIndex = 97;
|
||||
this.Label2.Text = "To";
|
||||
//
|
||||
// Label1
|
||||
//
|
||||
this.Label1.AutoSize = true;
|
||||
this.Label1.Location = new System.Drawing.Point(21, 18);
|
||||
this.Label1.Name = "Label1";
|
||||
this.Label1.Size = new System.Drawing.Size(30, 13);
|
||||
this.Label1.TabIndex = 95;
|
||||
this.Label1.Text = "From";
|
||||
//
|
||||
// dtpTo
|
||||
//
|
||||
this.dtpTo.Location = new System.Drawing.Point(191, 18);
|
||||
this.dtpTo.Name = "dtpTo";
|
||||
this.dtpTo.Size = new System.Drawing.Size(90, 20);
|
||||
this.dtpTo.TabIndex = 98;
|
||||
//
|
||||
// dtpFrom
|
||||
//
|
||||
this.dtpFrom.Location = new System.Drawing.Point(61, 18);
|
||||
this.dtpFrom.Name = "dtpFrom";
|
||||
this.dtpFrom.Size = new System.Drawing.Size(90, 20);
|
||||
this.dtpFrom.TabIndex = 96;
|
||||
this.dtpFrom.ValueChanged += new System.EventHandler(this.dtpFrom_ValueChanged);
|
||||
//
|
||||
// dgExpenses
|
||||
//
|
||||
this.dgExpenses.AllowUserToAddRows = false;
|
||||
this.dgExpenses.AllowUserToDeleteRows = false;
|
||||
this.dgExpenses.AllowUserToResizeRows = false;
|
||||
this.dgExpenses.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.dgExpenses.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgExpenses.Location = new System.Drawing.Point(13, 140);
|
||||
this.dgExpenses.Name = "dgExpenses";
|
||||
this.dgExpenses.ReadOnly = true;
|
||||
this.dgExpenses.RowHeadersVisible = false;
|
||||
this.dgExpenses.RowTemplate.Height = 19;
|
||||
this.dgExpenses.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgExpenses.Size = new System.Drawing.Size(378, 356);
|
||||
this.dgExpenses.TabIndex = 112;
|
||||
//
|
||||
// AdjustAdvanceForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(402, 536);
|
||||
this.Controls.Add(this.dgExpenses);
|
||||
this.Controls.Add(this.btnAdjust);
|
||||
this.Controls.Add(this.btnSelect);
|
||||
this.Controls.Add(this.Label7);
|
||||
this.Controls.Add(this.txtNarration);
|
||||
this.Controls.Add(this.txtAmount);
|
||||
this.Controls.Add(this.lblAmount);
|
||||
this.Controls.Add(this.txtCashier);
|
||||
this.Controls.Add(this.Label5);
|
||||
this.Controls.Add(this.txtVoid);
|
||||
this.Controls.Add(this.txtAmt);
|
||||
this.Controls.Add(this.Label4);
|
||||
this.Controls.Add(this.Label3);
|
||||
this.Controls.Add(this.Label2);
|
||||
this.Controls.Add(this.Label1);
|
||||
this.Controls.Add(this.dtpTo);
|
||||
this.Controls.Add(this.dtpFrom);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "AdjustAdvanceForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Payment Details";
|
||||
this.Load += new System.EventHandler(this.AdjustAdvancesForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgExpenses)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.Button btnAdjust;
|
||||
internal System.Windows.Forms.Button btnSelect;
|
||||
internal System.Windows.Forms.Label Label7;
|
||||
internal System.Windows.Forms.TextBox txtNarration;
|
||||
internal System.Windows.Forms.TextBox txtAmount;
|
||||
internal System.Windows.Forms.Label lblAmount;
|
||||
internal System.Windows.Forms.TextBox txtCashier;
|
||||
internal System.Windows.Forms.Label Label5;
|
||||
internal System.Windows.Forms.TextBox txtVoid;
|
||||
internal System.Windows.Forms.TextBox txtAmt;
|
||||
internal System.Windows.Forms.Label Label4;
|
||||
internal System.Windows.Forms.Label Label3;
|
||||
internal System.Windows.Forms.Label Label2;
|
||||
internal System.Windows.Forms.Label Label1;
|
||||
internal System.Windows.Forms.DateTimePicker dtpTo;
|
||||
internal System.Windows.Forms.DateTimePicker dtpFrom;
|
||||
private System.Windows.Forms.DataGridView dgExpenses;
|
||||
|
||||
}
|
||||
}
|
||||
120
Tanshu.Accounts.PointOfSale/Advances/AdjustAdvanceForm.resx
Normal file
120
Tanshu.Accounts.PointOfSale/Advances/AdjustAdvanceForm.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
83
Tanshu.Accounts.PointOfSale/Advances/RecieveAdvanceForm.cs
Normal file
83
Tanshu.Accounts.PointOfSale/Advances/RecieveAdvanceForm.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Helpers;
|
||||
using Tanshu.Accounts.Print;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Entities;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class RecieveAdvanceForm : Form
|
||||
{
|
||||
bool loading = true;
|
||||
public RecieveAdvanceForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Convert.ToDecimal(txtAmount.Text) == 0)
|
||||
return;
|
||||
Advance adv = new Advance();
|
||||
adv.Narration = txtNarration.Text;
|
||||
adv.Amount = Convert.ToDecimal(txtAmount.Text.Trim());
|
||||
adv.CashierIn = UserBI.GetUser((int)txtCashier.Tag);
|
||||
adv.DateIn = DateTime.Now;
|
||||
new AdvanceBI().Insert(adv);
|
||||
GridBind();
|
||||
PrintAdvances();
|
||||
}
|
||||
|
||||
|
||||
private void RecieveAdvanceForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpFrom.Format = DateTimePickerFormat.Custom;
|
||||
dtpFrom.CustomFormat = "dd-MMM-yyyy";
|
||||
dtpFrom.Value = DateTime.Now;
|
||||
dtpTo.Format = DateTimePickerFormat.Custom;
|
||||
dtpTo.CustomFormat = "dd-MMM-yyyy";
|
||||
dtpTo.Value = DateTime.Now;
|
||||
txtCashier.Text = Session.User.Name;
|
||||
txtCashier.Tag = Session.User.UserID;
|
||||
loading = false;
|
||||
GridBind();
|
||||
}
|
||||
|
||||
private void GridBind()
|
||||
{
|
||||
var advance = new AdvanceBI().GetAdvances(dtpFrom.Value, dtpTo.Value, true);
|
||||
dgExpenses.DataSource = advance;
|
||||
}
|
||||
|
||||
private void dtpFrom_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!loading)
|
||||
GridBind();
|
||||
}
|
||||
private void PrintAdvances()
|
||||
{
|
||||
Thermal.PrintAdvance(Session.User.Name, txtAmount.Text.Trim(), txtNarration.Text.Trim());
|
||||
}
|
||||
private string AddDate(string SqlStringP, DateTime FromDate, DateTime ToDate)
|
||||
{
|
||||
return SqlStringP.Replace("$From$", string.Format(FromDate.ToString(), "dd-MMM-yyyy" + " 05:00:00")).Replace("$To$", string.Format(ToDate.ToString(), "dd-MMM-yyyy" + " 23:59:59"));
|
||||
}
|
||||
|
||||
private void txtAmount_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void txtAmount_Leave(object sender, EventArgs e)
|
||||
{
|
||||
if (txtAmount.Text.Trim() == "")
|
||||
{
|
||||
txtAmount.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
258
Tanshu.Accounts.PointOfSale/Advances/RecieveAdvanceForm.designer.cs
generated
Normal file
258
Tanshu.Accounts.PointOfSale/Advances/RecieveAdvanceForm.designer.cs
generated
Normal file
@ -0,0 +1,258 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class RecieveAdvanceForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.btnAdd = new System.Windows.Forms.Button();
|
||||
this.Label7 = new System.Windows.Forms.Label();
|
||||
this.txtNarration = new System.Windows.Forms.TextBox();
|
||||
this.txtAmount = new System.Windows.Forms.TextBox();
|
||||
this.lblAmount = new System.Windows.Forms.Label();
|
||||
this.txtCashier = new System.Windows.Forms.TextBox();
|
||||
this.Label5 = new System.Windows.Forms.Label();
|
||||
this.txtVoid = new System.Windows.Forms.TextBox();
|
||||
this.txtAmt = new System.Windows.Forms.TextBox();
|
||||
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.dtpTo = new System.Windows.Forms.DateTimePicker();
|
||||
this.dtpFrom = new System.Windows.Forms.DateTimePicker();
|
||||
this.dgExpenses = new System.Windows.Forms.DataGridView();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgExpenses)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Location = new System.Drawing.Point(60, 115);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(75, 21);
|
||||
this.btnAdd.TabIndex = 109;
|
||||
this.btnAdd.Text = "&Add";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// Label7
|
||||
//
|
||||
this.Label7.AutoSize = true;
|
||||
this.Label7.Location = new System.Drawing.Point(12, 92);
|
||||
this.Label7.Name = "Label7";
|
||||
this.Label7.Size = new System.Drawing.Size(50, 13);
|
||||
this.Label7.TabIndex = 108;
|
||||
this.Label7.Text = "Narration";
|
||||
//
|
||||
// txtNarration
|
||||
//
|
||||
this.txtNarration.Location = new System.Drawing.Point(68, 89);
|
||||
this.txtNarration.Name = "txtNarration";
|
||||
this.txtNarration.Size = new System.Drawing.Size(322, 20);
|
||||
this.txtNarration.TabIndex = 107;
|
||||
//
|
||||
// txtAmount
|
||||
//
|
||||
this.txtAmount.Location = new System.Drawing.Point(68, 64);
|
||||
this.txtAmount.Name = "txtAmount";
|
||||
this.txtAmount.Size = new System.Drawing.Size(92, 20);
|
||||
this.txtAmount.TabIndex = 106;
|
||||
this.txtAmount.Text = "0";
|
||||
this.txtAmount.TextChanged += new System.EventHandler(this.txtAmount_TextChanged);
|
||||
this.txtAmount.Leave += new System.EventHandler(this.txtAmount_Leave);
|
||||
//
|
||||
// lblAmount
|
||||
//
|
||||
this.lblAmount.AutoSize = true;
|
||||
this.lblAmount.Location = new System.Drawing.Point(19, 67);
|
||||
this.lblAmount.Name = "lblAmount";
|
||||
this.lblAmount.Size = new System.Drawing.Size(43, 13);
|
||||
this.lblAmount.TabIndex = 105;
|
||||
this.lblAmount.Text = "Amount";
|
||||
//
|
||||
// txtCashier
|
||||
//
|
||||
this.txtCashier.Location = new System.Drawing.Point(68, 38);
|
||||
this.txtCashier.Name = "txtCashier";
|
||||
this.txtCashier.ReadOnly = true;
|
||||
this.txtCashier.Size = new System.Drawing.Size(322, 20);
|
||||
this.txtCashier.TabIndex = 104;
|
||||
//
|
||||
// Label5
|
||||
//
|
||||
this.Label5.AutoSize = true;
|
||||
this.Label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Label5.Location = new System.Drawing.Point(78, 505);
|
||||
this.Label5.Name = "Label5";
|
||||
this.Label5.Size = new System.Drawing.Size(40, 16);
|
||||
this.Label5.TabIndex = 103;
|
||||
this.Label5.Text = "Void";
|
||||
//
|
||||
// txtVoid
|
||||
//
|
||||
this.txtVoid.BackColor = System.Drawing.Color.Black;
|
||||
this.txtVoid.ForeColor = System.Drawing.Color.Lime;
|
||||
this.txtVoid.Location = new System.Drawing.Point(124, 504);
|
||||
this.txtVoid.Name = "txtVoid";
|
||||
this.txtVoid.ReadOnly = true;
|
||||
this.txtVoid.Size = new System.Drawing.Size(100, 20);
|
||||
this.txtVoid.TabIndex = 102;
|
||||
this.txtVoid.Text = "0.00";
|
||||
this.txtVoid.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// txtAmt
|
||||
//
|
||||
this.txtAmt.BackColor = System.Drawing.Color.Black;
|
||||
this.txtAmt.ForeColor = System.Drawing.Color.Lime;
|
||||
this.txtAmt.Location = new System.Drawing.Point(280, 504);
|
||||
this.txtAmt.Name = "txtAmt";
|
||||
this.txtAmt.ReadOnly = true;
|
||||
this.txtAmt.Size = new System.Drawing.Size(110, 20);
|
||||
this.txtAmt.TabIndex = 101;
|
||||
this.txtAmt.Text = "0.00";
|
||||
this.txtAmt.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// Label4
|
||||
//
|
||||
this.Label4.AutoSize = true;
|
||||
this.Label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Label4.Location = new System.Drawing.Point(230, 505);
|
||||
this.Label4.Name = "Label4";
|
||||
this.Label4.Size = new System.Drawing.Size(44, 16);
|
||||
this.Label4.TabIndex = 100;
|
||||
this.Label4.Text = "Total";
|
||||
//
|
||||
// Label3
|
||||
//
|
||||
this.Label3.AutoSize = true;
|
||||
this.Label3.Location = new System.Drawing.Point(20, 41);
|
||||
this.Label3.Name = "Label3";
|
||||
this.Label3.Size = new System.Drawing.Size(42, 13);
|
||||
this.Label3.TabIndex = 99;
|
||||
this.Label3.Text = "Cashier";
|
||||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.AutoSize = true;
|
||||
this.Label2.Location = new System.Drawing.Point(197, 18);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(20, 13);
|
||||
this.Label2.TabIndex = 96;
|
||||
this.Label2.Text = "To";
|
||||
//
|
||||
// Label1
|
||||
//
|
||||
this.Label1.AutoSize = true;
|
||||
this.Label1.Location = new System.Drawing.Point(32, 18);
|
||||
this.Label1.Name = "Label1";
|
||||
this.Label1.Size = new System.Drawing.Size(30, 13);
|
||||
this.Label1.TabIndex = 94;
|
||||
this.Label1.Text = "From";
|
||||
//
|
||||
// dtpTo
|
||||
//
|
||||
this.dtpTo.Location = new System.Drawing.Point(223, 12);
|
||||
this.dtpTo.Name = "dtpTo";
|
||||
this.dtpTo.Size = new System.Drawing.Size(167, 20);
|
||||
this.dtpTo.TabIndex = 97;
|
||||
//
|
||||
// dtpFrom
|
||||
//
|
||||
this.dtpFrom.Location = new System.Drawing.Point(68, 11);
|
||||
this.dtpFrom.Name = "dtpFrom";
|
||||
this.dtpFrom.Size = new System.Drawing.Size(121, 20);
|
||||
this.dtpFrom.TabIndex = 95;
|
||||
this.dtpFrom.ValueChanged += new System.EventHandler(this.dtpFrom_ValueChanged);
|
||||
//
|
||||
// dgExpenses
|
||||
//
|
||||
this.dgExpenses.AllowUserToAddRows = false;
|
||||
this.dgExpenses.AllowUserToDeleteRows = false;
|
||||
this.dgExpenses.AllowUserToResizeRows = false;
|
||||
this.dgExpenses.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.dgExpenses.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
|
||||
this.dgExpenses.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgExpenses.Location = new System.Drawing.Point(12, 142);
|
||||
this.dgExpenses.Name = "dgExpenses";
|
||||
this.dgExpenses.ReadOnly = true;
|
||||
this.dgExpenses.RowHeadersVisible = false;
|
||||
this.dgExpenses.RowTemplate.Height = 19;
|
||||
this.dgExpenses.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgExpenses.Size = new System.Drawing.Size(378, 356);
|
||||
this.dgExpenses.TabIndex = 110;
|
||||
//
|
||||
// RecieveAdvanceForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(402, 536);
|
||||
this.Controls.Add(this.dgExpenses);
|
||||
this.Controls.Add(this.btnAdd);
|
||||
this.Controls.Add(this.Label7);
|
||||
this.Controls.Add(this.txtNarration);
|
||||
this.Controls.Add(this.txtAmount);
|
||||
this.Controls.Add(this.lblAmount);
|
||||
this.Controls.Add(this.txtCashier);
|
||||
this.Controls.Add(this.Label5);
|
||||
this.Controls.Add(this.txtVoid);
|
||||
this.Controls.Add(this.txtAmt);
|
||||
this.Controls.Add(this.Label4);
|
||||
this.Controls.Add(this.Label3);
|
||||
this.Controls.Add(this.Label2);
|
||||
this.Controls.Add(this.Label1);
|
||||
this.Controls.Add(this.dtpTo);
|
||||
this.Controls.Add(this.dtpFrom);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "RecieveAdvanceForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Received Advance";
|
||||
this.Load += new System.EventHandler(this.RecieveAdvanceForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgExpenses)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.Button btnAdd;
|
||||
internal System.Windows.Forms.Label Label7;
|
||||
internal System.Windows.Forms.TextBox txtNarration;
|
||||
internal System.Windows.Forms.TextBox txtAmount;
|
||||
internal System.Windows.Forms.Label lblAmount;
|
||||
internal System.Windows.Forms.TextBox txtCashier;
|
||||
internal System.Windows.Forms.Label Label5;
|
||||
internal System.Windows.Forms.TextBox txtVoid;
|
||||
internal System.Windows.Forms.TextBox txtAmt;
|
||||
internal System.Windows.Forms.Label Label4;
|
||||
internal System.Windows.Forms.Label Label3;
|
||||
internal System.Windows.Forms.Label Label2;
|
||||
internal System.Windows.Forms.Label Label1;
|
||||
internal System.Windows.Forms.DateTimePicker dtpTo;
|
||||
internal System.Windows.Forms.DateTimePicker dtpFrom;
|
||||
private System.Windows.Forms.DataGridView dgExpenses;
|
||||
}
|
||||
}
|
||||
120
Tanshu.Accounts.PointOfSale/Advances/RecieveAdvanceForm.resx
Normal file
120
Tanshu.Accounts.PointOfSale/Advances/RecieveAdvanceForm.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user