private void frmAidEditAmount_Load(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; for (int i = 0; i < DiagArr.Count; i++) { clsParmDiagItem_VO DiagItem_VO = DiagArr[i] as clsParmDiagItem_VO; hasDiag.Add(DiagItem_VO.PchargeID, DiagItem_VO.DiagName.Trim()); } clsDcl_Charge objCharge = new clsDcl_Charge(); DataTable dtNormal; DataTable dtRefundment; decimal decAmount = 0; long l = objCharge.m_lngGetFeeItemByActiveType(DiagArr, out dtNormal, out dtRefundment); if (l > 0) { for (int i = 0; i < dtNormal.Rows.Count; i++) { DataRow drNormal = dtNormal.Rows[i]; string pchargeid = drNormal["pchargeid_chr"].ToString(); decimal decRef = 0; for (int j = 0; j < dtRefundment.Rows.Count; j++) { DataRow drRef = dtRefundment.Rows[j]; if (pchargeid == drRef["pchargeidorg_chr"].ToString()) { decRef += Math.Abs(clsPublic.ConvertObjToDecimal(drRef["amount_dec"])); } } string[] sarr = new string[10]; sarr[0] = Convert.ToString(i + 1).ToString(); sarr[1] = hasDiag[pchargeid].ToString(); sarr[2] = drNormal["itemcode_vchr"].ToString(); sarr[3] = drNormal["chargeitemname_chr"].ToString().Trim(); sarr[4] = drNormal["amount_dec"].ToString(); sarr[5] = decRef.ToString(); sarr[6] = Convert.ToString(clsPublic.ConvertObjToDecimal(drNormal["amount_dec"]) - decRef); sarr[7] = pchargeid; sarr[8] = drNormal["unitprice_dec"].ToString(); decAmount = clsPublic.ConvertObjToDecimal(drNormal["amount_dec"].ToString()); if (decAmount > 0) { sarr[9] = (clsPublic.ConvertObjToDecimal(drNormal["totaldiffcostmoney_dec"].ToString()) / decAmount).ToString();//让利单价 } this.dtItem.Rows.Add(sarr); } } this.Cursor = Cursors.Default; }
/// <summary> /// 退款 /// </summary> private void m_mthRefundment() { if (IsAllowPatchNegativeMed == false && IsAllowPatchNegativeNoMed == false) { MessageBox.Show("对不起,您没有权限对收费项目退费(负数冲帐)。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } this.Cursor = Cursors.WaitCursor; bool IsSelected = false; RefDiagArr = new ArrayList(); for (int i = 0; i < this.dtDiagItem.Rows.Count; i++) { if (this.dtDiagItem.Rows[i].Cells[0].Value.ToString().ToUpper() == "T") { DataView dv = this.m_mthShowChargeItem(((DataRow)this.dtDiagItem.Rows[i].Tag), 2); for (int j = 0; j < dv.Count; j++) { DataRow dr = dv[j].Row as DataRow; #region 检查 string Status = dr["pstatus_int"].ToString(); if (Status == "0") { continue; } else if (Status == "3") { continue; } else if (Status == "4") { continue; } if (clsPublic.ConvertObjToDecimal(dr["amount_dec"]) <= 0) { continue; } string InvoCat = objCtlQueryCharge.GetCatName(dr["invcateid_chr"].ToString().Trim()); if (InvoCat.IndexOf("药") >= 0) { if (!this.IsAllowPatchNegativeMed) { continue; } } else { if (!this.IsAllowPatchNegativeNoMed) { continue; } } #endregion #region 检查 //string Status = dr["pstatus_int"].ToString(); //if (Status == "0") //{ // this.Cursor = Cursors.Default; // MessageBox.Show("对不起," + this.dtDiagItem.Rows[i].Cells["colzlxmmc"].Value.ToString().Trim() + "->" + dr["chargeitemname_chr"].ToString().Trim() + "为待确认项目,不能退费。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} //else if (Status == "3") //{ // this.Cursor = Cursors.Default; // MessageBox.Show("对不起," + this.dtDiagItem.Rows[i].Cells["colzlxmmc"].Value.ToString().Trim() + "->" + dr["chargeitemname_chr"].ToString().Trim() + "为已清项目,不能退费。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} //else if (Status == "4") //{ // this.Cursor = Cursors.Default; // MessageBox.Show("对不起," + this.dtDiagItem.Rows[i].Cells["colzlxmmc"].Value.ToString().Trim() + "->" + dr["chargeitemname_chr"].ToString().Trim() + "为直收项目,不能退费。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} //if (clsPublic.ConvertObjToDecimal(dr["amount_dec"]) <= 0) //{ // this.Cursor = Cursors.Default; // MessageBox.Show("对不起," + this.dtDiagItem.Rows[i].Cells["colzlxmmc"].Value.ToString().Trim() + "->" + dr["chargeitemname_chr"].ToString().Trim() + "已经退费。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} //string InvoCat = objCtlQueryCharge.GetCatName(dr["invcateid_chr"].ToString().Trim()); //if (InvoCat.IndexOf("药") >= 0) //{ // if (!this.IsAllowPatchNegativeMed) // { // this.Cursor = Cursors.Default; // MessageBox.Show("对不起," + this.dtDiagItem.Rows[i].Cells["colzlxmmc"].Value.ToString().Trim() + "->" + dr["chargeitemname_chr"].ToString().Trim() + "为药品,你没有权限对药品退费。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; // } //} //else //{ // if (!this.IsAllowPatchNegativeNoMed) // { // this.Cursor = Cursors.Default; // MessageBox.Show("对不起," + this.dtDiagItem.Rows[i].Cells["colzlxmmc"].Value.ToString().Trim() + "->" + dr["chargeitemname_chr"].ToString().Trim() + "为非药品,你没有权限对非药品退费。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; // } //} #endregion clsParmDiagItem_VO DiagItem_VO = new clsParmDiagItem_VO(); DiagItem_VO.PchargeID = dr["pchargeid_chr"].ToString(); DiagItem_VO.DiagName = this.dtDiagItem.Rows[i].Cells["colzlxmmc"].Value.ToString().Trim() + "->" + dr["chargeitemname_chr"].ToString().Trim(); RefDiagArr.Add(DiagItem_VO); } IsSelected = true; } } this.Cursor = Cursors.Default; if (IsSelected) { if (RefDiagArr.Count > 0) { this.DialogResult = DialogResult.OK; } } else { MessageBox.Show("请在左侧诊疗项目列表中选择需要退款的诊疗项目。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }