/// <summary> /// 恢复发票 /// </summary> public void m_ResumeTicket() { //如果发票号为空则返回 if (m_objViewer.txtInvoice.Text.Trim() == "") { MessageBox.Show(m_objViewer, "发票号不正,或此发票不是退票!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (this.m_objViewer.LoginInfo != null) { m_strOperatorID = this.m_objViewer.LoginInfo.m_strEmpID; } //验证发票是否存在 clsT_opr_outpatientrecipeinv_VO objResult = null; long lngRet = m_objManage.m_lngGetInfoByNoForResume(m_objViewer.txtInvoice.Text.Trim(), out objResult); if (lngRet <= 0) { //退票失败! MessageBox.Show(m_objViewer, "恢复失败!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (objResult == null || objResult.m_intSTATUS_INT != 2) //发票状态 [发票状态:1-有效、0-作废、2-退票] { //发票不是已经退的发票,恢复失败! MessageBox.Show(m_objViewer, "此发票不是退票,恢复失败!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //发票未审核,不能退票 DataTable dt; lngRet = m_objManage.m_mthGetInvoiceAuditingInfo(m_objViewer.txtInvoice.Text.Trim(), out dt, 2); if (dt.Rows.Count == 0) { //发票未审核,不能退票 MessageBox.Show(m_objViewer, "发票未审核,不能恢复!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //发票如果含有药品,不能退票 bool blContains = false; lngRet = m_objManage.m_CheckIsContainMed(m_objViewer.txtInvoice.Text.Trim(), ref blContains); if (lngRet <= 0) { MessageBox.Show(m_objViewer, "恢复失败!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (blContains) { MessageBox.Show(m_objViewer, "发票含有药品,不能恢复", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } string Seqid = ""; lngRet = m_objManage.m_lngResumeTicket(m_objViewer.txtInvoice.Text.Trim(), m_strOperatorID, ref Seqid); if (lngRet <= 0) { //退票失败! MessageBox.Show(m_objViewer, "恢复失败!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { //退票成功! MessageBox.Show(m_objViewer, "发票恢复成功!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Information); if (IsPrintInvoice) { this.m_objViewer.Cursor = Cursors.WaitCursor; clsCalcPatientCharge objCalPatientCharge = new clsCalcPatientCharge(this.m_objComInfo.m_strGetHospitalTitle()); objCalPatientCharge.m_mthReprintinvoice(Seqid, this.m_objViewer.LoginInfo.m_strEmpID, 2); this.m_objViewer.Cursor = Cursors.Default; } } //清空发票号 m_EmptyInput(); }
/// <summary> /// 发票退回 /// </summary> public void m_ReturnTicket() { //如果发票号为空则返回 if (m_objViewer.txtInvoice.Text.Trim() == "") { MessageBox.Show("请输入发票号!", "错误提示框"); return; } if (this.m_objViewer.LoginInfo != null) { m_strOperatorID = this.m_objViewer.LoginInfo.m_strEmpID; } //验证发票是否存在 clsT_opr_outpatientrecipeinv_VO objResult = null; long lngRet = m_objManage.m_lngGetInfoByNoForReturn(m_objViewer.txtInvoice.Text.Trim(), out objResult); if (lngRet <= 0) { //退票失败! MessageBox.Show(m_objViewer, "退票失败!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (objResult == null || objResult.m_intSTATUS_INT != 1) { //发票不是有效的发票,退票失败! MessageBox.Show(m_objViewer, "此发票不是有效的发票,退票失败!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //发票未审核,不能退票 DataTable dt; lngRet = m_objManage.m_mthGetInvoiceAuditingInfo(m_objViewer.txtInvoice.Text.Trim(), out dt, 1); if (dt.Rows.Count == 0) { //发票未审核,不能退票 MessageBox.Show(m_objViewer, "发票未审核,不能退票!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // else // { // this.m_objViewer.lbeAuding.Text ="审核人:"+dt.Rows[0]["LASTNAME_VCHR"].ToString().Trim(); // } // by huafeng.xiao\ //添加对药品退药的检测 string m_strStatus = string.Empty; lngRet = m_objManage.m_lngReturnTicketCheckOutSendMed(m_objViewer.txtInvoice.Text.Trim(), out m_strStatus); if (lngRet > 0) { if (m_strStatus.Trim() == "1" || m_strStatus.Trim() == "2") { } else { MessageBox.Show(m_objViewer, "当前发票已经配发药,请先退药!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } else { MessageBox.Show(m_objViewer, "检测药品信息失败,请与管理员联系!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string Seqid = ""; int intFlag = 0; lngRet = m_objManage.m_lngReturnTicket(m_objViewer.txtInvoice.Text.Trim(), m_strOperatorID, ref Seqid, intFlag); if (lngRet <= 0) { //退票失败! MessageBox.Show(m_objViewer, "退票失败!", "错误提示框", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { //新增嵌入式社保退费,函数里有查询到社保数据才去作退费接口的调用 //自助机的经办人由于是 711014_ZZZD03 --- 711014_ZZZD01 ,而系统的登录号是截取后面6位,所以在退费的时候要将这些补充完整 string strEmpNo = this.m_objViewer.LoginInfo.m_strEmpNo; if (this.m_objViewer.LoginInfo.m_strEmpNo.Contains("ZZZD")) { strEmpNo = "711014_" + strEmpNo; } clsCtl_YBChargeMZCancel clsYbChargeMZCancel = new clsCtl_YBChargeMZCancel(); clsYbChargeMZCancel.m_lngCSYBChargeCancel(m_objViewer.txtCardID.Text.Trim(), strEmpNo); //退票成功! MessageBox.Show(m_objViewer, "退票成功!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Information); if (IsPrintInvoice) { this.m_objViewer.Cursor = Cursors.WaitCursor; clsCalcPatientCharge objCalPatientCharge = new clsCalcPatientCharge(this.m_objComInfo.m_strGetHospitalTitle()); objCalPatientCharge.m_mthReprintinvoice(Seqid, this.m_objViewer.LoginInfo.m_strEmpID, 1); this.m_objViewer.Cursor = Cursors.Default; } } //清空发票号 m_EmptyInput(); }