Feature: Added service tax and changed around a lot of SQL structure. Run the conversion sql file or it won't work.

This commit is contained in:
Amritanshu
2013-11-28 16:09:33 +05:30
parent b6498a7b1c
commit c36240398f
92 changed files with 434 additions and 1798 deletions

View File

@ -217,7 +217,7 @@ namespace Tanshu.Accounts.PointOfSale
return;
else
{
SetQuantity(product, amount / (product.Price * (1 + product.Tax) * (1 - product.Discount)), true, false, bindingSource, bill);
SetQuantity(product, amount / (product.Price * (1 + product.Vat + product.ServiceTax) * (1 - product.Discount)), true, false, bindingSource, bill);
}
}
#endregion

View File

@ -28,7 +28,6 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.chkImportant = new System.Windows.Forms.CheckBox();
this.txtRemarks = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
@ -36,9 +35,6 @@
this.label4 = new System.Windows.Forms.Label();
this.txtPhone = new System.Windows.Forms.TextBox();
this.txtAddress = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.cmbLedger = new System.Windows.Forms.ComboBox();
this.bsLedgers = new System.Windows.Forms.BindingSource(this.components);
this.label2 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.btnSave = new System.Windows.Forms.Button();
@ -46,7 +42,6 @@
this.btnCancel = new System.Windows.Forms.Button();
this.Label1 = new System.Windows.Forms.Label();
this.txtUniqueID = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.bsLedgers)).BeginInit();
this.SuspendLayout();
//
// chkImportant
@ -110,31 +105,6 @@
this.txtAddress.Size = new System.Drawing.Size(292, 85);
this.txtAddress.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(35, 67);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(40, 13);
this.label3.TabIndex = 10;
this.label3.Text = "Ledger";
//
// cmbLedger
//
this.cmbLedger.DataSource = this.bsLedgers;
this.cmbLedger.DisplayMember = "Name";
this.cmbLedger.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbLedger.FormattingEnabled = true;
this.cmbLedger.Location = new System.Drawing.Point(81, 64);
this.cmbLedger.Name = "cmbLedger";
this.cmbLedger.Size = new System.Drawing.Size(292, 21);
this.cmbLedger.TabIndex = 15;
this.cmbLedger.ValueMember = "LedgerID";
//
// bsLedgers
//
this.bsLedgers.DataSource = typeof(Tanshu.Accounts.Contracts.LedgerBO);
//
// label2
//
this.label2.AutoSize = true;
@ -172,6 +142,7 @@
// btnCancel
//
this.btnCancel.AccessibleName = "Done";
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(301, 315);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(72, 24);
@ -220,8 +191,6 @@
this.Controls.Add(this.label4);
this.Controls.Add(this.txtPhone);
this.Controls.Add(this.txtAddress);
this.Controls.Add(this.label3);
this.Controls.Add(this.cmbLedger);
this.Controls.Add(this.label2);
this.Controls.Add(this.txtName);
this.MaximizeBox = false;
@ -230,7 +199,6 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Customers";
this.Load += new System.EventHandler(this.CustomersForm_Load);
((System.ComponentModel.ISupportInitialize)(this.bsLedgers)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -245,14 +213,11 @@
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtPhone;
private System.Windows.Forms.TextBox txtAddress;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox cmbLedger;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtName;
internal System.Windows.Forms.Button btnSave;
internal System.Windows.Forms.Button btnDelete;
internal System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.BindingSource bsLedgers;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.TextBox txtUniqueID;
}

View File

