Esempio n. 1
0
        /// <summary>
        /// 执行日结过程
        /// </summary>
        /// <param name="dtBegin">起始时间</param>
        /// <param name="dtEnd">结束时间</param>
        /// <returns>1成功 -1失败</returns>
        protected virtual int ExecDayReport()
        {
            try
            {
                //统计时间
                this.lblStatDate.Text = this.feeDayreport.GetDateTimeFromSysDateTime().ToString();

                Neusoft.HISFC.Object.Fee.DayReport dayReport = new Neusoft.HISFC.Object.Fee.DayReport();

                //日结收取预交金金额


                this.lblLPrepayCost.Text = this.feeDayreport.GetPrepayCostByOperIDAndTime(this.DtBegin, this.dtEnd, this.feeDayreport.Operator.ID);

                //日结结算预交金金额


                this.lblDPrepayCost.Text = this.feeDayreport.GetBalancedPrepayCostByOperIDAndTime(this.DtBegin, this.DtEnd, this.feeDayreport.Operator.ID);

                //日结结算总金额


                this.lblLBalanceCost.Text = this.feeDayreport.GetBalancedCostByOperIDAndTime(this.DtBegin, this.DtEnd, this.feeDayreport.Operator.ID);

                //借方支票
                decimal prepayCheckCost = 0m;
                prepayCheckCost = decimal.Parse(this.feeDayreport.GetPrepayCheckCostByOperIDAndTime(this.DtBegin, this.DtEnd, this.feeDayreport.Operator.ID));
                decimal supplyCheckCost = 0m;
                supplyCheckCost         = decimal.Parse(this.feeDayreport.GetSupplyCheckCostByOperIDAndTime(this.DtEnd, this.DtEnd, this.feeDayreport.Operator.ID));
                this.lblDCheckCost.Text = (prepayCheckCost + supplyCheckCost).ToString();

                //贷方支票
                this.lblLCheckCost.Text = this.feeDayreport.GetReturnCheckCostByOperIDAndTime(this.DtBegin, this.DtEnd, this.feeDayreport.Operator.ID);

                //借方现金
                decimal prepayCashCost = 0m;
                prepayCashCost = decimal.Parse(feeDayreport.GetPrepayCashCostByOperIDAndTime(this.DtBegin, this.DtEnd, this.feeDayreport.Operator.ID));

                decimal supplyCashCost = 0m;
                supplyCashCost = decimal.Parse(feeDayreport.GetSupplyCashCostByOperIDAndTime(this.DtBegin, this.DtEnd, this.feeDayreport.Operator.ID));

                decimal returnCashCost = 0m;
                returnCashCost = decimal.Parse(feeDayreport.GetReturnCashCostByOperIDAndTime(this.DtBegin, this.DtEnd, this.feeDayreport.Operator.ID));

                this.lblDCashCost.Text = (prepayCashCost - returnCashCost + supplyCashCost).ToString();

                //借方银行
                decimal prepayBankCost = 0m;
                prepayBankCost = decimal.Parse(feeDayreport.GetPrepayBankCostByOperIDAndTime(DtBegin, DtEnd, feeDayreport.Operator.ID));

                decimal supplyBankCost = 0m;
                supplyBankCost = decimal.Parse(feeDayreport.GetSupplyBankCostByOperIDAndTime(DtBegin, DtEnd, feeDayreport.Operator.ID));

                this.lblDBankCost.Text = (prepayBankCost + supplyBankCost).ToString();


                //贷方银行
                this.lblLBankCost.Text = this.feeDayreport.GetReturnBankCostByOperIDAndTime(DtBegin, DtEnd, feeDayreport.Operator.ID);

                //公费记帐金额
                this.lblDBursaryCost.Text = this.feeDayreport.GetBursaryCostByOperIDAndTime(DtBegin, DtEnd, feeDayreport.Operator.ID);

                //市医保帐户支付


                this.lblDCityAccountCost.Text = this.feeDayreport.GetCPayCostByOperIDAndTime(DtBegin, DtEnd, feeDayreport.Operator.ID);


                //市医保统筹支付


                this.lblDCityPubCost.Text = this.feeDayreport.GetCPubCostByOperIDAndTime(DtBegin, DtEnd, feeDayreport.Operator.ID);

                //省医保帐户


                this.lblDProvinceAccountCost.Text = "0.00";

                //省医保统筹支付


                this.lblDProvincePubCost.Text = "0.00";

                //借方合计
                this.lblDTotCost.Text = Neusoft.NFC.Public.String.ExpressionVal(this.lblDPrepayCost.Text + "+" + this.lblDCashCost.Text
                                                                                + "+" + lblDCheckCost.Text + "+" + lblDBankCost.Text + "+" + lblDBursaryCost.Text + "+" + lblDCityAccountCost.Text
                                                                                + "+" + lblDCityPubCost.Text + "+" + lblDProvinceAccountCost.Text + "+" + lblDProvincePubCost.Text).ToString();
                //贷方合计
                this.lblLTotCost.Text = Neusoft.NFC.Public.String.ExpressionVal(this.lblLPrepayCost.Text + "+" + this.lblLCheckCost.Text
                                                                                + this.lblLBalanceCost.Text + "+" + this.lblLBankCost.Text).ToString();

                //预交金有效张数



                this.lblPrepayNum.Text = this.feeDayreport.GetValidPrepayInvoiceQtyByOperIDAndTime(DtBegin, dtEnd, feeDayreport.Operator.ID);
                //预交金作废张数


                this.lblWastePrepayNum.Text = this.feeDayreport.GetWastePrepayInvoiceQtyByOperIDAndTime(DtBegin, dtEnd, feeDayreport.Operator.ID);

                //预交金票据区间


                Neusoft.NFC.Object.NeuObject invoiceZone = new Neusoft.NFC.Object.NeuObject();

                invoiceZone = this.feeDayreport.GetPrepayInvoiceZoneByOperIDAndTime(DtBegin, dtEnd, feeDayreport.Operator.ID);

                if (invoiceZone != null)
                {
                    this.lblPreInvZone.Text = invoiceZone.ID.ToString() + "----" + invoiceZone.Name;
                }

                //预交金作废票号


                ArrayList alWasteNO = new ArrayList();
                alWasteNO = this.feeDayreport.QueryWastePrepayInvNOByOperIDAndTime(DtBegin, dtEnd, feeDayreport.Operator.ID);
                string wasteInvNO = "";
                Neusoft.HISFC.Object.Fee.Inpatient.Prepay prepay = new Neusoft.HISFC.Object.Fee.Inpatient.Prepay();
                if (alWasteNO.Count == 0)
                {
                    this.lblWastePrepayNO.Text = "";
                }
                else
                {
                    for (int i = 0; i < alWasteNO.Count; i++)
                    {
                        prepay     = (Neusoft.HISFC.Object.Fee.Inpatient.Prepay)alWasteNO[i];
                        wasteInvNO = wasteInvNO + prepay.RecipeNO + ",";
                    }
                    this.lblWastePrepayNO.Text = wasteInvNO.Substring(0, wasteInvNO.Length - 1);
                }


                //结算有效张数
                this.lblBalanceNum.Text = this.feeDayreport.GetValidBalanceInvoiceQtyByOperIDAndTime(DtBegin, DtEnd, feeDayreport.Operator.ID);

                //结算作废张数
                this.lblWasteBalanceNum.Text = this.feeDayreport.GetWasteBalanceInvoiceQtyByOperIDAndTime(DtBegin, DtEnd, feeDayreport.Operator.ID);

                //结算票据区间
                Neusoft.NFC.Object.NeuObject balanceInvoiceZone = new Neusoft.NFC.Object.NeuObject();
                balanceInvoiceZone = this.feeDayreport.GetBalanceInvoiceZoneByOperIDAndTime(DtBegin, DtEnd, feeDayreport.Operator.ID);
                if (balanceInvoiceZone != null)
                {
                    this.lblBalanceInvZone.Text = balanceInvoiceZone.ID.ToString() + "----" + balanceInvoiceZone.Name;
                }

                //结算作废票号
                ArrayList alWasteBalanceInvNO = new ArrayList();
                alWasteBalanceInvNO = this.feeDayreport.QueryWasteBalanceInvNOByOperIDAndTime(DtBegin, DtEnd, feeDayreport.Operator.ID);
                string balanceWasteNO = "";
                Neusoft.HISFC.Object.Fee.Inpatient.Balance balance = new Neusoft.HISFC.Object.Fee.Inpatient.Balance();

                if (alWasteBalanceInvNO.Count == 0)
                {
                    lblWasteBalanceNO.Text = "";
                }
                else
                {
                    for (int j = 0; j < alWasteBalanceInvNO.Count; j++)
                    {
                        balance        = (Neusoft.HISFC.Object.Fee.Inpatient.Balance)alWasteBalanceInvNO[j];
                        balanceWasteNO = balanceWasteNO + balance.Invoice.ID + ",";
                    }
                    this.lblWasteBalanceNO.Text = balanceWasteNO.Substring(0, balanceWasteNO.Length - 1);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("获取日结信息出错!" + this.feeDayreport.Err);
                return(-1);
            }

            this.OperMode = "1";

            return(1);
        }
Esempio n. 2
0
 public int SetValueForPrint(Neusoft.HISFC.Object.RADT.PatientInfo patientInfo, Neusoft.HISFC.Object.Fee.Inpatient.Balance balanceInfo, ArrayList alBalanceList)
 {
     return(this.SetPrintValue(patientInfo, balanceInfo, alBalanceList, false));
 }
Esempio n. 3
0
        /// <summary>
        /// 打印控件赋值



        /// </summary>
        /// <param name="patientInfo">患者实体</param>
        /// <param name="balanceHead">发票</param>
        /// <param name="alBalanceList">发票明细</param>
        /// <param name="IsPreview">是否预览</param>
        /// <returns></returns>
        protected int SetPrintValue(
            Neusoft.HISFC.Object.RADT.PatientInfo patientInfo,
            Neusoft.HISFC.Object.Fee.Inpatient.Balance balanceHead,
            ArrayList alBalanceList,
            bool IsPreview)
        {
            this.Controls.Clear();
            //如果费用明细为空,则返回
            if (alBalanceList.Count <= 0)
            {
                return(-1);
            }

            #region 克隆一个费用明细信息列表,因为后面操作需要对列表元素有删除操作.
            ArrayList alBalanceListClone = new ArrayList();
            foreach (Neusoft.HISFC.Object.Fee.Inpatient.BalanceList det in alBalanceList)
            {
                alBalanceListClone.Add(det.Clone());
            }
            #endregion
            //if (this.InvoiceType == "ZY02")
            //{
            //    c = new ucZYZF();
            //    while (c.Controls.Count > 0)
            //    {
            //        this.Controls.Add(c.Controls[0]);
            //    }
            //    //this.Controls.Add(c);
            //    this.Size = c.Size;
            //    this.InitReceipt();
            //    SetZYZFPrintValue(patientInfo,
            //           balanceHead,
            //           alBalanceListClone,
            //           IsPreview);
            //}
            //else if (this.InvoiceType == "ZY01")
            //{
            c = new ucZYFP();
            while (c.Controls.Count > 0)
            {
                this.Controls.Add(c.Controls[0]);
            }
            //this.Controls.Add(c);
            this.Size = c.Size;
            this.InitReceipt();
            SetZYFPPrintValue(patientInfo,
                              balanceHead,
                              alBalanceListClone,
                              IsPreview);
            //}

            //控制根据打印和预览显示选项
            if (IsPreview)
            {
                SetToPreviewMode();
            }
            else
            {
                SetToPrintMode();
            }
            return(0);
        }
Esempio n. 4
0
        /// <summary>
        /// 打印控件赋值

        /// </summary>
        /// <param name="Pinfo"></param>
        /// <param name="Pinfo"></param>
        /// <param name="al">balancelist数据</param>
        /// <param name="IsPreview">是否打印其余可显示部分</param>
        /// <returns></returns>
        protected int SetPrintValue(Neusoft.HISFC.Object.RADT.PatientInfo patientInfo, Neusoft.HISFC.Object.Fee.Inpatient.Balance balanceHead, ArrayList alBalanceList, bool IsPreview)
        {
            if (alBalanceList.Count <= 0)
            {
                return(-1);
            }
            //清空控件边框
            foreach (Control c in this.Controls)
            {
                if (c.Name.Substring(0, 3) == "lbl")
                {
                    System.Windows.Forms.Label lblControl;
                    lblControl             = (System.Windows.Forms.Label)c;
                    lblControl.BorderStyle = System.Windows.Forms.BorderStyle.None;
                    c.Visible = true;
                }
            }
            //控制根据打印和预览显示选项
            if (IsPreview)
            {
                foreach (Control c in this.Controls)
                {
                    if (c.Name.Substring(0, 6) == "lblPre")
                    {
                        c.Visible = IsPreview;
                    }
                }
            }
            else
            {
                foreach (Control c in this.Controls)
                {
                    if (c.Name.Substring(0, 6) == "lblPre")
                    {
                        c.Visible = IsPreview;
                    }
                }

                //如果特殊需求--发票上没有的大类需要显示出来 在此添加FeeName.Visible属性
            }



            Neusoft.HISFC.Management.Fee.InPatient myInpatient = new Neusoft.HISFC.Management.Fee.InPatient();
            ArrayList alBalancePay = new ArrayList();

            alBalancePay = myInpatient.QueryBalancePaysByInvoiceNOAndBalanceNO(balanceHead.Invoice.ID, int.Parse(balanceHead.ID));
            if (alBalancePay == null)
            {
                MessageBox.Show("获得患者支付方式出错!");
                return(-1);
            }
            //赋值



            //基本信息
            this.lblPriPatientNo.Text = patientInfo.PID.PatientNO;                     //住院号

            this.lblPriNurseCell.Text = patientInfo.PVisit.PatientLocation.Dept.Name;  //病区 --此处用科室name 发票空白太短 中山原有系统无病区概念

            this.lblPriYear.Text = balanceHead.BalanceOper.OperTime.Year.ToString();   //年

            this.lblPriMonth.Text = balanceHead.BalanceOper.OperTime.Month.ToString(); //月

            this.lblPriDay.Text = balanceHead.BalanceOper.OperTime.Day.ToString();     //日

            this.lblPriBalanceType.Text = balanceHead.BalanceType.Name.ToString();     //结算类型
            this.lblPriName.Text        = patientInfo.Name;                            //姓名
            //住院日期
            this.lblPriDateIn.Text = patientInfo.PVisit.InTime.ToShortDateString() + "至" + patientInfo.PVisit.OutTime.ToShortDateString();

            #region "Delete"
            //#region 住院日期,保存本次结算的 开始结束时间


            //ArrayList alBalance = myInpatient.GetBalanceHeadInfoByInpatientNo(Pinfo.ID);//获得所有结算信息

            //DateTime OutDate = DateTime.MinValue;
            //DateTime BeginDate = DateTime.MinValue;
            //if (alBalance == null)
            //{
            //    MessageBox.Show("获得患者结算信息出错!" + myInpatient.Err);
            //    return -1;
            //}
            //if (alBalance.Count == 0)
            //{
            //    MessageBox.Show("该患者没有发票信息!");
            //    return -1;
            //}
            //if (this.IsMidwayBalance)
            //{
            //    OutDate = BalanceHead.DtEnd;
            //}
            //else
            //{
            //    if (Pinfo.PVisit.Date_Out == DateTime.MinValue)
            //    {
            //        OutDate = BalanceHead.DtEnd;
            //    }
            //    else
            //    {
            //        OutDate = Pinfo.PVisit.Date_Out;
            //    }
            //}

            //if (alBalance.Count == 1)//就一次结算

            //{
            //    BeginDate = BalanceHead.DtBegin;
            //}
            //else //不止一次结算,有可能是召回或者多次中途结算,那么找到上一次有效的中途结算,开始时间取上一次有效结算的结束时间
            ////但是不包括直接结算.
            //{
            //    //因为取出的发票是按照结算时间排序的,所以从后向前找
            //    Neusoft.HISFC.Object.Fee.Balance b = null;
            //    bool isFind = false;
            //    for (int i = alBalance.Count - 2; i >= 0; i--)
            //    {
            //        b = alBalance[i] as Neusoft.HISFC.Object.Fee.Balance;
            //        if (b.WasteFlag == "0" && b.BalanceType.ID.ToString() != "D")
            //        {
            //            BeginDate = b.DtEnd.AddSeconds(1);
            //            isFind = true;
            //            break;
            //        }
            //    }
            //    if (!isFind)//是结算召回,前面的纪录没有有效的.或者前面的有效结算纪录都是直接结算.
            //    {
            //        BeginDate = BalanceHead.DtBegin;
            //    }
            //}
            //int days = (OutDate.Date - BeginDate.Date).Days;
            //if (this.IsMidwayBalance)
            //{
            //    days = days + 1;
            //}
            //if (days == 0)
            //{
            //    days = 1;
            //}
            //this.lblPriDateIn.Text = BeginDate.ToShortDateString() + "至" + OutDate.ToShortDateString() + "共" + days.ToString() + "天";
            //  #endregion
            #endregion


            //结算类别 --中山医暂时用合同单位
            //Neusoft.HISFC.Management.Fee.InPatient myInpatient = new Neusoft.HISFC.Management.Fee.InPatient();
            string PactName = "";
            PactName = myInpatient.GetComDictionaryNameByID("PACTUNIT", patientInfo.Pact.ID);
            if (PactName == null)
            {
                MessageBox.Show(myInpatient.Err);
                return(-1);
            }
            this.lblPriPayKind.Text = PactName + " " + balanceHead.Invoice.ID; //合同单位+电脑发票号;
            //操作员

            this.lblPriOper.Text = balanceHead.BalanceOper.ID;

            //票面信息
            for (int i = 0; i < alBalanceList.Count; i++)
            {
                Neusoft.HISFC.Object.Fee.Inpatient.BalanceList Blist = new Neusoft.HISFC.Object.Fee.Inpatient.BalanceList();
                Blist = (Neusoft.HISFC.Object.Fee.Inpatient.BalanceList)alBalanceList[i];
                //显示费用名称
                if (IsPreview)
                {
                    System.Windows.Forms.Label lblFeeName;
                    if (Blist.FeeCodeStat.SortID < 1 || Blist.FeeCodeStat.SortID > 36)
                    {
                        //Neusoft.NFC.Interface.Classes.Function.Msg("费用大类为"+Blist.StatClass.Name+"的打印序号维护错误,应在1与36之间!",111);
                        continue;
                    }
                    lblFeeName = (System.Windows.Forms.Label) this.GetFeeNameLable(Blist.FeeCodeStat.SortID);
                    if (lblFeeName == null)
                    {
                        MessageBox.Show("没有找到费用大类为" + Blist.FeeCodeStat.StatCate.Name + "的打印序号!");
                        return(-1);
                    }


                    try
                    {
                        lblFeeName.Text = Blist.FeeCodeStat.StatCate.Name;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                        return(-1);
                    }
                }
                //费用金额赋值

                System.Windows.Forms.Label lblFeeCost;
                lblFeeCost = (System.Windows.Forms.Label) this.GetFeeCostLable(Blist.FeeCodeStat.SortID);
                if (lblFeeCost == null)
                {
                    MessageBox.Show("没有找到费用大类为" + Blist.FeeCodeStat.StatCate.Name + "的打印序号!");
                    return(-1);
                }

                lblFeeCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(Blist.BalanceBase.FT.TotCost, 2);
            }



            //记帐金额
            this.lblPriPub.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.PubCost, 2);
            //个人缴费金额

            this.lblPriPay.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.PayCost, 2);


            //自付
            if (patientInfo.Pact.PayKind.ID == "03")
            {
                //医院要求公费个人自付金额不显示-By Maokb 06-03-25
                this.lblPriPay.Text = "";
                //				this.lblPreFeeName36.Text = "公费记帐";
                //				this.lblPriCost36.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(BalanceHead.Fee.Pub_Cost,2);
                this.lblPreFeeName36.Text    = "个人自付";
                this.lblPriCost36.Text       = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.PayCost, 2);
                this.lblPreFeeName35.Visible = true;
                this.lblPreFeeName36.Visible = true;
            }
            if (patientInfo.Pact.ID == "2")
            {
                this.lblPreFeeName36.Text = "医保个人";
                this.lblPriCost36.Text    = Neusoft.NFC.Public.String.FormatNumberReturnString(patientInfo.SIMainInfo.OwnCost, 2);
                //个人缴费金额
                this.lblPriPay.Text          = Neusoft.NFC.Public.String.FormatNumberReturnString(patientInfo.SIMainInfo.OwnCost, 2);
                this.lblPreFeeName35.Visible = true;
                this.lblPreFeeName36.Visible = true;
            }



            //个人缴费金额
            this.lblPriLower.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.PayCost + balanceHead.FT.OwnCost, 2);

            string returnMoney = "";
            string supplyMoney = "";
            foreach (Neusoft.HISFC.Object.Fee.Inpatient.BalancePay b in alBalancePay)
            {
                if (b.TransKind.ID == "1")//结算款

                {
                    if (b.RetrunOrSupplyFlag == "2")//返还
                    {
                        returnMoney = returnMoney + " " + b.PayType.Name + ":" + b.FT.TotCost.ToString();
                    }
                    else
                    {
                        supplyMoney = supplyMoney + " " + b.PayType.Name + ": " + b.FT.TotCost.ToString();
                    }
                }
            }
            //预收
            this.lblPriPrepay.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.PrepayCost, 2);
            this.lblpayType.Text   = returnMoney + supplyMoney;
            //补收
            this.lblPriSupply.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.SupplyCost, 2);
            //退款

            this.lblPriReturn.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.ReturnCost, 2);

            ////血滞纳金

            //if (BloodFee > 0)
            //{
            //    this.lblPriBlood.Text = "另开互助金发票" + BloodFee.ToString() + "元 收据号:";//Edit By Maokb
            //}
            string[] strMoney = new string[8];

            strMoney = this.GetUpperCashbyNumber(Neusoft.NFC.Public.String.FormatNumber(balanceHead.FT.PayCost + balanceHead.FT.OwnCost, 2));



            this.lblPriF.Text  = strMoney[0];
            this.lblPriJ.Text  = strMoney[1];
            this.lblPriY.Text  = strMoney[3];
            this.lblPriS.Text  = strMoney[4];
            this.lblPriB.Text  = strMoney[5];
            this.lblPriQ.Text  = strMoney[6];
            this.lblPriW.Text  = strMoney[7];
            this.lblPriSW.Text = strMoney[8];



            return(0);
        }
Esempio n. 5
0
        /// <summary>
        /// 打印控件赋值



        /// </summary>
        /// <param name="patientInfo">患者实体</param>
        /// <param name="balanceHead">发票</param>
        /// <param name="alBalanceList">发票明细</param>
        /// <param name="IsPreview">是否预览</param>
        /// <returns></returns>
        protected int SetZYFPPrintValue(
            Neusoft.HISFC.Object.RADT.PatientInfo patientInfo,
            Neusoft.HISFC.Object.Fee.Inpatient.Balance balanceHead,
            ArrayList alBalanceList,
            bool IsPreview)
        {
            //#region 设置自费发票打印内容
            //ucZYYB ucReceipt = (ucZYYB)c;

            //#region 医疗机构
            //ucReceipt.lblYiLiaoJiGou.Text = "鞍山市第三医院";
            //#endregion
            ////电脑编号
            //ucReceipt.lblSSN.Text = patientInfo.SSN;
            ////病房
            //ucReceipt.lblNurseCellName.Text = patientInfo.PVisit.PatientLocation.NurseCell.Name;
            ////基本信息
            ////病案号



            //ucReceipt.lblCaseNO.Text = patientInfo.PID.CaseNO;
            ////结算日期
            //ucReceipt.lblOperDate.Text = balanceHead.BalanceOper.OperTime.ToShortDateString();
            ////姓名
            //ucReceipt.lblName.Text = patientInfo.Name;
            ////住院日期
            //ucReceipt.lblInTime.Text = balanceHead.BeginTime.ToShortDateString();
            ////住院日期
            //ucReceipt.lblInTime.Text = balanceHead.BeginTime.ToShortDateString();
            //if (MidBalanceFlag)
            //{
            //    ucReceipt.lblOutTime.Text = balanceHead.EndTime.ToShortDateString();
            //    ucReceipt.lblInDay.Text = new TimeSpan(balanceHead.EndTime.Ticks - balanceHead.BeginTime.Ticks).Days.ToString();
            //}
            //else
            //{
            //    ucReceipt.lblOutTime.Text = patientInfo.PVisit.OutTime.ToShortDateString();
            //    ucReceipt.lblInDay.Text = new TimeSpan(patientInfo.PVisit.OutTime.Ticks - balanceHead.BeginTime.Ticks).Days.ToString();
            //}
            //////科室
            ////ucReceipt.lblDeptName.Text = patientInfo.PVisit.PatientLocation.Dept.Name;

            ////结算员



            //ucReceipt.lblOperName.Text = balanceHead.BalanceOper.ID;

            //////操作员



            ////ucReceipt.lblBalanceName.Text = balanceHead.Oper.ID;

            //#region 医保信息
            //decimal GeRenCost = decimal.Zero;
            //decimal TongChouCost = decimal.Zero;
            //decimal XianJinCost = decimal.Zero;
            //decimal GongWuYuanCost = decimal.Zero;
            //decimal DaECost = decimal.Zero;
            ////个人账户支付
            //GeRenCost = patientInfo.SIMainInfo.PayCost;
            //if (GeRenCost != 0)
            //{
            //    ucReceipt.lblGeRenCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(GeRenCost, 2);
            //}
            ////统筹基金支付
            //TongChouCost = patientInfo.SIMainInfo.PubCost;
            //if (TongChouCost != 0)
            //{
            //    ucReceipt.lblTongChouCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(TongChouCost, 2);
            //}
            ////现金支付
            //XianJinCost = patientInfo.SIMainInfo.OwnCost;
            //if (XianJinCost != 0)
            //{
            //    ucReceipt.lblXianJinCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(XianJinCost, 2);
            //}
            ////公务员补助

            //GongWuYuanCost = patientInfo.SIMainInfo.OfficalCost;
            //if (GongWuYuanCost > 0)
            //{
            //    ucReceipt.lblGongWuYuanCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(GongWuYuanCost, 2);
            //}
            ////大额补助
            //DaECost = patientInfo.SIMainInfo.OverTakeOwnCost;
            //if (DaECost != 0)
            //{
            //    ucReceipt.lblDaECost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(DaECost, 2);
            //}
            //#endregion
            ////票面信息
            //decimal[] FeeInfo =
            //    //---------------------1-----------2------------3------------4-------------5-----------------
            //    new decimal[23]{decimal.Zero,decimal.Zero,decimal.Zero,decimal.Zero,decimal.Zero,
            //                    decimal.Zero,decimal.Zero,decimal.Zero,decimal.Zero,decimal.Zero,
            //                    decimal.Zero,decimal.Zero,decimal.Zero,decimal.Zero,decimal.Zero,
            //                    decimal.Zero,decimal.Zero,decimal.Zero,
            //                    decimal.Zero,decimal.Zero,decimal.Zero,decimal.Zero,decimal.Zero};


            //for (int i = 0; i < alBalanceList.Count; i++)
            //{
            //    Neusoft.HISFC.Object.Fee.Inpatient.BalanceList detail = new Neusoft.HISFC.Object.Fee.Inpatient.BalanceList();
            //    detail = (Neusoft.HISFC.Object.Fee.Inpatient.BalanceList)alBalanceList[i];
            //    if (detail.FeeCodeStat.SortID <= FeeInfo.Length)
            //    {
            //        FeeInfo[detail.FeeCodeStat.SortID - 1] += detail.BalanceBase.FT.TotCost;
            //    }
            //}
            //int FeeInfoIndex = 0;
            //foreach (decimal d in FeeInfo)
            //{
            //    Label l = Function.GetFeeNameLable("lblFeeInfo" + FeeInfoIndex.ToString(), lblPrint);
            //    if (l != null)
            //    {
            //        if (FeeInfo[FeeInfoIndex] > 0)
            //        {
            //            l.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(FeeInfo[FeeInfoIndex], 2);
            //        }
            //    }
            //    FeeInfoIndex++;
            //}
            ////预收
            //if (balanceHead.FT.PrepayCost - balanceHead.FT.BalancedPrepayCost != 0)
            //{
            //    ucReceipt.lblPriPrepay.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.PrepayCost - balanceHead.FT.BalancedPrepayCost, 2);
            //}
            ////补收
            //if (balanceHead.FT.SupplyCost != 0)
            //{
            //    ucReceipt.lblPriSupply.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.SupplyCost, 2);
            //}
            ////退款


            //if (balanceHead.FT.ReturnCost != 0)
            //{
            //    ucReceipt.lblPriReturn.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.ReturnCost, 2);
            //}
            ////发票号


            //ucReceipt.lblReceiptNo.Text = balanceHead.Invoice.ID;
            ////总金额


            //if (balanceHead.FT.TotCost != 0)
            //{
            //    ucReceipt.lblTotCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.TotCost, 2);
            //}
            //#region 大写总金额


            //if (balanceHead.FT.TotCost != 0)
            //{
            //    ucReceipt.lblDaXie.Text = Function.GetUpperCashByNumber(Neusoft.NFC.Public.String.FormatNumber(balanceHead.FT.TotCost, 2));
            //}
            //#endregion
            //#endregion

            //return 0;

            #region 设置发票打印内容
            ucZYFP ucReceipt = (ucZYFP)c;
            //#region 医疗机构
            ucReceipt.lblYiLiaoJiGou.Text = "阜新市新邱区第二人民医院";
            //#endregion
            //结算日期
            ucReceipt.lblOperDate.Text = balanceHead.BalanceOper.OperTime.ToShortDateString();
            //收据号


            ucReceipt.lblReceiptNo.Text = balanceHead.Invoice.ID;

            //患者基本信息


            ucReceipt.lblInPatientNO.Text = patientInfo.PID.PatientNO; //住院号


            ucReceipt.lblName.Text = patientInfo.Name;//姓名
            //科室
            ucReceipt.lblDeptName.Text = patientInfo.PVisit.PatientLocation.Dept.Name;

            //打印出来的字:发票号,元 ,¥:


            ucReceipt.lblInvoiceNo.Text = "发票号";
            ucReceipt.lblyuan.Text      = "元";
            ucReceipt.lblY.Text         = "¥";


            //费别
            //if ( patientInfo.Pact.PayKind.ID = "01" )
            //{
            //本来想写死,怕以后增加别的类别,直接写此类别
            ucReceipt.lblPayKind.Text = patientInfo.Pact.Name;
            //}
            //else
            //{

            //}
            //住院日期
            ucReceipt.lblInTime.Text  = patientInfo.PVisit.InTime.ToShortDateString();
            ucReceipt.lblOutTime.Text = patientInfo.PVisit.OutTime.ToShortDateString();
            //ucReceipt.lblInDay.Text = new TimeSpan(patientInfo.PVisit.OutTime.Ticks - patientInfo.PVisit.InTime.Ticks).Days.ToString();
            //家庭住址
            ucReceipt.lblHome.Text = patientInfo.AddressHome;
            //电脑编号
            ucReceipt.lblSSN.Text = patientInfo.SSN;
            //操作员



            ucReceipt.lblOperName.Text = balanceHead.BalanceOper.ID;
            //ucReceipt.lblBalanceName.Text = balanceHead.Oper.ID;

            //票面信息
            decimal[] FeeInfo =
                //---------------------1-----------2------------3------------4-------------5-----------------
                new decimal[14] {
                decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero,
                decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero,
                decimal.Zero, decimal.Zero, decimal.Zero, decimal.Zero
            };


            for (int i = 0; i < alBalanceList.Count; i++)
            {
                Neusoft.HISFC.Object.Fee.Inpatient.BalanceList detail = new Neusoft.HISFC.Object.Fee.Inpatient.BalanceList();
                detail = (Neusoft.HISFC.Object.Fee.Inpatient.BalanceList)alBalanceList[i];
                if (detail.FeeCodeStat.SortID <= FeeInfo.Length)
                {
                    FeeInfo[detail.FeeCodeStat.SortID - 1] += detail.BalanceBase.FT.TotCost;
                }
            }
            int FeeInfoIndex = 0;
            foreach (decimal d in FeeInfo)
            {
                Label l = Function.GetFeeNameLable("lblFeeInfo" + FeeInfoIndex.ToString(), lblPrint);
                if (l != null)
                {
                    if (FeeInfo[FeeInfoIndex] > 0)
                    {
                        l.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(FeeInfo[FeeInfoIndex], 2).PadLeft(8);
                    }
                }
                FeeInfoIndex++;
            }
            //预收
            if (balanceHead.FT.PrepayCost > 0)
            {
                ucReceipt.lblPriPrepay.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.PrepayCost, 2).PadLeft(8);
            }
            //应交款


            if (balanceHead.FT.SupplyCost > 0)
            {
                ucReceipt.lblPriSupply.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.SupplyCost, 2).PadLeft(8);
            }
            //退款



            if (balanceHead.FT.ReturnCost > 0)
            {
                ucReceipt.lblPriReturn.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.ReturnCost, 2).PadLeft(8);
            }

            //小写总金额



            if (balanceHead.FT.TotCost > 0)
            {
                ucReceipt.lblTotCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.TotCost, 2);
                //ucReceipt.lblSum.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(balanceHead.FT.TotCost, 2);
            }
            #region 大写总金额



            ucReceipt.lblDaXie.Text = Function.GetUpperCashByNumber(Neusoft.NFC.Public.String.FormatNumber(balanceHead.FT.TotCost, 2));
            #endregion
            //医保里边的金额


            if (patientInfo.SIMainInfo.PayCost != 0)
            {
                ucReceipt.lblPayCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(patientInfo.SIMainInfo.PayCost, 2).PadLeft(8);
            }
            if (patientInfo.SIMainInfo.OwnCost != 0)
            {
                ucReceipt.lblOwnCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(patientInfo.SIMainInfo.OwnCost, 2).PadLeft(8);
            }
            if (patientInfo.SIMainInfo.PubCost != 0)
            {
                ucReceipt.lblPubCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(patientInfo.SIMainInfo.PubCost, 2).PadLeft(8);
            }
            if (patientInfo.SIMainInfo.OfficalCost != 0)
            {
                ucReceipt.lblGwyCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(patientInfo.SIMainInfo.OfficalCost, 2).PadLeft(8);
            }
            if (patientInfo.SIMainInfo.OverCost != 0)
            {
                ucReceipt.lblDebzCost.Text = Neusoft.NFC.Public.String.FormatNumberReturnString(patientInfo.SIMainInfo.OverCost, 2).PadLeft(8);
            }
            #endregion
            return(0);
        }