narsil/Tanshu.Accounts.PointOfSale/Updates/SaleTaxReportForm.cs
unknown 0172fc4e01 Added Service Tax and CIN Information to the bill printout
Added Nc Option in settlement
Merged Vouchers and SaleVoucher table. Need to update the Sql Schema
2014-08-08 17:35:38 +05:30

79 lines
3.0 KiB
C#

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 System.Data.SqlClient;
using System.Configuration;
using Tanshu.Accounts.Helpers;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.BI;
namespace Tanshu.Accounts.PointOfSale
{
public partial class SaleTaxReportForm : Form
{
List<SalesAnalysisBO> det;
public SaleTaxReportForm()
{
InitializeComponent();
}
private void dtpStart_ValueChanged(object sender, EventArgs e)
{
ShowStatement();
}
private void ShowStatement()
{
DateTime startDate = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 00:00:00", dtpStart.Value));
DateTime finishDate = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 23:59:59", dtpFinish.Value));
decimal voids = 0, pending = 0, net = 0, vat = 0, serviceTax = 0, nc = 0;
det = new SalesAnalysisBI().GetSalesTaxReturn(startDate, finishDate, ref voids, ref pending, ref net, ref vat, ref serviceTax, ref nc);
//dc.CommandTimeout = 50000;
dgvSale.AutoGenerateColumns = true;
dgvSale.DataSource = det;
dgvSale.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
dgvSale.Columns[0].Visible = false;
dgvSale.Columns[1].DefaultCellStyle.Format = "%";
dgvSale.Columns[2].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
dgvSale.Columns[3].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
dgvSale.Columns[4].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
// txtFreeSale.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", freeSale);
txtVoid.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", voids);
txtPending.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", pending);
txtNet.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", net);
txtVat.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", vat);
txtServiceTax.Text = String.Format("{0:#,##0.00;(#,##0.00);0}", net + serviceTax);
}
private void dtpFinish_ValueChanged(object sender, EventArgs e)
{
ShowStatement();
}
private void Sale_Analysis_Form_Load(object sender, EventArgs e)
{
dtpStart.Value = DateTime.Now;
dtpFinish.Value = DateTime.Now;
ShowStatement();
}
private void btnPrint_Click(object sender, EventArgs e)
{
if (det != null)
{
DateTime startDate = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 00:00:00", dtpStart.Value));
DateTime finishDate = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 23:59:59", dtpFinish.Value));
Tanshu.Accounts.Print.Thermal.PrintSale(det, startDate, finishDate);
}
}
}
}