private void Print(bool IsPrint, string ReportName) { Report = new grproLib.GridppReport(); Report.LoadFromFile(Constant.ApplicationDirectory + "\\report\\" + ReportName + ".grf"); Report.ParameterByName("制表人").AsString = _currentUser.Name; Report.ParameterByName("医院名称").AsString = HIS.SYSTEM.BussinessLogicLayer.Classes.BaseData.WorkName; Report.FetchRecord += new grproLib._IGridppReportEvents_FetchRecordEventHandler(Report_FetchRecord); if (IsPrint) { Report.Print(false); } else { Report.PrintPreview(false); } }
//打印科目分类 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); } } } }
/// 交款表打印 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> /// 打印个人交款表 /// </summary> /// <param name="accountBook"></param> public static void PrintAccountBook(PrivyAccountBook accountBook) { grproLib.GridppReport reportPrinter = new grproLib.GridppReport( ); reportPrinter.LoadFromFile(accountbookTemplatePath); reportPrinter.Title = "门诊个人交款表"; try { //传入参数 reportPrinter.ParameterByName("医院名称").AsString = "" + "每日交费清单"; reportPrinter.ParameterByName("交款人").AsString = accountBook.TollCollectorName; reportPrinter.ParameterByName("交款时间").AsString = accountBook.AccountBookDate.Value.ToString("yyyy-MM-dd HH:mm:ss"); //传入交款科目 for (int i = 0; i < accountBook.InvoiceItem.Length; i++) { try { reportPrinter.ParameterByName(accountBook.InvoiceItem[i].ItemName.Trim( )).AsString = accountBook.InvoiceItem[i].Cost.ToString( ); } catch { MessageBox.Show("没有找到参数:" + accountBook.InvoiceItem[i].ItemName + ",请确认模板中有该参数!", "", MessageBoxButtons.OK, MessageBoxIcon.Error); continue; } } reportPrinter.ParameterByName("发票科目合计").AsString = accountBook.InvoiceItemSumTotal.ToString( ); reportPrinter.ParameterByName("收费发票开始号").AsString = accountBook.ChargeInvoiceInfo.StartNumber; reportPrinter.ParameterByName("收费发票结束号").AsString = accountBook.ChargeInvoiceInfo.EndNumber; reportPrinter.ParameterByName("收费发票张数").AsString = accountBook.ChargeInvoiceInfo.Count.ToString( ); reportPrinter.ParameterByName("收费退费张数").AsString = accountBook.ChargeInvoiceInfo.RefundCount.ToString( ); reportPrinter.ParameterByName("收费退费金额").AsString = accountBook.ChargeInvoiceInfo.RefundMoney.ToString( ); reportPrinter.ParameterByName("挂号发票开始号").AsString = accountBook.RegisterInvoiceInfo.StartNumber; reportPrinter.ParameterByName("挂号发票结束号").AsString = accountBook.RegisterInvoiceInfo.EndNumber; reportPrinter.ParameterByName("挂号发票张数").AsString = accountBook.RegisterInvoiceInfo.Count.ToString( ); reportPrinter.ParameterByName("挂号退费张数").AsString = accountBook.RegisterInvoiceInfo.RefundCount.ToString( ); reportPrinter.ParameterByName("挂号退费金额").AsString = accountBook.RegisterInvoiceInfo.RefundMoney.ToString( ); //按病人类型记账部分 int tallyCount = 0; for (int i = 0; i < accountBook.TallyPart.Details.Length; i++) { reportPrinter.ParameterByName(accountBook.TallyPart.Details[i].PayName).AsString = accountBook.TallyPart.Details[i].Money.ToString( ); reportPrinter.ParameterByName(accountBook.TallyPart.Details[i].PayName + "_张数").AsString = accountBook.TallyPart.Details[i].BillCount.ToString( ); tallyCount = tallyCount + accountBook.TallyPart.Details[i].BillCount; } reportPrinter.ParameterByName("记账合计").AsString = accountBook.TallyPart.TotalMoney.ToString( ); reportPrinter.ParameterByName("记账合计张数").AsString = tallyCount.ToString( ); reportPrinter.ParameterByName("优惠金额").AsString = accountBook.FavorPart.TotalMoney.ToString( ); //现金部分 reportPrinter.ParameterByName("实收现金").AsString = accountBook.CashPart.TotalMoney.ToString( ); reportPrinter.ParameterByName("挂号现金").AsString = accountBook.CashPart.Details[1].Money.ToString( ); reportPrinter.ParameterByName("挂号诊金").AsString = accountBook.CashPart.Details[2].Money.ToString( ); reportPrinter.ParameterByName("处方收费").AsString = accountBook.CashPart.Details[0].Money.ToString( ); reportPrinter.ParameterByName("小写合计").AsString = accountBook.InvoiceItemSumTotal.ToString( ); reportPrinter.ParameterByName("大写合计").AsString = ""; //HIS.SYSTEM.PubicBaseClasses.Money.NumToChn( accountBook.InvoiceItemSumTotal.ToString( ) ); reportPrinter.PrintPreview(false); } catch (Exception err) { MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }