using LYFZ.ComponentLibrary;
using LYFZ.Software.MainBusiness.DoorCityProcess;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace LYFZ.Software.MainBusiness.StatisticalInquiry
{
public partial class FrmYearFinance : LYFZ.Software.UI.StatisticalInquiry.FrmYearFinance
{
private delegate void UpdateControl();
LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
LYFZ.BLL.BLL_AllViewSet avsbll = new BLL.BLL_AllViewSet();
LYFZ.BLL.BLL_ErpWagesSet wsbll = new BLL.BLL_ErpWagesSet();
public FrmYearFinance()
{
}
///
/// 加载
///
///
///
protected override void FrmYearFinance_Shown(object sender, EventArgs e)
{
try
{
//获取支付方式
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBACCAFCCEAGAIHH", this.cmbPay_PaymentMethod, IsFirstNodeNull: true);
// 导出
this.btnExPort.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.YearFinanceCompetence, CustomAttributes.OperatingAuthority.DataExport);
// 打印
this.btnPrint.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.YearFinanceCompetence, CustomAttributes.OperatingAuthority.Print);
// 财务支出
if (!LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.DayFinanceCompetence, CustomAttributes.OperatingAuthority.FinancialExpenses))
{ this.cmbProjectSearch.Items.RemoveAt(8); }
this.numYear.Value = SDateTime.Now.Year;
this.cmbProjectSearch.SelectedIndex = 0;
}
catch (Exception ex)
{ MessageBoxCustom.Show(ex.Message); }
}
///
/// 获取每月绑定报表
///
public void Bind()
{
this.dgvMonth.Rows.Clear();
string time = this.numYear.Value.ToString();
#region 获取月报表
LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
{
DataTable dt = avsbll.Vw_YearReport("convert(varchar,Pay_CreateDatetimes,120) like '%" + time + "%'").Tables[0];
if (dt.Rows.Count > 0)
{
this.Invoke(new UpdateControl(delegate()
{
#region
for (int t = 0; t < dt.Rows.Count; t++)
{
//订单收入
decimal DayOrdersIncome = dt.Rows[t]["DayOrdersIncome"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayOrdersIncome"]);
//补款收入
decimal DayReplenishmentIncome = dt.Rows[t]["DayReplenishmentIncome"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayReplenishmentIncome"]);
//后期收入
decimal DayLateStageIncome = dt.Rows[t]["DayLateStageIncome"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayLateStageIncome"]);
//其它收入
decimal DayOtherIncome = dt.Rows[t]["DayOtherIncome"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayOtherIncome"]);
//会员充值
decimal DayMemberIncome = dt.Rows[t]["DayMemberIncome"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayMemberIncome"]);
//服务卡充值
decimal DayMemberCardPaymentIncome = dt.Rows[t]["DayMemberCardPaymentIncome"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayMemberCardPaymentIncome"]);
//前期业绩
decimal DayEarlyPerformance = dt.Rows[t]["DayEarlyPerformance"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayEarlyPerformance"]);
//后期业绩(加挑商品+其它消费)
//加挑商品
decimal DayPluslatepickPerformance = dt.Rows[t]["DayPluslatepickPerformance"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayPluslatepickPerformance"]);
decimal DayOtherPerformance = dt.Rows[t]["DayOtherPerformance"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayOtherPerformance"]);
//总店面支出
decimal DayExpenditure = dt.Rows[t]["DayExpenditure"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayExpenditure"]);
//总支出
decimal DayExpenditure2 = dt.Rows[t]["DayExpenditure2"].ToString().Trim() == "" ? 0 : Convert.ToDecimal(dt.Rows[t]["DayExpenditure2"]);
#region 获取月报表
DataGridViewRow dgvr = new DataGridViewRow();
DataGridViewCell cell = null;
//日期
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Pay_CreateDatetimes"].ToString();
dgvr.Cells.Add(cell);
//总收入
cell = new DataGridViewTextBoxCell();
cell.Value = (DayOrdersIncome + DayReplenishmentIncome + DayLateStageIncome + DayOtherIncome + DayMemberIncome + DayMemberCardPaymentIncome);
dgvr.Cells.Add(cell);
//订单收入
cell = new DataGridViewTextBoxCell();
cell.Value = DayOrdersIncome;
dgvr.Cells.Add(cell);
//补款收入
cell = new DataGridViewTextBoxCell();
cell.Value = DayReplenishmentIncome;
dgvr.Cells.Add(cell);
//日后期收入
cell = new DataGridViewTextBoxCell();
cell.Value = DayLateStageIncome;
dgvr.Cells.Add(cell);
//其它收入
cell = new DataGridViewTextBoxCell();
cell.Value = DayOtherIncome;
dgvr.Cells.Add(cell);
//会员充值
cell = new DataGridViewTextBoxCell();
cell.Value = DayMemberIncome;
dgvr.Cells.Add(cell);
//服务卡充值
cell = new DataGridViewTextBoxCell();
cell.Value = DayMemberCardPaymentIncome;
dgvr.Cells.Add(cell);
//前期业绩
cell = new DataGridViewTextBoxCell();
cell.Value = DayEarlyPerformance;
dgvr.Cells.Add(cell);
//日后期业绩
cell = new DataGridViewTextBoxCell();
cell.Value = (DayPluslatepickPerformance + DayOtherPerformance);
dgvr.Cells.Add(cell);
//总业绩
cell = new DataGridViewTextBoxCell();
cell.Value = (DayEarlyPerformance + DayPluslatepickPerformance + DayOtherPerformance);
dgvr.Cells.Add(cell);
//总支出
cell = new DataGridViewTextBoxCell();
cell.Value = (DayExpenditure + DayExpenditure2);
dgvr.Cells.Add(cell);
this.dgvMonth.Rows.Add(dgvr);
#endregion
}
dgvMonth.ClearSelection();
#endregion
}));
}
});
#endregion
}
///
/// 获取订单前期
///
///
///
decimal OrderEarly()
{
decimal sum = 0;
DataTable dt = wsbll.GetTwoPieSum(" convert(varchar,Pay_CreateDatetime,120) like '%" + this.numYear.Value + "%' and Pay_Category!='后期收款' and (Pay_PaymentMethod!='BEBACCAFEGECFBJFD' and Pay_PaymentMethod!='BEBCABAJBDFBBJGID')").Tables[0];
if (!string.IsNullOrEmpty(dt.Rows[0]["Pay_AmountOf"].ToString()))
{ sum = Convert.ToDecimal(dt.Rows[0]["Pay_AmountOf"]); }
return sum;
}
///
/// 获取订单后期
///
///
///
decimal OrderLate()
{
decimal sum = 0;
DataTable dt = wsbll.GetTwoPieSum("convert(varchar,Pay_CreateDatetime,120) like '%" + this.numYear.Value + "%' and Pay_Category='后期收款' and (Pay_Type=0) and (Pay_PaymentMethod!='BEBACCAFEGECFBJFD' and Pay_PaymentMethod!='BEBCABAJBDFBBJGID')").Tables[0];
if (!string.IsNullOrEmpty(dt.Rows[0]["Pay_AmountOf"].ToString()))
{ sum = Convert.ToDecimal(dt.Rows[0]["Pay_AmountOf"]); }
return sum;
}
///
/// 获取收款记录金额
///
///
///
///
decimal TotalRevenueSun(string Symbol)
{
decimal sum = 0;
StringBuilder str = new StringBuilder();
str.Append("" + Symbol + " convert(varchar,Pay_CreateDatetime,120) like '%" + this.numYear.Value + "%' ");
if (!string.IsNullOrEmpty(this.cmbPay_PaymentMethod.Text) && this.cmbPay_PaymentMethod.Tag != null)
{ str.Append(" and Pay_PaymentMethod='" + this.cmbPay_PaymentMethod.Tag.ToString() + "'"); }
if (this.cmbProjectSearch.Text != "全部")
{
if (this.cmbProjectSearch.Text == "订单前期收入")
{
if (string.IsNullOrEmpty(this.CtvTsorder_Name.Text) || this.CtvTsorder_Name.Text == "全部")
{ str.Append(" and Pay_Category!='后期收款'"); }
else
{ str.Append(" and Pay_Category='" + this.CtvTsorder_Name.Text.ToString() + "'"); }
}
else if (this.cmbProjectSearch.Text == "订单后期收入")
{
if (string.IsNullOrEmpty(this.CtvTsorder_Name.Text) || this.CtvTsorder_Name.Text == "全部")
{ str.Append(" and Pay_Category='后期收款' and Pay_Type=0"); }
else
{ str.Append("and Pay_Category='后期收款' and Pay_Type=0 and Pay_TwoPinsCategory='" + this.CtvTsorder_Name.Tag.ToString() + "'"); }
}
else if (this.cmbProjectSearch.Text == "其它消费收入")
{
if (string.IsNullOrEmpty(this.CtvTsorder_Name.Text) || this.CtvTsorder_Name.Text == "全部")
{ str.Append(" and Pay_Category='后期收款' and Pay_Type=1"); }
else
{ str.Append("and Pay_Category='后期收款' and Pay_Type=1 and Pay_TwoPinsCategory='" + this.CtvTsorder_Name.Tag.ToString() + "'"); }
}
else if (this.cmbProjectSearch.Text == "礼服租售收入")
{
if (string.IsNullOrEmpty(this.CtvTsorder_Name.Text) || this.CtvTsorder_Name.Text == "全部")
{ str.Append(" and Pay_Category='后期收款' and Pay_Type=2"); }
else
{ str.Append("and Pay_Category='后期收款' and Pay_Type=2 and Pay_ReceivableProject='" + this.CtvTsorder_Name.Text.ToString() + "'"); }
}
}
DataTable dt = wsbll.GetTwoPieSum(str.ToString()).Tables[0];
if (!string.IsNullOrEmpty(dt.Rows[0]["Pay_AmountOf"].ToString()))
{ sum = Convert.ToDecimal(dt.Rows[0]["Pay_AmountOf"]); }
return sum;
}
///
/// 获取其它收入金额
///
///
///
decimal OtherIncomeSum()
{
decimal sum = 0;
StringBuilder str = new StringBuilder();
str.Append("Oiae_Type='收入' and convert(varchar,Oiae_IEDatetime,120) like '%" + this.numYear.Value + "%'");
if (!string.IsNullOrEmpty(this.cmbPay_PaymentMethod.Text) && this.cmbPay_PaymentMethod.Tag != null)
{ str.Append(" and Oiae_PaymentMethod='" + this.cmbPay_PaymentMethod.Tag.ToString() + "'"); }
DataTable dt = wsbll.GetOtherIncomeSum(str.ToString()).Tables[0];
if (!string.IsNullOrEmpty(dt.Rows[0]["Oiae_Money"].ToString()))
{ sum = Convert.ToDecimal(dt.Rows[0]["Oiae_Money"]); }
return sum;
}
///
/// 获取会员充值金额
///
///
///
decimal MembersRechargeSum()
{
decimal sum = 0;
StringBuilder str = new StringBuilder();
str.Append(" convert(varchar,Mcrr_CreateDatetime,120) like '%" + this.numYear.Value + "%' ");
if (!string.IsNullOrEmpty(this.cmbPay_PaymentMethod.Text) && this.cmbPay_PaymentMethod.Tag != null)
{ str.Append(" and Mcrr_PaymentMethod='" + this.cmbPay_PaymentMethod.Tag.ToString() + "'"); }
DataTable dt = wsbll.GetMembersRechargeSum(str.ToString()).Tables[0];
if (!string.IsNullOrEmpty(dt.Rows[0]["Mcrr_RechargeAmount"].ToString()))
{ sum = Convert.ToDecimal(dt.Rows[0]["Mcrr_RechargeAmount"]); }
return sum;
}
///
/// 获取服务卡消费充值金额
///
///
///
decimal MemberCardPayment()
{
LYFZ.BLL.BLL_AllViewSet AllViewSetBll = new BLL.BLL_AllViewSet();
decimal sum = 0;
StringBuilder str = new StringBuilder();
str.Append(" and convert(varchar,创建日期,120) like '%" + this.numYear.Value + "%' ");
if (!string.IsNullOrEmpty(this.cmbPay_PaymentMethod.Text) && this.cmbPay_PaymentMethod.Tag != null)
{ str.Append(" and 付款方式编号='" + this.cmbPay_PaymentMethod.Tag.ToString() + "'"); }
DataTable dt = AllViewSetBll.GetMemberCardPaymentSum(str.ToString()).Tables[0];
if (!string.IsNullOrEmpty(dt.Rows[0]["收款金额"].ToString()))
{ sum = Convert.ToDecimal(dt.Rows[0]["收款金额"]); }
return sum;
}
///
/// 现金支出金额
///
///
///
decimal ExpenditureSum()
{
decimal sum = 0;
StringBuilder str = new StringBuilder();
str.Append(" Oiae_Type='支出' and convert(varchar,Oiae_IEDatetime,120) like '%" + this.numYear.Value + "%' ");
if (!string.IsNullOrEmpty(this.cmbPay_PaymentMethod.Text) && this.cmbPay_PaymentMethod.Tag != null)
{ str.Append("and Oiae_PaymentMethod='" + this.cmbPay_PaymentMethod.Tag.ToString() + "'"); }
if (this.cmbProjectSearch.Text != "全部" && this.cmbProjectSearch.Text == "店面支出")
{
if (!string.IsNullOrEmpty(this.CtvTsorder_Name.Text) && this.CtvTsorder_Name.Text != "全部")
{ str.Append("and Oiae_ProjectName='" + this.CtvTsorder_Name.Text.ToString() + "'"); }
}
DataTable dt = wsbll.GetOtherIncomeSum(str.ToString()).Tables[0];
if (!string.IsNullOrEmpty(dt.Rows[0]["Oiae_Money"].ToString()))
{ sum = Convert.ToDecimal(dt.Rows[0]["Oiae_Money"]); }
return sum;
}
///
/// 财务支出金额
///
///
///
decimal FinancialExpensesSum()
{
decimal sum = 0;
StringBuilder str = new StringBuilder();
str.Append(" Oiae_Type='财务支出' and convert(varchar,Oiae_IEDatetime,120) like '%" + this.numYear.Value + "%' ");
if (!string.IsNullOrEmpty(this.cmbPay_PaymentMethod.Text) && this.cmbPay_PaymentMethod.Tag != null)
{ str.Append("and Oiae_PaymentMethod='" + this.cmbPay_PaymentMethod.Tag.ToString() + "'"); }
if (this.cmbProjectSearch.Text != "全部" && this.cmbProjectSearch.Text == "财务支出")
{
if (!string.IsNullOrEmpty(this.CtvTsorder_Name.Text) && this.CtvTsorder_Name.Text != "全部")
{ str.Append("and Oiae_ProjectName='" + this.CtvTsorder_Name.Text.ToString() + "'"); }
}
DataTable dt = wsbll.GetOtherIncomeSum(str.ToString()).Tables[0];
if (!string.IsNullOrEmpty(dt.Rows[0]["Oiae_Money"].ToString()))
{ sum = Convert.ToDecimal(dt.Rows[0]["Oiae_Money"]); }
return sum;
}
///
/// 文本框合计获取值
///
public void BindTotal()
{
string time = this.numYear.Value.ToString();
if (this.cmbProjectSearch.Text == "全部")
{
//收入
this.txtTotalRevenue.Text = (this.TotalRevenueSun("(Pay_PaymentMethod!='BEBACCAFEGECFBJFD' and Pay_PaymentMethod!='BEBCABAJBDFBBJGID') and ") + this.OtherIncomeSum()).ToString();
//营业收入
this.txtOperatingIncome.Text = (this.TotalRevenueSun("") + this.MembersRechargeSum() + this.MemberCardPayment()).ToString();
//总支出
this.txtTotalExpenditure.Text = (this.ExpenditureSum() + this.FinancialExpensesSum()).ToString();
//净收入
this.txtNetIncome.Text = (Convert.ToDecimal(this.txtTotalRevenue.Text) - Convert.ToDecimal(this.txtTotalExpenditure.Text)).ToString();
}
else if (this.cmbProjectSearch.Text == "订单前期收入")
{
//收入
this.txtTotalRevenue.Text = this.TotalRevenueSun("(Pay_PaymentMethod!='BEBACCAFEGECFBJFD' and Pay_PaymentMethod!='BEBCABAJBDFBBJGID') and ").ToString();
//营业收入
this.txtOperatingIncome.Text = this.TotalRevenueSun("").ToString();
//总支出
this.txtTotalExpenditure.Text = "0";
//净收入
this.txtNetIncome.Text = (Convert.ToDecimal(this.txtTotalRevenue.Text) - Convert.ToDecimal(this.txtTotalExpenditure.Text)).ToString();
}
else if (this.cmbProjectSearch.Text == "订单后期收入")
{
//收入
this.txtTotalRevenue.Text = this.TotalRevenueSun("(Pay_PaymentMethod!='BEBACCAFEGECFBJFD' and Pay_PaymentMethod!='BEBCABAJBDFBBJGID') and ").ToString();
//营业收入
this.txtOperatingIncome.Text = this.TotalRevenueSun("").ToString();
//总支出
this.txtTotalExpenditure.Text = "0";
//净收入
this.txtNetIncome.Text = (Convert.ToDecimal(this.txtTotalRevenue.Text) - Convert.ToDecimal(this.txtTotalExpenditure.Text)).ToString();
}
else if (this.cmbProjectSearch.Text == "其它消费收入")
{
//收入
this.txtTotalRevenue.Text = this.TotalRevenueSun("(Pay_PaymentMethod!='BEBACCAFEGECFBJFD' and Pay_PaymentMethod!='BEBCABAJBDFBBJGID') and ").ToString();
//营业收入
this.txtOperatingIncome.Text = this.TotalRevenueSun("").ToString();
//总支出
this.txtTotalExpenditure.Text = "0";
//净收入
this.txtNetIncome.Text = (Convert.ToDecimal(this.txtTotalRevenue.Text) - Convert.ToDecimal(this.txtTotalExpenditure.Text)).ToString();
}
else if (this.cmbProjectSearch.Text == "其它收入")
{
//收入
this.txtTotalRevenue.Text = this.OtherIncomeSum().ToString();
//营业收入
this.txtOperatingIncome.Text = "0";
//总支出
this.txtTotalExpenditure.Text = "0";
//净收入
this.txtNetIncome.Text = (Convert.ToDecimal(this.txtTotalRevenue.Text) - Convert.ToDecimal(this.txtTotalExpenditure.Text)).ToString();
}
else if (this.cmbProjectSearch.Text == "会员充值收入")
{
//收入
this.txtTotalRevenue.Text = "0";// Convert.ToDecimal(Convert.ToDecimal(MembersRechargeSum(time))).ToString();
//营业收入
this.txtOperatingIncome.Text = this.MembersRechargeSum().ToString();
//总支出
this.txtTotalExpenditure.Text = "0";
//净收入
this.txtNetIncome.Text = (Convert.ToDecimal(this.txtTotalRevenue.Text) - Convert.ToDecimal(this.txtTotalExpenditure.Text)).ToString();
}
else if (this.cmbProjectSearch.Text == "服务卡消费收入")
{
//收入
this.txtTotalRevenue.Text = "0";// Convert.ToDecimal(Convert.ToDecimal(MemberCardPayment(time))).ToString();
//营业收入
this.txtOperatingIncome.Text = this.MemberCardPayment().ToString();
//总支出
this.txtTotalExpenditure.Text = "0";
//净收入
this.txtNetIncome.Text = (Convert.ToDecimal(this.txtTotalRevenue.Text) - Convert.ToDecimal(this.txtTotalExpenditure.Text)).ToString();
}
else if (this.cmbProjectSearch.Text == "礼服租售收入")
{
//收入
this.txtTotalRevenue.Text = this.TotalRevenueSun("(Pay_PaymentMethod!='BEBACCAFEGECFBJFD' and Pay_PaymentMethod!='BEBCABAJBDFBBJGID') and ").ToString();
//营业收入
this.txtOperatingIncome.Text = this.TotalRevenueSun("").ToString();
//总支出
this.txtTotalExpenditure.Text = "0";
//净收入
this.txtNetIncome.Text = (Convert.ToDecimal(this.txtTotalRevenue.Text) - Convert.ToDecimal(this.txtTotalExpenditure.Text)).ToString();
}
else if (this.cmbProjectSearch.Text == "店面支出")
{
//收入
this.txtTotalRevenue.Text = "0";
//营业收入
this.txtOperatingIncome.Text = "0";
//总支出
this.txtTotalExpenditure.Text = this.ExpenditureSum().ToString();
//净收入
this.txtNetIncome.Text = (Convert.ToDecimal(this.txtTotalRevenue.Text) - Convert.ToDecimal(this.txtTotalExpenditure.Text)).ToString();
}
else if (this.cmbProjectSearch.Text == "财务支出")
{
//收入
this.txtTotalRevenue.Text = "0";
//营业收入
this.txtOperatingIncome.Text = "0";
//总支出
this.txtTotalExpenditure.Text = this.FinancialExpensesSum().ToString();
//净收入
this.txtNetIncome.Text = (Convert.ToDecimal(this.txtTotalRevenue.Text) - Convert.ToDecimal(this.txtTotalExpenditure.Text)).ToString();
}
else if (this.cmbProjectSearch.Text == "押金")
{
//收入
this.txtTotalRevenue.Text = "0";
//营业收入
this.txtOperatingIncome.Text = "0";
//总支出
this.txtTotalExpenditure.Text = "0";
//净收入
this.txtNetIncome.Text = "0";
}
//订单前期
this.txtPreliminaryResults.Text = this.OrderEarly().ToString();
//订单后期
this.txtLateResults.Text = this.OrderLate().ToString();
}
///
/// 项目查询
///
///
///
protected override void cmbProjectSearch_SelectedValueChanged(object sender, EventArgs e)
{
try
{
this.CtvTsorder_Name.Text = "";
if (this.cmbProjectSearch.Text == "全部")
{ this.CtvTsorder_Name.Visible = false; }
else if (this.cmbProjectSearch.Text == "订单前期收入")
{
this.CtvTsorder_Name.Visible = true;
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.CtvTsorder_Name, "全部,预约收款,预约补款,全款");
}
else if (this.cmbProjectSearch.Text == "订单后期收入" || this.cmbProjectSearch.Text == "其它消费收入")
{
this.CtvTsorder_Name.Visible = true;
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBACDAJDFDDEACGJ", this.CtvTsorder_Name, IsFirstNodeNull: true, IsFirstNodeName: "全部", StrWhere: "Sc_ClassCode!='BEBCADBFBCDFBGJHC' and Sc_ClassCode!='BEBCADBFBDDEGGABF' and Sc_ClassCode!='BEBCBFBICGDHCGBEJ' and Sc_ClassCode!='BEBCABBAAICBDHDHI' and Sc_ClassCode!='BEBCABBAAICJAAGDG' and Sc_ClassCode!='BEBCBFBICFCECBHFF'");
}
else if (this.cmbProjectSearch.Text == "其它收入")
{ this.CtvTsorder_Name.Visible = false; }
else if (this.cmbProjectSearch.Text == "会员充值收入")
{ this.CtvTsorder_Name.Visible = false; }
else if (this.cmbProjectSearch.Text == "服务卡消费收入")
{ this.CtvTsorder_Name.Visible = false; }
else if (this.cmbProjectSearch.Text == "礼服租售收入")
{
this.CtvTsorder_Name.Visible = true;
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.CtvTsorder_Name, "全部,礼服出租,礼服出售");
}
else if (this.cmbProjectSearch.Text == "店面支出")
{
this.CtvTsorder_Name.Visible = true;
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BEBACIAFBEDIGJJFE", this.CtvTsorder_Name, IsFirstNodeNull: true, IsFirstNodeName: "全部");
}
else if (this.cmbProjectSearch.Text == "财务支出")
{
this.CtvTsorder_Name.Visible = true;
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_SystemCategory("BFAGBGBAEJBACEEHJ", this.CtvTsorder_Name, IsFirstNodeNull: true, IsFirstNodeName: "全部");
}
else if (this.cmbProjectSearch.Text == "押金")
{ this.CtvTsorder_Name.Visible = false; }
//获取文本框金额
this.BindTotal();
}
catch (Exception ex)
{ MessageBoxCustom.Show(ex.Message); }
}
///
/// 项目名称
///
///
///
protected override void CtvTsorder_Name_ComboBoxTreeViewEx_TextChanged(object sender, TreeViewEventArgs e)
{ this.BindTotal(); }
///
/// 选择支付方式
///
///
///
protected override void cmbPay_PaymentMethod_ComboBoxTreeViewEx_TextChanged(object sender, TreeViewEventArgs e)
{ this.BindTotal(); }
///
/// 查询年
///
///
///
protected override void numYear_ValueChanged(object sender, EventArgs e)
{
try
{ //获取订单数
string strStartTime = this.numYear.Value + "-01-01";
string strEndTime = Convert.ToDateTime(strStartTime).AddYears(1).AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss.fff");
string ExecuteSql = orbll.GetView_CustomReturnExecuteSql("tb_ErpOrder", StrWhere: PublicCodeClasses.GetDateTime("Ord_CreateDateTime", strStartTime, strEndTime, DateAddDays: 0, ConnectWord: ""), ShowColumnName: "Ord_Type,Ord_Class");
DataSet dtSet = orbll.GetView_Custom(ExecuteSql);
DataTable tbl1 = dtSet.Tables["ds"];
DataRow[] dtRow = tbl1.Select("Ord_Type = '0'");
DataRow[] dtRow1 = tbl1.Select("Ord_Type = '1'");
DataRow[] dtRow2 = tbl1.Select("Ord_Type = '2'");
DataRow[] dtRow3 = tbl1.Select("Ord_Type = '3'");
DataRow[] dtRow4 = tbl1.Select("Ord_Type = '4'");
DataRow[] dtRow5 = tbl1.Select("Ord_Class = '0'");
this.lblCount.Text = "订单数: 婚纱:" + dtRow.Length + " 儿童:" + dtRow1.Length + " 写真:" + dtRow2.Length + " 服务:" + dtRow3.Length + " 婚庆:" + dtRow4.Length + " 其中意向:" + dtRow5.Length;
this.BindTotal();
this.Bind();
}
catch (Exception ex)
{ MessageBoxCustom.Show(ex.Message); }
}
///
/// 导出
///
///
///
protected override void btnExPort_Click(object sender, EventArgs e)
{ this.dgvMonth.ExportDataTable(); }
///
/// 关闭
///
///
///
protected override void btnClose_Click(object sender, EventArgs e)
{ this.Close(); }
///
/// 查询明细
///
///
///
protected override void dgvMonth_DoubleClick(object sender, EventArgs e)
{
try
{
if (this.dgvMonth.SelectedRows.Count == 0)
{ MessageBoxCustom.Show("请选择你要查看的日期!"); return; }
LYFZ.Software.MainBusiness.StatisticalInquiry.FrmMonthFinance frm = new FrmMonthFinance();
frm.DateTimeDay = this.dgvMonth.CurrentRow.Cells["DayNumber"].Value.ToString();
frm.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
frm.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
frm.ShowDialog();
}
catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
}
///
/// 打印
///
///
///
protected override void btnPrint_Click(object sender, EventArgs e)
{
try
{
string StrDateWeek = this.numYear.Value.ToString().Trim() + "年";
object StrText = "总收入:" + this.txtTotalRevenue.Text.Trim() + " 营业收入:" + this.txtOperatingIncome.Text.Trim() + " 总支出:" + this.txtTotalExpenditure.Text.Trim();
StrText += "\r\n净收入:" + this.txtNetIncome.Text.Trim() + " 前期业绩:" + this.txtPreliminaryResults.Text.Trim() + " 后期业绩:" + this.txtLateResults.Text.Trim();
StrText += "\r\n" + this.lblCount.Text.Trim();
Hashtable htData = new Hashtable();
htData["dgvData"] = this.dgvMonth;
htData["StrText"] = StrText;
htData["StrDateWeek"] = StrDateWeek;
LYFZ.Software.MainBusiness.ReportPrint.ReportFixedFormat.PrintFixedFormat(EnumPublic.PrintTypeEnum.财务报表年, htData);
}
catch (Exception ex)
{ MessageBoxCustom.Show(ex.Message); }
}
}
}