2010-03-02 17:56:21 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
using Tanshu.Accounts.Repository;
|
2010-03-02 17:56:21 +00:00
|
|
|
|
using Tanshu.Accounts.Print;
|
|
|
|
|
using Tanshu.Accounts.Helpers;
|
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.PointOfSale
|
|
|
|
|
{
|
|
|
|
|
public partial class Cashier_Checkout_Form : Form
|
|
|
|
|
{
|
|
|
|
|
CheckoutBI coProxy;
|
2011-02-09 12:03:22 +00:00
|
|
|
|
bool loading;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
//private static readonly Tanshu.Logging.SqlLogger log = new Tanshu.Logging.SqlLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
2010-03-02 17:56:21 +00:00
|
|
|
|
public Cashier_Checkout_Form()
|
|
|
|
|
{
|
2011-02-09 12:03:22 +00:00
|
|
|
|
loading = true;
|
2010-03-02 17:56:21 +00:00
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Cashier_Checkout_Form_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
dtpStart.Format = DateTimePickerFormat.Custom;
|
2011-02-09 12:03:22 +00:00
|
|
|
|
dtpStart.CustomFormat = "dd-MMM-yyyy";
|
2010-03-02 17:56:21 +00:00
|
|
|
|
dtpStart.Value = DateTime.Now;
|
|
|
|
|
dtpFinish.Format = DateTimePickerFormat.Custom;
|
2011-02-09 12:03:22 +00:00
|
|
|
|
dtpFinish.CustomFormat = "dd-MMM-yyyy";
|
2010-03-02 17:56:21 +00:00
|
|
|
|
dtpFinish.Value = DateTime.Now;
|
|
|
|
|
FillUsers();
|
2011-02-09 12:03:22 +00:00
|
|
|
|
loading = false;
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FillUsers()
|
|
|
|
|
{
|
|
|
|
|
cmbCashier.DisplayMember = "Name";
|
|
|
|
|
cmbCashier.ValueMember = "UserID";
|
2011-01-30 07:14:05 +00:00
|
|
|
|
cmbCashier.DataSource = UserBI.GetUsers();
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cmbCashier_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
EmployeeStatus();
|
2011-01-30 07:14:05 +00:00
|
|
|
|
//log.Warn(string.Format("User Checkout: {0} by {1}", coProxy.Cashier, Session.User.Name));
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void EmployeeStatus()
|
|
|
|
|
{
|
2011-02-09 12:03:22 +00:00
|
|
|
|
if (loading || cmbCashier.SelectedValue == null)
|
2010-03-02 17:56:21 +00:00
|
|
|
|
return;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
coProxy = new CheckoutBI((int)cmbCashier.SelectedValue, dtpStart.Value, dtpFinish.Value);
|
2011-02-04 19:30:55 +00:00
|
|
|
|
txtOpening.Text = string.Format("{0:#,##0.00}", coProxy);
|
|
|
|
|
txtReceipts.Text = string.Format("{0:#,##0.00}", coProxy.Receipts);
|
|
|
|
|
txtAdvanceReceived.Text = string.Format("{0:#,##0.00}", coProxy.AdvanceReceipts);
|
|
|
|
|
txtCCReceipts.Text = string.Format("{0:#,##0.00}", coProxy.CCReceipts);
|
|
|
|
|
txtNC.Text = string.Format("{0:#,##0.00}", coProxy.NCReceipts);
|
|
|
|
|
txtBillToCompany.Text = string.Format("{0:#,##0.00}", coProxy.BTCReceipts);
|
|
|
|
|
txtAdvanceAdjusted.Text = string.Format("{0:#,##0.00}", coProxy.AdvanceAdjusted);
|
|
|
|
|
txtPayments.Text = string.Format("{0:#,##0.00}", coProxy.CashPayments);
|
|
|
|
|
txtAdditionalVoids.Text = string.Format("{0:#,##0.00}", coProxy.AdditionalVoids);
|
|
|
|
|
txtVoidsInSystem.Text = string.Format("{0:#,##0.00}", coProxy.VoidsInSystem);
|
2011-02-09 12:03:22 +00:00
|
|
|
|
txtDiscounts.Text = string.Format("{0:#,##0.00}", coProxy.Discount);
|
2011-02-04 19:30:55 +00:00
|
|
|
|
txtPending.Text = string.Format("{0:#,##0.00}", coProxy.PendingBills);
|
|
|
|
|
txtSales.Text = string.Format("{0:#,##0.00}", coProxy.NetSales);
|
2011-02-09 12:03:22 +00:00
|
|
|
|
txtClosingCash.Text = string.Format("{0:#,##0.00}", coProxy.ClosingBalance);
|
2010-03-02 17:56:21 +00:00
|
|
|
|
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)
|
|
|
|
|
{
|
2011-01-17 14:55:43 +00:00
|
|
|
|
Thermal.PrintClosing(coProxy);
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|