//交款表打印 private void Print(int accountType) { Controller.BeginChargeWorkid(); zyAccount = new ZY_Account(); Report = new grproLib.GridppReport(); if (accountType == 0) { chargeRpt.GetAccountRptInfo(chargeRpt, ids.ToArray(), accountType); #region 预交金 Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院财务结帐预交金汇总.grf"); GWI_DesReport.HisReport.FillRecordToReport(Report, chargeRpt); Report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(Report_FetchRecord); #endregion } else { #region 结算 Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院财务结帐结算汇总.grf"); costRpt.GetAccountRptInfo(costRpt, ids.ToArray(), accountType); GWI_DesReport.HisReport.FillRecordToReport(Report, costRpt); for (int i = 0; i < costRpt.发票项目.Rows.Count; i++) { try { Report.ParameterByName(costRpt.发票项目.Rows[i]["itemname"].ToString()).AsString = costRpt.发票项目.Rows[i]["Tolal_Fee"].ToString(); } catch (Exception err) { MessageBox.Show("发票打印传入参数:发票项目_" + costRpt.发票项目.Rows[i]["itemname"].ToString() + " 错误\r\n" + err.Message); continue; } } for (int i = 0; i < costRpt.记账内容.Length; i++) { try { Report.ParameterByName(costRpt.记账内容[i].TypeName + "_记账_张数").AsString = costRpt.记账内容[i].CostNum; Report.ParameterByName(costRpt.记账内容[i].TypeName + "_记账").AsString = costRpt.记账内容[i].CostFee; } catch (Exception err) { MessageBox.Show("发票打印传入参数:记账类型_" + costRpt.记账内容[i].TypeName + " 错误\r\n" + err.Message); continue; } } #endregion } Controller.EndChargeWorkid(); //zyAccount.UpdatePrintNum(Accountid); Report.PrintPreview(false); }
/// <summary> /// 根据交款ID得到预交金交款表对象 /// </summary> /// <param name="rpt">预交金交款表对象</param> /// <param name="Accountid">交款ID</param> public void GetAccountRptInfo(AbstractChargeAccountRpt rpt, int[] Accountids, int type) { AllAccount Account = new AllAccount(); decimal total_fee = 0; decimal cash_fee = 0; decimal pos_fee = 0; decimal wticketfee = 0; decimal wticketnum = 0; decimal bticketfee = 0; decimal bticketnum = 0; CommMethod.list_AddString.Clear(); List <ZY_Account> zyAccounts = Account.GetAccounts(Accountids, type); ZY_Account zyAccount = null; for (int i = 0; i < zyAccounts.Count; i++) { zyAccount = zyAccounts[i]; rpt.交款人 = CommMethod.AddString(zyAccount.AccountName); total_fee += zyAccount.Total_Fee; cash_fee += zyAccount.Cash_Fee; pos_fee += zyAccount.POS_Fee; wticketfee += zyAccount.WTicketFee; wticketnum += zyAccount.WTicketNum; bticketfee += zyAccount.BTicketFee; bticketnum += zyAccount.BTicketNum; } rpt.交款时间 = zyAccount.AccountDate.ToString(); rpt.总金额 = total_fee.ToString(); rpt.总金额大写 = total_fee.ToString(); rpt.现金金额 = cash_fee.ToString(); rpt.POS金额 = pos_fee.ToString(); rpt.收费金额 = wticketfee.ToString(); rpt.收费张数 = wticketnum.ToString(); rpt.退费金额 = bticketfee.ToString(); rpt.退费张数 = bticketnum.ToString(); rpt.次交款时间 = zyAccount.LastDate.ToString(); rpt.医院名称 = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName; string[] AccountIDs = new string[Accountids.Length]; for (int i = 0; i < AccountIDs.Length; i++) { AccountIDs[i] = Accountids[i].ToString(); } List <ZY_ChargeList> zy_Chargelist = zyAccount.GetChargeData(AccountIDs, -1); for (int i = 0; i < zy_Chargelist.Count; i++) { zy_Chargelist[i].ChargeType = zy_Chargelist[i].FeeType == 0 ? "现金" : "POS"; zy_Chargelist[i].PatName = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.GetPatName(zy_Chargelist[i].PatID); } rpt.预交金记录 = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zy_Chargelist); }
public FrmAccount(long currentUserId, long currentDeptId, string chineseName) { InitializeComponent(); _currentUser = new User(currentUserId); _currentDept = new Deptment(currentDeptId); //_filterType = Constant.CustomFilterType; //_searchType = Constant.CustomSearchType; this.Text = chineseName; zyAccount = new ZY_Account(); zyAccount.AccountCode = this._currentUser.EmployeeID.ToString(); this.cbType.SelectedIndex = 0; this.tbTime.Text = zyAccount.GetLastTime().ToString(); }
//打印科目分类 private void button3_Click(object sender, EventArgs e) { if (this.dgvAccountlist.DataSource != null && this.dgvAccountlist.RowCount > 0) { DataTable dgvdt = ((DataTable)this.dgvAccountlist.DataSource).DefaultView.ToTable(); if (dgvdt.Rows.Count <= 0) { return; } if (dgvdt.Rows[this.dgvAccountlist.CurrentRow.Index]["ACCOUNTID"] != DBNull.Value && Convert.ToInt32(dgvdt.Rows[this.dgvAccountlist.CurrentRow.Index]["ACCOUNTID"]) > 0) { Accountid = Convert.ToInt32(dgvdt.Rows[this.dgvAccountlist.CurrentRow.Index]["ACCOUNTID"]); ZY_Account zy_Account_Son = zyAccount.GetAccount(Accountid); Report = new grproLib.GridppReport(); if (zy_Account_Son.AccountType != 0) { Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院财务结帐结算汇总附表.grf"); Report.ParameterByName("AccountName").AsString = zy_Account_Son.AccountName; Report.ParameterByName("AccountDate").AsString = zy_Account_Son.AccountDate.ToString(); Report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(DeptReport_FetchRecord); Report.ParameterByName("WorkName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName; } if (this.PrintType.Checked == false) { Report.PrintPreview(false); } else { Report.PrintPreview(false); } } } }
/// <summary> /// 根据交款ID得到预交金交款表对象 /// </summary> /// <param name="rpt">预交金交款表对象</param> /// <param name="Accountid">交款ID</param> public void GetAccountRptInfo(AbstractChargeAccountRpt rpt, int Accountid) { ZY_Account zyAccount = new ZY_Account(); zyAccount = zyAccount.GetAccount(Accountid); rpt.交款人 = zyAccount.AccountName; rpt.交款时间 = zyAccount.AccountDate.ToString(); rpt.总金额 = zyAccount.Total_Fee.ToString(); rpt.总金额大写 = zyAccount.Total_Fee.ToString(); rpt.现金金额 = zyAccount.Cash_Fee.ToString(); rpt.POS金额 = zyAccount.POS_Fee.ToString(); rpt.收费金额 = zyAccount.WTicketFee.ToString(); rpt.收费张数 = zyAccount.WTicketNum.ToString(); rpt.退费金额 = zyAccount.BTicketFee.ToString(); rpt.退费张数 = zyAccount.BTicketNum.ToString(); rpt.次交款时间 = zyAccount.LastDate.ToString(); rpt.医院名称 = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName; string[] AccountIDs = new string[1]; AccountIDs[0] = Accountid.ToString(); List <ZY_ChargeList> zy_Chargelist = zyAccount.GetChargeData(AccountIDs, -1); for (int i = 0; i < zy_Chargelist.Count; i++) { zy_Chargelist[i].ChargeType = zy_Chargelist[i].FeeType == 0 ? "现金" : "POS"; zy_Chargelist[i].PatName = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.GetPatName(zy_Chargelist[i].PatID); } rpt.预交金记录 = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zy_Chargelist); }
public FrmAccount() { InitializeComponent(); zyAccount = new ZY_Account(); }
/// 交款表打印 private void Print() { zyAccount = zyAccount.GetAccount(Accountid); Report = new grproLib.GridppReport(); if (zyAccount.AccountType == 0) { chargeRpt.GetAccountRptInfo(chargeRpt, Accountid); #region 预交金 Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院财务结帐预交金汇总.grf"); GWI_DesReport.HisReport.FillRecordToReport(Report, chargeRpt); Report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(Report_FetchRecord); #endregion #region OLD //Report.ParameterByName("AccountName").AsString = zyAccount.AccountName; //Report.ParameterByName("AccountDate").AsString = zyAccount.AccountDate.ToString(); //Report.ParameterByName("Total_Fee").AsString = zyAccount.Total_Fee.ToString(); //Report.ParameterByName("Total_FeeD").AsString = zyAccount.Total_Fee.ToString(); //Report.ParameterByName("YJ_M_FY").AsString = zyAccount.Cash_Fee.ToString(); //Report.ParameterByName("YJ_POS_FY").AsString = zyAccount.POS_Fee.ToString(); //Report.ParameterByName("WTICKETFEE").AsString = zyAccount.WTicketFee.ToString(); //Report.ParameterByName("WTICKETNUM").AsString = zyAccount.WTicketNum.ToString(); //Report.ParameterByName("BTICKETFEE").AsString = zyAccount.BTicketFee.ToString(); //Report.ParameterByName("BTICKETNUM").AsString = zyAccount.BTicketNum.ToString(); //Report.ParameterByName("LastDate").AsString = zyAccount.LastDate.ToString(); //Report.ParameterByName("WorkName").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName; #endregion } else { #region 结算 Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\住院财务结帐结算汇总.grf"); costRpt.GetAccountRptInfo(costRpt, Accountid); GWI_DesReport.HisReport.FillRecordToReport(Report, costRpt); //Report.ParameterByName("医院名称").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName + "住院每日缴款清单"; for (int i = 0; i < costRpt.发票项目.Rows.Count; i++) { try { Report.ParameterByName(costRpt.发票项目.Rows[i]["itemname"].ToString()).AsString = costRpt.发票项目.Rows[i]["Tolal_Fee"].ToString(); } catch (Exception err) { MessageBox.Show("发票打印传入参数:发票项目_" + costRpt.发票项目.Rows[i]["itemname"].ToString() + " 错误\r\n" + err.Message); continue; } } for (int i = 0; i < costRpt.记账内容.Length; i++) { try { Report.ParameterByName(costRpt.记账内容[i].TypeName + "_记账_张数").AsString = costRpt.记账内容[i].CostNum; Report.ParameterByName(costRpt.记账内容[i].TypeName + "_记账").AsString = costRpt.记账内容[i].CostFee; } catch (Exception err) { MessageBox.Show("发票打印传入参数:记账类型_" + costRpt.记账内容[i].TypeName + " 错误\r\n" + err.Message); continue; } } #endregion #region OLD //Report.ParameterByName("交款人").AsString = zyAccount.AccountName; //Report.ParameterByName("交款时间").AsString = zyAccount.AccountDate.ToString(); //DataTable dt = zyAccount.GetTicketTotle(Accountid); //decimal AllKMFee = 0; ////dt = null; //for (int i = 0; i < dt.Rows.Count; i++) //{ // for (int j = 1; j <= Report.Parameters.Count; j++) // { // if (dt.Rows[i]["itemname"].ToString().Trim() == Report.Parameters[j].Name) // { // Report.Parameters[j].Value = dt.Rows[i]["Tolal_Fee"].ToString(); // } // } // AllKMFee += Convert.ToDecimal(dt.Rows[i]["Tolal_Fee"]); //} //#endregion //Report.ParameterByName("发票科目合计").AsString = AllKMFee.ToString(); //List<ZY_CostMaster> zy_CML = zyAccount.GetCostData(Accountid); //if (zy_CML != null && zy_CML.Count > 0) //{ // #region 收费票据 // Report.ParameterByName("收费发票开始号").AsString = zy_CML[0].TicketCode; // Report.ParameterByName("收费发票结束号").AsString = zy_CML[zy_CML.Count - 1].TicketCode; // Report.ParameterByName("收费发票张数").AsString = zy_CML.Count.ToString(); // List<ZY_CostMaster> zy_CMLx = zy_CML.FindAll(delegate(ZY_CostMaster x) { return x.Record_Flag == 2; }); // Report.ParameterByName("收费退费张数").AsString = zy_CMLx.Count.ToString(); // Report.ParameterByName("收费退费金额").AsString = zy_CMLx.Sum(x => x.Total_Fee).ToString(); // Report.ParameterByName("废票张数").AsString = zyAccount.GetBadTicketCount(Accountid).ToString(); // #endregion // #region 记账部分 // //自费 // List<ZY_CostMaster> zy_CMLy1 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return (y.PatType.Trim() == "01" ); }); // //农合 // List<ZY_CostMaster> zy_CMLy2 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return (y.PatType.Trim() == "02"); }); // //居民医保 // List<ZY_CostMaster> zy_CMLy3 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return (y.PatType.Trim() == "03"); }); // //职工医保 // List<ZY_CostMaster> zy_CMLy4 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return (y.PatType.Trim() == "04" ); }); // //其他 // List<ZY_CostMaster> zy_CMLy6 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return (y.PatType.Trim() == "06"); }); // //单位 // List<ZY_CostMaster> zy_CMLy5 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return y.WorkUnit_Fee != 0; }); // Report.ParameterByName("居民医保_记账_张数").AsString = zy_CMLy3.Count.ToString(); // Report.ParameterByName("居民医保_记账").AsString = zy_CMLy3.Sum(y => y.NotWorkUnit_Fee).ToString(); // Report.ParameterByName("农合_记账_张数").AsString = zy_CMLy2.Count.ToString(); // Report.ParameterByName("农合_记账").AsString = zy_CMLy2.Sum(y => y.NotWorkUnit_Fee).ToString(); // Report.ParameterByName("职工医保_记账_张数").AsString = zy_CMLy4.Count.ToString(); // Report.ParameterByName("职工医保_记账").AsString = zy_CMLy4.Sum(y => y.NotWorkUnit_Fee).ToString(); // Report.ParameterByName("其他_记账_张数").AsString = zy_CMLy6.Count.ToString(); // Report.ParameterByName("其他_记账").AsString = zy_CMLy6.Sum(y => y.NotWorkUnit_Fee).ToString(); // Report.ParameterByName("自费_记账_张数").AsString = zy_CMLy1.Count.ToString(); // Report.ParameterByName("自费_记账").AsString = zy_CMLy1.Sum(y => y.NotWorkUnit_Fee).ToString(); // Report.ParameterByName("单位记账_张数").AsString = zy_CMLy5.Count.ToString(); // Report.ParameterByName("单位记账").AsString = zy_CMLy5.Sum(y => y.WorkUnit_Fee).ToString(); // Report.ParameterByName("记账合计张数").AsString = (zy_CMLy3.Count + zy_CMLy2.Count + zy_CMLy4.Count + zy_CMLy6.Count + zy_CMLy1.Count + zy_CMLy5.Count).ToString();//zy_CML.FindAll(delegate(ZY_CostMaster y) { return y.Village_Fee > 0; }).Count.ToString(); // Report.ParameterByName("记账合计").AsString = zy_CML.Sum(y => y.Village_Fee).ToString(); // #endregion // #region 收现金 // Report.ParameterByName("优惠金额").AsString = zy_CML.Sum(z => z.Favor_Fee).ToString(); // Report.ParameterByName("应收现金").AsString = zy_CML.Sum(z => z.Self_Fee).ToString(); // Report.ParameterByName("预收现金").AsString = zy_CML.Sum(z => z.Deptosit_Fee).ToString(); // decimal decR = zy_CML.Sum(z => z.Reality_Fee); // //补收 // List<ZY_CostMaster> zy_CML11 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return y.Reality_Fee > 0; }); // //补退 // List<ZY_CostMaster> zy_CML22 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return y.Reality_Fee < 0; }); // //欠费 // List<ZY_CostMaster> zy_CML33 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return y.Ntype ==3; }); // Report.ParameterByName("补收现金").AsString = zy_CML11.Sum(x => x.Reality_Fee).ToString("0.00"); // Report.ParameterByName("补退现金").AsString = (0 - zy_CML22.Sum(x => x.Reality_Fee)).ToString("0.00"); // Report.ParameterByName("实收现金").AsString = decR.ToString(); // Report.ParameterByName("小写合计").AsString = decR.ToString(); // Report.ParameterByName("大写合计").AsString = decR.ToString(); // try // { // List<ZY_ChargeList> zy_cl = zyAccount.GetChargeListData(Accountid); // //现金 // List<ZY_ChargeList> zy_cl0 = zy_cl.FindAll(x => x.FeeType == 0); // //POS // List<ZY_ChargeList> zy_cl1 = zy_cl.FindAll(x => x.FeeType == 1); // Report.ParameterByName("预交金现金").AsString = zy_cl0.Sum(x => x.Total_Fee).ToString(); // Report.ParameterByName("预交金POS").AsString = zy_cl1.Sum(x => x.Total_Fee).ToString(); // Report.ParameterByName("补收金额现金").AsString = zy_CML11.Sum(x => x.Money_Fee).ToString(); // Report.ParameterByName("补收金额POS").AsString = zy_CML11.Sum(x => x.Pos_Fee).ToString(); // Report.ParameterByName("欠费金额").AsString = zy_CML33.Sum(x => (x.Self_Fee - x.Deptosit_Fee)).ToString(); // } // catch { } #endregion } zyAccount.UpdatePrintNum(Accountid); if (this.PrintType.Checked == false) { Report.PrintPreview(false); } else { Report.PrintPreview(false); } }
/// <summary> /// 根据交款ID得到结算交款表对象 /// </summary> /// <param name="rpt">结算交款表对象</param> /// <param name="Accountid">交款ID</param> public void GetAccountRptInfo(AbstractCostAccountRpt rpt, int Accountid) { ZY_Account zyAccount = new ZY_Account(); zyAccount = zyAccount.GetAccount(Accountid); rpt.医院名称 = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName + "住院每日缴款清单"; rpt.交款人 = zyAccount.AccountName; rpt.交款时间 = zyAccount.AccountDate.ToString(); #region 发票项目 DataTable dt = zyAccount.GetTicketTotle(Accountid); decimal AllKMFee = 0; //dt = null; for (int i = 0; i < dt.Rows.Count; i++) { AllKMFee += Convert.ToDecimal(dt.Rows[i]["Tolal_Fee"]); } #endregion rpt.发票项目 = dt; rpt.发票科目合计 = AllKMFee.ToString(); List <ZY_CostMaster> zy_CML = zyAccount.GetCostData(Accountid); if (zy_CML != null && zy_CML.Count > 0) { #region 收费票据 rpt.收费发票开始号 = zy_CML[0].TicketCode; rpt.收费发票结束号 = zy_CML[zy_CML.Count - 1].TicketCode; rpt.收费发票张数 = zy_CML.Count.ToString(); List <ZY_CostMaster> zy_CMLx = zy_CML.FindAll(delegate(ZY_CostMaster x) { return(x.Record_Flag == 2); }); rpt.收费退费张数 = zy_CMLx.Count.ToString(); rpt.收费退费金额 = zy_CMLx.Sum(x => x.Total_Fee).ToString(); rpt.废票张数 = zyAccount.GetBadTicketCount(Accountid).ToString(); #endregion #region 记账部分 DataTable dt1 = BaseDataFactory.GetData(baseDataType.病人类型); List <AccountPatType> apts = new List <AccountPatType>(); AccountPatType apt; int AllNum = 0; for (int i = 0; i < dt1.Rows.Count; i++) { List <ZY_CostMaster> zy_CMLy = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.PatType.Trim() == dt1.Rows[i]["code"].ToString()); }); apt = new AccountPatType(); apt.TypeName = dt1.Rows[i]["name"].ToString(); apt.CostNum = zy_CMLy.Count.ToString(); apt.CostFee = zy_CMLy.Sum(x => x.NotWorkUnit_Fee).ToString(); apts.Add(apt); AllNum += zy_CMLy.Count; } apt = new AccountPatType(); //单位 List <ZY_CostMaster> zy_CMLy5 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.WorkUnit_Fee != 0); }); apt.TypeName = "单位"; apt.CostNum = zy_CMLy5.Count.ToString(); apt.CostFee = zy_CMLy5.Sum(y => y.WorkUnit_Fee).ToString(); apts.Add(apt); //合计 apt = new AccountPatType(); apt.TypeName = "合计"; apt.CostNum = (AllNum + zy_CMLy5.Count).ToString(); apt.CostFee = zy_CML.Sum(y => y.Village_Fee).ToString(); apts.Add(apt); rpt.记账内容 = apts.ToArray(); #endregion #region 收现金 rpt.优惠金额 = zy_CML.Sum(z => z.Favor_Fee).ToString(); rpt.应收金额 = zy_CML.Sum(z => z.Self_Fee).ToString(); rpt.预收金额 = zy_CML.Sum(z => z.Deptosit_Fee).ToString(); decimal decR = zy_CML.Sum(z => z.Reality_Fee); //补收 List <ZY_CostMaster> zy_CML11 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Reality_Fee > 0); }); //补退 List <ZY_CostMaster> zy_CML22 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Reality_Fee < 0); }); //欠费 List <ZY_CostMaster> zy_CML33 = zy_CML.FindAll(delegate(ZY_CostMaster y) { return(y.Ntype == 3); }); rpt.补收金额 = zy_CML11.Sum(x => x.Reality_Fee).ToString("0.00"); rpt.补退金额 = (0 - zy_CML22.Sum(x => x.Reality_Fee)).ToString("0.00"); rpt.实收金额 = decR.ToString(); rpt.小写合计 = decR.ToString(); rpt.大写合计 = decR.ToString(); List <ZY_ChargeList> zy_cl = zyAccount.GetChargeListData(Accountid); //现金 List <ZY_ChargeList> zy_cl0 = zy_cl.FindAll(x => x.FeeType == 0); //POS List <ZY_ChargeList> zy_cl1 = zy_cl.FindAll(x => x.FeeType == 1); rpt.预交金现金 = zy_cl0.Sum(x => x.Total_Fee).ToString(); rpt.预交金POS = zy_cl1.Sum(x => x.Total_Fee).ToString(); rpt.补收金额现金 = zy_CML11.Sum(x => x.Money_Fee).ToString(); rpt.补收金额POS = zy_CML11.Sum(x => x.Pos_Fee).ToString(); rpt.费金额 = zy_CML33.Sum(x => (x.Self_Fee - x.Deptosit_Fee)).ToString(); #endregion } }
private void GetText(List <ZY_Account> zyAccountlist, DateTime BeginDate, DateTime EndDate) { zyAccountSonlistCharge = new List <ZY_Account>(); zyAccountSonlistCost = new List <ZY_Account>(); AccountIDCharge = new List <string>(); AccountIDCost = new List <string>(); chargeAllText = new ChargeAllText(); chargeAllData = new ChargeAllData(); costAllText = new CostAllText(); costAllData = new CostAllData(); if (zyAccountlist != null && zyAccountlist.Count > 0) { //ChargeAllText chargeAllText = new ChargeAllText(); decimal _OrderAllFee = 0; int _OrderAllNum = 0; decimal _BackAllFee = 0; int _BackAllNum = 0; decimal _AllFee = 0; decimal _Menoy = 0; decimal _POS = 0; //CostAllText costAllText = new CostAllText(); decimal _receiveFee = 0; int _receiveNum = 0; decimal _retreatFee = 0; int _retreatNum = 0; decimal _AllFee1 = 0; decimal _Menoy1 = 0; decimal _POS1 = 0; decimal _costFee = 0; decimal _faoverFee = 0; for (int i = 0; i < zyAccountlist.Count; i++) { ZY_Account zyAS = zyAccountlist[i]; zyAS.AccountName = BaseNameFactory.GetName(baseNameType.用户名称, zyAS.AccountCode); if (zyAccountlist[i].AccountType == 0)//预交金 { zyAccountSonlistCharge.Add(zyAS); AccountIDCharge.Add(zyAS.AccountID.ToString()); _OrderAllFee += zyAS.WTicketFee; _OrderAllNum += zyAS.WTicketNum; _BackAllFee += zyAS.BTicketFee; _BackAllNum += zyAS.BTicketNum; _AllFee += zyAS.Total_Fee; _Menoy += zyAS.Cash_Fee; _POS += zyAS.POS_Fee; } else if (zyAccountlist[i].AccountType == 1)//结算 { zyAccountSonlistCost.Add(zyAS); AccountIDCost.Add(zyAS.AccountID.ToString()); _receiveFee += zyAS.WTicketFee; _receiveNum += zyAS.WTicketNum; _retreatFee += zyAS.BTicketFee; _retreatNum += zyAS.BTicketNum; _AllFee1 += zyAS.Total_Fee + zyAS.CostFee + zyAS.FaoverFee; _Menoy1 += zyAS.Cash_Fee; _POS1 += zyAS.POS_Fee; _costFee += zyAS.CostFee; _faoverFee += zyAS.FaoverFee; } } //第二步:获取预交金和结算界面的text控件的值 chargeAllText.OrderAllFee = _OrderAllFee.ToString(); chargeAllText.OrderAllNum = _OrderAllNum.ToString(); chargeAllText.BackAllFee = _BackAllFee.ToString(); chargeAllText.BackAllNum = _BackAllNum.ToString(); chargeAllText.AllFee = _AllFee.ToString(); chargeAllText.Menoy = _Menoy.ToString(); chargeAllText.POS = _POS.ToString(); costAllText.receiveFee = _receiveFee.ToString(); costAllText.receiveNum = _receiveNum.ToString(); costAllText.retreatFee = _retreatFee.ToString(); costAllText.retreatNum = _retreatNum.ToString(); costAllText.AllFee = _AllFee1.ToString(); costAllText.Menoy = _Menoy1.ToString(); costAllText.POS = _POS1.ToString(); costAllText.costFee = _costFee.ToString(); costAllText.faoverFee = _faoverFee.ToString(); costAllText.lbAllFee = zyAccount.GetAllChargeFee(BeginDate, EndDate, zyAccountlist).ToString("0.00");//? //得到树的结构 List <string> accountCodes = new List <string>(); for (int i = 0; i < zyAccountlist.Count; i++) { if (accountCodes.Contains(zyAccountlist[i].AccountCode) == false) { accountCodes.Add(zyAccountlist[i].AccountCode); } } CostEmps = new CostEmp[accountCodes.Count]; for (int i = 0; i < CostEmps.Length; i++) { CostEmps[i].EmpID = accountCodes[i]; CostEmps[i].EmpName = BaseNameFactory.GetName(baseNameType.用户名称, accountCodes[i]); //预交金 List <ZY_Account> zyas = zyAccountSonlistCharge.FindAll(x => x.AccountCode == accountCodes[i]); CostEmps[i].Chargedates = new DateTime[zyas.Count]; CostEmps[i].ChargeAccountIDs = new int[zyas.Count]; for (int j = 0; j < zyas.Count; j++) { //CostEmps[i].EmpName = zyas[j].AccountName; CostEmps[i].Chargedates[j] = zyas[j].AccountDate; CostEmps[i].ChargeAccountIDs[j] = zyas[j].AccountID; } //结算 List <ZY_Account> zyas1 = zyAccountSonlistCost.FindAll(x => x.AccountCode == accountCodes[i]); CostEmps[i].Costdates = new DateTime[zyas1.Count]; CostEmps[i].CostAccountIDs = new int[zyas1.Count]; for (int j = 0; j < zyas1.Count; j++) { //CostEmps[i].EmpName = zyas1[j].AccountName; CostEmps[i].Costdates[j] = zyas1[j].AccountDate; CostEmps[i].CostAccountIDs[j] = zyas1[j].AccountID; } } } }
private void GetChargeData() { #region 第三步: 预交金的DataGrid数据 List <ZY_ChargeList> zyChargelistW = AccountIDCharge.Count > 0 ? zyAccount.GetChargeData(AccountIDCharge.ToArray(), 0) : (new List <ZY_ChargeList>()); List <ZY_ChargeList> zyChargelistB = AccountIDCharge.Count > 0 ? zyAccount.GetChargeData(AccountIDCharge.ToArray(), 1) : (new List <ZY_ChargeList>()); List <ZY_ChargeList> zyChargelistSonW = new List <ZY_ChargeList>(); List <ZY_ChargeList> zyChargelistSonB = new List <ZY_ChargeList>(); //汇总预交金账单 ZY_Account zy_AS = new ZY_Account(); zy_AS.AccountName = "合计"; zy_AS.WTicketFee = zyAccountSonlistCharge.Sum(x => x.WTicketFee); zy_AS.WTicketNum = zyAccountSonlistCharge.Sum(x => x.WTicketNum); zy_AS.BTicketFee = zyAccountSonlistCharge.Sum(x => x.BTicketFee); zy_AS.BTicketNum = zyAccountSonlistCharge.Sum(x => x.BTicketNum); zy_AS.Total_Fee = zyAccountSonlistCharge.Sum(x => x.Total_Fee); zy_AS.Cash_Fee = zyAccountSonlistCharge.Sum(x => x.Cash_Fee); zy_AS.POS_Fee = zyAccountSonlistCharge.Sum(x => x.POS_Fee); zyAccountSonlistCharge.Add(zy_AS); chargeAllData.ChargeData = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyAccountSonlistCharge); for (int i = 0; i < zyChargelistW.Count; i++) { ZY_ChargeList zyChargelistson = zyChargelistW[i]; zyChargelistson.ChargeUserName = BaseNameFactory.GetName(baseNameType.用户名称, zyChargelistson.ChargeCode); zyChargelistSonW.Add(zyChargelistson); } //汇总 ZY_ChargeList zyChargelist1 = new ZY_ChargeList(); zyChargelist1.BillNo = "合计"; zyChargelist1.Total_Fee = zyChargelistSonW.Sum(x => x.Total_Fee); zyChargelistSonW.Add(zyChargelist1); chargeAllData.GoodChargeList = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyChargelistSonW); for (int i = 0; i < zyChargelistB.Count; i++) { ZY_ChargeList zyChargelistson = zyChargelistB[i]; zyChargelistson.ChargeUserName = BaseNameFactory.GetName(baseNameType.用户名称, zyChargelistson.ChargeCode); zyChargelistSonB.Add(zyChargelistson); } //汇总 ZY_ChargeList zyChargelist2 = new ZY_ChargeList(); zyChargelist2.BillNo = "合计"; zyChargelist2.Total_Fee = zyChargelistSonB.Sum(x => x.Total_Fee); zyChargelistSonB.Add(zyChargelist2); chargeAllData.BadChargeList = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyChargelistSonB); //汇总结算 ZY_Account zy_ASC = new ZY_Account(); zy_ASC.AccountName = "合计"; zy_ASC.WTicketFee = zyAccountSonlistCost.Sum(x => x.WTicketFee); zy_ASC.WTicketNum = zyAccountSonlistCost.Sum(x => x.WTicketNum); zy_ASC.BTicketFee = zyAccountSonlistCost.Sum(x => x.BTicketFee); zy_ASC.BTicketNum = zyAccountSonlistCost.Sum(x => x.BTicketNum); zy_ASC.Total_Fee = zyAccountSonlistCost.Sum(x => x.Total_Fee); zy_ASC.Cash_Fee = zyAccountSonlistCost.Sum(x => x.Cash_Fee); zy_ASC.POS_Fee = zyAccountSonlistCost.Sum(x => x.POS_Fee); zy_ASC.CostFee = zyAccountSonlistCost.Sum(x => x.CostFee); zy_ASC.FaoverFee = zyAccountSonlistCost.Sum(x => x.FaoverFee); zyAccountSonlistCost.Add(zy_ASC); costAllData.CostData = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(zyAccountSonlistCost); #endregion }