Scripts to transition database to new version.
Changed inventory and product entities to split Vat and Service Tax and IsScTaxable. Added MessageBox on startup to inform about Debug Mode. Updated ProductForm for the change. Work still needs to be done on Thermal Printing where the hack for VAT on Food and VAT on Liqour is still there. Now No Service Tax on Delivery Works as promised.
This commit is contained in:
@ -280,7 +280,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
|
||||
private void ShowAmount()
|
||||
{
|
||||
var taxAmount = _bill.Values.Sum(b => b.TaxAmount);
|
||||
var taxAmount = _bill.Values.Sum(b => b.ServiceTaxAmount + b.VatAmount);
|
||||
var discountAmount = _bill.Values.Sum(b => b.DiscountAmount);
|
||||
var grossAmount = _bill.Values.Sum(b => b.GrossAmount);
|
||||
var valueAmount = _bill.Values.Sum(b => b.Value);
|
||||
@ -394,7 +394,9 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
Price = inv.Price,
|
||||
Printed = true,
|
||||
Quantity = inv.Quantity,
|
||||
Tax = inv.Tax,
|
||||
IsScTaxable = inv.IsScTaxable,
|
||||
ServiceTax = inv.ServiceTax,
|
||||
Vat = inv.Vat,
|
||||
ServiceCharge = inv.ServiceCharge,
|
||||
};
|
||||
foreach (var mod in inv.InventoryModifier)
|
||||
@ -976,7 +978,9 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
FullPrice = item.Value.FullPrice,
|
||||
Discount = item.Value.Discount,
|
||||
ServiceCharge = item.Value.ServiceCharge,
|
||||
Tax = item.Value.Tax
|
||||
IsScTaxable = item.Value.IsScTaxable,
|
||||
ServiceTax = item.Value.ServiceTax,
|
||||
Vat = item.Value.Vat
|
||||
};
|
||||
foreach (var mod in item.Value.Modifiers)
|
||||
inv.InventoryModifier.Add(new InventoryModifier { Modifier = mod });
|
||||
|
||||
@ -144,6 +144,9 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
#if (DEBUG)
|
||||
MessageBox.Show("This software does not print kots!!!","Debug Mode", MessageBoxButtons.OK , MessageBoxIcon.Exclamation);
|
||||
#endif
|
||||
CheckRoles();
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
this.Label4 = new System.Windows.Forms.Label();
|
||||
this.bsProductGroups = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.Label7 = new System.Windows.Forms.Label();
|
||||
this.bsTax = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.bsServiceTax = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.txtProductID = new System.Windows.Forms.TextBox();
|
||||
@ -41,7 +41,7 @@
|
||||
this.txtUnits = new System.Windows.Forms.TextBox();
|
||||
this.txtName = new System.Windows.Forms.TextBox();
|
||||
this.txtPrice = new System.Windows.Forms.TextBox();
|
||||
this.cmbTax = new System.Windows.Forms.ComboBox();
|
||||
this.cmbVat = new System.Windows.Forms.ComboBox();
|
||||
this.chkDiscontinued = new System.Windows.Forms.CheckBox();
|
||||
this.txtServiceCharge = new System.Windows.Forms.TextBox();
|
||||
this.btnAddProductGroup = new System.Windows.Forms.Button();
|
||||
@ -51,18 +51,24 @@
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.txtSortOrder = new System.Windows.Forms.TextBox();
|
||||
this.txtFullPrice = new System.Windows.Forms.TextBox();
|
||||
this.cmbServiceTax = new System.Windows.Forms.ComboBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.chkIsScTaxable = new System.Windows.Forms.CheckBox();
|
||||
this.bsVat = new System.Windows.Forms.BindingSource(this.components);
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsProductGroups)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsTax)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsServiceTax)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsVat)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// Label4
|
||||
//
|
||||
this.Label4.AutoSize = true;
|
||||
this.Label4.Location = new System.Drawing.Point(12, 68);
|
||||
this.Label4.Location = new System.Drawing.Point(25, 82);
|
||||
this.Label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.Label4.Name = "Label4";
|
||||
this.Label4.Size = new System.Drawing.Size(114, 13);
|
||||
this.Label4.Size = new System.Drawing.Size(110, 17);
|
||||
this.Label4.TabIndex = 15;
|
||||
this.Label4.Text = "Price / Full Price / Tax";
|
||||
this.Label4.Text = "Price / Full Price";
|
||||
//
|
||||
// bsProductGroups
|
||||
//
|
||||
@ -71,102 +77,113 @@
|
||||
// Label7
|
||||
//
|
||||
this.Label7.AutoSize = true;
|
||||
this.Label7.Location = new System.Drawing.Point(70, 119);
|
||||
this.Label7.Location = new System.Drawing.Point(93, 174);
|
||||
this.Label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.Label7.Name = "Label7";
|
||||
this.Label7.Size = new System.Drawing.Size(36, 13);
|
||||
this.Label7.Size = new System.Drawing.Size(48, 17);
|
||||
this.Label7.TabIndex = 17;
|
||||
this.Label7.Text = "Group";
|
||||
//
|
||||
// bsTax
|
||||
// bsServiceTax
|
||||
//
|
||||
this.bsTax.DataSource = typeof(Tanshu.Accounts.Entities.Tax);
|
||||
this.bsServiceTax.DataSource = typeof(Tanshu.Accounts.Entities.Tax);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(26, 93);
|
||||
this.label5.Location = new System.Drawing.Point(35, 142);
|
||||
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(80, 13);
|
||||
this.label5.Size = new System.Drawing.Size(105, 17);
|
||||
this.label5.TabIndex = 16;
|
||||
this.label5.Text = "Service Charge";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(12, 15);
|
||||
this.label3.Location = new System.Drawing.Point(16, 18);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(94, 13);
|
||||
this.label3.Size = new System.Drawing.Size(119, 17);
|
||||
this.label3.TabIndex = 13;
|
||||
this.label3.Text = "Product ID / Code";
|
||||
//
|
||||
// txtProductID
|
||||
//
|
||||
this.txtProductID.Location = new System.Drawing.Point(112, 12);
|
||||
this.txtProductID.Location = new System.Drawing.Point(149, 15);
|
||||
this.txtProductID.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.txtProductID.Name = "txtProductID";
|
||||
this.txtProductID.ReadOnly = true;
|
||||
this.txtProductID.Size = new System.Drawing.Size(189, 20);
|
||||
this.txtProductID.Size = new System.Drawing.Size(251, 22);
|
||||
this.txtProductID.TabIndex = 12;
|
||||
//
|
||||
// txtCode
|
||||
//
|
||||
this.txtCode.AccessibleName = "";
|
||||
this.txtCode.Location = new System.Drawing.Point(307, 12);
|
||||
this.txtCode.Location = new System.Drawing.Point(409, 15);
|
||||
this.txtCode.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.txtCode.Name = "txtCode";
|
||||
this.txtCode.Size = new System.Drawing.Size(96, 20);
|
||||
this.txtCode.Size = new System.Drawing.Size(127, 22);
|
||||
this.txtCode.TabIndex = 0;
|
||||
this.txtCode.WordWrap = false;
|
||||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.AutoSize = true;
|
||||
this.Label2.Location = new System.Drawing.Point(36, 41);
|
||||
this.Label2.Location = new System.Drawing.Point(48, 50);
|
||||
this.Label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(70, 13);
|
||||
this.Label2.Size = new System.Drawing.Size(89, 17);
|
||||
this.Label2.TabIndex = 14;
|
||||
this.Label2.Text = "Name / Units";
|
||||
//
|
||||
// txtUnits
|
||||
//
|
||||
this.txtUnits.AccessibleName = "";
|
||||
this.txtUnits.Location = new System.Drawing.Point(307, 38);
|
||||
this.txtUnits.Location = new System.Drawing.Point(409, 47);
|
||||
this.txtUnits.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.txtUnits.Name = "txtUnits";
|
||||
this.txtUnits.Size = new System.Drawing.Size(96, 20);
|
||||
this.txtUnits.Size = new System.Drawing.Size(127, 22);
|
||||
this.txtUnits.TabIndex = 2;
|
||||
//
|
||||
// txtName
|
||||
//
|
||||
this.txtName.AccessibleName = "";
|
||||
this.txtName.Location = new System.Drawing.Point(112, 38);
|
||||
this.txtName.Location = new System.Drawing.Point(149, 47);
|
||||
this.txtName.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.txtName.Name = "txtName";
|
||||
this.txtName.Size = new System.Drawing.Size(189, 20);
|
||||
this.txtName.Size = new System.Drawing.Size(251, 22);
|
||||
this.txtName.TabIndex = 1;
|
||||
//
|
||||
// txtPrice
|
||||
//
|
||||
this.txtPrice.AccessibleName = "";
|
||||
this.txtPrice.Location = new System.Drawing.Point(132, 64);
|
||||
this.txtPrice.Location = new System.Drawing.Point(149, 79);
|
||||
this.txtPrice.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.txtPrice.Name = "txtPrice";
|
||||
this.txtPrice.Size = new System.Drawing.Size(84, 20);
|
||||
this.txtPrice.Size = new System.Drawing.Size(111, 22);
|
||||
this.txtPrice.TabIndex = 3;
|
||||
this.txtPrice.Text = "0";
|
||||
//
|
||||
// cmbTax
|
||||
// cmbVat
|
||||
//
|
||||
this.cmbTax.DataSource = this.bsTax;
|
||||
this.cmbTax.DisplayMember = "Name";
|
||||
this.cmbTax.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbTax.Location = new System.Drawing.Point(307, 65);
|
||||
this.cmbTax.Name = "cmbTax";
|
||||
this.cmbTax.Size = new System.Drawing.Size(96, 21);
|
||||
this.cmbTax.TabIndex = 4;
|
||||
this.cmbTax.ValueMember = "TaxID";
|
||||
this.cmbVat.DataSource = this.bsVat;
|
||||
this.cmbVat.DisplayMember = "Name";
|
||||
this.cmbVat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbVat.Location = new System.Drawing.Point(284, 107);
|
||||
this.cmbVat.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.cmbVat.Name = "cmbVat";
|
||||
this.cmbVat.Size = new System.Drawing.Size(116, 24);
|
||||
this.cmbVat.TabIndex = 4;
|
||||
this.cmbVat.ValueMember = "TaxID";
|
||||
//
|
||||
// chkDiscontinued
|
||||
//
|
||||
this.chkDiscontinued.AutoSize = true;
|
||||
this.chkDiscontinued.Location = new System.Drawing.Point(307, 92);
|
||||
this.chkDiscontinued.Location = new System.Drawing.Point(409, 141);
|
||||
this.chkDiscontinued.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.chkDiscontinued.Name = "chkDiscontinued";
|
||||
this.chkDiscontinued.Size = new System.Drawing.Size(88, 17);
|
||||
this.chkDiscontinued.Size = new System.Drawing.Size(112, 21);
|
||||
this.chkDiscontinued.TabIndex = 7;
|
||||
this.chkDiscontinued.Text = "Discontinued";
|
||||
this.chkDiscontinued.UseVisualStyleBackColor = true;
|
||||
@ -174,17 +191,19 @@
|
||||
// txtServiceCharge
|
||||
//
|
||||
this.txtServiceCharge.AccessibleName = "Phone 1";
|
||||
this.txtServiceCharge.Location = new System.Drawing.Point(112, 90);
|
||||
this.txtServiceCharge.Location = new System.Drawing.Point(149, 139);
|
||||
this.txtServiceCharge.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.txtServiceCharge.Name = "txtServiceCharge";
|
||||
this.txtServiceCharge.Size = new System.Drawing.Size(73, 20);
|
||||
this.txtServiceCharge.Size = new System.Drawing.Size(96, 22);
|
||||
this.txtServiceCharge.TabIndex = 5;
|
||||
this.txtServiceCharge.Text = "0";
|
||||
//
|
||||
// btnAddProductGroup
|
||||
//
|
||||
this.btnAddProductGroup.Location = new System.Drawing.Point(307, 116);
|
||||
this.btnAddProductGroup.Location = new System.Drawing.Point(409, 171);
|
||||
this.btnAddProductGroup.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnAddProductGroup.Name = "btnAddProductGroup";
|
||||
this.btnAddProductGroup.Size = new System.Drawing.Size(96, 21);
|
||||
this.btnAddProductGroup.Size = new System.Drawing.Size(128, 26);
|
||||
this.btnAddProductGroup.TabIndex = 9;
|
||||
this.btnAddProductGroup.Text = "Add Group";
|
||||
//
|
||||
@ -195,17 +214,19 @@
|
||||
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, 116);
|
||||
this.cmbProductGroup.Location = new System.Drawing.Point(149, 171);
|
||||
this.cmbProductGroup.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.cmbProductGroup.Name = "cmbProductGroup";
|
||||
this.cmbProductGroup.Size = new System.Drawing.Size(189, 21);
|
||||
this.cmbProductGroup.Size = new System.Drawing.Size(251, 24);
|
||||
this.cmbProductGroup.TabIndex = 8;
|
||||
this.cmbProductGroup.ValueMember = "ProductGroupID";
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Location = new System.Drawing.Point(328, 143);
|
||||
this.btnCancel.Location = new System.Drawing.Point(437, 204);
|
||||
this.btnCancel.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnCancel.Size = new System.Drawing.Size(100, 92);
|
||||
this.btnCancel.TabIndex = 11;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
@ -213,9 +234,10 @@
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Location = new System.Drawing.Point(247, 143);
|
||||
this.btnOk.Location = new System.Drawing.Point(329, 204);
|
||||
this.btnOk.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnOk.Size = new System.Drawing.Size(100, 92);
|
||||
this.btnOk.TabIndex = 10;
|
||||
this.btnOk.Text = "&Ok";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
@ -224,35 +246,78 @@
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(196, 93);
|
||||
this.label1.Location = new System.Drawing.Point(261, 142);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(26, 13);
|
||||
this.label1.Size = new System.Drawing.Size(34, 17);
|
||||
this.label1.TabIndex = 18;
|
||||
this.label1.Text = "Sort";
|
||||
//
|
||||
// txtSortOrder
|
||||
//
|
||||
this.txtSortOrder.AccessibleName = "";
|
||||
this.txtSortOrder.Location = new System.Drawing.Point(228, 90);
|
||||
this.txtSortOrder.Location = new System.Drawing.Point(304, 139);
|
||||
this.txtSortOrder.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.txtSortOrder.Name = "txtSortOrder";
|
||||
this.txtSortOrder.Size = new System.Drawing.Size(73, 20);
|
||||
this.txtSortOrder.Size = new System.Drawing.Size(96, 22);
|
||||
this.txtSortOrder.TabIndex = 6;
|
||||
this.txtSortOrder.Text = "0";
|
||||
//
|
||||
// txtFullPrice
|
||||
//
|
||||
this.txtFullPrice.AccessibleName = "";
|
||||
this.txtFullPrice.Location = new System.Drawing.Point(222, 64);
|
||||
this.txtFullPrice.Location = new System.Drawing.Point(268, 79);
|
||||
this.txtFullPrice.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.txtFullPrice.Name = "txtFullPrice";
|
||||
this.txtFullPrice.Size = new System.Drawing.Size(79, 20);
|
||||
this.txtFullPrice.Size = new System.Drawing.Size(104, 22);
|
||||
this.txtFullPrice.TabIndex = 19;
|
||||
this.txtFullPrice.Text = "0";
|
||||
//
|
||||
// cmbServiceTax
|
||||
//
|
||||
this.cmbServiceTax.DataSource = this.bsServiceTax;
|
||||
this.cmbServiceTax.DisplayMember = "Name";
|
||||
this.cmbServiceTax.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbServiceTax.Location = new System.Drawing.Point(149, 107);
|
||||
this.cmbServiceTax.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.cmbServiceTax.Name = "cmbServiceTax";
|
||||
this.cmbServiceTax.Size = new System.Drawing.Size(127, 24);
|
||||
this.cmbServiceTax.TabIndex = 20;
|
||||
this.cmbServiceTax.ValueMember = "TaxID";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(25, 110);
|
||||
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(115, 17);
|
||||
this.label6.TabIndex = 21;
|
||||
this.label6.Text = "Service Tax / Vat";
|
||||
//
|
||||
// chkIsScTaxable
|
||||
//
|
||||
this.chkIsScTaxable.AutoSize = true;
|
||||
this.chkIsScTaxable.Location = new System.Drawing.Point(409, 109);
|
||||
this.chkIsScTaxable.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.chkIsScTaxable.Name = "chkIsScTaxable";
|
||||
this.chkIsScTaxable.Size = new System.Drawing.Size(114, 21);
|
||||
this.chkIsScTaxable.TabIndex = 22;
|
||||
this.chkIsScTaxable.Text = "Is Sc Taxable";
|
||||
this.chkIsScTaxable.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// bsVat
|
||||
//
|
||||
this.bsVat.DataSource = typeof(Tanshu.Accounts.Entities.Tax);
|
||||
//
|
||||
// ProductForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(415, 230);
|
||||
this.ClientSize = new System.Drawing.Size(553, 340);
|
||||
this.Controls.Add(this.chkIsScTaxable);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.cmbServiceTax);
|
||||
this.Controls.Add(this.txtFullPrice);
|
||||
this.Controls.Add(this.txtSortOrder);
|
||||
this.Controls.Add(this.label1);
|
||||
@ -265,7 +330,7 @@
|
||||
this.Controls.Add(this.Label7);
|
||||
this.Controls.Add(this.txtPrice);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.cmbTax);
|
||||
this.Controls.Add(this.cmbVat);
|
||||
this.Controls.Add(this.txtUnits);
|
||||
this.Controls.Add(this.txtName);
|
||||
this.Controls.Add(this.Label2);
|
||||
@ -273,6 +338,7 @@
|
||||
this.Controls.Add(this.txtProductID);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.Label4);
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ProductForm";
|
||||
@ -280,7 +346,8 @@
|
||||
this.Text = "Products";
|
||||
this.Load += new System.EventHandler(this.Products_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsProductGroups)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsTax)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsServiceTax)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsVat)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@ -291,7 +358,7 @@
|
||||
internal System.Windows.Forms.Label Label4;
|
||||
internal System.Windows.Forms.Label Label7;
|
||||
private System.Windows.Forms.BindingSource bsProductGroups;
|
||||
private System.Windows.Forms.BindingSource bsTax;
|
||||
private System.Windows.Forms.BindingSource bsServiceTax;
|
||||
internal System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox txtProductID;
|
||||
@ -300,7 +367,7 @@
|
||||
internal System.Windows.Forms.TextBox txtUnits;
|
||||
internal System.Windows.Forms.TextBox txtName;
|
||||
internal System.Windows.Forms.TextBox txtPrice;
|
||||
internal System.Windows.Forms.ComboBox cmbTax;
|
||||
internal System.Windows.Forms.ComboBox cmbVat;
|
||||
private System.Windows.Forms.CheckBox chkDiscontinued;
|
||||
internal System.Windows.Forms.TextBox txtServiceCharge;
|
||||
internal System.Windows.Forms.Button btnAddProductGroup;
|
||||
@ -310,5 +377,9 @@
|
||||
internal System.Windows.Forms.Label label1;
|
||||
internal System.Windows.Forms.TextBox txtSortOrder;
|
||||
internal System.Windows.Forms.TextBox txtFullPrice;
|
||||
internal System.Windows.Forms.ComboBox cmbServiceTax;
|
||||
internal System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.CheckBox chkIsScTaxable;
|
||||
private System.Windows.Forms.BindingSource bsVat;
|
||||
}
|
||||
}
|
||||
@ -28,9 +28,11 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
txtUnits.Text = product.Units;
|
||||
txtPrice.Text = product.Price.ToString("#.##");
|
||||
txtFullPrice.Text = product.FullPrice.ToString("#.##");
|
||||
cmbTax.SelectedValue = product.Tax.TaxID;
|
||||
cmbVat.SelectedValue = product.Vat.TaxID;
|
||||
cmbServiceTax.SelectedValue = product.ServiceTax.TaxID;
|
||||
txtServiceCharge.Text = product.ServiceCharge.ToString("#.##");
|
||||
chkDiscontinued.Checked = product.Discontinued;
|
||||
chkIsScTaxable.Checked = product.IsScTaxable;
|
||||
cmbProductGroup.SelectedValue = product.ProductGroup.ProductGroupID;
|
||||
txtSortOrder.Text = product.SortOrder.ToString();
|
||||
}
|
||||
@ -46,7 +48,10 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
using (var bi = new ProductGroupBI())
|
||||
bsProductGroups.DataSource = bi.List();
|
||||
using (var bi = new TaxBI())
|
||||
bsTax.DataSource = bi.List();
|
||||
{
|
||||
bsServiceTax.DataSource = bi.List();
|
||||
bsVat.DataSource = bi.List();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAddCategory_Click(object sender, EventArgs e)
|
||||
@ -92,9 +97,13 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
product.FullPrice = price;
|
||||
|
||||
// Tax
|
||||
if (cmbTax.SelectedItem == null)
|
||||
if (cmbVat.SelectedItem == null)
|
||||
return null;
|
||||
product.Tax = (Tax)cmbTax.SelectedItem;
|
||||
product.Vat = (Tax)cmbVat.SelectedItem;
|
||||
|
||||
if (cmbServiceTax.SelectedItem == null)
|
||||
return null;
|
||||
product.ServiceTax = (Tax)cmbServiceTax.SelectedItem;
|
||||
|
||||
decimal serviceCharge;
|
||||
if (!decimal.TryParse(txtServiceCharge.Text, out serviceCharge))
|
||||
@ -103,6 +112,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
return null;
|
||||
product.ServiceCharge = serviceCharge;
|
||||
|
||||
product.IsScTaxable = chkIsScTaxable.Checked;
|
||||
product.Discontinued = chkDiscontinued.Checked;
|
||||
int sortOrder;
|
||||
if (!int.TryParse(txtSortOrder.Text, out sortOrder))
|
||||
|
||||
@ -120,8 +120,11 @@
|
||||
<metadata name="bsProductGroups.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>211, 17</value>
|
||||
</metadata>
|
||||
<metadata name="bsTax.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>129, 17</value>
|
||||
<metadata name="bsServiceTax.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>56, 25</value>
|
||||
</metadata>
|
||||
<metadata name="bsVat.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>382, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>102</value>
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
this.bsList = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.unitsDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Tax = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Vat = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Group = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.serviceChargeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.salePriceDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@ -51,9 +51,10 @@
|
||||
// btnAdd
|
||||
//
|
||||
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAdd.Location = new System.Drawing.Point(12, 255);
|
||||
this.btnAdd.Location = new System.Drawing.Point(16, 314);
|
||||
this.btnAdd.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.btnAdd.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnAdd.Size = new System.Drawing.Size(100, 92);
|
||||
this.btnAdd.TabIndex = 68;
|
||||
this.btnAdd.Text = "&Add";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
@ -62,9 +63,10 @@
|
||||
//
|
||||
this.btnEdit.AccessibleName = "Done";
|
||||
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnEdit.Location = new System.Drawing.Point(93, 255);
|
||||
this.btnEdit.Location = new System.Drawing.Point(124, 314);
|
||||
this.btnEdit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.btnEdit.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnEdit.Size = new System.Drawing.Size(100, 92);
|
||||
this.btnEdit.TabIndex = 62;
|
||||
this.btnEdit.Text = "&Edit";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
@ -73,9 +75,10 @@
|
||||
//
|
||||
this.btnExit.AccessibleName = "Done";
|
||||
this.btnExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnExit.Location = new System.Drawing.Point(286, 255);
|
||||
this.btnExit.Location = new System.Drawing.Point(381, 314);
|
||||
this.btnExit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.btnExit.Name = "btnExit";
|
||||
this.btnExit.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnExit.Size = new System.Drawing.Size(100, 92);
|
||||
this.btnExit.TabIndex = 61;
|
||||
this.btnExit.Text = "E&xit";
|
||||
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
|
||||
@ -94,7 +97,7 @@
|
||||
this.dgvProductTypes.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.nameDataGridViewTextBoxColumn,
|
||||
this.unitsDataGridViewTextBoxColumn,
|
||||
this.Tax,
|
||||
this.Vat,
|
||||
this.Group,
|
||||
this.serviceChargeDataGridViewTextBoxColumn,
|
||||
this.salePriceDataGridViewTextBoxColumn,
|
||||
@ -102,14 +105,16 @@
|
||||
this.sortOrderDataGridViewTextBoxColumn});
|
||||
this.dgvProductTypes.DataSource = this.bsList;
|
||||
this.dgvProductTypes.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
|
||||
this.dgvProductTypes.Location = new System.Drawing.Point(12, 12);
|
||||
this.dgvProductTypes.Location = new System.Drawing.Point(16, 15);
|
||||
this.dgvProductTypes.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.dgvProductTypes.MultiSelect = false;
|
||||
this.dgvProductTypes.Name = "dgvProductTypes";
|
||||
this.dgvProductTypes.ReadOnly = true;
|
||||
this.dgvProductTypes.RowHeadersVisible = false;
|
||||
this.dgvProductTypes.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
|
||||
this.dgvProductTypes.RowTemplate.Height = 24;
|
||||
this.dgvProductTypes.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgvProductTypes.Size = new System.Drawing.Size(349, 237);
|
||||
this.dgvProductTypes.Size = new System.Drawing.Size(465, 292);
|
||||
this.dgvProductTypes.TabIndex = 74;
|
||||
this.dgvProductTypes.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvProductTypes_CellFormatting);
|
||||
//
|
||||
@ -123,7 +128,7 @@
|
||||
this.nameDataGridViewTextBoxColumn.HeaderText = "Name";
|
||||
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
|
||||
this.nameDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.nameDataGridViewTextBoxColumn.Width = 60;
|
||||
this.nameDataGridViewTextBoxColumn.Width = 70;
|
||||
//
|
||||
// unitsDataGridViewTextBoxColumn
|
||||
//
|
||||
@ -131,15 +136,15 @@
|
||||
this.unitsDataGridViewTextBoxColumn.HeaderText = "Units";
|
||||
this.unitsDataGridViewTextBoxColumn.Name = "unitsDataGridViewTextBoxColumn";
|
||||
this.unitsDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.unitsDataGridViewTextBoxColumn.Width = 56;
|
||||
this.unitsDataGridViewTextBoxColumn.Width = 65;
|
||||
//
|
||||
// Tax
|
||||
// Vat
|
||||
//
|
||||
this.Tax.DataPropertyName = "Tax";
|
||||
this.Tax.HeaderText = "Tax";
|
||||
this.Tax.Name = "Tax";
|
||||
this.Tax.ReadOnly = true;
|
||||
this.Tax.Width = 50;
|
||||
this.Vat.DataPropertyName = "Vat";
|
||||
this.Vat.HeaderText = "Vat";
|
||||
this.Vat.Name = "Vat";
|
||||
this.Vat.ReadOnly = true;
|
||||
this.Vat.Width = 54;
|
||||
//
|
||||
// Group
|
||||
//
|
||||
@ -147,7 +152,7 @@
|
||||
this.Group.HeaderText = "ProductGroup";
|
||||
this.Group.Name = "Group";
|
||||
this.Group.ReadOnly = true;
|
||||
this.Group.Width = 98;
|
||||
this.Group.Width = 122;
|
||||
//
|
||||
// serviceChargeDataGridViewTextBoxColumn
|
||||
//
|
||||
@ -157,7 +162,7 @@
|
||||
this.serviceChargeDataGridViewTextBoxColumn.HeaderText = "SC";
|
||||
this.serviceChargeDataGridViewTextBoxColumn.Name = "serviceChargeDataGridViewTextBoxColumn";
|
||||
this.serviceChargeDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.serviceChargeDataGridViewTextBoxColumn.Width = 46;
|
||||
this.serviceChargeDataGridViewTextBoxColumn.Width = 51;
|
||||
//
|
||||
// salePriceDataGridViewTextBoxColumn
|
||||
//
|
||||
@ -167,7 +172,7 @@
|
||||
this.salePriceDataGridViewTextBoxColumn.HeaderText = "Price";
|
||||
this.salePriceDataGridViewTextBoxColumn.Name = "salePriceDataGridViewTextBoxColumn";
|
||||
this.salePriceDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.salePriceDataGridViewTextBoxColumn.Width = 77;
|
||||
this.salePriceDataGridViewTextBoxColumn.Width = 65;
|
||||
//
|
||||
// discontinuedDataGridViewCheckBoxColumn
|
||||
//
|
||||
@ -175,7 +180,7 @@
|
||||
this.discontinuedDataGridViewCheckBoxColumn.HeaderText = "Discontinued";
|
||||
this.discontinuedDataGridViewCheckBoxColumn.Name = "discontinuedDataGridViewCheckBoxColumn";
|
||||
this.discontinuedDataGridViewCheckBoxColumn.ReadOnly = true;
|
||||
this.discontinuedDataGridViewCheckBoxColumn.Width = 75;
|
||||
this.discontinuedDataGridViewCheckBoxColumn.Width = 96;
|
||||
//
|
||||
// sortOrderDataGridViewTextBoxColumn
|
||||
//
|
||||
@ -183,17 +188,18 @@
|
||||
this.sortOrderDataGridViewTextBoxColumn.HeaderText = "SortOrder";
|
||||
this.sortOrderDataGridViewTextBoxColumn.Name = "sortOrderDataGridViewTextBoxColumn";
|
||||
this.sortOrderDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.sortOrderDataGridViewTextBoxColumn.Width = 77;
|
||||
this.sortOrderDataGridViewTextBoxColumn.Width = 96;
|
||||
//
|
||||
// ProductListForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(373, 342);
|
||||
this.ClientSize = new System.Drawing.Size(497, 421);
|
||||
this.Controls.Add(this.dgvProductTypes);
|
||||
this.Controls.Add(this.btnAdd);
|
||||
this.Controls.Add(this.btnEdit);
|
||||
this.Controls.Add(this.btnExit);
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ProductListForm";
|
||||
@ -213,17 +219,17 @@
|
||||
internal System.Windows.Forms.Button btnExit;
|
||||
private System.Windows.Forms.DataGridView dgvProductTypes;
|
||||
private System.Windows.Forms.BindingSource bsList;
|
||||
//private System.Windows.Forms.DataGridViewTextBoxColumn discountLimitDataGridViewTextBoxColumn;
|
||||
//private System.Windows.Forms.DataGridViewTextBoxColumn groupTypeDataGridViewTextBoxColumn;
|
||||
//private System.Windows.Forms.DataGridViewTextBoxColumn productGroupDataGridViewTextBoxColumn;
|
||||
//private System.Windows.Forms.DataGridViewTextBoxColumn taxDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn unitsDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Tax;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Vat;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Group;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn serviceChargeDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn salePriceDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn discontinuedDataGridViewCheckBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn sortOrderDataGridViewTextBoxColumn;
|
||||
//private System.Windows.Forms.DataGridViewTextBoxColumn discountLimitDataGridViewTextBoxColumn;
|
||||
//private System.Windows.Forms.DataGridViewTextBoxColumn groupTypeDataGridViewTextBoxColumn;
|
||||
//private System.Windows.Forms.DataGridViewTextBoxColumn productGroupDataGridViewTextBoxColumn;
|
||||
//private System.Windows.Forms.DataGridViewTextBoxColumn taxDataGridViewTextBoxColumn;
|
||||
}
|
||||
}
|
||||
@ -46,7 +46,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
return;
|
||||
if (e.Value.ToString() == "Castle.Proxies.TaxProxy")
|
||||
{
|
||||
e.Value = ((Product)bsList[e.RowIndex]).Tax.Name;
|
||||
e.Value = ((Product)bsList[e.RowIndex]).Vat.Name;
|
||||
}
|
||||
else if (e.Value.ToString() == "Castle.Proxies.ProductGroupProxy")
|
||||
{
|
||||
|
||||
@ -117,7 +117,7 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="Tax.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="Vat.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Group.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
||||
@ -203,7 +203,7 @@ namespace Tanshu.Accounts.PointOfSale.Sales
|
||||
var dgv = sender as DataGridView;
|
||||
var data = dgv.Rows[e.RowIndex].DataBoundItem as BillItemValue;
|
||||
|
||||
if (data.Tax == -1)
|
||||
if (data.Vat == -1)
|
||||
{
|
||||
e.CellStyle.SelectionBackColor = Color.Blue;
|
||||
e.CellStyle.BackColor = Color.LightBlue;
|
||||
|
||||
Reference in New Issue
Block a user