Moved numpad control to Tanshu.Common. Billing feature complete. Delete not working as expected
Signed-off-by: unknown <tanshu@.(none)>
This commit is contained in:
94
Tanshu.Accounts.PointOfSale/Reports/CheckoutForm.cs
Normal file
94
Tanshu.Accounts.PointOfSale/Reports/CheckoutForm.cs
Normal file
@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Tanshu.Accounts.Repository;
|
||||
using Tanshu.Accounts.Print;
|
||||
using Tanshu.Accounts.Helpers;
|
||||
|
||||
namespace Tanshu.Accounts.PointOfSale
|
||||
{
|
||||
public partial class Cashier_Checkout_Form : Form
|
||||
{
|
||||
CheckoutBI coProxy;
|
||||
//private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public Cashier_Checkout_Form()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Cashier_Checkout_Form_Load(object sender, EventArgs e)
|
||||
{
|
||||
dtpStart.Format = DateTimePickerFormat.Custom;
|
||||
dtpStart.CustomFormat = "dd-MMM-yyyy HH:mm:ss";
|
||||
dtpStart.Value = DateTime.Now;
|
||||
dtpFinish.Format = DateTimePickerFormat.Custom;
|
||||
dtpFinish.CustomFormat = "dd-MMM-yyyy HH:mm:ss";
|
||||
dtpFinish.Value = DateTime.Now;
|
||||
FillUsers();
|
||||
}
|
||||
|
||||
private void FillUsers()
|
||||
{
|
||||
cmbCashier.DisplayMember = "Name";
|
||||
cmbCashier.ValueMember = "UserID";
|
||||
cmbCashier.DataSource = UserBI.GetUsers();
|
||||
}
|
||||
|
||||
private void cmbCashier_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
EmployeeStatus();
|
||||
//log.Warn(string.Format("User Checkout: {0} by {1}", coProxy.Cashier, Session.User.Name));
|
||||
}
|
||||
|
||||
private void EmployeeStatus()
|
||||
{
|
||||
if (cmbCashier.SelectedValue == null)
|
||||
return;
|
||||
dtpStart.Value = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 00:00:00", dtpStart.Value));
|
||||
dtpFinish.Value = Convert.ToDateTime(String.Format("{0:dd-MMM-yyyy} 23:59:59", dtpFinish.Value));
|
||||
|
||||
coProxy = new CheckoutBI((int)cmbCashier.SelectedValue, dtpStart.Value, dtpFinish.Value);
|
||||
txtOpening.Text = coProxy.Opening.ToString();
|
||||
txtReceipts.Text = coProxy.Receipts.ToString();
|
||||
txtAdvanceReceived.Text = coProxy.AdvanceReceipts.ToString();
|
||||
txtCCReceipts.Text = coProxy.CCReceipts.ToString();
|
||||
txtAdvanceAdjusted.Text = coProxy.AdvanceAdjusted.ToString();
|
||||
txtPayments.Text = coProxy.CashPayments.ToString();
|
||||
txtAdditionalVoids.Text = coProxy.AdditionalVoids.ToString();
|
||||
txtVoidsInSystem.Text = coProxy.VoidsInSystem.ToString();
|
||||
txtPending.Text = coProxy.PendingBills.ToString();
|
||||
txtSales.Text = coProxy.NetSales.ToString();
|
||||
txtClosingCash.Text = coProxy.ClosingBalance.ToString();
|
||||
txtStatus.Text = coProxy.Status;
|
||||
}
|
||||
|
||||
private void dtpStart_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
EmployeeStatus();
|
||||
}
|
||||
|
||||
private void dtpFinish_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
EmployeeStatus();
|
||||
}
|
||||
|
||||
private void btnCalculate_Click(object sender, EventArgs e)
|
||||
{
|
||||
decimal deposited = 0;
|
||||
if (!decimal.TryParse(txtDeposited.Text, out deposited))
|
||||
deposited = 0;
|
||||
|
||||
coProxy.Calculate(deposited, 0);
|
||||
txtStatus.Text = coProxy.Status;
|
||||
}
|
||||
|
||||
private void btnPrint_Click(object sender, EventArgs e)
|
||||
{
|
||||
Thermal.PrintClosing(coProxy);
|
||||
}
|
||||
|
||||
private void txtSales_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user