Пример #1
0
        /// <summary>
        /// 处理结算明细表
        /// </summary>
        /// <param name="balance">结算头信息</param>
        /// <param name="balanceNO">负记录结算序号</param>
        /// <param name="nowTime">当前时间</param>
        /// <param name="errText">错误信息</param>
        /// <returns>成功 1 失败 -1</returns>
        private int DealBalanceList(Neusoft.HISFC.Models.Fee.Inpatient.Balance balance, string balanceNO, DateTime nowTime, ref string errText)
        {
            ArrayList balanceLists = new ArrayList();

            balanceLists = this.inpatientManager.QueryBalanceListsByInpatientNOAndBalanceNO(this.patientInfo.ID, balance.Invoice.ID, NConvert.ToInt32(balance.ID));
            if (balanceLists == null)
            {
                errText = "获得结算明细出错!" + this.inpatientManager.Err;

                return(-1);
            }
            foreach (Neusoft.HISFC.Models.Fee.Inpatient.BalanceList balanceList in balanceLists)
            {
                //形成负记录
                balanceList.BalanceBase.TransType = Neusoft.HISFC.Models.Base.TransTypes.Negative;
                balanceList.BalanceBase.ID        = balanceNO;
                balanceList.ID = balanceNO;
                balanceList.BalanceBase.FT.TotCost           = -balanceList.BalanceBase.FT.TotCost;
                balanceList.BalanceBase.FT.OwnCost           = -balanceList.BalanceBase.FT.OwnCost;
                balanceList.BalanceBase.FT.PayCost           = -balanceList.BalanceBase.FT.PayCost;
                balanceList.BalanceBase.FT.PubCost           = -balanceList.BalanceBase.FT.PubCost;
                balanceList.BalanceBase.FT.RebateCost        = -balanceList.BalanceBase.FT.RebateCost;
                balanceList.BalanceBase.BalanceOper.ID       = this.inpatientManager.Operator.ID;
                balanceList.BalanceBase.BalanceOper.OperTime = nowTime;

                if (this.inpatientManager.InsertBalanceList(this.patientInfo, balanceList) == -1)
                {
                    errText = "插入结算明细出错!" + this.inpatientManager.Err;

                    return(-1);
                }
            }
            return(1);
        }
Пример #2
0
        /// <summary>
        /// 处理支付表信息
        /// </summary>
        /// <param name="orgBalance">原始结算信息</param>
        /// <param name="balanceNO">负记录结算序号</param>
        /// <param name="nowTime">当前时间</param>
        /// <param name="errText">错误信息</param>
        /// <returns>成功 1 失败 -1</returns>
        private int DealBalancePay(Neusoft.HISFC.Models.Fee.Inpatient.Balance orgBalance, int balanceNO, DateTime nowTime, ref string errText)
        {
            ArrayList balancePays = new ArrayList();

            balancePays = this.inpatientManager.QueryBalancePaysByInvoiceNOAndBalanceNO(orgBalance.Invoice.ID, NConvert.ToInt32(orgBalance.ID));
            if (balancePays == null)
            {
                errText = "获得支付信息出错!" + this.inpatientManager.Err;

                return(-1);
            }

            foreach (Neusoft.HISFC.Models.Fee.Inpatient.BalancePay balancePay in balancePays)
            {
                balancePay.TransType            = Neusoft.HISFC.Models.Base.TransTypes.Negative;
                balancePay.FT.TotCost           = -balancePay.FT.TotCost;
                balancePay.Qty                  = -balancePay.Qty;
                balancePay.BalanceOper.ID       = this.inpatientManager.Operator.ID;
                balancePay.BalanceOper.OperTime = nowTime;
                balancePay.BalanceNO            = balanceNO;

                if (this.inpatientManager.InsertBalancePay(balancePay) == -1)
                {
                    errText = "插入支付负信息出错!" + this.inpatientManager.Err;

                    return(-1);
                }
            }

            return(1);
        }
Пример #3
0
        private void txtInvoiceNO_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (this.GetInvoiceNO(this.txtInvoiceNO.Text.Trim()) == -1)
                {
                    this.txtInvoiceNO.Focus();

                    return;
                }

                //显示人员信息
                base.SetPatientInfomation();

                //找到主发票信息
                Neusoft.HISFC.Models.Fee.Inpatient.Balance mainBalance = new Neusoft.HISFC.Models.Fee.Inpatient.Balance();
                if (balances.Count == 1)
                {
                    mainBalance = (Neusoft.HISFC.Models.Fee.Inpatient.Balance)balances[0];
                }
                else
                {
                    Neusoft.HISFC.Models.Fee.Inpatient.Balance bTemp = null;
                    for (int i = 0; i < balances.Count; i++)
                    {
                        bTemp = (Neusoft.HISFC.Models.Fee.Inpatient.Balance)balances[i];
                        if (bTemp.IsMainInvoice)
                        {
                            mainBalance = bTemp;
                        }
                    }
                }

                if (mainBalance.BalanceType.ID.ToString() != "D")
                {
                    MessageBox.Show(Language.Msg("只有直接收费的患者才能使用直接退费!"));
                    Clear();

                    return;
                }

                if (mainBalance.CancelType != Neusoft.HISFC.Models.Base.CancelTypes.Valid)
                {
                    MessageBox.Show(Language.Msg("此张发票已经作废!"));
                    this.Clear();

                    return;
                }

                this.txtInvoiceNO.Tag = mainBalance;

                dtpBeginTime.Value = this.patientInfo.PVisit.InTime;
                dtpEndTime.Value   = Neusoft.FrameWork.Function.NConvert.ToDateTime(this.inpatientManager.GetSysDateTime());

                this.btnRead.Focus();
            }
        }
Пример #4
0
        /// <summary>
        /// 插入结算头负信息
        /// </summary>
        /// <param name="balance">结算头信息</param>
        /// <param name="nowTime">当前系统时间</param>
        /// <param name="balanceNO">负记录结算序号</param>
        /// <param name="errText">错误信息</param>
        /// <returns>成功 1 失败 -1</returns>
        private int DealBalanceHead(Neusoft.HISFC.Models.Fee.Inpatient.Balance balance, DateTime nowTime, int balanceNO, ref string errText)
        {
            int returnValue = 0;

            //更新原始结算头信息为作废信息
            returnValue = this.inpatientManager.UpdateBalanceHeadWasteFlag(this.patientInfo.ID, NConvert.ToInt32(balance.ID), "0", nowTime, balance.Invoice.ID);
            if (returnValue == 0)//并发
            {
                errText = Language.Msg("该发票已经退费,请刷新屏幕!");

                return(-1);
            }
            else if (returnValue == -1) //错误
            {
                errText = Language.Msg("作废原始发票出错!") + this.inpatientManager.Err;

                return(-1);
            }

            Neusoft.HISFC.Models.Fee.Inpatient.Balance balanceTemp = balance.Clone();

            balanceTemp.ID = balanceNO.ToString();

            //负记录赋值
            balanceTemp.FT.TotCost            = -balanceTemp.FT.TotCost;
            balanceTemp.FT.OwnCost            = -balanceTemp.FT.OwnCost;
            balanceTemp.FT.PayCost            = -balanceTemp.FT.PayCost;
            balanceTemp.FT.PubCost            = -balanceTemp.FT.PubCost;
            balanceTemp.FT.RebateCost         = -balanceTemp.FT.RebateCost;
            balanceTemp.FT.DerateCost         = -balanceTemp.FT.DerateCost;
            balanceTemp.FT.TransferTotCost    = -balanceTemp.FT.TransferTotCost;
            balanceTemp.FT.TransferPrepayCost = -balanceTemp.FT.TransferPrepayCost;
            balanceTemp.FT.PrepayCost         = -balanceTemp.FT.PrepayCost;

            decimal returnCost = balanceTemp.FT.ReturnCost;
            decimal supplyCost = balanceTemp.FT.SupplyCost;

            balanceTemp.FT.SupplyCost = returnCost;
            balanceTemp.FT.ReturnCost = supplyCost;

            balanceTemp.TransType            = Neusoft.HISFC.Models.Base.TransTypes.Negative;
            balanceTemp.BalanceOper.ID       = this.inpatientManager.Operator.ID;
            balanceTemp.BalanceOper.OperTime = nowTime;
            balanceTemp.CancelType           = Neusoft.HISFC.Models.Base.CancelTypes.Canceled;

            //插入结算头负信信息
            returnValue = this.inpatientManager.InsertBalance(this.patientInfo, balanceTemp);
            if (returnValue <= 0)
            {
                errText = Language.Msg("插入结算头负信息出错!") + this.inpatientManager.Err;

                return(-1);
            }

            return(1);
        }
Пример #5
0
        //中途结算标记

        //protected bool MidBalanceFlag;
        ///// <summary>
        ///// 中途结算标记

        ///// </summary>
        //public bool IsMidwayBalance
        //{
        //    get
        //    {
        //        return MidBalanceFlag;
        //    }
        //    set
        //    {
        //        MidBalanceFlag = value;
        //    }
        //}



        /// <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.Models.RADT.PatientInfo patientInfo,
            Neusoft.HISFC.Models.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.Models.Fee.Inpatient.BalanceList det in alBalanceList)
            {
                alBalanceListClone.Add(det.Clone());
            }
            #endregion

            Control c;

            if (this.InvoiceType == "ZY01")
            {
                c = new ucDianLiZY01();

                this.Controls.Add(c);
                this.Size = c.Size;
                this.InitReceipt();
                SetZY01PrintValue(patientInfo,
                                  balanceHead,
                                  alBalanceListClone,
                                  IsPreview);
            }
            else if (this.InvoiceType == "ZY02")
            {
                c = new ucDianLiZY02();
                this.Controls.Add(c);
                this.Size = c.Size;
                this.InitReceipt();
                SetZY02PrintValue(patientInfo,
                                  balanceHead,
                                  alBalanceListClone,
                                  IsPreview);
            }
            else if (this.InvoiceType == "ZY03")
            {
                c = new ucDianLiZY01();
                this.Controls.Add(c);
                this.Size = c.Size;
                this.InitReceipt();
                SetZY03PrintValue(patientInfo,
                                  balanceHead,
                                  alBalanceListClone,
                                  IsPreview);
            }
            //控制根据打印和预览显示选项
            if (IsPreview)
            {
                SetToPreviewMode();
            }
            else
            {
                SetToPrintMode();
            }
            return(0);
        }
Пример #6
0
 //{1FADBEC0-514A-46f0-9A4B-037F5B65892A}
 public int SetValueForPrint(Neusoft.HISFC.Models.RADT.PatientInfo patientInfo, Neusoft.HISFC.Models.Fee.Inpatient.Balance balanceInfo, ArrayList alBalanceList, ArrayList alPayList)
 {
     return(this.SetPrintValue(patientInfo, balanceInfo, alBalanceList, false));
 }
Пример #7
0
        /// <summary>
        /// 打印控件赋值
        /// </summary>
        /// <param name="Pinfo"></param>
        /// <param name="Pinfo"></param>
        /// <param name="al">balancelist数据</param>
        /// <param name="IsPreview">是否打印其余可显示部分</param>
        /// <returns></returns>
        protected int SetZY01PrintValue(
            Neusoft.HISFC.Models.RADT.PatientInfo patientInfo,
            Neusoft.HISFC.Models.Fee.Inpatient.Balance balanceHead,
            ArrayList alBalanceList,
            bool IsPreview)
        {
            #region 设置自费发票打印内容
            ucDianLiZY01 ucReceipt = (ucDianLiZY01)this.Controls[0];
            //#region 医疗机构
            //ucReceipt.lblYiLiaoJiGou.Text = "辽宁电力中心医院";
            //#endregion
            //基本信息
            ucReceipt.lblCaseNO.Text     = patientInfo.PID.CaseNO;                            //病案号
            ucReceipt.lblPrintYear.Text  = balanceHead.BalanceOper.OperTime.Year.ToString();  //年
            ucReceipt.lblPrintMonth.Text = balanceHead.BalanceOper.OperTime.Month.ToString(); //月
            ucReceipt.lblPrintDay.Text   = balanceHead.BalanceOper.OperTime.Day.ToString();   //日
            //ucReceipt.lblName.Text = patientInfo.Name;//姓名
            //住院日期
            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.lblDeptName.Text = patientInfo.PVisit.PatientLocation.Dept.Name;

            //操作员
            ucReceipt.lblOperName.Text = balanceHead.BalanceOper.ID;

            //结算员
            //ucReceipt.lblBalanceName.Text = balanceHead.Oper.ID;

            //票面信息
            decimal[] FeeInfo =
                //---------------------1-----------2------------3------------4-------------5-----------------
                new decimal[18] {
                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.Models.Fee.Inpatient.BalanceList detail = new Neusoft.HISFC.Models.Fee.Inpatient.BalanceList();
                detail = (Neusoft.HISFC.Models.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(), ucReceipt);
                if (l != null)
                {
                    if (FeeInfo[FeeInfoIndex] > 0)
                    {
                        l.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(FeeInfo[FeeInfoIndex], 2);
                    }
                }
                FeeInfoIndex++;
            }
            //预收
            if (balanceHead.FT.PrepayCost > 0)
            {
                ucReceipt.lblPriPrepay.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.PrepayCost, 2);
            }
            //实收
            if (balanceHead.FT.SupplyCost > 0)
            {
                ucReceipt.lblPriSupply.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.OwnCost, 2);
            }
            //退款
            if (balanceHead.FT.ReturnCost > 0)
            {
                ucReceipt.lblPriReturn.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.ReturnCost, 2);
            }
            //小写总金额
            if (balanceHead.FT.TotCost > 0)
            {
                ucReceipt.lblTotCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.TotCost, 2);
                ucReceipt.lblSum.Text     = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.TotCost, 2);
            }
            #region 大写总金额
            ucReceipt.lblDaXie.Text = Function.GetUpperCashByNumber(Neusoft.FrameWork.Public.String.FormatNumber(balanceHead.FT.TotCost, 2));
            #endregion
            #endregion
            return(0);
        }
Пример #8
0
        } /// <summary>

        /// 打印控件赋值
        /// </summary>
        /// <param name="Pinfo"></param>
        /// <param name="Pinfo"></param>
        /// <param name="al">balancelist数据</param>
        /// <param name="IsPreview">是否打印其余可显示部分</param>
        /// <returns></returns>
        protected int SetZY03PrintValue(
            Neusoft.HISFC.Models.RADT.PatientInfo patientInfo,
            Neusoft.HISFC.Models.Fee.Inpatient.Balance balanceHead,
            ArrayList alBalanceList,
            bool IsPreview)
        {
            #region 设置自费发票打印内容
            ucDianLiZY03 ucReceipt = (ucDianLiZY03)this.Controls[0];

            #region 医疗机构
            ucReceipt.lblYiLiaoJiGou.Text = "辽宁电力中心医院";
            #endregion

            //基本信息
            //病案号
            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.lblOutTime.Text = balanceHead.EndTime.ToShortDateString();
            ucReceipt.lblInDay.Text   = new TimeSpan(balanceHead.EndTime.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.FrameWork.Public.String.FormatNumberReturnString(GeRenCost, 2);
            //}
            //统筹基金支付
            TongChouCost = patientInfo.SIMainInfo.PubCost - patientInfo.SIMainInfo.OverCost - patientInfo.SIMainInfo.OfficalCost;
            if (TongChouCost > 0)
            {
                ucReceipt.lblTongChouCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(TongChouCost, 2);
            }
            //现金支付
            XianJinCost = patientInfo.SIMainInfo.OwnCost;
            if (XianJinCost > 0)
            {
                ucReceipt.lblXianJinCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(XianJinCost, 2);
            }
            ////公务员补助
            //GongWuYuanCost = patientInfo.SIMainInfo.OfficalCost;
            //if (GongWuYuanCost > 0)
            //{
            //    ucReceipt.lblGongWuYuanCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(GongWuYuanCost, 2);
            //}
            ////大额补助
            //DaECost = patientInfo.SIMainInfo.OverCost;
            //if (DaECost > 0)
            //{
            //    ucReceipt.lblDaECost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(DaECost, 2);
            //}
            #endregion
            //票面信息
            decimal[] FeeInfo =
                //---------------------1-----------2------------3------------4-------------5-----------------
                new decimal[21] {
                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.Models.Fee.Inpatient.BalanceList detail = new Neusoft.HISFC.Models.Fee.Inpatient.BalanceList();
                detail = (Neusoft.HISFC.Models.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(), ucReceipt);
                if (l != null)
                {
                    if (FeeInfo[FeeInfoIndex] > 0)
                    {
                        l.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(FeeInfo[FeeInfoIndex], 2);
                    }
                }
                FeeInfoIndex++;
            }
            //预收
            ucReceipt.lblPriPrepay.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.PrepayCost, 2);
            //补收
            ucReceipt.lblPriSupply.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.SupplyCost, 2);
            //退款
            ucReceipt.lblPriReturn.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.ReturnCost, 2);

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

            ucReceipt.lblDaXie.Text = Function.GetUpperCashByNumber(Neusoft.FrameWork.Public.String.FormatNumber(balanceHead.FT.TotCost, 2));

            #endregion
            #endregion

            return(0);
        }
Пример #9
0
        /// <summary>
        /// 获得发票信息
        /// </summary>
        /// <param name="inputText"></param>
        /// <returns></returns>
        private int GetInvoiceNO(string inputText)
        {
            string invoiceNO = string.Empty;

            invoiceNO = inputText.PadLeft(12, '0');

            //验证输入发票号是否有效:
            ArrayList balanceTemps = this.inpatientManager.QueryBalancesByInvoiceNO(invoiceNO);

            if (balanceTemps == null || balanceTemps.Count == 0)
            {
                this.txtInvoiceNO.SelectAll();
                MessageBox.Show(Language.Msg("发票号不存在,请重新录入") + this.inpatientManager.Err);
                this.txtInvoiceNO.Focus();

                return(-1);
            }

            //获得发票列表,通过一组发票中的某一张,获得balance_no的其他发票;
            Neusoft.HISFC.Models.Fee.Inpatient.Balance balance = (Neusoft.HISFC.Models.Fee.Inpatient.Balance)balanceTemps[0];

            ////如果该笔结算的结算操作员还未作日结,不允许其他操作员召回--by Maokb
            //Neusoft.FrameWork.Models.NeuObject currOper = this.inpatientManager.Operator;
            //if (currOper.ID != balance.BalanceOper.ID)
            //{
            //    string dayBalanceDate = feeReportManager.GetMaxTimeDayReport(balance.BalanceOper.ID);
            //    if (NConvert.ToDateTime(dayBalanceDate) < balance.BalanceOper.OperTime)
            //    {
            //        MessageBox.Show(Language.Msg("此患者的原结算操作员") + "[" + balance.BalanceOper.ID +"]" + Language.Msg("还没作结,必须原操作员召回!"));

            //        return -1;
            //    }
            //}

            balances = this.inpatientManager.QueryBalancesByBalanceNO(balance.Patient.ID, NConvert.ToInt32(balance.ID));
            if (balances == null)
            {
                MessageBox.Show(Language.Msg("获得发票列表出错!") + this.inpatientManager.Err);

                return(-1);
            }

            //判断是否有发票组
            if (balances.Count > 1)
            {
                DialogResult result = MessageBox.Show(Language.Msg("该笔结算有") + balances.Count.ToString() + Language.Msg("张发票,退费会重新打印未全退的发票,是否继续?"),
                                                      "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.No)
                {
                    balances = new ArrayList();

                    return(-1);
                }
                foreach (Neusoft.HISFC.Models.Fee.Inpatient.Balance obj in balances)
                {
                    if (obj.IsMainInvoice)
                    {
                        mainOldInvoiceNO = obj.Invoice.ID;
                    }
                    if (obj.FT.DerateCost > 0)
                    {
                        MessageBox.Show(Language.Msg("该张发票是减免发票不能退费!"));

                        return(-1);
                    }
                }
            }

            if (balances.Count == 1)
            {
                mainOldInvoiceNO = balance.Invoice.ID;
            }
            //通过住院号获取住院基本信息
            this.patientInfo = this.radtIntegrate.GetPatientInfomation(balance.Patient.ID);
            if (this.patientInfo == null || this.patientInfo.ID == null || this.patientInfo.ID == string.Empty)
            {
                MessageBox.Show(Language.Msg("获得患者基本信息出错!") + this.radtIntegrate.Err);

                return(-1);
            }

            //赋值
            this.txtInvoiceNO.Text  = invoiceNO;
            this.txtInvoiceNO.Tag   = balance;
            this.dtpBeginTime.Value = this.patientInfo.PVisit.InTime;
            this.dtpEndTime.Value   = this.inpatientManager.GetDateTimeFromSysDateTime();

            return(1);
        }
Пример #10
0
        /// <summary>
        /// 保存方法
        /// </summary>
        /// <returns>成功 1 失败 -1</returns>
        public override int Save()
        {
            string newFirBalanceNO = ""; //负记录结算序号
            string newSecBalanceNO = ""; //正记录结算序号
            //string newInvoiceNO = ""; //新发票号
            int    returnValue = 0;
            string errText     = string.Empty;//错误信息

            if (this.patientInfo == null || this.patientInfo.ID == string.Empty)
            {
                MessageBox.Show(Language.Msg("患者不存在或者该发票不能退费!"));

                return(-1);
            }

            Neusoft.HISFC.Models.Fee.Inpatient.Balance orgBalance = (Neusoft.HISFC.Models.Fee.Inpatient.Balance) this.txtInvoiceNO.Tag;
            if (orgBalance == null)
            {
                MessageBox.Show(Language.Msg("请输入发票号"));

                return(-1);
            }

            ArrayList feeItemListNoBackQtyOverZero = base.QueryUnQuitItems(true);

            if (feeItemListNoBackQtyOverZero == null)
            {
                MessageBox.Show("获得未退明细失败!");

                return(-1);
            }

            if (feeItemListNoBackQtyOverZero.Count > 0)
            {
                MessageBox.Show(Language.Msg("直接退费必须全退!"));

                return(-1);
            }

            //if (NConvert.ToDecimal((this.tbQuitCost.Tag.ToString())) == orgBalance.Fee.Tot_Cost)
            //{
            //    this.isAllQuit = true;
            //}
            //else
            //{
            //    this.isAllQuit = false;
            //}
            //#region 在开始事务前处理支付方式,避免t开始后弹出窗口 By Maokb
            //neusoft.HISFC.Models.Fee.Balance Main = new neusoft.HISFC.Models.Fee.Balance();
            //Main = (neusoft.HISFC.Models.Fee.Balance)this.invoiceTextBox.Tag;
            //alBalancePay = new ArrayList();
            //alBalancePay = this.myFee.GetBalancePayByInvoiceAndBalNo(Main.Invoice.ID, Main.ID);
            //if (alBalancePay == null) return -1;
            //try
            //{
            //    //判断是否弹出选择框,如果支付方式是一种,并且是现金,不弹出。
            //    int paycount = 0;
            //    foreach (neusoft.HISFC.Models.Fee.BalancePay pay in alBalancePay)
            //    {//因为结算实付表中的预交金支付方式都是"CA"
            //        if (pay.TransKind == "1")
            //        {
            //            paycount++;
            //        }
            //        if (pay.PayType.ID != "CA")
            //        {
            //            paycount++;
            //        }
            //    }
            //    if (paycount > 1)
            //    {
            //        Fee.ucPayTypeSelect usc = new ucPayTypeSelect();
            //        usc.AlPayType = alBalancePay;
            //        neusoft.neuFC.Interface.Classes.Function.PopShowControl(usc);
            //    }
            //}
            //catch
            //{
            //    MessageBox.Show("处理召回支付方式出错");
            //    return -1;
            //}
            //#endregion

            //Transaction t = new Transaction(this.inpatientManager.Connection);
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            this.inpatientManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            base.phamarcyIntegrate.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);
            base.feeIntegrate.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            //获得最新负记录结算流水号
            newFirBalanceNO = this.inpatientManager.GetNewBalanceNO(this.patientInfo.ID);
            if (newFirBalanceNO == null || newFirBalanceNO == string.Empty)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(Language.Msg("获得发票序号出错!") + this.inpatientManager.Err);

                return(-1);
            }
            //获得正记录结算序号,是新的负记录结算序号+1;
            newSecBalanceNO = Convert.ToString((Convert.ToInt32(newFirBalanceNO) + 1));

            //获得系统当前时间
            DateTime nowTime = this.inpatientManager.GetDateTimeFromSysDateTime();

            //处理结算头表,更新原始结算头记录为作废,插入负记录
            returnValue = this.DealBalanceHead(orgBalance, nowTime, NConvert.ToInt32(newFirBalanceNO), ref errText);
            if (returnValue != 1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(errText);

                return(-1);
            }

            //处理结算明细信息,插入负记录
            returnValue = this.DealBalanceList(orgBalance.Clone(), newFirBalanceNO, nowTime, ref errText);
            if (returnValue != 1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(errText);

                return(-1);
            }

            //处理支付信息
            returnValue = this.DealBalancePay(orgBalance, NConvert.ToInt32(newFirBalanceNO), nowTime, ref errText);
            if (returnValue != 1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(errText);

                return(-1);
            }

            //处理费用明细和费用汇总信息
            returnValue = this.DealFeeInfoAndFeeItemList(NConvert.ToInt32(newFirBalanceNO), nowTime, ref errText);
            if (returnValue != 1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(errText);

                return(-1);
            }

            //更新住院主表清 0
            returnValue = this.inpatientManager.UpdateMainInfoForDirQuitFee(this.patientInfo.ID, orgBalance.FT.TotCost, NConvert.ToInt32(newFirBalanceNO), nowTime);
            if (returnValue <= 0)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("更新住院主表失败!" + this.inpatientManager.Err);

                return(-1);
            }

            Neusoft.FrameWork.Management.PublicTrans.Commit();

            MessageBox.Show(Language.Msg("退费成功!"));

            this.Clear();

            return(1);
        }
Пример #11
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.Models.Fee.DayReport dayReport = new Neusoft.HISFC.Models.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.lblLBlank1.Text      = "0";

                //市医保帐户支付



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


                //市医保统筹支付


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

                //省医保帐户


                this.lblDProvinceAccountCost.Text = "0";
                this.lblLBlank4.Text = "0";

                //省医保统筹支付


                this.lblDProvincePubCost.Text = "0";
                this.lblLBlank5.Text          = "0";

                //借方合计
                this.lblDTotCost.Text = Neusoft.FrameWork.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.FrameWork.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.FrameWork.Models.NeuObject invoiceZone = new Neusoft.FrameWork.Models.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.Models.Fee.Inpatient.Prepay prepay = new Neusoft.HISFC.Models.Fee.Inpatient.Prepay();
                if (alWasteNO.Count == 0)
                {
                    this.lblWastePrepayNO.Text = "";
                }
                else
                {
                    for (int i = 0; i < alWasteNO.Count; i++)
                    {
                        prepay     = (Neusoft.HISFC.Models.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.FrameWork.Models.NeuObject balanceInvoiceZone = new Neusoft.FrameWork.Models.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.Models.Fee.Inpatient.Balance balance = new Neusoft.HISFC.Models.Fee.Inpatient.Balance();

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

            this.OperMode = "1";

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

            #region 医疗机构
            //医院名称从数据库获取 {8A045104-A387-48e7-91A5-6E362E44B765} wbo 2010-08-20
            Neusoft.HISFC.BizProcess.Integrate.Manager mgr = new Neusoft.HISFC.BizProcess.Integrate.Manager();
            ucReceipt.lblHospitalName.Text = mgr.GetHospitalName();
            //ucReceipt.lblHospitalName.Text = "中国北车集团长春客车厂职工医院";
            #endregion
            //电脑编号
            ucReceipt.lblSSN.Text = patientInfo.SSN;
            //病房
            ucReceipt.lblNurseCellName.Text = patientInfo.PVisit.PatientLocation.NurseCell.Name;
            //基本信息
            //病案号
            ucReceipt.lblCaseNO.Text = patientInfo.PID.CaseNO;
            //结算日期
            ucReceipt.lblDate.Text = balanceHead.BalanceOper.OperTime.ToString("yyyy    MM    dd");
            //姓名
            ucReceipt.lblName.Text = patientInfo.Name;
            //住院日期
            ucReceipt.lblInTime.Text = balanceHead.BeginTime.ToString("yyyy    MM    dd     HH     mm");
            //住院日期
            ucReceipt.lblInTime.Text = balanceHead.BeginTime.ToString("yyyy    MM    dd     HH     mm");

            #region //出院日期如果没有,那么打现在的日期 {02F13455-1B64-48bb-9C69-1D2C9038E3B0} wbo 2010-08-20

            Neusoft.HISFC.BizLogic.Manager.Constant consMgr = new Neusoft.HISFC.BizLogic.Manager.Constant();
            DateTime dt = consMgr.GetDateTimeFromSysDateTime();
            if (MidBalanceFlag == Neusoft.HISFC.Models.Base.EBlanceType.Mid)
            {
                if (balanceHead.EndTime < new DateTime(1900, 1, 1))
                {
                    ucReceipt.lblOutTime.Text = dt.ToShortDateString();
                    ucReceipt.lblInDay.Text   = new TimeSpan(dt.Ticks - balanceHead.BeginTime.Ticks).Days.ToString();
                }
                else
                {
                    ucReceipt.lblOutTime.Text = balanceHead.EndTime.ToShortDateString();
                    ucReceipt.lblInDay.Text   = new TimeSpan(balanceHead.EndTime.Ticks - balanceHead.BeginTime.Ticks).Days.ToString();
                }
            }
            else
            {
                if (patientInfo.PVisit.OutTime < new DateTime(1900, 1, 1))
                {
                    ucReceipt.lblOutTime.Text = dt.ToShortDateString();
                    ucReceipt.lblInDay.Text   = new TimeSpan(dt.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();
                }
            }
            //if (MidBalanceFlag == Neusoft.HISFC.Models.Base.EBlanceType.Mid)
            //{
            //    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();
            //}
            #endregion
            ////科室
            //ucReceipt.lblDeptName.Text = patientInfo.PVisit.PatientLocation.Dept.Name;

            //结算员

            Neusoft.HISFC.BizLogic.Manager.Person person = new Neusoft.HISFC.BizLogic.Manager.Person();
            string operUserCode = string.Empty;
            operUserCode = person.GetPersonByID(balanceHead.BalanceOper.ID).Name;

            ucReceipt.lblOperName.Text = operUserCode;

            ////操作员



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

            #region 医保信息
            ucReceipt.lblSSNTitle.Visible     = false;
            ucReceipt.lblPayCostTitle.Visible = false;
            ucReceipt.lblPubCostTitle.Visible = false;
            ucReceipt.lblOwnCost.Visible      = false;
            ucReceipt.lblPubCost.Visible      = false;
            ucReceipt.lblPayCost.Visible      = false;
            ucReceipt.lblOverCost.Visible     = false;
            ucReceipt.lblSSN.Visible          = false;
            ucReceipt.lblOwnCostTitle.Visible = false;

            if (balanceHead.Patient.Pact.PayKind.ID == "02")
            {
                ucReceipt.lblSSNTitle.Visible     = true;
                ucReceipt.lblPayCostTitle.Visible = true;
                ucReceipt.lblPubCostTitle.Visible = true;
                ucReceipt.lblOwnCost.Visible      = true;
                ucReceipt.lblPubCost.Visible      = true;
                ucReceipt.lblPayCost.Visible      = true;
                ucReceipt.lblOverCost.Visible     = true;
                ucReceipt.lblSSN.Visible          = true;
                ucReceipt.lblOwnCostTitle.Visible = true;
                ucReceipt.lblSSN.Text             = patientInfo.SSN;
                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.lblPayCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(GeRenCost, 2);
                }
                //统筹基金支付
                TongChouCost = patientInfo.SIMainInfo.PubCost;
                if (TongChouCost != 0)
                {
                    ucReceipt.lblPubCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(TongChouCost, 2);
                }
                //现金支付
                XianJinCost = patientInfo.SIMainInfo.OwnCost;
                if (XianJinCost != 0)
                {
                    ucReceipt.lblOwnCost.Text   = Neusoft.FrameWork.Public.String.FormatNumberReturnString(XianJinCost, 2);
                    ucReceipt.lblUpOwnCost.Text = Neusoft.FrameWork.Public.String.LowerMoneyToUpper(Neusoft.FrameWork.Public.String.FormatNumber(XianJinCost, 2));
                }
                //公务员补助

                //GongWuYuanCost = patientInfo.SIMainInfo.OfficalCost;
                //if (GongWuYuanCost > 0)
                //{
                //    ucReceipt.lblGongWuYuanCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(GongWuYuanCost, 2);
                //}
                //大额补助
                DaECost = patientInfo.SIMainInfo.OverCost;
                if (DaECost != 0)
                {
                    ucReceipt.lblOverCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(DaECost, 2);
                } //-----1---------------------------2----------------3-----------------------4-----------------------5-----------------6----------------
                //|医疗费总额TotCost|个人帐户支付金额PayCost|统筹支付金额PubCost|个人现金支付OwnCost|救助金支出金额OverCost|公务员补助支出金额OfficalCost
                //-----------------7------------------8-----------------------9-----------
                //|保健对象补贴支出BaseCost|离休人员统筹支出PubOwnCost|医院付担金额HosCost
                //-------------10-------------11----------------------12------------13------------------
                //|上次进入统筹医疗费用累计|本次进入统筹医疗费用金额|上次个人帐户余额|个人自费金额
                //----14---------------15-------------16--------------------------------17----------
                //|乙类药品个人自理|起付标准自付金额|分段自理金额|超过封顶线个人自付金额|住院封顶线以上公务员补助支出金额
                //----18---------------------------19------20--------------21--------------------
                //|住院自付部分公务员补助支出金额|住院人次|工伤基金支付金额|生育基金支付金额|
                string[] temp = patientInfo.SIMainInfo.Memo.Split('|');
                ucReceipt.lblTemp18.Text = temp[18];
                ucReceipt.lblTemp6.Text  = temp[6];
                ucReceipt.lblTemp7.Text  = temp[7];
                ucReceipt.lblTemp8.Text  = temp[8];
                ucReceipt.lblTemp20.Text = temp[20];
                ucReceipt.lblTemp21.Text = temp[21];
                ucReceipt.lblTemp15.Text = temp[15];
                ucReceipt.lblTemp13.Text = temp[13];
            }
            #endregion
            //票面信息
            decimal[] FeeInfo =
                //---------------------1-----------2------------3------------4-------------5-----------------
                new decimal[18] {
                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, decimal.Zero
            };
            //票面信息
            string[] FeeInfoName =
                //---------------------1-----------2------------3------------4-------------5-----------------
                new string[18] {
                string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                //string.Empty,string.Empty,string.Empty,string.Empty,string.Empty,
                string.Empty, string.Empty, string.Empty,               //string.Empty,
                string.Empty, string.Empty, string.Empty, string.Empty, string.Empty
            };

            for (int i = 0; i < alBalanceList.Count; i++)
            {
                Neusoft.HISFC.Models.Fee.Inpatient.BalanceList detail = new Neusoft.HISFC.Models.Fee.Inpatient.BalanceList();
                detail = (Neusoft.HISFC.Models.Fee.Inpatient.BalanceList)alBalanceList[i];
                if (detail.FeeCodeStat.SortID <= FeeInfo.Length)
                {
                    FeeInfo[detail.FeeCodeStat.SortID - 1] += detail.BalanceBase.FT.TotCost;
                    if (detail.FeeCodeStat.StatCate.Name.Length > 5)
                    {
                        FeeInfoName[detail.FeeCodeStat.SortID - 1] += detail.FeeCodeStat.StatCate.Name.Substring(0, 5);
                    }
                    else
                    {
                        FeeInfoName[detail.FeeCodeStat.SortID - 1] += detail.FeeCodeStat.StatCate.Name;
                    }
                }
            }
            int feeInfoNameIdx = 0;
            int FeeInfoIndex   = 0;
            foreach (decimal d in FeeInfo)
            {
                //测试用
                //FeeInfo[FeeInfoIndex] = 999999.99m;
                //名称
                Label lName  = GetFeeNameLable("lblFeeName" + feeInfoNameIdx.ToString(), lblPrint);
                Label lValue = GetFeeNameLable("lblFeeInfo" + feeInfoNameIdx.ToString(), lblPrint);
                if (lName != null)
                {
                    if (FeeInfo[FeeInfoIndex] > 0)
                    {
                        //lName.Text = FeeInfoName[feeInfoNameIdx] + "普通人工器官材料费";
                        // lName.Text = FeeInfoName[FeeInfoIndex] + "";
                        lValue.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(FeeInfo[FeeInfoIndex], 2).PadLeft(9, ' ');
                    }
                }
                FeeInfoIndex++;
                feeInfoNameIdx++;
            }
            //预收
            if (balanceHead.FT.PrepayCost - balanceHead.FT.BalancedPrepayCost != 0)
            {
                ucReceipt.lblPriPrepay.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.PrepayCost - balanceHead.FT.BalancedPrepayCost, 2);
            }
            //补收
            if (balanceHead.FT.SupplyCost != 0)
            {
                ucReceipt.lblPriReturn.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.SupplyCost, 2);
            }
            //退款
            if (balanceHead.FT.ReturnCost != 0)
            {
                ucReceipt.lblPriReturn.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(0 - balanceHead.FT.ReturnCost, 2);
            }
            //发票号
            ucReceipt.lblInvoiceNO.Text = balanceHead.Invoice.ID;
            //总金额
            if (balanceHead.FT.TotCost != 0)
            {
                ucReceipt.lblTotCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.TotCost, 2);
            }
            #region 大写总金额
            if (balanceHead.FT.TotCost != 0)
            {
                ucReceipt.lblUpTotCost.Text = Neusoft.FrameWork.Public.String.LowerMoneyToUpper(Neusoft.FrameWork.Public.String.FormatNumber(balanceHead.FT.TotCost, 2));
            }
            #endregion
            #endregion

            return(0);
        }
Пример #13
0
        private int SetPrintValue(Neusoft.HISFC.Models.RADT.PatientInfo patientInfo, Neusoft.HISFC.Models.Fee.Inpatient.Balance balanceHead, System.Collections.ArrayList alBalanceList, bool IsPreview)
        {
            #region 设置自费发票打印内容

            /*
             * {E7AF00A9-C588-464b-8C3B-2E312694A5B1} 席宗飞 modified on 20100923
             * 05 郑州市医疗保险
             * 08郑州市铁路医疗保险
             *
             */
            Neusoft.HISFC.BizProcess.Integrate.Manager mgr = new Neusoft.HISFC.BizProcess.Integrate.Manager();
            Hashtable ZZCityKind = new Hashtable();
            ZZCityKind["302"] = "郑州市医疗保险(中原区)";
            ZZCityKind["303"] = "郑州市医疗保险(二七区)";
            ZZCityKind["304"] = "郑州市医疗保险(管城区)";
            ZZCityKind["305"] = "郑州市医疗保险(金水区)";
            ZZCityKind["306"] = "郑州市医疗保险(上街区)";
            ZZCityKind["308"] = "郑州市医疗保险(惠济区)";
            if (patientInfo.Pact.ID == "05")
            {
                if (patientInfo.SIMainInfo.PersonType.ID == "41")
                {
                    this.label2.Text = "郑州市医疗保险(居民)";
                }
                else if ((patientInfo.SIMainInfo.PersonType.ID == "21" || patientInfo.SIMainInfo.PersonType.ID == "11") && !ZZCityKind.ContainsKey(patientInfo.SIMainInfo.Fund.Name))
                {
                    this.label2.Text = "郑州市医疗保险(职工)";
                }
                else
                {
                    this.label2.Text = ZZCityKind[patientInfo.SIMainInfo.Fund.Name].ToString();
                }
            }
            else if (patientInfo.Pact.ID == "08")
            {
                if (patientInfo.SIMainInfo.PersonType.ID == "11" || patientInfo.SIMainInfo.PersonType.ID == "21")
                {
                    this.label2.Text = "郑州市铁路医疗保险(职工)";
                }
                else if (patientInfo.SIMainInfo.PersonType.ID == "31")
                {
                    this.label2.Text = "郑州市铁路医疗保险(家庭)";
                }
                else
                {
                    this.label2.Text = "郑州市铁路医疗保险(离休)";
                }
            }
            else
            {
                this.label2.Text = patientInfo.Pact.Name;
            }
            ///{C00F610C-D314-4783-B4D9-548ACD884312} 席宗飞 添加结算状态20101110
            if (balanceHead.BalanceType.ID.ToString() == "Q")
            {
                this.label2.Text += "  逃帐结算";
            }
            else if (balanceHead.BalanceType.ID.ToString() == "I")
            {
                this.label2.Text += "  中途结算";
            }
            else
            {
                this.label2.Text += "  正常结算";
            }
            //打票单位
            this.lblHospitalName.Text = mgr.GetHospitalName();
            //打印时间
            this.label2.Text += " " + Neusoft.FrameWork.Management.Connection.Sql.GetSysDateTime();
            //姓名
            #region 对于新农合患者,打印患者所在县 modified by xizf 20101224
            if (patientInfo.Pact.ID == "13")
            {
                this.lblPatientName.Text = patientInfo.Name + "(" + patientInfo.CompanyName + ")";
                this.lblCountryID.Text   = "新农合:" + patientInfo.User03;//打印新农合地区编码
            }
            else
            {
                this.lblPatientName.Text = patientInfo.Name;
                this.lblCountryID.Text   = "";
            }
            #endregion



            //住院科室
            this.lblDept.Text = patientInfo.PVisit.PatientLocation.Dept.Name;
            //医保号 {9252CFAC-171B-451d-A517-23D363BEED44} 席宗飞20101112
            if (balanceHead.Patient.Pact.PayKind.ID == "02")
            {
                if (patientInfo.Pact.ID == "05")
                {
                    this.label42.Text = patientInfo.IDCard;
                }
                else if (patientInfo.Pact.ID == "03" || patientInfo.Pact.ID == "02" || patientInfo.Pact.ID == "07")
                {
                    this.label42.Text = patientInfo.SSN;
                }
                else
                {
                    this.label42.Text = patientInfo.IDCard;
                }
            }
            else
            {
                this.label42.Text = string.Empty;
            }

            //住院号码
            this.lblInNo.Text = patientInfo.PID.PatientNO;

            //住院日期
            this.lblInTime.Text = balanceHead.BeginTime.ToString("yyyy.MM.dd");

            //出院日期
            if (MidBalanceFlag == Neusoft.HISFC.Models.Base.EBlanceType.Mid)
            {
                this.lblOutTime.Text = balanceHead.EndTime.ToString("yyyy.MM.dd");
                //this.lblInDay.Text = new TimeSpan(balanceHead.EndTime.Ticks - balanceHead.BeginTime.Ticks).Days.ToString();
            }
            else
            {
                this.lblOutTime.Text = patientInfo.PVisit.OutTime.ToString("yyyy.MM.dd");
                //this.lblInDay.Text = new TimeSpan(patientInfo.PVisit.OutTime.Ticks - balanceHead.BeginTime.Ticks).Days.ToString();
            }

            //结算形式
            this.lblPayKind.Text = patientInfo.PayKind.Name;

            #region 具体的项目

            for (int i = 0; i < alBalanceList.Count; i++)
            {
                Neusoft.HISFC.Models.Fee.Inpatient.BalanceList detail = new Neusoft.HISFC.Models.Fee.Inpatient.BalanceList();
                detail = (Neusoft.HISFC.Models.Fee.Inpatient.BalanceList)alBalanceList[i];



                foreach (System.Windows.Forms.Control ctrl in this.Controls.Find("lblItem" + i.ToString(), true))
                {
                    ctrl.Visible = true;
                    ctrl.Text    = detail.FeeCodeStat.StatCate.Name;
                }

                foreach (System.Windows.Forms.Control ctrl in this.Controls.Find("lblItemFee" + i.ToString(), true))
                {
                    ctrl.Visible = true;
                    ctrl.Text    = detail.BalanceBase.FT.TotCost.ToString();
                }
            }

            #endregion

            #region 医保相关信息

            this.label46.Visible = false;
            this.label47.Visible = false;
            this.label48.Visible = false;
            this.label49.Visible = false;
            this.label50.Visible = false;
            this.label51.Visible = false;
            this.label52.Visible = false;
            this.label53.Visible = false;
            this.label54.Visible = false;
            this.label55.Visible = false;

            //医保记账
            this.label56.Visible = false;
            //大额比例自负
            this.label1.Visible = false;


            if (balanceHead.Patient.Pact.PayKind.ID == "02")
            {
                this.label46.Visible = true;
                this.label47.Visible = true;
                this.label48.Visible = true;
                this.label49.Visible = true;
                this.label50.Visible = true;
                this.label51.Visible = true;
                this.label52.Visible = true;
                this.label53.Visible = true;
                this.label54.Visible = true;
                this.label55.Visible = true;

                //
                this.label56.Visible = true;
                //
                this.label1.Visible = true;
                //
                decimal ziFeiFeiYong = decimal.Zero;
                decimal daEJiZhang   = decimal.Zero;

                decimal geRenZiFu     = decimal.Zero;
                decimal caoDaEJiZhang = decimal.Zero;

                decimal biaoZhunQiFu      = decimal.Zero;
                decimal gongWuYuanJiZhang = decimal.Zero;

                decimal anBiLiZiFu   = decimal.Zero;
                decimal geRenZhangHu = decimal.Zero;

                decimal tongChouJiZhang = decimal.Zero;
                decimal xianJinZhiFu    = decimal.Zero;

                decimal daEBiLiZiFu = decimal.Zero;

                //46自费费用
                ziFeiFeiYong = patientInfo.SIMainInfo.ItemYLCost;
                if (ziFeiFeiYong != 0)
                {
                    this.label46.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(ziFeiFeiYong, 2);
                }

                //47大额记账
                daEJiZhang = patientInfo.SIMainInfo.OverCost;
                if (daEJiZhang != 0)
                {
                    this.label47.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(daEJiZhang, 2);
                }

                //48个人自付
                geRenZiFu = patientInfo.SIMainInfo.PubOwnCost;
                if (geRenZiFu != 0)
                {
                    this.label48.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(geRenZiFu, 2);
                }

                //49超大额记账
                caoDaEJiZhang = patientInfo.SIMainInfo.OverTakeOwnCost;
                if (caoDaEJiZhang != 0)
                {
                    this.label49.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(caoDaEJiZhang, 2);
                }

                //50起付标准
                biaoZhunQiFu = patientInfo.SIMainInfo.BaseCost;
                if (biaoZhunQiFu != 0)
                {
                    this.label50.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(biaoZhunQiFu, 2);
                }

                //51公务员记账
                gongWuYuanJiZhang = patientInfo.SIMainInfo.OfficalCost;
                if (gongWuYuanJiZhang > 0)
                {
                    //{8DA5C28A-11C3-4891-A727-E72A19C36AE2} 席宗飞2010118 对于省农合公务员记帐不显示
                    if (patientInfo.Pact.ID == "13")
                    {
                        this.label51.Text = "";
                    }
                    else
                    {
                        this.label51.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(gongWuYuanJiZhang, 2);
                    }
                }

                //52按比例自付
                anBiLiZiFu = patientInfo.SIMainInfo.ItemPayCost;
                if (anBiLiZiFu != 0)
                {
                    this.label52.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(anBiLiZiFu, 2);
                }

                //53个人账户
                geRenZhangHu = patientInfo.SIMainInfo.PayCost;
                if (geRenZhangHu != 0)
                {
                    //20101108 席宗飞 省农合的个人账户存储超限额费用{B8DCCA59-92A9-483d-8531-D1177F0D79E3}
                    if (patientInfo.Pact.ID == "13")
                    {
                        this.label51.Text = "超限额:" + Neusoft.FrameWork.Public.String.FormatNumberReturnString(geRenZhangHu, 2);
                    }
                    else
                    {
                        this.label53.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(geRenZhangHu, 2);
                    }
                }

                //54统筹记账
                tongChouJiZhang = patientInfo.SIMainInfo.SiPubCost;
                if (tongChouJiZhang != 0)
                {
                    this.label54.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(tongChouJiZhang, 2);
                }

                //55现金支付
                xianJinZhiFu = patientInfo.SIMainInfo.OwnCost;
                if (xianJinZhiFu != 0)
                {
                    this.label55.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(xianJinZhiFu, 2);
                }

                //大额比例自付
                daEBiLiZiFu = patientInfo.SIMainInfo.YearHelpCost;
                //if (daEBiLiZiFu != 0)
                //{
                this.label1.Text = string.Format("大额比例自付:{0}", Neusoft.FrameWork.Public.String.FormatNumberReturnString(daEBiLiZiFu, 2));
                //}

                //医保记账
                if (patientInfo.SIMainInfo.PayAddCost != 0)
                {
                    this.label56.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(patientInfo.SIMainInfo.PayAddCost, 2);
                }
            }


            #endregion

            //费用合计
            if (balanceHead.FT.TotCost != 0)
            {
                this.lblTotAll.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.TotCost, 2);
            }


            //预收押金
            if (balanceHead.FT.PrepayCost - balanceHead.FT.BalancedPrepayCost != 0)
            {
                this.lblPriPrepay.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.PrepayCost - balanceHead.FT.BalancedPrepayCost, 2);
            }
            //退押金
            if (balanceHead.FT.ReturnCost != 0)
            {
                this.lblPriReturn.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.ReturnCost, 2);
            }
            else
            {
                this.lblPriReturn.Text = "0.00";
            }


            //退还款{D70E9BBD-E2BF-41c6-9804-EFD6C447C8C1}
            if (balanceHead.FT.SupplyCost != 0)
            {
                //{C5DD6E04-F68D-483d-B0FB-22F0B41A3472} 席宗飞 逃帐结算的特殊显示20101110
                if (balanceHead.BalanceType.ID.ToString() == "Q")
                {
                    this.lblPriAdd.Text = "欠费 " + Neusoft.FrameWork.Public.String.FormatNumberReturnString(decimal.Negate(balanceHead.FT.SupplyCost), 2);
                }
                else
                {
                    this.lblPriAdd.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(decimal.Negate(balanceHead.FT.SupplyCost), 2);
                }
            }
            else
            {
                this.lblPriAdd.Text = "0.00";
            }


            //实收金额(大写)
            if (balanceHead.FT.TotCost != 0)
            {
                this.lblUpTotCost.Text = Neusoft.FrameWork.Public.String.LowerMoneyToUpper(Neusoft.FrameWork.Public.String.FormatNumber(balanceHead.FT.TotCost, 2));
            }
            //实收金额
            if (balanceHead.FT.TotCost != 0)
            {
                this.lblTotCost.Text = Neusoft.FrameWork.Public.String.FormatNumberReturnString(balanceHead.FT.TotCost, 2);
            }


            //流水号
            this.lblInvoiceNo.Text = balanceHead.Invoice.ID;

            //制单
            this.label57.Text = new Neusoft.HISFC.BizLogic.Manager.Person().GetPersonByID(balanceHead.BalanceOper.ID).ID;

            //结算员工号
            this.lblOperater.Text = new Neusoft.HISFC.BizLogic.Manager.Person().GetPersonByID(balanceHead.BalanceOper.ID).ID;

            //发票号
            //this.lblInvoiceNO.Text = balanceHead.Invoice.ID;


            #endregion


            return(0);
        }
Пример #14
0
 public int SetValueForPrint(Neusoft.HISFC.Models.RADT.PatientInfo patientInfo, Neusoft.HISFC.Models.Fee.Inpatient.Balance balanceInfo, System.Collections.ArrayList alBalanceList, System.Collections.ArrayList alPayList)
 {
     return(this.SetPrintValue(patientInfo, balanceInfo, alBalanceList, true));
 }