Feature: Added a Tax Management form and a beer consumption report.
Chore: Fixed some Form_Load function names as they were copied from old forms and were not neat. Feature: Management BI Improved and should be pretty much solid by now.
This commit is contained in:
parent
09a8b546cf
commit
5e64209b76
Tanshu.Accounts.Contracts/Data Contracts Display
Tanshu.Accounts.PointOfSale
MainForm.csMainForm.designer.cs
Management
Masters
ReorderTableForm.Designer.csReorderTableForm.csTaxEditForm.Designer.csTaxEditForm.csTaxEditForm.resxTaxListForm.Designer.csTaxListForm.csTaxListForm.resx
Products
Reports
BeerConsumptionForm.csBeerConsumptionForm.designer.csBeerConsumptionForm.resxBillDetailsForm.csBillDetailsForm.designer.csCheckoutForm.Designer.csCheckoutForm.csDiscountReportForm.csDiscountReportForm.designer.csSaleDetailForm.csSaleDetailForm.designer.csSaleDetailForm.resxTaxAnalysisForm.csTaxAnalysisForm.designer.csVoidReprintedForm.csVoidReprintedForm.designer.cs
Tanshu.Accounts.PointOfSale.csprojUser Management
Tanshu.Accounts.Repository
@ -43,4 +43,11 @@ namespace Tanshu.Accounts.Contracts
|
||||
public virtual decimal Amount { get; set; }
|
||||
public virtual string Settlement { get; set; }
|
||||
}
|
||||
public class BeerConsumptionDetail
|
||||
{
|
||||
public virtual DateTime Date { get; set; }
|
||||
public virtual Guid ProductID { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual decimal Quantity { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
private void btnCashierCheckout_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Session.IsAllowed("Cashier Checkout"))
|
||||
using (var frm = new CashierCheckoutForm())
|
||||
using (var frm = new CheckoutForm())
|
||||
frm.ShowDialog();
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
private void btnSaleDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Session.IsAllowed("Sales Detail"))
|
||||
using (var frm = new FrmSaleDetail())
|
||||
using (var frm = new SaleDetailForm())
|
||||
frm.ShowDialog();
|
||||
}
|
||||
|
||||
@ -153,8 +153,10 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
btnSaleDetail.Visible = Session.IsAllowed("Sales Detail");
|
||||
|
||||
btnBillDetails.Visible = Session.IsAllowed("Bill Details");
|
||||
btnBeerConsumption.Visible = Session.IsAllowed("Beer Consumption");
|
||||
btnVoidOrReprints.Visible = Session.IsAllowed("Void or Reprinted Bill Report");
|
||||
btnDiscountReport.Visible = Session.IsAllowed("Discount Report");
|
||||
btnTaxes.Visible = Session.IsAllowed("Discount Report");
|
||||
|
||||
btnChangePassword.Visible = Session.IsAuthenticated;
|
||||
#if (DEBUG)
|
||||
@ -301,8 +303,23 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
private void btnTaxAnalysis_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Session.IsAllowed("Tax Analysis"))
|
||||
using (var frm = new frmTaxAnalysisForm())
|
||||
using (var frm = new TaxAnalysisForm())
|
||||
frm.ShowDialog();
|
||||
}
|
||||
|
||||
private void btnBeerConsumption_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Session.IsAllowed("Beer Consumption"))
|
||||
using (var frm = new BeerConsumptionForm())
|
||||
frm.ShowDialog();
|
||||
}
|
||||
|
||||
private void btnTaxes_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Session.IsAllowed("Taxes"))
|
||||
using (var frm = new TaxListForm())
|
||||
frm.ShowDialog();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
48
Tanshu.Accounts.PointOfSale/MainForm.designer.cs
generated
48
Tanshu.Accounts.PointOfSale/MainForm.designer.cs
generated
@ -47,10 +47,12 @@
|
||||
this.btnTaxAnalysis = new System.Windows.Forms.Button();
|
||||
this.btnSaleDetail = new System.Windows.Forms.Button();
|
||||
this.btnBillDetails = new System.Windows.Forms.Button();
|
||||
this.btnBeerConsumption = new System.Windows.Forms.Button();
|
||||
this.btnVoidOrReprints = new System.Windows.Forms.Button();
|
||||
this.btnDiscountReport = new System.Windows.Forms.Button();
|
||||
this.btnChangePassword = new System.Windows.Forms.Button();
|
||||
this.btnManagement = new System.Windows.Forms.Button();
|
||||
this.btnTaxes = new System.Windows.Forms.Button();
|
||||
this.btnExit = new System.Windows.Forms.Button();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@ -95,10 +97,12 @@
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnTaxAnalysis);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnSaleDetail);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnBillDetails);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnBeerConsumption);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnVoidOrReprints);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnDiscountReport);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnChangePassword);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnManagement);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnTaxes);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnExit);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
@ -266,52 +270,72 @@
|
||||
this.btnBillDetails.UseVisualStyleBackColor = true;
|
||||
this.btnBillDetails.Click += new System.EventHandler(this.btnBillDetails_Click);
|
||||
//
|
||||
// btnBeerConsumption
|
||||
//
|
||||
this.btnBeerConsumption.Location = new System.Drawing.Point(471, 321);
|
||||
this.btnBeerConsumption.Name = "btnBeerConsumption";
|
||||
this.btnBeerConsumption.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnBeerConsumption.TabIndex = 18;
|
||||
this.btnBeerConsumption.Text = "Beer Consumption";
|
||||
this.btnBeerConsumption.UseVisualStyleBackColor = true;
|
||||
this.btnBeerConsumption.Click += new System.EventHandler(this.btnBeerConsumption_Click);
|
||||
//
|
||||
// btnVoidOrReprints
|
||||
//
|
||||
this.btnVoidOrReprints.Location = new System.Drawing.Point(471, 321);
|
||||
this.btnVoidOrReprints.Location = new System.Drawing.Point(627, 321);
|
||||
this.btnVoidOrReprints.Name = "btnVoidOrReprints";
|
||||
this.btnVoidOrReprints.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnVoidOrReprints.TabIndex = 18;
|
||||
this.btnVoidOrReprints.TabIndex = 19;
|
||||
this.btnVoidOrReprints.Text = "Voids or Reprints";
|
||||
this.btnVoidOrReprints.UseVisualStyleBackColor = true;
|
||||
this.btnVoidOrReprints.Click += new System.EventHandler(this.btnVoidOrReprints_Click);
|
||||
//
|
||||
// btnDiscountReport
|
||||
//
|
||||
this.btnDiscountReport.Location = new System.Drawing.Point(627, 321);
|
||||
this.btnDiscountReport.Location = new System.Drawing.Point(3, 427);
|
||||
this.btnDiscountReport.Name = "btnDiscountReport";
|
||||
this.btnDiscountReport.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnDiscountReport.TabIndex = 19;
|
||||
this.btnDiscountReport.TabIndex = 20;
|
||||
this.btnDiscountReport.Text = "Discount Report";
|
||||
this.btnDiscountReport.UseVisualStyleBackColor = true;
|
||||
this.btnDiscountReport.Click += new System.EventHandler(this.btnDiscountReport_Click);
|
||||
//
|
||||
// btnChangePassword
|
||||
//
|
||||
this.btnChangePassword.Location = new System.Drawing.Point(3, 427);
|
||||
this.btnChangePassword.Location = new System.Drawing.Point(159, 427);
|
||||
this.btnChangePassword.Name = "btnChangePassword";
|
||||
this.btnChangePassword.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnChangePassword.TabIndex = 20;
|
||||
this.btnChangePassword.TabIndex = 21;
|
||||
this.btnChangePassword.Text = "Change Password";
|
||||
this.btnChangePassword.UseVisualStyleBackColor = true;
|
||||
this.btnChangePassword.Click += new System.EventHandler(this.btnChangePassword_Click);
|
||||
//
|
||||
// btnManagement
|
||||
//
|
||||
this.btnManagement.Location = new System.Drawing.Point(159, 427);
|
||||
this.btnManagement.Location = new System.Drawing.Point(315, 427);
|
||||
this.btnManagement.Name = "btnManagement";
|
||||
this.btnManagement.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnManagement.TabIndex = 21;
|
||||
this.btnManagement.TabIndex = 22;
|
||||
this.btnManagement.Text = "Management";
|
||||
this.btnManagement.UseVisualStyleBackColor = true;
|
||||
this.btnManagement.Click += new System.EventHandler(this.btnManagement_Click);
|
||||
//
|
||||
// btnTaxes
|
||||
//
|
||||
this.btnTaxes.Location = new System.Drawing.Point(471, 427);
|
||||
this.btnTaxes.Name = "btnTaxes";
|
||||
this.btnTaxes.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnTaxes.TabIndex = 23;
|
||||
this.btnTaxes.Text = "Taxes";
|
||||
this.btnTaxes.UseVisualStyleBackColor = true;
|
||||
this.btnTaxes.Click += new System.EventHandler(this.btnTaxes_Click);
|
||||
//
|
||||
// btnExit
|
||||
//
|
||||
this.btnExit.Location = new System.Drawing.Point(315, 427);
|
||||
this.btnExit.Location = new System.Drawing.Point(627, 427);
|
||||
this.btnExit.Name = "btnExit";
|
||||
this.btnExit.Size = new System.Drawing.Size(150, 100);
|
||||
this.btnExit.TabIndex = 22;
|
||||
this.btnExit.TabIndex = 24;
|
||||
this.btnExit.Text = "Exit";
|
||||
this.btnExit.UseVisualStyleBackColor = true;
|
||||
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
|
||||
@ -353,11 +377,13 @@
|
||||
private System.Windows.Forms.Button btnSaleAnalysis;
|
||||
private System.Windows.Forms.Button btnSaleDetail;
|
||||
private System.Windows.Forms.Button btnBillDetails;
|
||||
private System.Windows.Forms.Button btnTaxAnalysis;
|
||||
private System.Windows.Forms.Button btnBeerConsumption;
|
||||
private System.Windows.Forms.Button btnVoidOrReprints;
|
||||
private System.Windows.Forms.Button btnDiscountReport;
|
||||
private System.Windows.Forms.Button btnChangePassword;
|
||||
private System.Windows.Forms.Button btnManagement;
|
||||
private System.Windows.Forms.Button btnTaxes;
|
||||
private System.Windows.Forms.Button btnExit;
|
||||
private System.Windows.Forms.Button btnTaxAnalysis;
|
||||
}
|
||||
}
|
@ -34,7 +34,7 @@ namespace Tanshu.Accounts.Management
|
||||
bwExcel.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwExcel_RunWorkerCompleted);
|
||||
}
|
||||
|
||||
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
|
||||
private void ManagementForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpStart.Value = DateTime.Today;
|
||||
dtpFinish.Value = DateTime.Today;
|
||||
@ -179,6 +179,13 @@ namespace Tanshu.Accounts.Management
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bi.IncreaseLiqIfLess(item.Sale.Where(x=>x.IsLiq).ToList(), startDate, finishDate);
|
||||
bwGo.ReportProgress(++count, "Sale Done");
|
||||
if (bwGo.CancellationPending == true)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
bi.SaveChanges();
|
||||
}
|
||||
bwGo.ReportProgress(++count, "Cleanup done");
|
||||
|
@ -133,7 +133,7 @@
|
||||
this.Name = "ManagementForm";
|
||||
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.ManagementForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
@ -55,7 +55,7 @@
|
||||
this.Name = "ReorderTableForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Move Table / Kot";
|
||||
this.Load += new System.EventHandler(this.MoveTableForm_Load);
|
||||
this.Load += new System.EventHandler(this.ReorderTableForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
}
|
||||
public FoodTable Selection { get; private set; }
|
||||
|
||||
private void MoveTableForm_Load(object sender, EventArgs e)
|
||||
private void ReorderTableForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
GenerateTables(new Point(75, 75));
|
||||
}
|
||||
|
136
Tanshu.Accounts.PointOfSale/Masters/TaxEditForm.Designer.cs
generated
Normal file
136
Tanshu.Accounts.PointOfSale/Masters/TaxEditForm.Designer.cs
generated
Normal file
@ -0,0 +1,136 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class TaxEditForm
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
this.txtName = new System.Windows.Forms.TextBox();
|
||||
this.Label2 = new System.Windows.Forms.Label();
|
||||
this.Label5 = new System.Windows.Forms.Label();
|
||||
this.btnOk = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.bsLocations = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.txtRate = new System.Windows.Forms.TextBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsLocations)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txtName
|
||||
//
|
||||
this.txtName.AccessibleName = "";
|
||||
this.txtName.Location = new System.Drawing.Point(94, 12);
|
||||
this.txtName.Name = "txtName";
|
||||
this.txtName.Size = new System.Drawing.Size(276, 20);
|
||||
this.txtName.TabIndex = 0;
|
||||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.AutoSize = true;
|
||||
this.Label2.Location = new System.Drawing.Point(40, 15);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(25, 13);
|
||||
this.Label2.TabIndex = 10;
|
||||
this.Label2.Text = "Tax";
|
||||
//
|
||||
// Label5
|
||||
//
|
||||
this.Label5.AutoSize = true;
|
||||
this.Label5.Location = new System.Drawing.Point(40, 41);
|
||||
this.Label5.Name = "Label5";
|
||||
this.Label5.Size = new System.Drawing.Size(30, 13);
|
||||
this.Label5.TabIndex = 11;
|
||||
this.Label5.Text = "Rate";
|
||||
//
|
||||
// btnOk
|
||||
//
|
||||
this.btnOk.Location = new System.Drawing.Point(214, 65);
|
||||
this.btnOk.Name = "btnOk";
|
||||
this.btnOk.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnOk.TabIndex = 6;
|
||||
this.btnOk.Text = "&Ok";
|
||||
this.btnOk.UseVisualStyleBackColor = true;
|
||||
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(295, 65);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnCancel.TabIndex = 7;
|
||||
this.btnCancel.Text = "&Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// bsLocations
|
||||
//
|
||||
this.bsLocations.DataSource = typeof(string);
|
||||
//
|
||||
// txtRate
|
||||
//
|
||||
this.txtRate.AccessibleName = "";
|
||||
this.txtRate.Location = new System.Drawing.Point(94, 38);
|
||||
this.txtRate.Name = "txtRate";
|
||||
this.txtRate.Size = new System.Drawing.Size(276, 20);
|
||||
this.txtRate.TabIndex = 22;
|
||||
//
|
||||
// TaxEditForm
|
||||
//
|
||||
this.AcceptButton = this.btnOk;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(382, 153);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOk);
|
||||
this.Controls.Add(this.Label5);
|
||||
this.Controls.Add(this.txtName);
|
||||
this.Controls.Add(this.Label2);
|
||||
this.Controls.Add(this.txtRate);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TaxEditForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Taxes";
|
||||
this.Load += new System.EventHandler(this.TaxEditForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsLocations)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.TextBox txtName;
|
||||
internal System.Windows.Forms.Label Label2;
|
||||
internal System.Windows.Forms.Label Label5;
|
||||
private System.Windows.Forms.Button btnOk;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.BindingSource bsLocations;
|
||||
internal System.Windows.Forms.TextBox txtRate;
|
||||
}
|
||||
}
|
81
Tanshu.Accounts.PointOfSale/Masters/TaxEditForm.cs
Normal file
81
Tanshu.Accounts.PointOfSale/Masters/TaxEditForm.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Entities;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class TaxEditForm : Form
|
||||
{
|
||||
private Guid? _taxID;
|
||||
public TaxEditForm(Guid taxID)
|
||||
: this()
|
||||
{
|
||||
_taxID = taxID;
|
||||
}
|
||||
|
||||
public TaxEditForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void TaxEditForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Tax tax;
|
||||
if (_taxID.HasValue)
|
||||
{
|
||||
using (var bi = new TaxBI())
|
||||
{
|
||||
tax = bi.Get(x => x.TaxID == _taxID.Value);
|
||||
txtName.Text = tax.Name;
|
||||
txtRate.Text = (tax.Rate * 100).ToString();
|
||||
}
|
||||
}
|
||||
txtName.Focus();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
Tax tax;
|
||||
using (var bi = new TaxBI())
|
||||
{
|
||||
if (_taxID.HasValue)
|
||||
tax = bi.Get(x => x.TaxID == _taxID.Value);
|
||||
else
|
||||
tax = new Tax();
|
||||
|
||||
if (string.IsNullOrEmpty(txtName.Text.Trim()))
|
||||
return;
|
||||
tax.Name = txtName.Text.Trim();
|
||||
|
||||
if (string.IsNullOrEmpty(txtRate.Text.Trim()))
|
||||
txtRate.Text = "0";
|
||||
decimal rate;
|
||||
if (!decimal.TryParse(txtRate.Text, out rate) || (rate < 0 || rate > 100))
|
||||
{
|
||||
MessageBox.Show("Tax Rate is not valid, it must be between 0 to 100 percent.");
|
||||
txtRate.Focus();
|
||||
return;
|
||||
}
|
||||
else
|
||||
tax.Rate = rate / 100;
|
||||
|
||||
if (_taxID.HasValue)
|
||||
bi.Update(tax);
|
||||
else
|
||||
bi.Insert(tax);
|
||||
bi.SaveChanges();
|
||||
}
|
||||
MessageBox.Show("Update / Save Successful");
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
123
Tanshu.Accounts.PointOfSale/Masters/TaxEditForm.resx
Normal file
123
Tanshu.Accounts.PointOfSale/Masters/TaxEditForm.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="bsLocations.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
157
Tanshu.Accounts.PointOfSale/Masters/TaxListForm.Designer.cs
generated
Normal file
157
Tanshu.Accounts.PointOfSale/Masters/TaxListForm.Designer.cs
generated
Normal file
@ -0,0 +1,157 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class TaxListForm
|
||||
{
|
||||
/// <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.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.btnAdd = new System.Windows.Forms.Button();
|
||||
this.btnEdit = new System.Windows.Forms.Button();
|
||||
this.btnExit = new System.Windows.Forms.Button();
|
||||
this.dgvTaxes = new System.Windows.Forms.DataGridView();
|
||||
this.bsList = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.rateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvTaxes)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsList)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// 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.Name = "btnAdd";
|
||||
this.btnAdd.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnAdd.TabIndex = 68;
|
||||
this.btnAdd.Text = "&Add";
|
||||
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||
//
|
||||
// btnEdit
|
||||
//
|
||||
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.Name = "btnEdit";
|
||||
this.btnEdit.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnEdit.TabIndex = 62;
|
||||
this.btnEdit.Text = "&Edit";
|
||||
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||
//
|
||||
// btnExit
|
||||
//
|
||||
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(514, 255);
|
||||
this.btnExit.Name = "btnExit";
|
||||
this.btnExit.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnExit.TabIndex = 61;
|
||||
this.btnExit.Text = "E&xit";
|
||||
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
|
||||
//
|
||||
// dgvTaxes
|
||||
//
|
||||
this.dgvTaxes.AllowUserToAddRows = false;
|
||||
this.dgvTaxes.AllowUserToDeleteRows = false;
|
||||
this.dgvTaxes.AllowUserToResizeRows = false;
|
||||
this.dgvTaxes.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.dgvTaxes.AutoGenerateColumns = false;
|
||||
this.dgvTaxes.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.dgvTaxes.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvTaxes.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.nameDataGridViewTextBoxColumn,
|
||||
this.rateDataGridViewTextBoxColumn});
|
||||
this.dgvTaxes.DataSource = this.bsList;
|
||||
this.dgvTaxes.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
|
||||
this.dgvTaxes.Location = new System.Drawing.Point(12, 12);
|
||||
this.dgvTaxes.MultiSelect = false;
|
||||
this.dgvTaxes.Name = "dgvTaxes";
|
||||
this.dgvTaxes.ReadOnly = true;
|
||||
this.dgvTaxes.RowHeadersVisible = false;
|
||||
this.dgvTaxes.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
|
||||
this.dgvTaxes.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dgvTaxes.Size = new System.Drawing.Size(577, 237);
|
||||
this.dgvTaxes.TabIndex = 74;
|
||||
this.dgvTaxes.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvTaxes_CellFormatting);
|
||||
//
|
||||
// bsList
|
||||
//
|
||||
this.bsList.DataSource = typeof(Tanshu.Accounts.Entities.Tax);
|
||||
//
|
||||
// nameDataGridViewTextBoxColumn
|
||||
//
|
||||
this.nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
|
||||
this.nameDataGridViewTextBoxColumn.HeaderText = "Name";
|
||||
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
|
||||
this.nameDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.nameDataGridViewTextBoxColumn.Width = 60;
|
||||
//
|
||||
// rateDataGridViewTextBoxColumn
|
||||
//
|
||||
this.rateDataGridViewTextBoxColumn.DataPropertyName = "Rate";
|
||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
|
||||
this.rateDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.rateDataGridViewTextBoxColumn.HeaderText = "Rate";
|
||||
this.rateDataGridViewTextBoxColumn.Name = "rateDataGridViewTextBoxColumn";
|
||||
this.rateDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.rateDataGridViewTextBoxColumn.Width = 55;
|
||||
//
|
||||
// TaxListForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(601, 342);
|
||||
this.Controls.Add(this.dgvTaxes);
|
||||
this.Controls.Add(this.btnAdd);
|
||||
this.Controls.Add(this.btnEdit);
|
||||
this.Controls.Add(this.btnExit);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TaxListForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Taxes";
|
||||
this.Load += new System.EventHandler(this.TaxListForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvTaxes)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsList)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
internal System.Windows.Forms.Button btnAdd;
|
||||
internal System.Windows.Forms.Button btnEdit;
|
||||
internal System.Windows.Forms.Button btnExit;
|
||||
private System.Windows.Forms.DataGridView dgvTaxes;
|
||||
private System.Windows.Forms.BindingSource bsList;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn machineDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn rateDataGridViewTextBoxColumn;
|
||||
}
|
||||
}
|
64
Tanshu.Accounts.PointOfSale/Masters/TaxListForm.cs
Normal file
64
Tanshu.Accounts.PointOfSale/Masters/TaxListForm.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Entities;
|
||||
using Tanshu.Accounts.Repository;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class TaxListForm : Form
|
||||
{
|
||||
private IList<Tax> _list;
|
||||
public TaxListForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var frm = new TaxEditForm())
|
||||
frm.ShowDialog();
|
||||
using (var bi = new TaxBI())
|
||||
_list = bi.List();
|
||||
bsList.DataSource = _list;
|
||||
}
|
||||
|
||||
private void TaxListForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
using (var bi = new TaxBI())
|
||||
_list = bi.List();
|
||||
bsList.DataSource = _list;
|
||||
}
|
||||
|
||||
private void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
var id = ((Tax)bsList.Current).TaxID;
|
||||
using (var frm = new TaxEditForm(id))
|
||||
frm.ShowDialog();
|
||||
using (var bi = new TaxBI())
|
||||
_list = bi.List();
|
||||
bsList.DataSource = _list;
|
||||
}
|
||||
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void dgvTaxes_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
|
||||
{
|
||||
var data = dgvTaxes.Rows[e.RowIndex].DataBoundItem as Tax;
|
||||
if (data == null)
|
||||
return;
|
||||
if (e.ColumnIndex != 1)
|
||||
return;
|
||||
var rate = (decimal)e.Value;
|
||||
e.Value = string.Format("{0:P}", rate);
|
||||
}
|
||||
}
|
||||
}
|
123
Tanshu.Accounts.PointOfSale/Masters/TaxListForm.resx
Normal file
123
Tanshu.Accounts.PointOfSale/Masters/TaxListForm.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="bsList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
@ -289,7 +289,7 @@
|
||||
this.Name = "ProductForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Products";
|
||||
this.Load += new System.EventHandler(this.Products_Load);
|
||||
this.Load += new System.EventHandler(this.ProductForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsProductGroups)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsServiceTax)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsVat)).EndInit();
|
||||
|
@ -15,7 +15,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Products_Load(object sender, EventArgs e)
|
||||
private void ProductForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
FillCombos();
|
||||
using (var bis = new SettingBI())
|
||||
|
@ -252,7 +252,7 @@
|
||||
this.Name = "ProductListForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Products";
|
||||
this.Load += new System.EventHandler(this.ProductGroupListForm_Load);
|
||||
this.Load += new System.EventHandler(this.ProductListForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProducts)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bsList)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
@ -24,7 +24,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
bsList.DataSource = _list;
|
||||
}
|
||||
|
||||
private void ProductGroupListForm_Load(object sender, EventArgs e)
|
||||
private void ProductListForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
ShowGrid();
|
||||
}
|
||||
|
102
Tanshu.Accounts.PointOfSale/Reports/BeerConsumptionForm.cs
Normal file
102
Tanshu.Accounts.PointOfSale/Reports/BeerConsumptionForm.cs
Normal file
@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Contracts;
|
||||
using System.Data;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class BeerConsumptionForm : Form
|
||||
{
|
||||
IList<BeerConsumptionDetail> _list;
|
||||
public BeerConsumptionForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
dgvSale.AutoGenerateColumns = false;
|
||||
}
|
||||
|
||||
private void dtpStart_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ShowStatement();
|
||||
}
|
||||
|
||||
private void ShowStatement()
|
||||
{
|
||||
if (DateTime.Today.Subtract(dtpStart.Value.Date).Days > 5 && !Session.IsAllowed("Accounts Audit"))
|
||||
return;
|
||||
var bi = new ReportsBI();
|
||||
_list = bi.BeerConsumption(dtpStart.Value, dtpFinish.Value);
|
||||
dgvSale.DataSource = _list;
|
||||
}
|
||||
|
||||
private void dtpFinish_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
ShowStatement();
|
||||
}
|
||||
|
||||
private void BeerConsumptionForm_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)
|
||||
return;
|
||||
var startDate = dtpStart.Value.Date.AddHours(6);
|
||||
var finishDate = dtpFinish.Value.Date.AddDays(1).AddHours(5);
|
||||
//Print.Thermal.PrintSale(Session.User.Name, _list, startDate, finishDate);
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
var q = new decimal[_list.Select(x => x.Date.ToString("dd-MMM-yyyy")).Distinct().Count(), _list.Select(x => x.Name).Distinct().Count()];
|
||||
var dates = new List<string>();
|
||||
var names = new List<string>();
|
||||
string data;
|
||||
foreach (var item in _list)
|
||||
{
|
||||
var date = item.Date.ToString("dd-MMM-yyyy");
|
||||
if (!dates.Contains(date))
|
||||
{
|
||||
dates.Add(date);
|
||||
}
|
||||
if (!names.Contains(item.Name))
|
||||
{
|
||||
names.Add(item.Name);
|
||||
}
|
||||
q[dates.IndexOf(date), names.IndexOf(item.Name)] += item.Quantity;
|
||||
}
|
||||
|
||||
if (_list == null)
|
||||
return;
|
||||
data = "Date";
|
||||
foreach (var item in names)
|
||||
{
|
||||
data += string.Format("\t{0}", item);
|
||||
}
|
||||
data += "\n";
|
||||
|
||||
for (int i = 0; i < dates.Count; i++)
|
||||
{
|
||||
data += dates[i];
|
||||
for (int j = 0; j < names.Count; j++)
|
||||
{
|
||||
data += string.Format("\t{0}", q[i, j]);
|
||||
}
|
||||
data += "\n";
|
||||
}
|
||||
Clipboard.SetText(data, TextDataFormat.Text);
|
||||
}
|
||||
}
|
||||
}
|
195
Tanshu.Accounts.PointOfSale/Reports/BeerConsumptionForm.designer.cs
generated
Normal file
195
Tanshu.Accounts.PointOfSale/Reports/BeerConsumptionForm.designer.cs
generated
Normal file
@ -0,0 +1,195 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class BeerConsumptionForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.dgvSale = new System.Windows.Forms.DataGridView();
|
||||
this.dtpFinish = new System.Windows.Forms.DateTimePicker();
|
||||
this.dtpStart = new System.Windows.Forms.DateTimePicker();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.btnPrint = new System.Windows.Forms.Button();
|
||||
this.btnExport = new System.Windows.Forms.Button();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.DateColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.NameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.QuantityColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dgvSale
|
||||
//
|
||||
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.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||
this.dgvSale.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvSale.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.DateColumn,
|
||||
this.NameColumn,
|
||||
this.QuantityColumn});
|
||||
this.dgvSale.Location = new System.Drawing.Point(12, 41);
|
||||
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(335, 385);
|
||||
this.dgvSale.TabIndex = 14;
|
||||
//
|
||||
// dtpFinish
|
||||
//
|
||||
this.dtpFinish.CustomFormat = "dd-MMM-yyyy";
|
||||
this.dtpFinish.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
|
||||
this.dtpFinish.Location = new System.Drawing.Point(168, 12);
|
||||
this.dtpFinish.Name = "dtpFinish";
|
||||
this.dtpFinish.Size = new System.Drawing.Size(90, 20);
|
||||
this.dtpFinish.TabIndex = 21;
|
||||
this.dtpFinish.ValueChanged += new System.EventHandler(this.dtpFinish_ValueChanged);
|
||||
//
|
||||
// dtpStart
|
||||
//
|
||||
this.dtpStart.CustomFormat = "dd-MMM-yyyy";
|
||||
this.dtpStart.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
|
||||
this.dtpStart.Location = new System.Drawing.Point(12, 12);
|
||||
this.dtpStart.Name = "dtpStart";
|
||||
this.dtpStart.Size = new System.Drawing.Size(90, 20);
|
||||
this.dtpStart.TabIndex = 20;
|
||||
this.dtpStart.ValueChanged += new System.EventHandler(this.dtpStart_ValueChanged);
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(108, 16);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(54, 13);
|
||||
this.label10.TabIndex = 22;
|
||||
this.label10.Text = "<- Date ->";
|
||||
//
|
||||
// btnPrint
|
||||
//
|
||||
this.btnPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnPrint.Location = new System.Drawing.Point(12, 432);
|
||||
this.btnPrint.Name = "btnPrint";
|
||||
this.btnPrint.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnPrint.TabIndex = 28;
|
||||
this.btnPrint.Text = "Print";
|
||||
this.btnPrint.UseVisualStyleBackColor = true;
|
||||
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
|
||||
//
|
||||
// btnExport
|
||||
//
|
||||
this.btnExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnExport.Location = new System.Drawing.Point(93, 432);
|
||||
this.btnExport.Name = "btnExport";
|
||||
this.btnExport.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnExport.TabIndex = 29;
|
||||
this.btnExport.Text = "Export";
|
||||
this.btnExport.UseVisualStyleBackColor = true;
|
||||
this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnClose.Location = new System.Drawing.Point(272, 432);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(75, 75);
|
||||
this.btnClose.TabIndex = 30;
|
||||
this.btnClose.Text = "&Close";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// DateColumn
|
||||
//
|
||||
this.DateColumn.DataPropertyName = "Date";
|
||||
this.DateColumn.HeaderText = "Date";
|
||||
this.DateColumn.Name = "DateColumn";
|
||||
this.DateColumn.ReadOnly = true;
|
||||
this.DateColumn.Width = 55;
|
||||
//
|
||||
// NameColumn
|
||||
//
|
||||
this.NameColumn.DataPropertyName = "Name";
|
||||
this.NameColumn.HeaderText = "Name";
|
||||
this.NameColumn.Name = "NameColumn";
|
||||
this.NameColumn.ReadOnly = true;
|
||||
this.NameColumn.Width = 60;
|
||||
//
|
||||
// QuantityColumn
|
||||
//
|
||||
this.QuantityColumn.DataPropertyName = "Quantity";
|
||||
dataGridViewCellStyle2.Format = "#,##0.00;(#,##0.00);0";
|
||||
this.QuantityColumn.DefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.QuantityColumn.HeaderText = "Quantity";
|
||||
this.QuantityColumn.Name = "QuantityColumn";
|
||||
this.QuantityColumn.ReadOnly = true;
|
||||
this.QuantityColumn.Width = 71;
|
||||
//
|
||||
// BeerConsumption
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(359, 519);
|
||||
this.Controls.Add(this.btnClose);
|
||||
this.Controls.Add(this.btnExport);
|
||||
this.Controls.Add(this.btnPrint);
|
||||
this.Controls.Add(this.dgvSale);
|
||||
this.Controls.Add(this.dtpFinish);
|
||||
this.Controls.Add(this.dtpStart);
|
||||
this.Controls.Add(this.label10);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "BeerConsumption";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Beer Consumption";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.BeerConsumptionForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dgvSale;
|
||||
private System.Windows.Forms.DateTimePicker dtpFinish;
|
||||
private System.Windows.Forms.DateTimePicker dtpStart;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.Button btnPrint;
|
||||
private System.Windows.Forms.Button btnExport;
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn DateColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn NameColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn QuantityColumn;
|
||||
}
|
||||
}
|
138
Tanshu.Accounts.PointOfSale/Reports/BeerConsumptionForm.resx
Normal file
138
Tanshu.Accounts.PointOfSale/Reports/BeerConsumptionForm.resx
Normal file
@ -0,0 +1,138 @@
|
||||
<?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>
|
||||
<metadata name="DateColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="NameColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="QuantityColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="DateColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="NameColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="QuantityColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
@ -39,7 +39,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
ShowStatement();
|
||||
}
|
||||
|
||||
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
|
||||
private void BillDetailsForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpStart.Value = DateTime.Today;
|
||||
dtpFinish.Value = DateTime.Today;
|
||||
|
@ -97,7 +97,7 @@
|
||||
this.Name = "BillDetailsForm";
|
||||
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.BillDetailsForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class CashierCheckoutForm
|
||||
partial class CheckoutForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
@ -130,7 +130,7 @@
|
||||
this.Name = "CashierCheckoutForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Cashier Checkout Form";
|
||||
this.Load += new System.EventHandler(this.CashierCheckoutForm_Load);
|
||||
this.Load += new System.EventHandler(this.CheckoutForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
@ -8,17 +8,17 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class CashierCheckoutForm : Form
|
||||
public partial class CheckoutForm : Form
|
||||
{
|
||||
CheckoutBI _coProxy;
|
||||
bool _loading;
|
||||
public CashierCheckoutForm()
|
||||
public CheckoutForm()
|
||||
{
|
||||
_loading = true;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void CashierCheckoutForm_Load(object sender, EventArgs e)
|
||||
private void CheckoutForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpStart.Format = DateTimePickerFormat.Custom;
|
||||
dtpStart.CustomFormat = "dd-MMM-yyyy";
|
||||
|
@ -36,7 +36,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
ShowStatement();
|
||||
}
|
||||
|
||||
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
|
||||
private void DiscountReportForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpStart.Value = DateTime.Today;
|
||||
dtpFinish.Value = DateTime.Today;
|
||||
|
@ -97,7 +97,7 @@
|
||||
this.Name = "BillDetailsForm";
|
||||
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.DiscountReportForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
@ -7,10 +7,10 @@ using Tanshu.Accounts.Contracts;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class FrmSaleDetail : Form
|
||||
public partial class SaleDetailForm : Form
|
||||
{
|
||||
IList<SalesAnalysisDetail> _list;
|
||||
public FrmSaleDetail()
|
||||
public SaleDetailForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
dgvSale.AutoGenerateColumns = false;
|
||||
@ -44,7 +44,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
ShowStatement();
|
||||
}
|
||||
|
||||
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
|
||||
private void SaleDetailForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpStart.Value = DateTime.Today;
|
||||
dtpFinish.Value = DateTime.Today;
|
@ -1,6 +1,6 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class FrmSaleDetail
|
||||
partial class SaleDetailForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
@ -174,7 +174,7 @@
|
||||
this.Name = "FrmSaleDetail";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Sale Detail";
|
||||
this.Load += new System.EventHandler(this.Sale_Analysis_Form_Load);
|
||||
this.Load += new System.EventHandler(this.SaleDetailForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
@ -6,17 +6,17 @@ using Tanshu.Accounts.Contracts;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class frmTaxAnalysisForm : Form
|
||||
public partial class TaxAnalysisForm : Form
|
||||
{
|
||||
IList<TaxAnalysis> _list;
|
||||
bool _loading;
|
||||
public frmTaxAnalysisForm()
|
||||
public TaxAnalysisForm()
|
||||
{
|
||||
_loading = true;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SaleAnalysisForm_Load(object sender, EventArgs e)
|
||||
private void TaxAnalysisForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpStart.Format = DateTimePickerFormat.Custom;
|
||||
dtpStart.CustomFormat = "dd-MMM-yyyy";
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
partial class frmTaxAnalysisForm
|
||||
partial class TaxAnalysisForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
@ -110,7 +110,7 @@
|
||||
this.Name = "frmTaxAnalysisForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Sale Analysis Form";
|
||||
this.Load += new System.EventHandler(this.SaleAnalysisForm_Load);
|
||||
this.Load += new System.EventHandler(this.TaxAnalysisForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
@ -37,7 +37,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
ShowStatement();
|
||||
}
|
||||
|
||||
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
|
||||
private void VoidReprintedForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpStart.Value = DateTime.Today;
|
||||
dtpFinish.Value = DateTime.Today;
|
||||
|
@ -97,7 +97,7 @@
|
||||
this.Name = "BillDetailsForm";
|
||||
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.VoidReprintedForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvSale)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
@ -111,6 +111,18 @@
|
||||
<Compile Include="Management\ManagementForm.designer.cs">
|
||||
<DependentUpon>ManagementForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Masters\TaxEditForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Masters\TaxEditForm.Designer.cs">
|
||||
<DependentUpon>TaxEditForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Masters\TaxListForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Masters\TaxListForm.Designer.cs">
|
||||
<DependentUpon>TaxListForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Masters\MachineListForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -164,6 +176,12 @@
|
||||
<Compile Include="Reports\BillDetailsForm.designer.cs">
|
||||
<DependentUpon>BillDetailsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Reports\BeerConsumptionForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Reports\BeerConsumptionForm.designer.cs">
|
||||
<DependentUpon>BeerConsumptionForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Reports\TaxAnalysisForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -182,11 +200,11 @@
|
||||
<Compile Include="Reports\VoidReprintedForm.designer.cs">
|
||||
<DependentUpon>VoidReprintedForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Reports\SaleDetail.cs">
|
||||
<Compile Include="Reports\SaleDetailForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Reports\SaleDetail.designer.cs">
|
||||
<DependentUpon>SaleDetail.cs</DependentUpon>
|
||||
<Compile Include="Reports\SaleDetailForm.designer.cs">
|
||||
<DependentUpon>SaleDetailForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Masters\ReorderTableForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
@ -285,11 +303,11 @@
|
||||
<Compile Include="MainForm.designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="User Management\AssignRoleGroups.cs">
|
||||
<Compile Include="User Management\AssignGroupRoles.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="User Management\AssignRoleGroups.Designer.cs">
|
||||
<DependentUpon>AssignRoleGroups.cs</DependentUpon>
|
||||
<Compile Include="User Management\AssignGroupRoles.Designer.cs">
|
||||
<DependentUpon>AssignGroupRoles.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="User Management\UserListForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
@ -327,6 +345,14 @@
|
||||
<EmbeddedResource Include="Management\ManagementForm.resx">
|
||||
<DependentUpon>ManagementForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Masters\TaxEditForm.resx">
|
||||
<DependentUpon>TaxEditForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Masters\TaxListForm.resx">
|
||||
<DependentUpon>TaxListForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Masters\MachineListForm.resx">
|
||||
<DependentUpon>MachineListForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
@ -364,6 +390,10 @@
|
||||
<DependentUpon>BillDetailsForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Reports\BeerConsumptionForm.resx">
|
||||
<DependentUpon>BeerConsumptionForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Reports\TaxAnalysisForm.resx">
|
||||
<DependentUpon>TaxAnalysisForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
@ -376,8 +406,8 @@
|
||||
<DependentUpon>VoidReprintedForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Reports\SaleDetail.resx">
|
||||
<DependentUpon>SaleDetail.cs</DependentUpon>
|
||||
<EmbeddedResource Include="Reports\SaleDetailForm.resx">
|
||||
<DependentUpon>SaleDetailForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Masters\ReorderTableForm.resx">
|
||||
@ -436,8 +466,8 @@
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="User Management\AssignRoleGroups.resx">
|
||||
<DependentUpon>AssignRoleGroups.cs</DependentUpon>
|
||||
<EmbeddedResource Include="User Management\AssignGroupRoles.resx">
|
||||
<DependentUpon>AssignGroupRoles.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="User Management\UserListForm.resx">
|
||||
|
@ -97,7 +97,7 @@
|
||||
this.Name = "AssignUserGroups";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Assign User Groups";
|
||||
this.Load += new System.EventHandler(this.AssignRoles_Load);
|
||||
this.Load += new System.EventHandler(this.AssignUserGroups_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace Tanshu.Accounts.PointOfSale
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void AssignRoles_Load(object sender, EventArgs e)
|
||||
private void AssignUserGroups_Load(object sender, EventArgs e)
|
||||
{
|
||||
FillUsers();
|
||||
}
|
||||
|
@ -766,7 +766,7 @@ and v.VoucherType = :regular";
|
||||
//Increase Sales
|
||||
if (inv.Inv.IsHappyHour)
|
||||
IncreaseLiqourUsingHappyHour(s, inv, c);
|
||||
else if (inv.Inv.Discount > .10M)
|
||||
else if (inv.Inv.Discount > 0)
|
||||
IncreaseLiqourUsingDiscount(s, inv, c);
|
||||
|
||||
}
|
||||
@ -778,6 +778,49 @@ and v.VoucherType = :regular";
|
||||
}
|
||||
}
|
||||
|
||||
public void IncreaseLiqIfLess(IList<SaleDetailJson> sale, DateTime startDate, DateTime finishDate)
|
||||
{
|
||||
var rand = new Random();
|
||||
const string query = @"
|
||||
select v.Date, i
|
||||
from Voucher v
|
||||
inner join v.Kots k
|
||||
inner join k.Inventories i
|
||||
where v.Date >= :startDate and v.Date <= :finishDate
|
||||
and v.VoucherType = :regular";
|
||||
var list = _session
|
||||
.CreateQuery(query)
|
||||
.SetParameter("startDate", startDate.AddHours(7))
|
||||
.SetParameter("finishDate", finishDate.AddDays(1).AddHours(7))
|
||||
.SetParameter("regular", VoucherType.Regular)
|
||||
.List<object[]>();
|
||||
List<InvDate> inventories = new List<InvDate>();
|
||||
foreach (var item in Randomize(list))
|
||||
{
|
||||
inventories.Add(new InvDate()
|
||||
{
|
||||
Date = ((DateTime)item[0]).AddHours(-7).Date,
|
||||
Inv = (Inventory)item[1]
|
||||
});
|
||||
}
|
||||
foreach (var inv in inventories)
|
||||
{
|
||||
var s = sale.SingleOrDefault(x => x.Rate == inv.Inv.VatRate);
|
||||
if (s == null) // Temp ignore and move on
|
||||
continue;
|
||||
//throw new ArgumentException("Unknown type of vat rate encountered");
|
||||
if (Math.Abs(s.Amount) < 10)
|
||||
continue; // Close enough for now
|
||||
if (s.Amount >= 0)
|
||||
continue; //Move on if we have to reduce and we do not have credit sale margin
|
||||
if (s.IsLiq)
|
||||
continue; //Move on if we have to reduce and we do not have credit sale margin
|
||||
//Increase Sales
|
||||
IncreaseLiqourUsingPrice(s, inv);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void IncreaseFood(SaleDetailJson s, InvDate inv, CreditJson c)
|
||||
{
|
||||
//Increase Sales
|
||||
@ -874,6 +917,23 @@ and v.VoucherType = :regular";
|
||||
s.Amount += inv.Inv.Net;
|
||||
c.Amount += inv.Inv.Amount;
|
||||
}
|
||||
private void IncreaseLiqourUsingPrice(SaleDetailJson s, InvDate inv)
|
||||
{
|
||||
//decimal price;
|
||||
//if (s.Amount * -1 > inv.Inv.Quantity * inv.Inv.EffectivePrice)
|
||||
// discount = 0;
|
||||
//else
|
||||
// discount = inv.Inv.Discount + Math.Round(s.Amount / (inv.Inv.Quantity * inv.Inv.EffectivePrice), 2);
|
||||
|
||||
//const string query = @"update Inventory i set Discount = :discount where i.InventoryID = :inventoryID";
|
||||
//_session.CreateQuery(query)
|
||||
// .SetParameter("discount", discount)
|
||||
// .SetParameter("inventoryID", inv.Inv.InventoryID)
|
||||
// .ExecuteUpdate();
|
||||
//inv.Inv.Discount = 1 - (inv.Inv.Discount - discount);
|
||||
//s.Amount += inv.Inv.Net;
|
||||
//c.Amount += inv.Inv.Amount;
|
||||
}
|
||||
private void DecreaseLiqour(Random r, SaleDetailJson s, InvDate inv, CreditJson c)
|
||||
{
|
||||
var min = Math.Max(Convert.ToInt32(inv.Inv.Discount * 100) + 1, 10);
|
||||
|
@ -12,6 +12,44 @@ namespace Tanshu.Accounts.Repository
|
||||
{
|
||||
public class ReportsBI
|
||||
{
|
||||
public IList<BeerConsumptionDetail> BeerConsumption(DateTime startDate, DateTime finishDate)
|
||||
{
|
||||
startDate = startDate.Date.AddHours(6);
|
||||
finishDate = finishDate.Date.AddDays(1).AddHours(5);
|
||||
if (finishDate <= startDate)
|
||||
return new List<BeerConsumptionDetail>();
|
||||
|
||||
using (var session = SessionManager.Session)
|
||||
{
|
||||
const string query = @"
|
||||
select v.Date, p.ProductID, p.Name, Sum(i.Quantity * p.Quantity)
|
||||
from Voucher v
|
||||
inner join v.Kots k
|
||||
inner join k.Inventories i
|
||||
inner join i.Product p
|
||||
where v.Date >= :startDate and v.Date <= :finishDate and v.Void = false
|
||||
and exists (select Voucher from VoucherSettlement vs where vs.Voucher = v
|
||||
and vs.Settled in (:cash, :creditCard, :billToCompany, :staff, :noCharge))
|
||||
group by v.Date, p.ProductID, p.Name
|
||||
order by v.Date, p.ProductID, p.Name
|
||||
";
|
||||
var list = session
|
||||
.CreateQuery(query)
|
||||
.SetParameter("startDate", startDate)
|
||||
.SetParameter("finishDate", finishDate)
|
||||
.SetParameter("cash", SettleOption.Cash)
|
||||
.SetParameter("creditCard", SettleOption.CreditCard)
|
||||
.SetParameter("billToCompany", SettleOption.BillToCompany)
|
||||
.SetParameter("staff", SettleOption.Staff)
|
||||
.SetParameter("noCharge", SettleOption.NoCharge)
|
||||
.List<object[]>();
|
||||
var outList = new List<BeerConsumptionDetail>();
|
||||
foreach (var item in list)
|
||||
if ((decimal)item[3] != 0)
|
||||
outList.Add(new BeerConsumptionDetail() { Date = (DateTime)item[0], ProductID = (Guid)item[1], Name = (string)item[2], Quantity = (decimal)item[3] });
|
||||
return outList;
|
||||
}
|
||||
}
|
||||
public IList<SalesAnalysisDetail> SaleQuantity(DateTime startDate, DateTime finishDate)
|
||||
{
|
||||
startDate = startDate.Date.AddHours(6);
|
||||
|
Loading…
x
Reference in New Issue
Block a user