@ -23,13 +23,11 @@ namespace Tanshu.Accounts.PointOfSale
}
private void CustomersForm_Load(object sender, EventArgs e)
{
bsLedgers.DataSource = new CustomerBI().GetCustomerLedgers();
if (customerID.HasValue)
{
customer = new CustomerBI().GetCustomer(customerID.Value);
btnDelete.Enabled = true;
txtName.Text = customer.Name;
cmbLedger.SelectedValue = customer.LedgerID;
txtPhone.Text = customer.Phone;
txtAddress.Text = customer.Address;
txtRemarks.Text = customer.Remarks;
@ -71,12 +69,7 @@ namespace Tanshu.Accounts.PointOfSale
private bool ValidateValues()
{
bool returnType = true;
if (txtName.Text.Trim().Length > 0)
{
if (cmbLedger.SelectedValue == null)
return false;
}
else
if (txtName.Text.Trim().Length == 0)
return false;
return returnType;
}
@ -86,7 +79,6 @@ namespace Tanshu.Accounts.PointOfSale
customer = new CustomerBO();
UserBO user = CurrentUser.user;
customer.Name = txtName.Text;
customer.LedgerID = (Guid)cmbLedger.SelectedValue;
customer.Phone = txtPhone.Text;
customer.Address = txtAddress.Text;
customer.Remarks = txtRemarks.Text;

View File

@ -117,10 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="bsLedgers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="bsLedgers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -50,14 +50,9 @@ namespace Tanshu.Accounts.PointOfSale
}
decimal freeSale = 0, voids = 0, pending = 0, net = 0, tax = 0;
new SalesAnalysisBI().GetAdditionalInfo(ref freeSale, ref voids, ref pending, ref net, ref tax, startDate, finishDate);
decimal freeSale = new SalesAnalysisBI().GetFreeSale(startDate, finishDate);
txtVoid.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", voids);
txtPending.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", pending);
txtNet.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", net);
txtTax.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", tax);
txtGross.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", net + tax);
txtFreeSale.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", freeSale);
}
private void dtpFinish_ValueChanged(object sender, EventArgs e)
@ -75,7 +70,7 @@ namespace Tanshu.Accounts.PointOfSale
private void dgvSale_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (!_details.HasValue)
_details = ((SalesAnalysisBO)dgvSale.SelectedRows[0].DataBoundItem).TypeID;
_details = ((SalesAnalysisBO)dgvSale.SelectedRows[0].DataBoundItem).ProductGroupID;
else
_details = null;
ShowStatement();

View File

@ -28,16 +28,8 @@
/// </summary>
private void InitializeComponent()
{
this.txtNet = new System.Windows.Forms.TextBox();
this.txtTax = new System.Windows.Forms.TextBox();
this.txtGross = new System.Windows.Forms.TextBox();
this.txtPending = new System.Windows.Forms.TextBox();
this.txtVoid = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtFreeSale = 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.dgvSale = new System.Windows.Forms.DataGridView();
this.dtpFinish = new System.Windows.Forms.DateTimePicker();
this.dtpStart = new System.Windows.Forms.DateTimePicker();
@ -46,54 +38,13 @@
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).BeginInit();
this.SuspendLayout();
//
// txtNet
// txtFreeSale
//
this.txtNet.Location = new System.Drawing.Point(224, 487);
this.txtNet.Name = "txtNet";
this.txtNet.ReadOnly = true;
this.txtNet.Size = new System.Drawing.Size(100, 20);
this.txtNet.TabIndex = 17;
//
// txtTax
//
this.txtTax.Location = new System.Drawing.Point(330, 487);
this.txtTax.Name = "txtTax";
this.txtTax.ReadOnly = true;
this.txtTax.Size = new System.Drawing.Size(100, 20);
this.txtTax.TabIndex = 18;
//
// txtGross
//
this.txtGross.Location = new System.Drawing.Point(436, 487);
this.txtGross.Name = "txtGross";
this.txtGross.ReadOnly = true;
this.txtGross.Size = new System.Drawing.Size(100, 20);
this.txtGross.TabIndex = 19;
//
// txtPending
//
this.txtPending.Location = new System.Drawing.Point(118, 487);
this.txtPending.Name = "txtPending";
this.txtPending.ReadOnly = true;
this.txtPending.Size = new System.Drawing.Size(100, 20);
this.txtPending.TabIndex = 16;
//
// txtVoid
//
this.txtVoid.Location = new System.Drawing.Point(12, 487);
this.txtVoid.Name = "txtVoid";
this.txtVoid.ReadOnly = true;
this.txtVoid.Size = new System.Drawing.Size(100, 20);
this.txtVoid.TabIndex = 15;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(115, 471);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(70, 13);
this.label5.TabIndex = 24;
this.label5.Text = "Pending Sale";
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
//
@ -102,34 +53,7 @@
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(52, 13);
this.label4.TabIndex = 23;
this.label4.Text = "Void Sale";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(327, 471);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(25, 13);
this.label3.TabIndex = 26;
this.label3.Text = "Tax";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(433, 471);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(58, 13);
this.label2.TabIndex = 27;
this.label2.Text = "Gross Sale";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(221, 471);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 13);
this.label1.TabIndex = 25;
this.label1.Text = "Net Sale";
this.label4.Text = "Free Sale";
//
// dgvSale
//
@ -194,16 +118,8 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(548, 519);
this.Controls.Add(this.btnPrint);
this.Controls.Add(this.txtNet);
this.Controls.Add(this.txtTax);
this.Controls.Add(this.txtGross);
this.Controls.Add(this.txtPending);
this.Controls.Add(this.txtVoid);
this.Controls.Add(this.label5);
this.Controls.Add(this.txtFreeSale);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.dgvSale);
this.Controls.Add(this.dtpFinish);
this.Controls.Add(this.dtpStart);
@ -221,16 +137,8 @@
#endregion
private System.Windows.Forms.TextBox txtNet;
private System.Windows.Forms.TextBox txtTax;
private System.Windows.Forms.TextBox txtGross;
private System.Windows.Forms.TextBox txtPending;
private System.Windows.Forms.TextBox txtVoid;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtFreeSale;
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.DataGridView dgvSale;
private System.Windows.Forms.DateTimePicker dtpFinish;
private System.Windows.Forms.DateTimePicker dtpStart;

View File

@ -262,7 +262,7 @@ namespace Tanshu.Accounts.PointOfSale
}
private void CalculateAmount()
{
txtGrossTax.Text = string.Format("{0:#0.00}", bill.Values.Sum(b => b.TaxAmount));
txtGrossTax.Text = string.Format("{0:#0.00}", bill.Values.Sum(b => b.TotalTax));
txtDiscount.Text = string.Format("{0:#0.00}", bill.Values.Sum(b => b.DiscountAmount));
txtGrossAmount.Text = string.Format("{0:#0.00}", bill.Values.Sum(b => b.GrossAmount));
txtAmount.Text = string.Format("{0:#0.00}", Math.Round(bill.Values.Sum(b => b.Value)));
@ -424,8 +424,6 @@ namespace Tanshu.Accounts.PointOfSale
Printed = finalBill,
Date = DateTime.Now,
Narration = txtNarration.Text,
Ref = "",
Type = 'S',
UserID = user.UserID,
Floor = _floor,
AdvanceID = _advanceID
@ -448,14 +446,11 @@ namespace Tanshu.Accounts.PointOfSale
var saleVoucher = new SaleVoucherBO
{
VoucherID = _billInfo.VoucherID,
timestamp = _billInfo.timestamp,
UserID = _billInfo.UserID,
Date = _billInfo.Date,
CreationDate = DateTime.Now,
LastEditDate = DateTime.Now,
Narration = _billInfo.Narration,
Ref = "",
Type = 'S',
Alarm = _billInfo.Alarm,
BillID = _billInfo.BillID,
CustomerID = customer.CustomerID,
@ -465,7 +460,6 @@ namespace Tanshu.Accounts.PointOfSale
TableID = txtTableID.Text,
VoidReason = _billInfo.VoidReason,
WaiterID = (Guid)btnWaiter.Tag,
SaleTimestamp = _billInfo.SaleTimestamp,
Floor = _floor,
AdvanceID = _advanceID
};
@ -533,7 +527,8 @@ namespace Tanshu.Accounts.PointOfSale
Price = inventory.Rate,
Printed = inventory.Quantity,
Quantity = inventory.Quantity,
Tax = inventory.Tax,
Vat = inventory.Vat,
ServiceTax = inventory.ServiceTax
});
}
CalculateAmount();