843d644154
Fixed error were unprinted bill was not removed from table when voided.
60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows.Forms;
|
|
using Tanshu.Accounts.Repository;
|
|
using Tanshu.Accounts.Contracts;
|
|
|
|
namespace Tanshu.Accounts.PointOfSale
|
|
{
|
|
public partial class frmSaleAnalysisForm : Form
|
|
{
|
|
IList<SalesAnalysis> _list;
|
|
public frmSaleAnalysisForm()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void dtpStart_ValueChanged(object sender, EventArgs e)
|
|
{
|
|
ShowStatement();
|
|
}
|
|
|
|
private void ShowStatement()
|
|
{
|
|
if (DateTime.Today.Subtract(dtpStart.Value.Date).Days > 5 &&
|
|
!Session.IsAllowed(RoleConstants.ACCOUNTS_AUDIT))
|
|
return;
|
|
|
|
_list = new SalesAnalysisBI().GetSale(dtpStart.Value, dtpFinish.Value);
|
|
|
|
dgvSale.AutoGenerateColumns = true;
|
|
dgvSale.DataSource = _list;
|
|
dgvSale.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
|
|
dgvSale.Columns[1].DefaultCellStyle.Format = "#,##0.00;(#,##0.00);0";
|
|
dgvSale.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
|
|
}
|
|
|
|
private void dtpFinish_ValueChanged(object sender, EventArgs e)
|
|
{
|
|
ShowStatement();
|
|
}
|
|
|
|
private void Sale_Analysis_Form_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)
|
|
{
|
|
var startDate = dtpStart.Value.Date.AddHours(6);
|
|
var finishDate = dtpFinish.Value.Date.AddDays(1).AddHours(5);
|
|
Accounts.Print.Thermal.PrintSale(Session.User.Name, _list, startDate, finishDate);
|
|
}
|
|
}
|
|
}
|
|
}
|