/// <summary> /// 创建发票 /// </summary> /// <param name="CostMasterID">结算ID</param> /// <param name="invoiceType">发票类型</param> /// <returns></returns> public static Object CreateInvoice(int CostMasterID, string invoiceType) { switch (invoiceType) { case "湖南": Invoice_HN invoice = new Invoice_HN(); return(invoice.GetTicketInfo(CostMasterID)); case "广东": Invoice_GD invoice1 = new Invoice_GD(); return(invoice1.GetInvoiceInfo(CostMasterID)); } return(null); }
/// <summary> /// 得到住院发票数据 /// </summary> /// <param name="CostMasterID">结算ID</param> /// <returns>发票实体对象</returns> public Invoice_GD GetInvoiceInfo(int CostMasterID) { Invoice_GD invoice = new Invoice_GD();; try { GetInvoiceInfo(invoice, CostMasterID); //结算方式 if (zyCM.Money_Fee != 0) { invoice.结算方式 = "现金"; } if (zyCM.Pos_Fee != 0) { if (invoice.结算方式 != null) { invoice.结算方式 += "|POS"; } else { invoice.结算方式 = "POS"; } } if (zyCM.PatType == "01") { invoice.结算方式 += "|自费"; } else if (zyCM.PatType == "02") { invoice.结算方式 += "|农合"; } else if (zyCM.PatType == "03") { invoice.结算方式 += "|居民医保"; } else if (zyCM.PatType == "04") { invoice.结算方式 += "|职工医保"; } else if (zyCM.PatType == "05") { invoice.结算方式 += "|公费"; } else if (zyCM.PatType == "06") { invoice.结算方式 += "|其他"; } if (zyCM.WorkUnit_Fee > 0) { invoice.结算方式 += "|单位记账"; } // char[] ch = zyCM.Total_Fee.ToString("0.00").ToCharArray(); invoice.拾万 = ch.Length >= 9 ? NumToChar(ch[ch.Length - 9]) : "零"; invoice.万 = ch.Length >= 8 ? NumToChar(ch[ch.Length - 8]) : "零"; invoice.仟 = ch.Length >= 7 ? NumToChar(ch[ch.Length - 7]) : "零"; invoice.佰 = ch.Length >= 6 ? NumToChar(ch[ch.Length - 6]) : "零"; invoice.拾 = ch.Length >= 5 ? NumToChar(ch[ch.Length - 5]) : "零"; invoice.元 = ch.Length >= 4 ? NumToChar(ch[ch.Length - 4]) : "零"; invoice.角 = NumToChar(ch[ch.Length - 2]); invoice.分 = NumToChar(ch[ch.Length - 1]); invoice.记账金额 = (zyCM.Village_Fee - zyCM.WorkUnit_Fee).ToString("0.00"); invoice.优惠金额 = zyCM.Favor_Fee.ToString("0.00"); invoice.自付金额 = zyCM.Self_Fee.ToString("0.00"); invoice.单位金额 = zyCM.WorkUnit_Fee.ToString("0.00"); invoice.自费西药 = zyCM.SelfDrug_Fee.ToString("0.00");//add zenghao 091011 string strWhere = "costid" + oleDb.EuqalTo() + zyCM.CostMasterID + oleDb.And() + "BIGITEMCODE" + oleDb.In(OP_ZYConfigSetting.GetConfigText("007", 0)); invoice.CT = HIS.SYSTEM.PubicBaseClasses.XcConvert.IsNull(BindEntity <ZY_CostOrder> .CreateInstanceDAL(oleDb).GetSum("TOTAL_FEE", strWhere), "").ToString(); strWhere = "costid" + oleDb.EuqalTo() + zyCM.CostMasterID + oleDb.And() + "BIGITEMCODE" + oleDb.In(OP_ZYConfigSetting.GetConfigText("007", 1)); invoice.MRI = HIS.SYSTEM.PubicBaseClasses.XcConvert.IsNull(BindEntity <ZY_CostOrder> .CreateInstanceDAL(oleDb).GetSum("TOTAL_FEE", strWhere), "").ToString(); strWhere = "costid" + oleDb.EuqalTo() + zyCM.CostMasterID + oleDb.And() + "BIGITEMCODE" + oleDb.In(OP_ZYConfigSetting.GetConfigText("007", 2)); invoice.B超 = HIS.SYSTEM.PubicBaseClasses.XcConvert.IsNull(BindEntity <ZY_CostOrder> .CreateInstanceDAL(oleDb).GetSum("TOTAL_FEE", strWhere), "").ToString(); strWhere = "costid" + oleDb.EuqalTo() + zyCM.CostMasterID + oleDb.And() + "BIGITEMCODE" + oleDb.In(OP_ZYConfigSetting.GetConfigText("007", 3)); invoice.X光 = HIS.SYSTEM.PubicBaseClasses.XcConvert.IsNull(BindEntity <ZY_CostOrder> .CreateInstanceDAL(oleDb).GetSum("TOTAL_FEE", strWhere), "").ToString(); strWhere = "costid" + oleDb.EuqalTo() + zyCM.CostMasterID + oleDb.And() + "BIGITEMCODE" + oleDb.In(OP_ZYConfigSetting.GetConfigText("007", 4)); invoice.心脑电图 = HIS.SYSTEM.PubicBaseClasses.XcConvert.IsNull(BindEntity <ZY_CostOrder> .CreateInstanceDAL(oleDb).GetSum("TOTAL_FEE", strWhere), "").ToString(); strWhere = "costid" + oleDb.EuqalTo() + zyCM.CostMasterID + oleDb.And() + "BIGITEMCODE" + oleDb.In(OP_ZYConfigSetting.GetConfigText("007", 5)); invoice.输血费 = HIS.SYSTEM.PubicBaseClasses.XcConvert.IsNull(BindEntity <ZY_CostOrder> .CreateInstanceDAL(oleDb).GetSum("TOTAL_FEE", strWhere), "").ToString(); strWhere = "costid" + oleDb.EuqalTo() + zyCM.CostMasterID + oleDb.And() + "BIGITEMCODE" + oleDb.In(OP_ZYConfigSetting.GetConfigText("007", 6)); invoice.输养费 = HIS.SYSTEM.PubicBaseClasses.XcConvert.IsNull(BindEntity <ZY_CostOrder> .CreateInstanceDAL(oleDb).GetSum("TOTAL_FEE", strWhere), "").ToString(); return(invoice); } catch (System.Exception e) { throw new Exception(e.Message); } }